diff -pruN 0.32f-2.1/COPYRIGHT 0.60.0-0ubuntu3/COPYRIGHT
--- 0.32f-2.1/COPYRIGHT	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/COPYRIGHT	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-Copyright (c) 2004 yoshi@giganet.net
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff -pruN 0.32f-2.1/ChangeLog 0.60.0-0ubuntu3/ChangeLog
--- 0.32f-2.1/ChangeLog	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/ChangeLog	1970-01-01 01:00:00.000000000 +0100
@@ -1,171 +0,0 @@
-2004-07-17  <yoshi@giganet.net>
-
-	* fixed marks callback function (thanks patch: nobu.nokada@softhome.net)
-
-2004-07-10  <yoshi@giganet.net>
-
-	* fixed ReadPixels bug (thanks patch: Alvin Schur)
-
-	* fixed GLUT font constats(thanks patch: Alvin Schur)
-
-2004-02-28  <yoshi@giganet.net>
-
-	* fixed SubWindow bug (thanks patch: HATAKEYAMA Motohiko)
-
-	* add COPYRIGHT file
-
-	* fixed sample (thanks patch: Matthias Neeracher)
-
-2003-10-12  <yoshi@giganet.net>
-	
-	* fixed nurbs bug (thanks patch: Ashish Myles)
-
-2003-10-12  <yoshi@giganet.net>
-
-	* fixed submenu bug (thanks bug report: Daniel Amelang)
-
-	* fixed for cygwin 1.5.5 (???)
-
-2003-08-17  <yoshi@giganet.net>
-
-	* fixed for mswin32 (thanks patch: nobu.nakada)
-
-	* function call which was being called from the NUM2INT() argument is deleted
-	* change allocate_buffer_with_string()
-
-2003-08-04  <yoshi@giganet.net>
-
-	* fixed bug teapot.rb, extconf.rb (thanks patch: Stef Telford)
-
-	* fixed bug glu.c (thanks patch: Ashish Myles)
-
-	* fixed for gcc 3.3.1 (thanks patch: Haukur Hreinsson)
-
-	* fixed for cygwin environment
-
-	* release OpenGL module 0.32c
-
-2001-12-01  <yoshi@giganet.net>
-
-	* patch for mswin32. (thanks patch: Nobuyuki Horie(ruby-talk:21179))
-
-        * patch for missing methods. (thanks patch: Takaaki Tateishi)
-
-        * release OpenGL module 0.32b
-
-2001-05-05  <yoshi@giganet.net>
-
-	* release OpenGL module 0.32a
-
-2001-04-30  Akinori MUSHA  <knu@iDaemons.org>
-
-	* extconf.rb: Use the better way to default X11 lib/header
-	directories to /usr/X11R6/{lib,include}.
-	
-2001-04-30  <yoshi@giganet.net>
-
-        * extconf.rb ogl.c glu.c: patch for cygwin environment.
-
-2001-04-24  Akinori MUSHA  <knu@iDaemons.org>
-
-	* glu.c: change errno to errorno to avoid the clash.
-
-	* extconf.rb: do dir_config("x11").
-
-2001-03-20    <yoshi@giganet.net>   
-        * release OpenGL module 0.32
-
-        * extconf.rb : patch for ruby 1.6.x
-
-        * extconf.rb : add site-install target
-
-2001-01-15    <yoshi@giganet.net>   
-        * ogl.c : fixed constant name
-
-2000-02-08    <yoshi@giganet.net>   
-        * release OpenGL module 0.31
- 
-	* ogl.c : add some Version 1.2 function
-
-	* glu.c : add GLU 1.2 Tessellator function
-
-2000-01-06    <yoshi@giganet.net>
-	* ogl.c glu.c glut.c: include "windows.h"
-
-2000-01-01    <yoshi@giganet.net>
-	* ogl.c: glu_PickMatrix(): fixed use invalid argument bug
-
-1999-12-29    <yoshi@giganet.net>
-	* rbogl.c: add allocate_buffer_with_string()
-
-	* ogl.c: implement GL::FeedbackBuffer
-
-	* ogl.c: add OpenGL Array function
-
-	* sample: add some sample files
-
-	* glut.c: glut_CreateWindow(): uses $0 if not have argment
-
-1999-12-28    <yoshi@giganet.net>
-	* release OpenGL module 0.3
-
-	* ogl.c: gl_SelectBuffer() bug: allocate selection buffer size (thanks bug report:jkuro@gb3.so-net.ne.jp)
-
-	* add sample/select.rb(GL::SelectBuffer demo)
-
-	* glut.c: glut_Init(): use $0 and ARGV value
-
-	* extconf.rb: divide module opengl.so -> opengl.so and glut.so
-
-	* glu.c glut.c: rb_define_variable() -> rb_global_variable()
-
-	* ogl.c glu.c glut.c: remove some unreference local variable
-
-1999-12-25    <yashi@yashi.com>
-
-	* glu.c: fix_to_s -> rb_fix2str
-
-	* ogl.c: macro MAX is added. And max(), which I don't know where
-	it is defined, is changed to MAX()
-
-1999-12-18    <yashi@yashi.com>
-
-	* glu.c: as of Mesa 3.1, Mesa assumes all data NURBS object points
-	to is valid at gluEndSurface.  so, free them in glu_EndSurface()
-
-1999-12-17    <yashi@yashi.com>
-
-	* glu.c: Mesa-3.1 does not define GLU_TESS_ERROR9
-
-1999-12-14    <yashi@yashi.com>
-
-	* ogl.c: TRUE and FALSE was accidentally changed to Qtrue and
-	Qfalse by rename.rb: Fixed
-
-1999-12-13    <yashi@yashi.com>
-
-	* glu.c: used rename.rb to fix rest of old func.  surface.rb in
-	sample dir still doesn't work...
-
-	* glut.c: likewise
-
-	* ogl.c: likewise
-
-	* rbogl.c: likewise
-
-1999-12-12    <yashi@yashi.com>
-
-	* rbogl.c: [ruby-ext: 704] if you read japanese.
-	- changed to rb_()
-	- uses xmalloc instead of regular malloc
-	- pthread support in extconf
-	- (mary2ary) first arg casted with VALUE
-
-	* ogl.c: likewise
-
-	* glut.c: likewise
-
-	* glu.c: likewise
-
-	* extconf.rb: likewise
-
diff -pruN 0.32f-2.1/MANIFEST 0.60.0-0ubuntu3/MANIFEST
--- 0.32f-2.1/MANIFEST	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/MANIFEST	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-MANIFEST
-Makefile
-depend
-glu.c
-glut.c
-ogl.c
-rbogl.c
-rbogl.h
diff -pruN 0.32f-2.1/MIT-LICENSE 0.60.0-0ubuntu3/MIT-LICENSE
--- 0.32f-2.1/MIT-LICENSE	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/MIT-LICENSE	2006-08-27 02:34:54.000000000 +0100
@@ -0,0 +1,18 @@
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions: 
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software. 
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE. 
diff -pruN 0.32f-2.1/Makefile 0.60.0-0ubuntu3/Makefile
--- 0.32f-2.1/Makefile	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/Makefile	1970-01-01 01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-SHELL = /bin/sh
-srcdir = .
-VPATH = $(srcdir)
-
-all: glut.so opengl.so
-
-opengl.so: rbogl.c ogl.c glu.c rbogl.h
-	@echo Now Making opengl extend module
-	@$(MAKE) -f Makefile.ogl
-
-glut.so: glut.c
-	@echo Now Making glut extend module
-	@$(MAKE) -f Makefile.glut
-
-clean:
-	@$(MAKE) -f Makefile.ogl clean
-	@$(MAKE) -f Makefile.glut clean
-
-distclean:
-	@$(MAKE) -f Makefile.ogl distclean
-	@$(MAKE) -f Makefile.glut distclean
-
-install: glut.so opengl.so
-	@$(MAKE) -f Makefile.ogl install
-	@$(MAKE) -f Makefile.glut install
-
-site-install: glut.so opengl.so
-	@$(MAKE) -f Makefile.ogl site-install
-	@$(MAKE) -f Makefile.glut site-install
diff -pruN 0.32f-2.1/Makefile.glut 0.60.0-0ubuntu3/Makefile.glut
--- 0.32f-2.1/Makefile.glut	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/Makefile.glut	1970-01-01 01:00:00.000000000 +0100
@@ -1,120 +0,0 @@
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = .
-topdir = $(rubylibdir)/$(arch)
-hdrdir = $(rubylibdir)/$(arch)
-VPATH = $(srcdir)
-prefix = $(DESTDIR)/usr/local
-exec_prefix = $(prefix)
-sitedir = $(prefix)/lib/ruby/site_ruby
-rubylibdir = $(libdir)/ruby/$(ruby_version)
-builddir = $(ac_builddir)
-archdir = $(rubylibdir)/$(arch)
-sbindir = $(exec_prefix)/sbin
-compile_dir = $(DESTDIR)/home/Kusano/ruby-1.8.0
-datadir = $(prefix)/share
-includedir = $(prefix)/include
-infodir = $(prefix)/info
-top_builddir = $(ac_top_builddir)
-sysconfdir = $(prefix)/etc
-mandir = $(prefix)/man
-libdir = $(exec_prefix)/lib
-sharedstatedir = $(prefix)/com
-oldincludedir = $(DESTDIR)/usr/include
-sitearchdir = $(sitelibdir)/$(sitearch)
-bindir = $(exec_prefix)/bin
-localstatedir = $(prefix)/var
-sitelibdir = $(sitedir)/$(ruby_version)
-libexecdir = $(exec_prefix)/libexec
-
-CC = gcc
-LIBRUBY = lib$(LIBRUBY_SO).a
-LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
-LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
-LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
-
-CFLAGS   =  -DWIN32
-CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)  
-CXXFLAGS = $(CFLAGS) 
-DLDFLAGS =   -Wl,--enable-auto-import,--export-all 
-LDSHARED = gcc -shared -s
-AR = ar
-EXEEXT = .exe
-
-RUBY_INSTALL_NAME = ruby
-RUBY_SO_NAME = cygwin-$(RUBY_INSTALL_NAME)18
-arch = i386-cygwin
-sitearch = i386-cygwin
-ruby_version = 1.8
-RUBY = ruby
-RM = $(RUBY) -run -e rm -- -f
-MAKEDIRS = $(RUBY) -run -e mkdir -- -p
-INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
-INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644
-
-#### End of system configuration section. ####
-
-
-LIBPATH =  -L"$(libdir)"
-DEFFILE = 
-
-CLEANFILES = 
-DISTCLEANFILES = 
-
-target_prefix = 
-LOCAL_LIBS = 
-LIBS = $(LIBRUBYARG_SHARED) -lglut32 -lglu32 -lopengl32  -lcrypt  
-OBJS = glut.o
-TARGET = glut
-DLLIB = $(TARGET).so
-
-RUBYCOMMONDIR = $(sitedir)$(target_prefix)
-RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
-RUBYARCHDIR   = $(sitearchdir)$(target_prefix)
-
-CLEANLIBS     = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
-CLEANOBJS     = "*.{o,a,s[ol],pdb,bak}"
-
-all:		$(DLLIB)
-
-clean:
-		@$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
-
-distclean:	clean
-		@$(RM) Makefile extconf.h conftest.* mkmf.log
-		@$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
-
-realclean:	distclean
-install: $(RUBYARCHDIR)
-install: $(RUBYARCHDIR)/$(DLLIB)
-$(RUBYARCHDIR)/$(DLLIB): $(DLLIB) $(RUBYARCHDIR)
-	@$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
-$(RUBYARCHDIR):
-	@$(MAKEDIRS) $(RUBYARCHDIR)
-
-site-install: install
-
-.SUFFIXES: .c .cc .m .cxx .cpp .C .o
-
-.cc.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cpp.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.C.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.c.o:
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
-$(DLLIB): $(OBJS)
-	@-$(RM) $@
-	$(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $(DLLIB) $(OBJS) $(LOCAL_LIBS) $(LIBS)
-
diff -pruN 0.32f-2.1/Makefile.ogl 0.60.0-0ubuntu3/Makefile.ogl
--- 0.32f-2.1/Makefile.ogl	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/Makefile.ogl	1970-01-01 01:00:00.000000000 +0100
@@ -1,120 +0,0 @@
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = .
-topdir = $(rubylibdir)/$(arch)
-hdrdir = $(rubylibdir)/$(arch)
-VPATH = $(srcdir)
-prefix = $(DESTDIR)/usr/local
-exec_prefix = $(prefix)
-sitedir = $(prefix)/lib/ruby/site_ruby
-rubylibdir = $(libdir)/ruby/$(ruby_version)
-builddir = $(ac_builddir)
-archdir = $(rubylibdir)/$(arch)
-sbindir = $(exec_prefix)/sbin
-compile_dir = $(DESTDIR)/home/Kusano/ruby-1.8.0
-datadir = $(prefix)/share
-includedir = $(prefix)/include
-infodir = $(prefix)/info
-top_builddir = $(ac_top_builddir)
-sysconfdir = $(prefix)/etc
-mandir = $(prefix)/man
-libdir = $(exec_prefix)/lib
-sharedstatedir = $(prefix)/com
-oldincludedir = $(DESTDIR)/usr/include
-sitearchdir = $(sitelibdir)/$(sitearch)
-bindir = $(exec_prefix)/bin
-localstatedir = $(prefix)/var
-sitelibdir = $(sitedir)/$(ruby_version)
-libexecdir = $(exec_prefix)/libexec
-
-CC = gcc
-LIBRUBY = lib$(LIBRUBY_SO).a
-LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
-LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
-LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
-
-CFLAGS   =  -DWIN32
-CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)  
-CXXFLAGS = $(CFLAGS) 
-DLDFLAGS =   -Wl,--enable-auto-import,--export-all 
-LDSHARED = gcc -shared -s
-AR = ar
-EXEEXT = .exe
-
-RUBY_INSTALL_NAME = ruby
-RUBY_SO_NAME = cygwin-$(RUBY_INSTALL_NAME)18
-arch = i386-cygwin
-sitearch = i386-cygwin
-ruby_version = 1.8
-RUBY = ruby
-RM = $(RUBY) -run -e rm -- -f
-MAKEDIRS = $(RUBY) -run -e mkdir -- -p
-INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
-INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644
-
-#### End of system configuration section. ####
-
-
-LIBPATH =  -L"$(libdir)"
-DEFFILE = 
-
-CLEANFILES = 
-DISTCLEANFILES = 
-
-target_prefix = 
-LOCAL_LIBS = 
-LIBS = $(LIBRUBYARG_SHARED) -lglu32 -lopengl32  -lcrypt  
-OBJS = glu.o ogl.o rbogl.o
-TARGET = opengl
-DLLIB = $(TARGET).so
-
-RUBYCOMMONDIR = $(sitedir)$(target_prefix)
-RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
-RUBYARCHDIR   = $(sitearchdir)$(target_prefix)
-
-CLEANLIBS     = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
-CLEANOBJS     = "*.{o,a,s[ol],pdb,bak}"
-
-all:		$(DLLIB)
-
-clean:
-		@$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
-
-distclean:	clean
-		@$(RM) Makefile extconf.h conftest.* mkmf.log
-		@$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
-
-realclean:	distclean
-install: $(RUBYARCHDIR)
-install: $(RUBYARCHDIR)/$(DLLIB)
-$(RUBYARCHDIR)/$(DLLIB): $(DLLIB) $(RUBYARCHDIR)
-	@$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
-$(RUBYARCHDIR):
-	@$(MAKEDIRS) $(RUBYARCHDIR)
-
-site-install: install
-
-.SUFFIXES: .c .cc .m .cxx .cpp .C .o
-
-.cc.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cpp.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.C.o:
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.c.o:
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
-$(DLLIB): $(OBJS)
-	@-$(RM) $@
-	$(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $(DLLIB) $(OBJS) $(LOCAL_LIBS) $(LIBS)
-
diff -pruN 0.32f-2.1/README.EUC 0.60.0-0ubuntu3/README.EUC
--- 0.32f-2.1/README.EUC	2004-07-17 16:26:38.000000000 +0100
+++ 0.60.0-0ubuntu3/README.EUC	1970-01-01 01:00:00.000000000 +0100
@@ -1,38 +0,0 @@
-opengl拡張モジュール
-
-このモジュールはrubyからOpenGL+glutを使用するためのモジュールです．
-インプリメントはまだ不完全のため，つかえない関数やバグが多数存在する
-ことを前提としてお使いください．
-
-このモジュールはruby-1.4.3で動作確認しています．なお環境は
-    irix6.5+glut-3.7
-で動作を確認しています．OpenGL(Mesa)+glutが必要ですので別途入手
-してください．
-
-インストール方法
- opengl.0.3.tgzをrubyディレクトリにコピーして以下のコマンドを実行し
-てください．
-        gzip -dc opengl.0.3.tgz | tar xvf -
-	cd ruby-gl
-	ruby extconf.rb
-	make
-
-使用方法
- require "opengl" でGL,GLU,require "glut"でGLUTの各モジュールが使用
-できます．
- 詳しくはsampleの下の各サンプルソースを参考にしてください．
-
-注意
- もし、サンプルを動かしてみたとき、Xのエラーでよくアプリケーションが
-終了する場合は、extconf.rbの中のhave_library("pthread", "pthread_create")
-をコメントアウトした後、再度モジュールを作成しなおしてみてください。
-
-バグを発見されましたり，モジュールに関しての御意見等ございましたら
-        rubyメーリングリスト(ruby-list@netlab.co.jp)
-        kusano@kke.co.jp
-        yoshi@giganet.net
-のどれかにメールして頂けると助かります．
-
-version 0.2から0.3にversion upのほとんどの作業はyashi@yashi.comさんが
-行なわれました。謹んで、お礼申し上げます。
-
diff -pruN 0.32f-2.1/README.txt 0.60.0-0ubuntu3/README.txt
--- 0.32f-2.1/README.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/README.txt	2007-12-29 00:02:00.000000000 +0000
@@ -0,0 +1,47 @@
+ruby-opengl
+===========
+
+[ruby-opengl][] consists of Ruby extension modules that are bindings for
+the [OpenGL][], GLU, and [GLUT][] libraries. It is intended to be a
+replacement for -- and uses the code from -- [Yoshi's ruby-opengl][].
+
+It's licensed under the MIT license. Please see the included MIT-LICENSE
+file for the terms of the license.
+
+
+[ruby-opengl]: http://rubyforge.org/projects/ruby-opengl/
+[OpenGL]: http://www.opengl.org/
+[GLUT]: http://www.opengl.org/documentation/specs/glut/spec3/spec3.html
+
+
+[Yoshi's ruby-opengl]: http://www2.giganet.net/~yoshi/
+
+
+Current release: 0.60.0 (December 29, 2007)
+-----------------
+Changes in this release:
+* Automatic error checking for GL/GLU calls, enabled by default (see doc/tutorial)
+* Added support for many more OpenGL extensions
+* Support for Ruby 1.9.0+ (requires mkrf 0.2.3)
+* Ton of bugfixes.<br><br>
+<b>API Changes:</b>
+* Boolean functions/parameters was changed to ruby true/false instead of GL\_TRUE / GL\_FALSE, which remains for compatibility
+* glGet\* functions now returns x instead of [x] when returning only one value
+* Functions operating on packed strings (glTexture, gl\*Pointer etc.) now also accepts ruby arrays directly
+* Matrix handling functions now also accepts instances of Matrix class, or any class that can be converted to array
+* glUniform\*v and glUniformmatrix\*v now does not require 'count' parameter, they will calculate it from length of passed array
+* glCallLists needs type specifier (previously was forced to GL_BYTE)
+* On ruby 1.9, glut keyboard callback returns char ("x") instead of integer so using 'if key == ?x' works on both 1.8 and 1.9
+
+Previous release: 0.50.0 (October 23, 2007)
+-----------------
+Changes in this release:
+
+* GLU and GLUT cleanup, bugfixes, some missing functions added - version 3.7
+  of GLUT API is now requirement (previously 3.0)
+* We added support for number of OpenGL extensions
+* Some new examples and code cleanup
+* Support for OpenGL 2.1 (that includes pixelpack/unpack buffer)
+* Some code refactoring to remove duplicity
+* Documentation update (still no API doc though)
+* Lots of bugfixes.
diff -pruN 0.32f-2.1/Rakefile 0.60.0-0ubuntu3/Rakefile
--- 0.32f-2.1/Rakefile	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/Rakefile	2007-12-15 00:32:31.000000000 +0000
@@ -0,0 +1,160 @@
+#-*-ruby-*-
+#
+# Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
+#
+# This program is distributed under the terms of the MIT license.
+# See the included MIT-LICENSE file for the terms of this license.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
+
+begin
+    require 'rubygems'
+rescue LoadError
+    nil
+end
+
+require 'rake'
+require 'rake/clean'
+require 'rake/gempackagetask'
+require 'rake/testtask'
+
+require 'mkrf/rakehelper'
+
+# Generate html docs from the markdown source and upload to the site.
+# All doc files that are destined for the website have filenames that
+# end in .txt.
+
+WEBSITE_MKDN = FileList['./doc/*.txt'] << 'README.txt'
+NICE_HTML_DOCS = WEBSITE_MKDN.ext('html')
+
+# defines columns in the HTML extension list
+GLEXT_VERSIONS = ["svn","0.60","0.50"]
+
+CLEAN.include("ext/gl*/Rakefile", "ext/*/mkrf.log", "ext/*/*.so", 
+              "ext/**/*.bundle", "lib/*.so", "lib/*.bundle", "ext/*/*.o{,bj}", 
+              "ext/*/*.lib", "ext/*/*.exp", "ext/*/*.pdb",
+              "pkg")
+CLOBBER.include("*.plain", "doc/*.plain", "doc/*.snip", "*.html",
+                "doc/*.html", "website/*.html", "website/images/*")
+# Make sure these files aren't deleted in a clobber op
+CLOBBER.exclude("website/images/tab_bottom.gif")
+CLOBBER.exclude("website/images/*.jpg")
+
+setup_extension('gl', 'gl')
+setup_extension('glu', 'glu')
+setup_extension('glut', 'glut')
+
+case RUBY_PLATFORM
+when /(:?mswin|mingw)/
+	desc 'Does a full win32 compile'
+	task :default do
+		exts = ["gl","glu","glut"]
+		exts.each do |ext|
+			Dir.chdir("ext\\#{ext}") do
+				sh "ruby mkrf_conf.rb"
+				sh "call rake --nosearch"
+				sh "copy #{ext}.so ..\\..\\lib"
+			end
+		end
+	end
+else
+	desc 'Does a full compile'
+	task :default => [:gl, :glu, :glut]
+end
+
+
+task :extension => :default
+
+desc 'Show contents of some variables related to website doc generation.'
+task :explain_website do
+    puts "WEBSITE_MKDN:"
+    WEBSITE_MKDN.each do |doc|
+        puts "\t#{doc}"
+    end
+    puts "NICE_HTML_DOCS:"
+    NICE_HTML_DOCS.each do |doc|
+        puts "\t#{doc}"
+    end
+end
+
+desc 'Generate supported extension list.'
+task :gen_glext_list do
+	sh "./utils/extlistgen.rb doc/extensions.txt.in doc/extensions.txt " + GLEXT_VERSIONS.join(" ")
+end
+
+desc 'Generate website html.'
+task :gen_website => [:gen_glext_list] + NICE_HTML_DOCS do
+    # Now that the website docs have been generated, copy them to ./website.
+    puts
+    sh "cp README.html website/index.html"
+    sh "cp doc/*.html website"
+end
+
+# You'll see some intermediate .plain files get generated. These are html,
+# but don't yet have their code snippets syntax highlighted.
+rule '.html' => '.plain' do |t|
+    puts "Turning #{t.source} into #{t.name} ..."
+    sh "./utils/post-mkdn2html.rb #{t.source} #{t.name}"
+end
+
+# Process the markdown docs into plain html.
+rule '.plain' => '.txt' do |t|
+    puts
+    puts "Turning #{t.source} into #{t.name} ..."
+    sh "./utils/mkdn2html.rb #{t.source} #{t.name}"
+end
+
+desc 'Upload the newly-built site to RubyForge.'
+task :upload_website => [:gen_website] do
+    sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
+    sh "scp website/images/* hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl/images/"
+end
+
+desc 'Upload entire site, including stylesheet and the images directory.'
+task :upload_entire_website => [:gen_website] do
+    sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
+    sh "scp website/*.css hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
+    sh "scp -r website/images hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl"
+end
+
+desc 'Runs unit tests.'
+Rake::TestTask.new do |t|
+    t.libs << "test"
+    t.test_files = FileList['test/tc_*.rb']
+    t.verbose = true
+end
+
+desc 'Runs unit tests.'
+task :test_all => [:test]
+
+# Define the files that will go into the gem
+gem_files = FileList["{lib,ext,doc,examples,test}/**/*"]
+gem_files = gem_files.exclude("**/*.so", "**/*.o{,bj}", "ext/**/*.log", "ext/gl*/Rakefile")
+
+spec = Gem::Specification.new do |s|
+    s.name              = "ruby-opengl"
+    s.version           = "0.60.0"
+    s.authors           = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam" ]
+    s.homepage          = "http://ruby-opengl.rubyforge.org"
+    s.platform          = Gem::Platform::RUBY
+    s.summary           = "OpenGL Interface for Ruby"
+    s.files             = gem_files
+    s.extensions        << 'Rakefile'
+    s.require_path      = "lib"
+    s.autorequire       = "gl"
+    s.has_rdoc          = false
+    s.add_dependency("mkrf", ">=0.2.0")
+    s.add_dependency("rake")
+end
+
+# Create a task for creating a ruby gem
+Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.gem_spec = spec
+    pkg.need_tar = true
+end
diff -pruN 0.32f-2.1/debian/changelog 0.60.0-0ubuntu3/debian/changelog
--- 0.32f-2.1/debian/changelog	2009-10-27 00:51:12.000000000 +0000
+++ 0.60.0-0ubuntu3/debian/changelog	2009-10-26 19:13:22.000000000 +0000
@@ -1,9 +1,45 @@
-libopengl-ruby (0.32f-2.1) unstable; urgency=low
+libopengl-ruby (0.60.0-0ubuntu3) hardy; urgency=low
 
-  * Non-maintainer upload.
-  * Build-depend on freeglut3-dev instead of libglut-dev. Closes: #545632.
+  * debian/control: add Conflicts/Replaces libopengl-ruby (<< 0.60.0) in
+    libopengl-ruby1.8 binary stanza to perform a clean upgrade from Dapper
+    and Gutsy (LP: #197816).
 
- -- Matt Kraai <kraai@debian.org>  Thu, 22 Oct 2009 22:18:14 -0700
+ -- Luca Falavigna <dktrkranz@ubuntu.com>  Tue, 04 Mar 2008 21:21:28 +0100
+
+libopengl-ruby (0.60.0-0ubuntu2) hardy; urgency=low
+
+  * Added debian/patches/001-missing-rubyver-cflags.patch 
+    - fixes build for ruby 1.9 (LP: #191975)
+ -- Jan Dvorak <jan.dvorak@kraxnet.cz>  Fri, 15 Feb 2008 00:14:49 +0100
+
+libopengl-ruby (0.60.0-0ubuntu1) hardy; urgency=low
+
+  * New upstream version (LP: #182449)
+  * debian/control:
+    - Added dependency on cdbs and ruby-pkg-tools to accomodate for 	
+      new upstream building process (setup.rb)
+    - Added separate packages for ruby 1.8 and 1.9
+    - Added Homepage header
+    - Update Standards-Version to 3.7.2.
+  * debian/copyright:
+    - Added copyrights for new upstream development team and added examples
+  * debian/rules:
+    - Changed build for new upstream build process
+  * debian/watch:
+    - Changed URL for new project homepage
+ -- Jan Dvorak <jan.dvorak@kraxnet.cz>  Sat, 30 Jan 2008 11:53:42 +0100
+
+libopengl-ruby (0.32f-2ubuntu2) gutsy; urgency=low
+
+  * Update maintainer fields according to debian-maintainer-field spec.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri, 14 Sep 2007 16:48:22 +0200
+
+libopengl-ruby (0.32f-2ubuntu1) dapper; urgency=low
+
+  * Resynchronise with Debian.
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Tue, 08 Nov 2005 08:10:26 +0000
 
 libopengl-ruby (0.32f-2) unstable; urgency=low
 
@@ -11,6 +47,12 @@ libopengl-ruby (0.32f-2) unstable; urgen
 
  -- Dafydd Harries <daf@debian.org>  Tue,  9 Aug 2005 12:46:50 +0100
 
+libopengl-ruby (0.32f-1ubuntu1) breezy; urgency=low
+
+  * Update {build-,}depends for xorg -> mesa transition.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Mon, 22 Aug 2005 15:28:02 +1000
+
 libopengl-ruby (0.32f-1) unstable; urgency=low
 
   * New upstream release.
diff -pruN 0.32f-2.1/debian/control 0.60.0-0ubuntu3/debian/control
--- 0.32f-2.1/debian/control	2009-10-27 00:51:12.000000000 +0000
+++ 0.60.0-0ubuntu3/debian/control	2009-10-26 19:13:22.000000000 +0000
@@ -1,13 +1,38 @@
 Source: libopengl-ruby
 Section: interpreters
 Priority: optional
-Maintainer: Dafydd Harries <daf@debian.org>
-Build-Depends: debhelper (>= 4.0.0), ruby (>= 1.8), ruby1.8-dev, xlibmesa-gl-dev | libgl-dev, freeglut3-dev
-Standards-Version: 3.6.2
+Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
+XSBC-Original-Maintainer: Dafydd Harries <daf@debian.org>
+Build-Depends: cdbs, debhelper (>= 5.0.0), ruby1.8, ruby1.8-dev, ruby1.9, ruby1.9-dev, ruby-pkg-tools (>= 0.8), libgl1-mesa-dev | libgl-dev, freeglut3-dev | libglut-dev
+Homepage: http://ruby-opengl.rubyforge.org
+Standards-Version: 3.7.2
 
 Package: libopengl-ruby
+Architecture: all
+Depends: libopengl-ruby1.8
+Description: OpenGL binding for Ruby
+ This library allows program written in Ruby to use the OpenGL API for
+ graphics.
+ .
+ This is a dependency package which depends on Debian's default version of Ruby
+ (currently 1.8).
+
+Package: libopengl-ruby1.8
+Architecture: any
+Depends: ruby1.8, ${shlibs:Depends}
+Conflicts: libopengl-ruby (<< 0.60.0)
+Replaces: libopengl-ruby (<< 0.60.0)
+Description: OpenGL binding for Ruby
+ This library allows program written in Ruby to use the OpenGL API for
+ graphics.
+ .
+ This package is built for Ruby 1.8.
+
+Package: libopengl-ruby1.9
 Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ruby1.9, ${shlibs:Depends}
 Description: OpenGL binding for Ruby
  This library allows program written in Ruby to use the OpenGL API for
  graphics.
+ .
+ This package is built for Ruby 1.9.
diff -pruN 0.32f-2.1/debian/copyright 0.60.0-0ubuntu3/debian/copyright
--- 0.32f-2.1/debian/copyright	2009-10-27 00:51:12.000000000 +0000
+++ 0.60.0-0ubuntu3/debian/copyright	2009-10-26 19:13:22.000000000 +0000
@@ -1,27 +1,113 @@
 This package was debianized by Dafydd Harries <daf@muse.19inch.net> on
 Tue, 18 Nov 2003 20:50:57 +0000.
 
-It was downloaded from <http://www2.giganet.net/~yoshi/>.
+It was downloaded from <http://ruby-opengl.rubyforge.org/>.
 
-Rbogl is copyright (c) 2004 Yoshiyuki Kusano <yoshi@giganet.net>.
-
-Licence:
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to 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.
+ruby-opengl copyrights:
+Copyright (C) 1999-2005 Yoshiyuki Kusano <yoshi@giganet.net>.
+Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
+Copyright (C) 2006 Peter McLain <peter.mclain@gmail.com>
+Copyright (C) 2006 Minh Thu Vo <noteed@gmail.com>
+Copyright (C) 2007-2008 Alain Hoang <hoanga@alum.rpi.edu>
+Copyright (C) 2007-2008 Jan Dvorak <jan.dvorak@kraxnet.cz>
+
+	Permission is hereby granted, free of charge, to any person obtaining a copy
+	of this software and associated documentation files (the "Software"), to deal
+	in the Software without restriction, including without limitation the rights
+	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+	copies of the Software, and to 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.
+
+
+examples/RedBook/* and examples/misc/plane.rb copyrights:
+
+	Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+
+examples/OrangeBook/* copyrights:
+
+	Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
+	All rights reserved.
+	
+	Redistribution and use in source and binary forms, with or without
+	modification, are permitted provided that the following conditions
+	are met:
+	
+			Redistributions of source code must retain the above copyright
+			notice, this list of conditions and the following disclaimer.
+	
+			Redistributions in binary form must reproduce the above
+			copyright notice, this list of conditions and the following
+			disclaimer in the documentation and/or other materials provided
+			with the distribution.
+	
+			Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+			contributors may be used to endorse or promote products derived
+			from this software without specific prior written permission.
+	
+	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 HOLDERS 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.
+
+examples/misc/OGLBench.rb and examples/misc/trislam.rb copyrights:
+
+	Copyright (c) 2006, Geoff Broadwell; this module is released
+	as open source and may be distributed and modified under the terms
+	of either the Artistic License or the GNU General Public License,
+	in the same manner as Perl itself.  These licenses should have been
+	distributed to you as part of your Perl distribution, and can be
+	read using `perldoc perlartistic` and `perldoc perlgpl` respectively.
 
+see `/usr/share/common-licenses/Artistic' and `/usr/share/common-licenses/GPL' for details
diff -pruN 0.32f-2.1/debian/patches/001-missing-rubyver-cflags.patch 0.60.0-0ubuntu3/debian/patches/001-missing-rubyver-cflags.patch
--- 0.32f-2.1/debian/patches/001-missing-rubyver-cflags.patch	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/debian/patches/001-missing-rubyver-cflags.patch	2009-10-26 19:13:22.000000000 +0000
@@ -0,0 +1,36 @@
+diff -urN ext/gl/extconf.rb.orig ext/gl/extconf.rb
+--- ext/gl/extconf.rb.orig	2008-01-13 17:19:18.000000000 +0100
++++ ext/gl/extconf.rb	2008-02-14 22:27:56.000000000 +0100
+@@ -1,5 +1,8 @@
+ require "mkmf"
+ 
++RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join
++$CFLAGS += RUBYVER
++
+ dir_config('x11','/usr/X11R6')
+ have_library("GL", "glVertex3f")
+ create_makefile("gl")
+diff -urN ext/glu/extconf.rb.orig ext/glu/extconf.rb
+--- ext/glu/extconf.rb.orig	2008-01-13 17:19:18.000000000 +0100
++++ ext/glu/extconf.rb	2008-02-14 22:28:17.000000000 +0100
+@@ -1,5 +1,8 @@
+ require "mkmf"
+ 
++RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join
++$CFLAGS += RUBYVER
++
+ dir_config('x11','/usr/X11R6')
+ have_library("GL", "glVertex3f")
+ have_library("GLU", "gluOrtho2D")
+diff -urN ext/glut/extconf.rb.orig ext/glut/extconf.rb
+--- ext/glut/extconf.rb.orig	2008-01-13 17:19:18.000000000 +0100
++++ ext/glut/extconf.rb	2008-02-14 22:29:55.000000000 +0100
+@@ -1,5 +1,8 @@
+ require "mkmf"
+ 
++RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join
++$CFLAGS += RUBYVER
++
+ dir_config('x11','/usr/X11R6')
+ have_library("GL", "glVertex3f")
+ have_library("GLU", "gluOrtho2D")
diff -pruN 0.32f-2.1/debian/rules 0.60.0-0ubuntu3/debian/rules
--- 0.32f-2.1/debian/rules	2009-10-27 00:51:12.000000000 +0000
+++ 0.60.0-0ubuntu3/debian/rules	2009-10-26 19:13:22.000000000 +0000
@@ -1,54 +1,20 @@
 #!/usr/bin/make -f
 
-configure-stamp:
-	dh_testdir
-	ruby extconf.rb
-	touch configure-stamp
-
-configure: configure-stamp
-
-clean: configure
-	dh_testdir
-	dh_testroot
-	rm -f configure-stamp build-stamp
-	$(MAKE) clean
-	dh_clean Makefile Makefile.glut Makefile.ogl mkmf.log
-
-build-stamp: configure-stamp
-	dh_testdir
-	$(MAKE)
-	touch build-stamp
-
-build: build-stamp
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
 
-install: build
+binary-arch: build
 	dh_testdir
 	dh_testroot
-	dh_installdirs
-	$(MAKE) install \
-		DESTDIR=$(CURDIR)/debian/libopengl-ruby \
-		sitedir=$(CURDIR)/debian/libopengl-ruby/usr/lib/ruby
-	dh_installchangelogs ChangeLog
-	dh_installdocs README.EUC
-	dh_installexamples sample/*
-	find $(CURDIR)/debian/libopengl-ruby/usr/share/doc/libopengl-ruby \
-		-name '*.rb' -exec chmod 644 '{}' ';'
+	dh_installdocs -A README.txt doc/*.txt
+	dh_installexamples -A examples/*
+	dh_link
 	dh_strip
 	dh_compress
 	dh_fixperms
-
-binary-indep: build install
-
-binary-arch: build install
-	dh_testdir
-	dh_testroot
 	dh_installdeb
 	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
-
-binary: binary-indep binary-arch
-
-.PHONY: configure build clean install binary-indep binary-arch
-
diff -pruN 0.32f-2.1/debian/watch 0.60.0-0ubuntu3/debian/watch
--- 0.32f-2.1/debian/watch	2009-10-27 00:51:12.000000000 +0000
+++ 0.60.0-0ubuntu3/debian/watch	2009-10-26 19:13:22.000000000 +0000
@@ -1,4 +1,2 @@
-version=2
-http://www2.giganet.net/~yoshi/rbogl-(.*).tar.gz \
-	debian \
-	uupdate
+version=3
+http://ruby-opengl.rubyforge.org/dist/ruby-opengl-(.*)-ubuntu\.tar\.gz
diff -pruN 0.32f-2.1/doc/build_install.txt 0.60.0-0ubuntu3/doc/build_install.txt
--- 0.32f-2.1/doc/build_install.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/build_install.txt	2007-12-28 15:15:58.000000000 +0000
@@ -0,0 +1,122 @@
+Building ruby-opengl
+====================
+
+Pre-requisites
+--------------
+
+General
+--------------
+* C compiler (not needed for binary install on Windows)
+* ruby 1.8.5+ or ruby 1.9.0+
+* rake
+* mkrf 0.2.0+ (0.2.3+ for ruby 1.9)
+* rubygems 0.9.1+
+* OpenGL headers for OpenGL version 1.1 or later (not needed for binary install on Windows)
+* GLUT 3.7+ or API-compatible implementation (freeglut,OpenGLUT)
+
+Linux
+--------------
+On Ubuntu or Debian systems, aside from Ruby you'll need ruby and
+some extra ruby related packages:
+
+* `ruby rdoc ri ruby1.8-dev`
+
+For OpenGL related headers you'll need the following packages:
+
+* `libgl1-mesa-dri libglu1-mesa freeglut3`
+* `libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev`
+
+On older Gentoo, Debian and Ubuntu, rubygems 0.9.0 will be installed by default
+in the packages.  This version of rubygems is INCOMPATIBLE with ruby-opengl.
+You'll need to install rubygems 0.9.1+ from source.
+
+On some distributions you may need 'xorg-dev' developer package.
+
+Mac OS X
+--------------
+On OS X, you will need to install your own version of Ruby as the
+version that ships with OS X has known problems with properly building
+ruby-opengl bindings.  You'll also need XCode for gcc and tools.  Macports
+or fink should handle this cleanly.
+
+* To compile under Mac OS X you MUST install your own version of Ruby
+  as the version included with Tiger (1.8.2) has a broken rbconfig
+  and will fail to build the project properly.  Try either [MacPorts][],
+  [Fink][], or [building your own from source][].
+
+[Macports]: http://www.macports.org/
+[Fink]: http://finkproject.org/
+[building your own from source]: http://www.ruby-lang.org/en/downloads/
+
+Windows
+--------------
+For manual build on Windows you need to have platform SDK and compiler that *must* match the one which was used for compiling ruby binary (for One-click ruby installer it is MSVC 6.0).
+You may also need 'glut.h' in SDK include directory, as the One-click ruby
+installer is missing it. You can copy the file from glut package at [glut homepage][].
+Alternatively, you can install the precompiled binary gem (see bellow).
+
+<b>Important note:</b> If you are using the One-click installer version 1.8.6-25 or earlier,
+you must delete or rename files 'opengl.so' and 'glut.so' in
+C:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
+
+[glut homepage]: http://www.xmission.com/~nate/glut.html
+
+Build and installation
+--------------
+
+Installing from rubygems
+-------------------
+
+ruby-opengl should support being installed via gems now.  Just
+try 'gem install -y ruby-opengl' and it should pull down the gem
+and try to build the bindings for you automatically.
+
+For windows there is also pre-built binary windows gem available
+(i386-mswin32) which is compatible with the ruby one-click installer and does not need
+compiler or other mentioned tools installed.
+
+Manual Build instructions for all platforms (see above for platform-specific notes)
+------------------
+1. Make sure you have working ruby with rubygems installed
+	 and (if needed) appropriate developer packages (ruby-dev,ruby1.8-dev,...).
+2. Make sure you have working C compiler
+3. Install rake either from package or by running 'gem install rake'
+4. Install mkrf (0.2.0+) either from package or by running 'gem install mkrf'
+5. Make sure you have working OpenGL installation, this includes libGL,libGLU,
+   glut and (if needed) appropriate -dev or -devel packages.
+6. Run 'rake' at the top level of the project
+7. (OPTIONAL) Run 'rake test' to run unit tests to verify it works properly
+
+Installing manually built extensions
+------------------
+1. Run 'rake clean' to clean out the project
+2. Run 'rake gem' to create source gem from project
+3. Run 'gem install pkg/ruby-opengl-(version).gem' to compile and install the gem
+4. Done.
+
+Building binary gem (useful only for binary distribution of the project)
+------------------
+1. Run 'gem install gembuilder' to install the gembuilder package
+2. Run 'rake clean' to clean out the project
+3. Run 'rake gem' to build source gem
+4. Run 'gembuilder pkg/ruby-opengl-(version).gem' to compile the binary gem
+
+
+Testing
+-----------------
+
+To run unit tests:
+
+   $ rake test
+
+Note that the tests have the adverse effect of testing the underlying OpenGL
+implementation, so depending on your GL provider,drivers or OS, the tests may
+fail, crash, or not run at all, without affecting your ability to use the
+bindings.
+
+Running programs and examples
+-----------------
+To run a sample file, make sure the ruby-opengl gem is installed then:
+
+    $ cd examples
+    $ ruby -rubygems plane.rb
diff -pruN 0.32f-2.1/doc/extensions.txt.in 0.60.0-0ubuntu3/doc/extensions.txt.in
--- 0.32f-2.1/doc/extensions.txt.in	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/extensions.txt.in	2007-12-07 18:55:07.000000000 +0000
@@ -0,0 +1,348 @@
+# extension name, [Supported/Unsupported/NonGL], first supported in ruby-opengl version x.y.z
+GL_ARB_multitexture,Unsupported,N/A
+GLX_ARB_get_proc_address,NonGL,N/A
+GL_ARB_transpose_matrix,Supported,0.50
+WGL_ARB_buffer_region,NonGL,N/A
+GL_ARB_multisample,Supported,0.50
+GLX_ARB_multisample,NonGL,N/A
+WGL_ARB_multisample,NonGL,N/A
+GL_ARB_texture_env_add,Supported,0.50
+GL_ARB_texture_cube_map,Supported,0.50
+WGL_ARB_extensions_string,NonGL,N/A
+WGL_ARB_pixel_format,NonGL,N/A
+WGL_ARB_make_current_read,NonGL,N/A
+WGL_ARB_pbuffer,NonGL,N/A
+GL_ARB_texture_compression,Unsupported,N/A
+GL_ARB_texture_border_clamp,Supported,0.50
+GL_ARB_point_parameters,Supported,0.60
+GL_ARB_vertex_blend,Unsupported,N/A
+GL_ARB_matrix_palette,Unsupported,N/A
+GL_ARB_texture_env_combine,Supported,0.50
+GL_ARB_texture_env_crossbar,Supported,0.50
+GL_ARB_texture_env_dot3,Supported,0.50
+WGL_ARB_render_texture,NonGL,N/A
+GL_ARB_texture_mirrored_repeat,Supported,0.50
+GL_ARB_depth_texture,Supported,0.50
+GL_ARB_shadow,Supported,0.50
+GL_ARB_shadow_ambient,Supported,0.50
+GL_ARB_window_pos,Supported,0.60
+GL_ARB_vertex_program,Supported,0.60
+GL_ARB_fragment_program,Supported,0.60
+GL_ARB_vertex_buffer_object,Unsupported,N/A
+GL_ARB_occlusion_query,Supported,0.60
+GL_ARB_shader_objects,Supported,0.60
+GL_ARB_vertex_shader,Supported,0.60
+GL_ARB_fragment_shader,Supported,0.60
+GL_ARB_shading_language_100,Supported,0.50
+GL_ARB_texture_non_power_of_two,Supported,0.50
+GL_ARB_point_sprite,Supported,0.50
+GL_ARB_fragment_program_shadow,Supported,0.50
+GL_ARB_draw_buffers,Supported,0.50
+GL_ARB_texture_rectangle,Supported,0.50
+GL_ARB_color_buffer_float,Supported,0.50
+WGL_ARB_pixel_format_float,NonGL,N/A
+GLX_ARB_fbconfig_float,NonGL,N/A
+GL_ARB_half_float_pixel,Supported,0.50
+GL_ARB_texture_float,Supported,0.50
+GL_ARB_pixel_buffer_object,Supported,0.50
+GL_EXT_abgr,Supported,0.50
+GL_EXT_blend_color,Supported,0.60
+GL_EXT_polygon_offset,Supported,0.60
+GL_EXT_texture,Supported,0.50
+GL_EXT_texture3D,Supported,0.50
+GL_SGIS_texture_filter4,Unsupported,N/A
+GL_EXT_subtexture,Unsupported,N/A
+GL_EXT_copy_texture,Unsupported,N/A
+GL_EXT_histogram,Unsupported,N/A
+GL_EXT_convolution,Unsupported,N/A
+GL_SGI_color_matrix,Supported,0.50
+GL_SGI_color_table,Unsupported,N/A
+GL_SGIS_pixel_texture,Unsupported,N/A
+GL_SGIX_pixel_texture,Unsupported,N/A
+GL_SGIS_texture4D,Unsupported,N/A
+GL_SGI_texture_color_table,Supported,0.50
+GL_EXT_cmyka,Supported,0.50
+GL_EXT_texture_object,Supported,0.60
+GL_SGIS_detail_texture,Unsupported,N/A
+GL_SGIS_sharpen_texture,Unsupported,N/A
+GL_EXT_packed_pixels,Supported,0.50
+GL_SGIS_texture_lod,Supported,0.50
+GL_SGIS_multisample,Unsupported,N/A
+GLX_SGIS_multisample,NonGL,N/A
+GL_EXT_rescale_normal,Supported,0.50
+GLX_EXT_visual_info,NonGL,N/A
+GL_EXT_vertex_array,Unsupported,N/A
+GL_EXT_misc_attribute,Supported,0.50
+GL_SGIS_generate_mipmap,Supported,0.50
+GL_SGIX_clipmap,Supported,0.50
+GL_SGIX_shadow,Supported,0.50
+GL_SGIS_texture_edge_clamp,Supported,0.50
+GL_SGIS_texture_border_clamp,Supported,0.50
+GL_EXT_blend_minmax,Supported,0.60
+GL_EXT_blend_subtract,Supported,0.50
+GL_EXT_blend_logic_op,Supported,0.50
+GLX_SGI_swap_control,NonGL,N/A
+GLX_SGI_video_sync,NonGL,N/A
+GLX_SGI_make_current_read,NonGL,N/A
+GLX_SGIX_video_source,NonGL,N/A
+GLX_EXT_visual_rating,NonGL,N/A
+GL_SGIX_interlace,Supported,0.50
+GLX_EXT_import_context,NonGL,N/A
+GLX_SGIX_fbconfig,NonGL,N/A
+GLX_SGIX_pbuffer,NonGL,N/A
+GL_SGIS_texture_select,Supported,0.50
+GL_SGIX_sprite,Unsupported,N/A
+GL_SGIX_texture_multi_buffer,Supported,0.50
+GL_EXT_point_parameters,Supported,0.60
+GL_SGIX_instruments,Unsupported,N/A
+GL_SGIX_texture_scale_bias,Supported,0.50
+GL_SGIX_framezoom,Unsupported,N/A
+GL_SGIX_tag_sample_buffer,Unsupported,N/A
+GL_SGIX_reference_plane,Unsupported,N/A
+GL_SGIX_flush_raster,Unsupported,N/A
+GLX_SGI_cushion,NonGL,N/A
+GL_SGIX_depth_texture,Supported,0.50
+GL_SGIS_fog_function,Unsupported,N/A
+GL_SGIX_fog_offset,Supported,0.50
+GL_HP_image_transform,Unsupported,N/A
+GL_HP_convolution_border_modes,Supported,0.50
+GL_SGIX_texture_add_env,Supported,0.50
+GL_EXT_color_subtable,Unsupported,N/A
+GLU_EXT_object_space_tess,NonGL,N/A
+GL_PGI_vertex_hints,Supported,0.50
+GL_PGI_misc_hints,Unsupported,N/A
+GL_EXT_paletted_texture,Unsupported,N/A
+GL_EXT_clip_volume_hint,Supported,0.50
+GL_SGIX_list_priority,Unsupported,N/A
+GL_SGIX_ir_instrument1,Supported,0.50
+GLX_SGIX_video_resize,NonGL,N/A
+GL_SGIX_texture_lod_bias,Supported,0.50
+GLU_SGI_filter4_parameters,NonGL,N/A
+GLX_SGIX_dm_buffer,NonGL,N/A
+GL_SGIX_shadow_ambient,Supported,0.50
+GLX_SGIX_swap_group,NonGL,N/A
+GLX_SGIX_swap_barrier,NonGL,N/A
+GL_EXT_index_texture,Supported,0.50
+GL_EXT_index_material,Unsupported,N/A
+GL_EXT_index_func,Unsupported,N/A
+GL_EXT_index_array_formats,Supported,0.50
+GL_EXT_compiled_vertex_array,Supported,0.60
+GL_EXT_cull_vertex,Unsupported,N/A
+GLU_EXT_nurbs_tessellator,NonGL,N/A
+GL_SGIX_ycrcb,Supported,0.50
+GL_EXT_fragment_lighting,Unsupported,N/A
+GL_IBM_rasterpos_clip,Supported,0.50
+GL_HP_texture_lighting,Supported,0.50
+GL_EXT_draw_range_elements,Supported,0.60
+GL_WIN_phong_shading,Supported,0.50
+GL_WIN_specular_fog,Supported,0.50
+GL_SGIS_color_range,NonGL,N/A
+GLX_SGIS_color_range,NonGL,N/A
+GL_EXT_light_texture,Unsupported,N/A
+GL_SGIX_blend_alpha_minmax,Supported,0.50
+GL_EXT_scene_marker,NonGL,N/A
+GLX_EXT_scene_marker,NonGL,N/A
+GL_SGIX_pixel_texture_bits,Supported,0.50
+GL_EXT_bgra,Supported,0.50
+GL_SGIX_async,Unsupported,N/A
+GL_SGIX_async_pixel,Supported,0.50
+GL_SGIX_async_histogram,Supported,0.50
+GL_INTEL_texture_scissor,Other,N/A
+GL_INTEL_parallel_arrays,Unsupported,N/A
+GL_HP_occlusion_test,Other,N/A
+GL_EXT_pixel_transform,Unsupported,N/A
+GL_EXT_pixel_transform_color_table,Supported,0.50
+GL_EXT_shared_texture_palette,Supported,0.50
+GLX_SGIS_blended_overlay,NonGL,N/A
+GL_EXT_separate_specular_color,Supported,0.50
+GL_EXT_secondary_color,Supported,0.60
+GL_EXT_texture_env,Other,N/A
+GL_EXT_texture_perturb_normal,Unsupported,N/A
+GL_EXT_multi_draw_arrays,Supported,0.60
+GL_SUN_multi_draw_arrays,Supported,0.60
+GL_EXT_fog_coord,Supported,0.60
+GL_REND_screen_coordinates,Supported,0.50
+GL_EXT_coordinate_frame,Unsupported,N/A
+GL_EXT_texture_env_combine,Supported,0.50
+GL_APPLE_specular_vector,Supported,0.50
+GL_APPLE_transform_hint,Supported,0.50
+GL_SUNX_constant_data,Unsupported,N/A
+GL_SUN_global_alpha,Unsupported,N/A
+GL_SUN_triangle_list,Unsupported,N/A
+GL_SUN_vertex,Unsupported,N/A
+WGL_EXT_display_color_table,NonGL,N/A
+WGL_EXT_extensions_string,NonGL,N/A
+WGL_EXT_make_current_read,NonGL,N/A
+WGL_EXT_pixel_format,NonGL,N/A
+WGL_EXT_pbuffer,NonGL,N/A
+WGL_EXT_swap_control,NonGL,N/A
+GL_EXT_blend_func_separate,Supported,0.60
+GL_INGR_color_clamp,Supported,0.50
+GL_INGR_interlace_read,Supported,0.50
+GL_EXT_stencil_wrap,Supported,0.50
+WGL_EXT_depth_float,NonGL,N/A
+GL_EXT_422_pixels,Supported,0.50
+GL_NV_texgen_reflection,Supported,0.50
+GL_SGIX_texture_range,Supported,0.50
+GL_SUN_convolution_border_modes,Supported,0.50
+GLX_SUN_get_transparent_index,NonGL,N/A
+GL_EXT_texture_env_add,Supported,0.50
+GL_EXT_texture_lod_bias,Supported,0.50
+GL_EXT_texture_filter_anisotropic,Supported,0.50
+GL_EXT_vertex_weighting,Unsupported,N/A
+GL_NV_light_max_exponent,Supported,0.50
+GL_NV_vertex_array_range,Unsupported,N/A
+GL_NV_register_combiners,Unsupported,N/A
+GL_NV_fog_distance,Supported,0.50
+GL_NV_texgen_emboss,Supported,0.50
+GL_NV_blend_square,Supported,0.50
+GL_NV_texture_env_combine4,Supported,0.50
+GL_MESA_resize_buffers,NonGL,N/A
+GL_MESA_window_pos,NonGL,N/A
+GL_EXT_texture_compression_s3tc,Supported,0.50
+GL_IBM_cull_vertex,Supported,0.50
+GL_IBM_multimode_draw_arrays,Unsupported,N/A
+GL_IBM_vertex_array_lists,Unsupported,N/A
+GL_3DFX_texture_compression_FXT1,Supported,0.50
+GL_3DFX_multisample,NonGL,N/A
+GL_3DFX_tbuffer,Supported,0.60
+GL_EXT_multisample,NonGL,N/A
+WGL_EXT_multisample,NonGL,N/A
+GL_SGIX_vertex_preclip,Supported,0.50
+GL_SGIX_vertex_preclip_hint,Supported,0.50
+GL_SGIX_resample,Supported,0.50
+GL_SGIS_texture_color_mask,Unsupported,N/A
+GLX_MESA_copy_sub_buffer,NonGL,N/A
+GLX_MESA_pixmap_colormap,NonGL,N/A
+GLX_MESA_release_buffers,NonGL,N/A
+GLX_MESA_set_3dfx_mode,NonGL,N/A
+GL_EXT_texture_env_dot3,Supported,0.50
+GL_ATI_texture_mirror_once,Supported,0.50
+GL_NV_fence,Supported,0.60
+GL_IBM_static_data,Unsupported,N/A
+GL_IBM_texture_mirrored_repeat,Supported,0.50
+GL_NV_evaluators,Other,N/A
+GL_NV_packed_depth_stencil,Supported,0.50
+GL_NV_register_combiners2,Unsupported,N/A
+GL_NV_texture_compression_vtc,Supported,0.50
+GL_NV_texture_rectangle,Supported,0.50
+GL_NV_texture_shader,Supported,0.50
+GL_NV_texture_shader2,Supported,0.50
+GL_NV_vertex_array_range2,Supported,0.50
+GL_NV_vertex_program,Supported,0.60
+GLX_SGIX_visual_select_group,NonGL,N/A
+GL_SGIX_texture_coordinate_clamp,Supported,0.50
+GLX_OML_swap_method,NonGL,N/A
+GLX_OML_sync_control,NonGL,N/A
+GL_OML_interlace,Supported,0.50
+GL_OML_subsample,Supported,0.50
+GL_OML_resample,Supported,0.50
+WGL_OML_sync_control,NonGL,N/A
+GL_NV_copy_depth_to_color,Supported,0.50
+GL_ATI_envmap_bumpmap,Unsupported,N/A
+GL_ATI_fragment_shader,Unsupported,N/A
+GL_ATI_pn_triangles,Unsupported,N/A
+GL_ATI_vertex_array_object,Unsupported,N/A
+GL_EXT_vertex_shader,Unsupported,N/A
+GL_ATI_vertex_streams,Unsupported,N/A
+WGL_I3D_digital_video_control,NonGL,N/A
+WGL_I3D_gamma,NonGL,N/A
+WGL_I3D_genlock,NonGL,N/A
+WGL_I3D_image_buffer,NonGL,N/A
+WGL_I3D_swap_frame_lock,NonGL,N/A
+WGL_I3D_swap_frame_usage,NonGL,N/A
+GL_ATI_element_array,Unsupported,N/A
+GL_SUN_mesh_array,Unsupported,N/A
+GL_SUN_slice_accum,Supported,0.50
+GL_NV_multisample_filter_hint,Supported,0.50
+GL_NV_depth_clamp,Supported,0.50
+GL_NV_occlusion_query,Supported,0.60
+GL_NV_point_sprite,Supported,0.60
+WGL_NV_render_depth_texture,NonGL,N/A
+WGL_NV_render_texture_rectangle,NonGL,N/A
+GL_NV_texture_shader3,Supported,0.50
+GL_NV_vertex_program1_1,Supported,0.50
+GL_EXT_shadow_funcs,Supported,0.50
+GL_EXT_stencil_two_side,Supported,0.60
+GL_ATI_text_fragment_shader,Supported,0.50
+GL_APPLE_client_storage,Supported,0.50
+GL_APPLE_element_array,Unsupported,N/A
+GL_APPLE_fence,Unsupported,N/A
+GL_APPLE_vertex_array_object,Unsupported,N/A
+GL_APPLE_vertex_array_range,Unsupported,N/A
+GL_APPLE_ycbcr_422,Supported,0.50
+GL_S3_s3tc,Other,N/A
+GL_ATI_draw_buffers,Supported,0.60
+WGL_ATI_pixel_format_float,NonGL,N/A
+GL_ATI_texture_env_combine3,Supported,0.50
+GL_ATI_texture_float,Supported,0.50
+GL_NV_float_buffer,Supported,0.50
+WGL_NV_float_buffer,NonGL,N/A
+GL_NV_fragment_program,Supported,0.60
+GL_NV_half_float,Unsupported,N/A
+GL_NV_pixel_data_range,Unsupported,N/A
+GL_NV_primitive_restart,Supported,0.60
+GL_NV_texture_expand_normal,Supported,0.50
+GL_NV_vertex_program2,Supported,0.50
+GL_ATI_map_object_buffer,Unsupported,N/A
+GL_ATI_separate_stencil,Unsupported,N/A
+GL_ATI_vertex_attrib_array_object,Unsupported,N/A
+GL_OES_byte_coordinates,Supported,0.50
+GL_OES_fixed_point,Unsupported,N/A
+GL_OES_single_precision,Unsupported,N/A
+GL_OES_compressed_paletted_texture,Supported,0.50
+GL_OES_read_format,Supported,0.50
+GL_OES_query_matrix,Unsupported,N/A
+GL_EXT_depth_bounds_test,Supported,0.60
+GL_EXT_texture_mirror_clamp,Supported,0.50
+GL_EXT_blend_equation_separate,Supported,0.60
+GL_MESA_pack_invert,Supported,0.50
+GL_MESA_ycbcr_texture,Supported,0.50
+GL_EXT_pixel_buffer_object,Supported,0.50
+GL_NV_fragment_program_option,Supported,0.50
+GL_NV_fragment_program2,Supported,0.50
+GL_NV_vertex_program2_option,Supported,0.50
+GL_NV_vertex_program3,Supported,0.50
+GLX_SGIX_hyperpipe,NonGL,N/A
+GLX_MESA_agp_offset,NonGL,N/A
+GL_EXT_texture_compression_dxt1,Supported,0.50
+GL_EXT_framebuffer_object,Supported,0.50
+GL_GREMEDY_string_marker,Supported,0.60
+GL_EXT_packed_depth_stencil,Supported,0.50
+WGL_3DL_stereo_control,NonGL,N/A
+GL_EXT_stencil_clear_tag,Supported,0.60
+GL_EXT_texture_sRGB,Supported,0.50
+GL_EXT_framebuffer_blit,Supported,0.60
+GL_EXT_framebuffer_multisample,Supported,0.60
+GL_MESAX_texture_stack,Supported,0.50
+GL_EXT_timer_query,Supported,0.60
+GL_EXT_gpu_program_parameters,Supported,0.60
+GL_APPLE_flush_buffer_range,Unsupported,N/A
+GL_NV_gpu_program4,Supported,0.60
+GL_NV_geometry_program4,Supported,0.60
+GL_EXT_geometry_shader4,Supported,0.60
+GL_NV_vertex_program4,Supported,0.60
+GL_EXT_gpu_shader4,Supported,0.60
+GL_EXT_draw_instanced,Supported,0.60
+GL_EXT_packed_float,Supported,0.50
+WGL_EXT_pixel_format_packed_float,NonGL,N/A
+GLX_EXT_fbconfig_packed_float,NonGL,N/A
+GL_EXT_texture_array,Supported,0.60
+GL_EXT_texture_buffer_object,Supported,0.60
+GL_EXT_texture_compression_latc,Supported,0.50
+GL_EXT_texture_compression_rgtc,Supported,0.50
+GL_EXT_texture_shared_exponent,Supported,0.50
+GL_NV_depth_buffer_float,Supported,0.60
+GL_NV_fragment_program4,Supported,0.50
+GL_NV_framebuffer_multisample_coverage,Supported,0.60
+GL_EXT_framebuffer_sRGB,Supported,0.50
+GLX_EXT_framebuffer_sRGB,NonGL,N/A
+WGL_EXT_framebuffer_sRGB,NonGL,N/A
+GL_NV_geometry_shader4,Supported,0.50
+GL_NV_parameter_buffer_object,Unsupported,N/A
+GL_EXT_draw_buffers2,Unsupported,N/A
+GL_NV_transform_feedback,Unsupported,N/A
+GL_EXT_bindable_uniform,Unsupported,N/A
+GL_EXT_texture_integer,Supported,0.60
+GLX_EXT_texture_from_pixmap,NonGL,N/A
+GL_GREMEDY_frame_terminator,Supported,0.60
diff -pruN 0.32f-2.1/doc/history.txt 0.60.0-0ubuntu3/doc/history.txt
--- 0.32f-2.1/doc/history.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/history.txt	2007-12-29 00:02:00.000000000 +0000
@@ -0,0 +1,66 @@
+Project history
+===============
+
+The [original ruby-opengl](http://www2.giganet.net/~yoshi/) was written
+by Yoshi.
+
+James A. desperately wanted to get the OpenGL Ruby bindings working on his Mac,
+but they wouldn't even compile on OSX. After a little bit of tweaking, he made
+his patched bindings available to the ruby community in a very informal manner.
+
+John G. then wanted to clean it up and add some docs to it, and so started
+tweaking and put up a new site and made his changes available.
+
+Then Peter M. came along and decided to try updating ruby-opengl using SWIG,
+as it seemed easier than doing everything by hand. Peter wrote the new code,
+John started the actual RubyForge project, put up a new site, and Peter
+committed the code.
+
+Thu M. V. joined the project with a lot of energy, and the mailing list
+was showing a good bit of activity.
+
+After some experience, we began to question whether SWIG was necessary/helpful
+for a project of this nature.  The leaning was that people want to abandon
+SWIG and go back to maintaining the binding files by hand. Thu even provided
+a script to help with the manual coding that would be required without using
+SWIG.
+
+The reasoning at the time was:
+
+Pro-SWIG:
+
+* Could use the .i files for another project, perhaps (OTOH, we couldn't
+  use previous .i files on this project...)
+
+* It's supposed to require less manual coding.
+
+Con-SWIG:
+
+* yet another tool to learn
+
+* OpenGL isn't really all that big
+
+* OpenGL doesn't change a lot
+
+* A lot of boilerplate and overhead in the generated files because SWIG is
+  a general tool.
+
+
+In September 2006, we stopped using SWIG. Thu and Peter began fine tuning
+Thu's original `utils/mkwrap.rb` script.
+
+Development stalled in October 2006.
+
+Development picked up again towards the end of 2006. After a long hiatus 
+and getting a new release of mkrf out the door, version 0.33 (following the
+numbering of original Yoshi's bindings which stalled at 0.32) was released.
+
+During first half of 2007, we added large portion of code, as well as number
+of unit tests, creating near-complete support for OpenGL 2.1.
+Support for MS Windows was also added during this time.
+
+Version 0.40 was released in July 2007.
+
+Version 0.50 was released in October 2007.
+
+Version 0.60 was released in December 2007.
diff -pruN 0.32f-2.1/doc/requirements_and_design.txt 0.60.0-0ubuntu3/doc/requirements_and_design.txt
--- 0.32f-2.1/doc/requirements_and_design.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/requirements_and_design.txt	2007-09-22 09:33:43.000000000 +0100
@@ -0,0 +1,117 @@
+Design
+======
+
+This document records the requirements, high-level design, and the
+specifications for the ruby-opengl project.
+
+The content of this document was gleaned from the postings on the
+ruby-opengl-dev list and internal notes from John G., Peter M., Vo Minh Thu,
+and Robert K.
+
+
+Requirements
+------------
+
+* ruby-opengl is a Ruby extension library which wraps the OpenGL, GLU,
+  and GLUT libraries.
+
+* ruby-opengl shall provide three base modules: *BaseGL*, *BaseGLU*, and
+  *BaseGLUT* (the "Base Modules").
+
+  Note: "BaseGL" etc. are not the names that appear in the code -- they are
+  just handles so we can write about them in documents like this one.
+
+* The Base Modules shall be separately loadable.
+
+* BaseGL shall not depend on any of the other Ruby modules.
+
+* BaseGLU shall depend on, at most, BaseGL.
+
+* BaseGLUT shall depend on, at most, BaseGLU and BaseGL.
+
+* Base Module syntax shall closely follow the standard C-syntax.
+
+  The syntax for a Ruby program that uses the base modules, shall closely
+  follow the standard C-like syntax that OpenGL programmers are used to,
+  and that most OpenGL examples are published in:
+
+        {{ruby}}
+        require 'gl'
+        Gl.glBegin( Gl::GL_POLYGON )
+          Gl.glVertex2d( 0, 0 )
+          Gl.glVertex2d( 0, 1 )
+          Gl.glVertex2d( 1, 1 )
+          Gl.glVertex2d( 1, 0 )
+        Gl.glEnd
+
+  Or:
+
+        {{ruby}}
+        require 'gl'
+        include Gl
+        glBegin( GL_POLYGON )
+          glVertex2d( 0, 0 )
+          glVertex2d( 0, 1 )
+          glVertex2d( 1, 1 )
+          glVertex2d( 1, 0 )
+        glEnd
+
+  The rationale for adopting the C-like syntax is:
+    * Makes it familiar to OpenGL programmers.
+    * Removes the burden of learning OpenGL plus some Ruby-isms, just to
+      get started.
+    * Makes it easier to port OpenGL programs to/from ruby-opengl.
+    * The current OpenGL documentation more naturally fits ruby-opengl.
+    * Putting "gl", "glu" and "glut" in front of all the names (i.e.,
+      following the C-like syntax) leaves common variable names open for
+      the programmers (e.g., "vertex", "color" etc. are popular topics in
+      3D programming, so not robbing the ruby namespace of such valuable
+      real-estate seems nice).
+
+
+* It shall be possible to check out the project from svn, compile and test
+  on the following platforms: Mac OS X, GNU/Linux. MS Windows operating
+  systems may also be supported in the future.
+
+* The project will make a number of pre-compiled extensions available as gems.
+
+* The project will supply source code and build scripts (via svn checkout)
+  conducive to straightforward porting to other platforms.
+
+* There shall be a test suite that exercises each call in each of the Base
+  modules.
+
+* All project documentation will be in Markdown format in files that end in
+  `.txt`.
+
+* The project will make some efforts to track versions of OpenGL.
+
+
+### Things in the future
+
+Once the base modules are implemented, there are several ideas on things to
+do next.  This list is not really requirements, but a list of nice ideas to
+try:
+
+* Provide wrappers for glBegin/glEnd, eg: polygon()...translates to
+  glBegin(GL_POLYGON)....glEnd
+
+* Untyped versions of the multi-typed gl functions:  e.g., a single
+  glVertex that examines its arguments and calls the appropriate
+  glVertex{234}{fisdv} call in BaseGL.
+
+
+
+Implementation
+--------------
+
+Our plan is to continue on with Yoshi's original code, modified
+to use standard OpenGL-style constant and function names.
+
+
+### Build environment ###
+
+The build environment will use:
+
+* use rake and mkrf. 
+* minimize the number of additional tools required
diff -pruN 0.32f-2.1/doc/roadmap.txt 0.60.0-0ubuntu3/doc/roadmap.txt
--- 0.32f-2.1/doc/roadmap.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/roadmap.txt	2007-12-29 00:02:00.000000000 +0000
@@ -0,0 +1,28 @@
+Roadmap
+=======
+
+* Write comprehensive API documentation
+* Create more example code
+* Add RMagick(ImageMagick) integration for easy image handling (textures,screenshots)
+* Support all pixelstore modes (currently forced to default values by
+  any function getting/setting data affected by it)
+
+Possible Features
+========
+* Add **all** OpenGL extensions (some are obsolete or not really used or useful at all)
+* Add direct mapping on ruby types for vertex arrays, buffers and image data to allow high performance data operations from within ruby
+	- this should be modeled after Perl's OpenGL::Array
+	- Update: preliminary tests shows that performance-wise there is no need for it, as the Ruby interpreter overhead is currently larger than immediate-mode calls overhead, so any potential speed gains are in domain of 1-5%. It still may be good idea from usability perspective, although that would require more comprehensive design, not just simple wrapper.
+* Support for r/w VBO buffer mapping - gl(Un)MapBuffer (is it needed?)
+
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
diff -pruN 0.32f-2.1/doc/scientific_use.txt 0.60.0-0ubuntu3/doc/scientific_use.txt
--- 0.32f-2.1/doc/scientific_use.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/scientific_use.txt	2007-12-15 00:32:31.000000000 +0000
@@ -0,0 +1,35 @@
+Scientific Use
+--------------
+
+Though not directly related to ruby-opengl, this page contains a
+few tidbits of general info that might possibly be of interest to
+a number of users.
+
+There are currently two bindings to the [GNU Scientific Library][1] (GSL):
+
+* Yoshiki's Ruby/GSL (<http://rb-gsl.rubyforge.org/>) --
+  Comes with an API reference. Also, I've been told that the API has been
+  worked a bit to be more comfortable for Ruby programmers.
+* Arno's ruby-gsl (<http://ruby-gsl.sourceforge.net/>) --
+  more of a straight wrapper around the C API.
+
+[1]: http://www.gnu.org/software/gsl/
+
+<a href="http://rubyforge.org/softwaremap/trove_list.php?form_cat=97">Browse Rubyforge</a>
+for more.
+
+
+Links
+-----
+
+* <http://sciruby.codeforpeople.com/sr.cgi/FrontPage> -- SciRuby wiki.
+* <http://narray.rubyforge.org/> -- Numerical n-dimensional Array class.
+* <http://www.kitp.ucsb.edu/~paxton/tioga.html> -- Tioga. Create plots using
+  Ruby and TeX.
+
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
diff -pruN 0.32f-2.1/doc/supplies/page_template.html 0.60.0-0ubuntu3/doc/supplies/page_template.html
--- 0.32f-2.1/doc/supplies/page_template.html	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/supplies/page_template.html	2007-12-15 00:32:31.000000000 +0000
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link type="text/css" media="screen" rel="stylesheet" href="style.css" />
+<title>ruby-opengl -- {{title}}</title>
+</head>
+
+<body>
+
+<div id="container">
+
+	<div id="header">
+		<em>ruby-opengl</em>
+	</div>
+
+	<ul id="tabnav">
+		<li><a href="./index.html">Home</a></li>
+		<li><a href="./tutorial.html">Tutorial</a></li>
+		<li><a href="./build_install.html">Build/Install</a></li>
+		<li><a href="./roadmap.html">Roadmap</a></li>
+		<li><a href="./requirements_and_design.html">Req's doc</a></li>
+		<li><a href="./history.html">History</a></li>
+	</ul>
+	
+	<div id="sidebar">
+    <img src="./images/ogl.jpg">
+		<h3>Contact</h3>
+		<ul>
+			<li><a href="http://rubyforge.org/mail/?group_id=2103">Mailing list</a></li>
+			<li><a href="http://rubyforge.org/tracker/?atid=8185&amp;group_id=2103&amp;func=browse">Bug tracker</a></li>
+			<li><a href="http://rubyforge.org/projects/ruby-opengl">Project page</a></li>
+		</ul>
+		<h3>Download</h3>
+		<ul>
+			<li><a href="http://rubyforge.org/frs/?group_id=2103">Releases</a></li>
+			<li><a href="http://rubyforge.org/scm/?group_id=2103">SVN</a></li>
+		</ul>
+        <h3>Other docs</h3>
+        <ul>
+            <li><a href="./extensions.html">Extension support</a></li>
+            <li><a href="./thanks.html">Thanks</a></li>
+            <li><a href="./scientific_use.html">Scientific use</a></li>
+        </ul>
+
+		<h3>Links</h3>
+		<ul>
+			<li><a href="http://www.opengl.org/">OpenGL</a></li>
+			<li><a href="http://www.mesa3d.org/">Mesa</a></li>
+			<li><a href="http://freeglut.sourceforge.net/">freeglut</a></li>
+			<li><a href="http://rubyforge.org/projects/ruby-ftgl/">ruby-ftgl</a></li>
+			<li><a href="http://www.rubygarden.org/ruby?OpenGL">Ruby wiki GL page</a></li>
+			<li><a href="http://rubygame.sourceforge.net">RubyGame</a></li>
+		</ul>
+	</div>	
+	
+	<div id="content">
+
+    {{content}}
+
+	</div>
+	<div id="footer">
+	<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0</a> |
+    Copyright &copy; <a href="#">Alain Hoang</a> |
+    Design by <a href="http://www.jdavidmacor.com">super j man</a></p>
+	</div>
+	
+</div>
+
+</body>
+</html>
diff -pruN 0.32f-2.1/doc/thanks.txt 0.60.0-0ubuntu3/doc/thanks.txt
--- 0.32f-2.1/doc/thanks.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/thanks.txt	2007-12-15 00:32:31.000000000 +0000
@@ -0,0 +1,29 @@
+Thank you
+---------
+
+Aside from big thank-you's to the core devs, special thanks also goes to:
+
+* Bill Kelly -- provided some pilot code changing how users can call method and constant names.
+* Ilmari Heikkinen -- provided code for changing how users can call method and constant names.
+* James Adam -- Mac OS X fixes
+* Tony Hursh -- Mac OS X glut build tweak
+* Sean Long -- More Mac OS X fixes
+* John Gabriele -- Numerous fixes, documentation, and project support
+* Ronald Pijnacker -- Windows support and bugfixes
+* **Yoshi** -- providing ruby-opengl-0.32g from which to work off of.
+
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
diff -pruN 0.32f-2.1/doc/tutorial.txt 0.60.0-0ubuntu3/doc/tutorial.txt
--- 0.32f-2.1/doc/tutorial.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/doc/tutorial.txt	2007-12-28 22:21:52.000000000 +0000
@@ -0,0 +1,469 @@
+Usage Tutorial
+==============
+This page should serve as tutorial and also as reference to Ruby bindings for OpenGL
+language. It is assumed that you have basic understanding of both OpenGL and Ruby.
+
+If you are new to OpenGL, you can start by visiting [OpenGL homepage](http://www.opengl.org)
+, reading the [OpenGL Programming Guide](http://opengl.org/documentation/books/#the_opengl_programming_guide_the_official_guide_to_learning_opengl_version) (also known as Red Book) or going to [NeHe's tutorials page](http://nehe.gamedev.net/).
+
+If you are new to Ruby, [the ruby-lang website](http://www.ruby-lang.org/en/documentation/) contains lots of
+documentation and manuals for Ruby.
+
+Table of Contents
+==============
+Basics:
+* [Naming Conventions](#naming_conventions)<br/>
+* [Function parameters](#function_parameters)<br/>
+* [Return values](#return_values)<br/>
+* [Matrices](#matrices)<br/>
+* [Textures and other raw data](#textures)<br/>
+* [Error Checking](#error_checking)<br/>
+* [Examples](#examples)<br/>
+
+Advanced stuff:
+* [OpenGL version and Extensions](#extensions)<br/>
+* [Selection and Feedback queries](#selection_feedback)<br/>
+* [Vertex Arrays](#vertex_arrays)<br/>
+* [Buffer Objects](#buffer_objects)<br/>
+* [GLUT, SDL, GLFW..](#glut_sdl)<br/>
+* [GLUT callbacks](#glut_callbacks)<br/>
+* [Internals](#internals)<br/>
+
+API reference:
+* TODO
+
+<a name="naming_conventions"></a>
+Naming conventions
+------------------
+
+The bindings contains three modules:
+* 'Gl' - OpenGL functions itself
+* 'Glu' - OpenGL Utility Library API - higher-level drawing routines, NURBS etc.
+* 'Glut' - OpenGL Utility Toolkit - low level functions such as creating OpenGL
+  context, opening window or handling user input
+
+You can import all three modules by calling
+
+	{{ruby}}
+	require 'opengl'
+
+You can also load the modules separately by using:
+
+	{{ruby}}
+	require 'gl'
+	require 'glu'
+	require 'glut'
+
+The functions and constants are named the same as their C counterparts:
+
+	{{ruby}}
+	require 'opengl'
+	...
+	Gl.glFooBar( Gl::GL_FOO_BAR )
+	Glu.gluFooBar( Glu::GLU_FOO_BAR )
+	Glut.glutFooBar( Glut::GLUT_FOO_BAR )
+
+This is the 'full' syntax, usefull when you are expecting name clashes
+with other modules, or just want to be formal ;) More often, you will
+want to use the 'C-style' syntax, which you can accomplish by using 'include'
+to export the module functions and constants to global namespace:
+
+	{{ruby}}
+	require 'opengl'
+	include Gl,Glu,Glut
+	...
+	glFooBar( GL_FOO_BAR )
+	gluFooBar( GLU_FOO_BAR )
+	glutFooBar( GLUT_FOO_BAR )
+
+Finally, you can use the 'old' syntax:
+
+	{{ruby}}
+	require 'opengl'
+	...
+	# Note the missing prefixes in functions and constants
+	# and also capitalization of module names
+	GL.FooBar( GL::FOO_BAR )
+	GLU.FooBar( GLU::FOO_BAR )
+	GLUT.FooBar( GLUT::FOO_BAR )
+
+This syntax was used by previous ruby-opengl versions; some people also
+consider it as being more in the spirit of OO programming. It has one
+downside though - due to Ruby's naming scheme, you cannot use constants
+which begins with number, e.g. GL_2D would under this syntax be (GL::)2D
+which is illegal.
+
+All three variants of syntax will continue to be supported in future,
+so it's up to you which one you choose to use.
+
+The rest of this tutorial will use the C syntax.
+
+Calling syntax
+--------------
+<a name="function_parameters"></a>
+Function parameters
+--------------
+For most types the ruby syntax follows the C API. If needed, ruby will do
+automatic parameter conversion to required type if possible. Example:
+
+	{{ruby}}
+	glVertex3f( 1.0, 1.0, 1.0 )  # matches C syntax
+	glVertex3f( 1, 1, 1 )        # equivalent to the above
+	glVertex3f( "string", 1, 1 ) # raises TypeError exception
+		
+Arrays are passed/received as Ruby arrays:
+
+	{{ruby}}
+	vertex = [ 1, 1, 1 ]
+	glVertex3fv( vertex )
+
+For functions with multiple parameter-number variations (glVertex,glColor,...)
+we define 'overloaded' functions, as in:
+
+	{{ruby}}
+	glVertexf( 1, 1 )       # will call glVertex2f()
+	glVertexf( 1, 1, 1 )    # will call glVertex3f()
+	glVertexf( 1, 1, 1, 1 ) # will call glVertex4f()
+	glVertexi( 1, 1 )       # will call glVertex2i()
+	...
+	# and so on
+
+<a name="return_values"></a>
+Return values
+-------------
+In C, OpenGL functions rarely return values directly, instead you pass in pointer to
+preallocated buffer and they will fill it with values; sometimes you have to even query
+how big buffer you'll need to allocate. Ruby does this all for you, returning either single
+value or array:
+
+	{{ruby}}
+	glColor4f( 1.0, 1.0, 1.0, 1.0 )
+	...
+	color =	glGetDoublev(GL_CURRENT_COLOR)
+	p color # will be [1.0,1.0,1.0,1.0]
+
+<a name="matrices"></a>
+Matrices
+-------------
+Matrices are passed and received as ruby array, or as ruby Matrix objects:
+
+	{{ruby}}
+	matrix_a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
+	matrix_b = [ [  0, 1, 2, 3 ],
+	             [  4, 5, 6, 7 ],
+	             [  8, 9,10,11 ],
+	             [ 12,13,14,15 ] ]
+	matrix_c = Matrix.rows( [ [  0, 1, 2, 3 ],
+	                          [  4, 5, 6, 7 ],
+	                          [  8, 9,10,11 ],
+	                          [ 12,13,14,15 ] ] )
+	...
+	glLoadMatrixf(matrix_a)
+	glLoadMatrixf(matrix_b) 
+	glLoadMatrixf(matrix_c) # same result
+
+You may also create your own matrix class and pass it this way, provided that it
+is convertible to array (has 'to_a' method).
+
+Note that as OpenGL uses column-major
+notation for matrices, you may need to call transpose() when working with
+row-major matrices or arrays in ruby.
+
+<a name="textures"></a>
+Textures and other raw data
+-------------
+Data for textures, arrays, buffers etc. can be specified either as ruby arrays or directly as raw packed strings -
+strings that contains their direct memory representation (just like C arrays). If you need to convert between
+ruby arrays and these strings, use ruby Array#pack() and String#unpack() functions.
+Example:
+
+	{{ruby}}
+	# create texture, 2x2 pixels,
+	# 3 components (R,G,B) for each pixel as floats
+	texture = [
+	           1.0, 0.0, 0.0, # 1st pixel, red
+	           0.0, 1.0, 0.0, # 2nd pixel, green
+	           0.0, 0.0, 1.0, # 3rd pixel, blue
+	           1.0, 1.0, 1.0  # 4th pixel, white
+	          ]
+	# convert it to string
+	# f = native float representation
+	# * = convert all values in the array the same way
+	data = texture.pack("f*")
+	...
+	glTexImage2D(
+	  GL_TEXTURE_2D, # target
+	  0,             # mipmap level,
+	  GL_RGB8,       # internal format
+	  2, 2,          # width, height
+	  0,             # border = no
+	  GL_RGB,        # components per each pixel
+	  GL_FLOAT,      # component type - floats
+	  data           # the packed data
+	)
+
+Reverse works just the same:
+
+	{{ruby}}
+	...
+	data = glGetTexImage( # returns the packed data as string
+	  GL_TEXTURE_2D, # target
+	  0,             # mipmap level
+	  GL_RGB,        # components per pixel
+	  GL_FLOAT       # component type
+	)
+	# now convert it to ruby array
+	texture = data.unpack("f*")
+	...
+
+For storage, packed strings are more memory efficient than ruby arrays, but
+cannot be easily changed or manipulated.
+
+<a name="error_checking"></a>
+Error Checking
+--------------
+Starting with version 0.60.0, ruby-opengl performs automatic checking of OpenGL and GLU errors.
+Functions:
+
+	{{ruby}}
+	Gl.enable_error_checking
+	Gl.disable_error_checking
+	Gl.is_error_checking_enabled? # true/false
+
+When the checking is enabled (default), glGetError() is executed after each OpenGL call, and should error
+occur, Gl::Error exception is raised:
+
+	{{ruby}}
+	Gl.enable_error_checking
+	...
+	begin 
+	  ...
+	  glEnable(GL_TRUE) # will raise exception
+	  ...
+	rescue Gl::Error => err
+		# err.id contains the OpenGL error ID
+		if (err.id == GL_INVALID_ENUM)
+			puts "Oh noes! You used invalid enum!"
+			...
+		end
+		...
+	end
+
+Some GLU functions may also throw Glu::Error - the handling is the same as above.
+
+It is usually good idea to leave error checking on for all your code, as OpenGL errors have habit to pop-up in
+unexpected places. For now there is no measurable performance hit for error checking, although this may depend
+on your graphic drivers implementation.
+
+<a name="examples"></a>
+The Examples
+-----------
+
+Various examples are in 'examples' directory of the bindings. To run them, manually pass them to `ruby` like:
+
+    ruby some_sample.rb
+
+On windows, you may want to use 'rubyw' instead, which displays the standard output window
+as some examples use the console for usage info etc.
+
+If you get 'opengl not found' error, and you installed ruby-opengl from gems, your
+shell or ruby installation is probably not configured to use the gems; in that case type:
+
+    ruby -rubygems some_sample.rb
+
+The `README` file in the `examples` directory contains some notes on the examples.
+
+<a name="extensions"></a>
+OpenGL Version and Extensions 
+-----------
+To query for available OpenGL version or OpenGL extension, use Gl.is_available? function:
+
+	{{ruby}}
+	# true if OpenGL version is 2.0 or later is available
+	Gl.is_available?(2.0)
+	...
+	# returns true if GL_ARB_shadow is available on this system
+	Gl.is_available?("GL_ARB_shadow")
+	
+For list of what extensions are supported in ruby-opengl see this [page](extensions.html)
+
+The extensions' function names once again follows the C API. Some extensions were over time
+promoted to ARB or even to OpenGL core, retaining their function names just with suffix changed
+or removed. However sometimes the functions semantics was changed in the process, so to avoid
+confusion, ruby-opengl bindings will strictly adhere to the C naming, e.g. :
+
+	{{ruby}}
+	# will call the function from GL_ARB_transpose_matrix extension
+	glLoadTransposeMatrixfARB(matrix)
+	...
+	# will call the function from OpenGL 1.3
+	glLoadTransposeMatrixf(matrix)
+
+<b>Note:</b> ruby-opengl is compiled against OpenGL 1.1, and all functions and enums from later
+versions of OpenGL and from extensions are loaded dynamically at runtime. That means that all
+of OpenGL 2.1 and supported extensions are available even if the ruby-opengl bindings are
+compiled on platform which lacks proper libraries or headers (like for example Windows without
+installed graphic drivers). This should ease binary-only distribution and application packaging.
+
+
+<a name="selection_feedback"></a>
+Selection/Feedback queries
+-----------
+Querying selection and feedback is different from C. Example:
+
+	{{ruby}}
+	# this will create selection buffer 512*sizeof(GLuint) long
+	buf = glselectbuffer(512)
+	# enter feedback mode
+	glRenderMode(GL_SELECT) 
+	... # draw something here	
+	# return to render mode
+	count = glRenderMode(GL_RENDER)
+	# at this point the buf string is freezed and contains
+	# the selection data, which you can recover with unpack
+	# function
+	data = buf.unpack("I*") # I for unsigned integer
+	# also, next call to glRenderMode(GL_SELECT) will overwrite
+	# the 'buf' buffer with new data
+
+The feedback query follows the same pattern, only the data are stored
+as floats.
+
+<a name="vertex_arrays"></a>
+Vertex Arrays
+-----------
+In current state, vertex arrays are not very efficient in ruby-opengl, as it is not possible to change
+the array content once it is specified, and there is overhead for converting between ruby and C representation
+of numbers. Using display lists for static and immediate mode for dynamic objects is recommended instead.
+
+You can specify the data the same way as [texture data](#textures). Example:
+
+	{{ruby}}
+	normals = [0,1,0, 1,0,0, 1,1,1]
+	glNormalPointer(GL_FLOAT,0,normals)
+	...
+	glEnable(GL_NORMAL_ARRAY)
+	glDrawArrays(...)
+	...
+
+This applies to all *pointer functions. glGetPointerv will return reference to the frozen string
+previously specified.
+
+<a name="buffer_objects"></a>
+Buffer Objects
+-----------
+Once again, in current state buffer objects (VBOs in particular) are not very efficient in ruby-opengl.
+Unlike textures and vertex arrays, the data for buffers *must* be prepacked by using .pack() function,
+as buffers does not retain information about the storage type. Mapping of the buffer afterwards is read-only. 
+
+Like in C, buffer binding affects some functions in way that if particular buffer is bound, the related
+functions (for example glTexImage) take integer offset in place of data string argument. This is also true
+for getter functions (e.g. glGetTexImage) - instead of returning the data string, they take offset as they're
+last argument (so in ruby they take one extra argument), and will write the data in the bound buffer as expected.
+
+VBO example:
+
+	{{ruby}}
+	# specify 3 vertices, 2*float each
+	data = [0,0, 0,1, 1,1].pack("f*")
+	...
+	# generate buffer name
+	buffers = glGenBuffers(1)
+	# bind to the name to ARRAY buffer for vertex array
+	glBindBuffer(GL_ARRAY_BUFFER,buffers[0])
+	# here the data is specified, size is n*sizeof(float)
+	# note that you don't get to specify type, as buffers
+	# operate on byte level
+	glBufferData(GL_ARRAY_BUFFER,6*4,data,GL_DYNAMIC_DRAW)
+	...
+	# here instead of specyfing the data, you pass '0' (or
+	# positive integer) as offset to the bound buffer
+	glVertexPointer(2,GL_FLOAT,0,0)
+	...
+	glEnableClientState(GL_VERTEX_ARRAY)
+	...
+
+<a name="glut_sdl"></a>
+GLUT, SDL, GLFW..
+---------
+When it comes to low-level task like GL window creation, input and event handling, the first choice is GLUT,
+as it is readilly available alongside OpenGL. However both GLUT itself and its implementations
+have their drawbacks, and for that and other reasons there are number of replacement libraries.
+You can use any of them with ruby-opengl (as long as there are ruby bindings for them).
+
+Here is example for [SDL](http://www.kmc.gr.jp/~ohai/index.en.html):
+
+	{{ruby}}
+	require 'opengl'
+	require 'sdl'
+	# init
+	SDL.init(SDL::INIT_VIDEO)
+	SDL.setGLAttr(SDL::GL_DOUBLEBUFFER,1)
+	SDL.setVideoMode(512,512,32,SDL::OPENGL)
+	...
+	Gl.glVertex3f(1.0,0.0,0.0)
+	...
+	SDL.GLSwapBuffers()
+	...
+
+and another example for [GLFW](http://ruby-glfw.rubyforge.org/):
+
+	{{ruby}}
+	require 'opengl'
+	require 'glfw'
+	# init
+	Glfw.glfwOpenWindow( 500,500, 0,0,0,0, 32,0, Glfw::GLFW_WINDOW )
+	...
+	Gl.glVertex3f(1.0,0.0,0.0)
+	...
+	Glfw.glfwSwapBuffers()
+	...
+
+<a name="glut_callbacks"></a>
+GLUT callbacks
+--------------
+
+The GLUT callback functions are specified as Proc objects, which you can
+either create with lambda as:
+
+	{{ruby}}
+	reshape = lambda do |w, h|
+	  ...
+	end
+	...
+	glutReshapeFunc( reshape )
+
+or by conversion from normal functions:
+
+	{{ruby}}
+	def reshape(w,h)
+	  ...
+	end
+	...
+	glutReshapeFunc( method("reshape").to_proc )
+    
+Note: An older notation you'll see instead of `lambda` is `proc`. The
+PickAxe v2 notes that `proc` is "mildly deprecated" in favor of `lambda`.
+You'll also sometimes see `Proc.new` used in place of either. Pages 359-360 of
+PickAxe v2 describe the differences between using `lambda` and `Proc.new`,
+but for our purposes either will be fine.
+
+<a name="internals"></a>
+Internals
+---------
+
+The directory structure follows current Ruby standards, with a few
+extra directories added.
+
+* `doc/` -- Contains documentation for the project (from which this
+  website is generated).
+* `examples/` -- Example programs.
+* `ext/` -- Contains subdirectories, one for each of the three extension
+  modules (gl, glu, glut). Herein are the files needed to compile the extension
+  modules.
+* `lib/` -- Files that the user is meant to `require` in their own code.
+* `test/` -- Contains automatic testsuite for the bindings
+* `utils` -- Some utility scripts used to help generate code, documentation
+  and website.
+* `website` -- After running `rake gen_website` this directory will contain
+  the ruby-opengl website.
diff -pruN 0.32f-2.1/examples/OrangeBook/3Dlabs-License.txt 0.60.0-0ubuntu3/examples/OrangeBook/3Dlabs-License.txt
--- 0.32f-2.1/examples/OrangeBook/3Dlabs-License.txt	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/3Dlabs-License.txt	2007-07-28 16:18:38.000000000 +0100
@@ -0,0 +1,33 @@
+Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+    Redistributions in binary form must reproduce the above
+    copyright notice, this list of conditions and the following
+    disclaimer in the documentation and/or other materials provided
+    with the distribution.
+
+    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+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 HOLDERS 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 -pruN 0.32f-2.1/examples/OrangeBook/brick.frag 0.60.0-0ubuntu3/examples/OrangeBook/brick.frag
--- 0.32f-2.1/examples/OrangeBook/brick.frag	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/brick.frag	2007-07-28 16:18:38.000000000 +0100
@@ -0,0 +1,36 @@
+//
+// Fragment shader for procedural bricks
+//
+// Authors: Dave Baldwin, Steve Koren, Randi Rost
+//          based on a shader by Darwyn Peachey
+//
+// Copyright (c) 2002-2004 3Dlabs Inc. Ltd.
+//
+// See 3Dlabs-License.txt for license information
+//  
+
+uniform vec3  BrickColor, MortarColor;
+uniform vec2  BrickSize;
+uniform vec2  BrickPct;
+
+varying vec2  MCposition;
+varying float LightIntensity;
+
+void main(void)
+{
+    vec3  color;
+    vec2  position, useBrick;
+    
+    position = MCposition / BrickSize;
+
+    if (fract(position.y * 0.5) > 0.5)
+        position.x += 0.5;
+
+    position = fract(position);
+
+    useBrick = step(position, BrickPct);
+
+    color  = mix(MortarColor, BrickColor, useBrick.x * useBrick.y);
+    color *= LightIntensity;
+    gl_FragColor = vec4 (color, 1.0);
+}
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/OrangeBook/brick.rb 0.60.0-0ubuntu3/examples/OrangeBook/brick.rb
--- 0.32f-2.1/examples/OrangeBook/brick.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/brick.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,376 @@
+# Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#    Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#    Redistributions in binary form must reproduce the above
+#    copyright notice, this list of conditions and the following
+#    disclaimer in the documentation and/or other materials provided
+#    with the distribution.
+#
+#    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+#    contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# 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 HOLDERS 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 source of the shaders itself are in plain text files. Files ending in
+# .vert are vertex shaders, and files ending in .frag are fragment shaders.
+
+require 'opengl'
+include Gl,Glu,Glut
+
+$rotl = 1 * Math::PI / 180
+$last_time = 0
+
+$fXDiff = 206
+$fYDiff = 16
+$fZDiff = 10
+$xLastIncr = 0
+$yLastIncr = 0
+$fXInertia = -0.5
+$fYInertia = 0
+$fXInertiaOld = 0
+$fYInertiaOld = 0
+$fScale = 1.0
+$ftime = 0
+$xLast = -1
+$yLast = -1
+$bmModifiers = 0
+$rotate = true
+
+INERTIA_THRESHOLD = 1.0
+INERTIA_FACTOR = 0.5
+SCALE_FACTOR = 0.01
+SCALE_INCREMENT = 0.5
+TIMER_FREQUENCY_MILLIS = 20
+
+
+$gleModel = [:cube, :teapot,:torus,:sphere]
+$clearColor = [[0,0,0,1], [0.2,0.2,0.3,1], [0.7,0.7,0.7,1]]
+
+def drawCube
+	size = 1.0
+	scale = 0.2
+	delta = 0.1
+
+	v = [
+		[ size,  size,  size * scale + delta ], 
+		[ size,  size, -size * scale + delta ], 
+		[ size, -size, -size * scale ], 
+		[ size, -size,  size * scale ],
+		[-size,  size,  size * scale + delta ],
+		[-size,  size, -size * scale + delta ],
+		[-size, -size, -size * scale ],
+		[-size, -size,  size * scale ]
+	]
+
+	cube = [
+		[ [1,0,0], v[3],v[2],v[1],v[0] ], # normal, vertices
+		[ [-1,0,0], v[6],v[7],v[4],v[5] ],
+		[ [0,0,-1], v[2],v[6],v[5],v[1] ],
+		[ [0,0,1], v[7],v[3],v[0],v[4] ],
+		[ [0,1,0], v[4],v[0],v[1],v[5] ],
+		[ [0,-1,0], v[6],v[2],v[3],v[7] ]
+	]
+
+	glBegin(GL_QUADS)
+	cube.each do |side|
+		glNormal3fv(side[0])
+
+    glTexCoord2f(1,1)
+    glVertex3fv(side[1])
+    glTexCoord2f(0,1)
+    glVertex3fv(side[2])
+    glTexCoord2f(0,0)
+    glVertex3fv(side[3])
+    glTexCoord2f(1,0)
+    glVertex3fv(side[4])
+	end
+	glEnd()
+end
+
+def nextClearColor
+	glClearColor($clearColor[0][0],
+							 $clearColor[0][1],
+							 $clearColor[0][2],
+							 $clearColor[0][3])
+	$clearColor << $clearColor.shift # rotate
+end
+
+
+play = lambda do
+	this_time = glutGet(GLUT_ELAPSED_TIME)
+
+	$rotl+=(this_time - $last_time) * -0.001
+	$last_time = this_time
+
+	glutPostRedisplay()
+end
+
+display = lambda do
+	glLoadIdentity()
+	glTranslatef(0.0, 0.0, -5.0)
+	
+	glRotatef($fYDiff, 1,0,0)
+	glRotatef($fXDiff, 0,1,0)
+	glRotatef($fZDiff, 0,0,1)
+	
+	glScalef($fScale, $fScale, $fScale)
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	case $gleModel[0]
+		when :teapot :
+			glutSolidTeapot(0.6)
+		when :torus :
+			glutSolidTorus(0.2, 0.6, 64, 64)
+		when :sphere :
+			glutSolidSphere(0.6, 64, 64)
+		when :cube :
+			drawCube()
+	end
+	glFlush()
+	glutSwapBuffers()
+end
+
+key = lambda do |key,x,y|
+	case(key)
+	when ?b
+		nextClearColor()
+	when ?q, ?\e # esc
+		exit(0)
+	when ?t
+		$gleModel << $gleModel.shift # rotate the array
+	when ?\s # space
+		$rotate = !$rotate
+
+		if ($rotate==false)
+			$fXInertiaOld = $fXInertia
+			$fYInertiaOld = $fYInertia
+		else
+			$fXInertia = $fXInertiaOld
+			$fYInertia = $fYInertiaOld
+
+      # To prevent confusion, force some rotation
+			if ($fXInertia == 0 && $fYInertia == 0)
+				$fXInertia = -0.5
+			end
+		end
+	when ?+
+		$fScale += SCALE_INCREMENT
+	when ?-
+		$fScale -= SCALE_INCREMENT
+	else
+		puts "Keyboard commands:\n"
+		puts "b - Toggle among background clear colors"
+		puts "q, <esc> - Quit"
+		puts "t - Toggle among models to render"
+		puts "? - Help"
+		puts "<home>     - reset zoom and rotation"
+		puts "<space> or <click>        - stop rotation"
+		puts "<+>, <-> or <ctrl + drag> - zoom model"
+		puts "<arrow keys> or <drag>    - rotate model\n"
+	end
+end
+
+reshape = lambda do |w,h|
+	vp = 0.8
+	aspect = w.to_f/h.to_f
+	
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	
+	glFrustum(-vp, vp, -vp / aspect, vp / aspect, 3, 10)
+	
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslatef(0.0, 0.0, -5.0)
+end
+
+motion = lambda do |x,y|
+	if ($xLast != -1 || $yLast != -1)
+		$xLastIncr = x - $xLast
+		$yLastIncr = y - $yLast
+		if ($bmModifiers & GLUT_ACTIVE_CTRL != 0)
+			if ($xLast != -1)
+				$fZDiff += $xLastIncr
+				$fScale += $yLastIncr*SCALE_FACTOR
+			end
+		else
+			if ($xLast != -1)
+				$fXDiff += $xLastIncr
+				$fYDiff += $yLastIncr
+			end
+		end
+	end
+	$xLast = x
+	$yLast = y
+end
+
+mouse = lambda do |button,state,x,y|
+	$bmModifiers = glutGetModifiers()
+	if (button == GLUT_LEFT_BUTTON)
+		if (state == GLUT_UP)
+			$xLast = -1
+			$yLast = -1
+			if $xLastIncr > INERTIA_THRESHOLD
+				$fXInertia = ($xLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+			if -$xLastIncr > INERTIA_THRESHOLD
+				$fXInertia = ($xLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+
+			if $yLastIncr > INERTIA_THRESHOLD
+				$fYInertia = ($yLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+			if -$yLastIncr > INERTIA_THRESHOLD
+				$fYInertia = ($yLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+		else
+			$fXInertia = 0
+			$fYInertia = 0
+		end
+		$xLastIncr = 0
+		$yLastIncr = 0
+	end
+end
+
+special = lambda do |key,x,y|
+	case key
+	when GLUT_KEY_HOME:
+		$fXDiff = 0
+		$fYDiff = 35
+		$fZDiff = 0
+		$xLastIncr = 0
+		$yLastIncr = 0
+		$fXInertia = -0.5
+		$fYInertia = 0
+		$fScale = 1.0
+	when GLUT_KEY_LEFT:
+		$fXDiff -= 1
+	when GLUT_KEY_RIGHT:
+		$fXDiff += 1
+	when GLUT_KEY_UP:
+		$fYDiff -= 1
+	when GLUT_KEY_DOWN:
+		$fYDiff += 1
+	end
+end
+
+timer = lambda do |value|
+	$ftime += 0.01
+	if $rotate
+		$fXDiff += $fXInertia
+		$fYDiff += $fYInertia
+	end
+	glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0)
+end
+
+def getUniLoc(program, name)
+	loc = glGetUniformLocation(program, name)
+	
+	if (loc == -1)
+		puts "No such uniform named #{name}"
+	end
+	return loc
+end
+
+def installBrickShaders(vs_fname,fs_fname)
+	# Create a vertex shader object and a fragment shader object
+	brickVS = glCreateShader(GL_VERTEX_SHADER)
+	brickFS = glCreateShader(GL_FRAGMENT_SHADER)
+
+	# Load source code strings into shaders
+	glShaderSource(brickVS, File.read(vs_fname))
+	glShaderSource(brickFS, File.read(fs_fname))
+
+	# Compile the brick vertex shader, and print out
+	#	the compiler log file.
+	glCompileShader(brickVS)
+  vertCompiled = glGetShaderiv(brickVS, GL_COMPILE_STATUS)
+	puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickVS)}\n"
+	
+	# Compile the brick fragment shader, and print out
+	# the compiler log file.
+	glCompileShader(brickFS)
+  fragCompiled = glGetShaderiv(brickFS, GL_COMPILE_STATUS)
+	puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickFS)}\n"
+	
+	return false if (vertCompiled == 0 || fragCompiled == 0)
+	# Create a program object and attach the two compiled shaders
+	brickProg = glCreateProgram()
+	glAttachShader(brickProg,brickVS)
+	glAttachShader(brickProg,brickFS)
+	# Link the program object and print out the info log
+	glLinkProgram(brickProg)
+	linked = glGetProgramiv(brickProg,GL_LINK_STATUS)
+	puts "Program InfoLog:\n#{glGetProgramInfoLog(brickProg)}\n"
+	return false if linked==0
+
+	# Install program object as part of current state
+	glUseProgram(brickProg)
+
+	# Set up initial uniform values
+	glUniform3f(getUniLoc(brickProg, "BrickColor"), 1.0, 0.3, 0.2)
+	glUniform3f(getUniLoc(brickProg, "MortarColor"), 0.85, 0.86, 0.84)
+	glUniform2f(getUniLoc(brickProg, "BrickSize"), 0.30, 0.15)
+	glUniform2f(getUniLoc(brickProg, "BrickPct"), 0.90, 0.85)
+	glUniform3f(getUniLoc(brickProg, "LightPosition"), 0.0, 0.0, 4.0)
+
+	return true
+end
+
+# Main
+
+glutInit()
+glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE)
+glutInitWindowPosition(100,100)
+glutInitWindowSize(500, 500)
+glutCreateWindow( "3Dlabs Brick Shader")
+
+glutIdleFunc(play)
+glutDisplayFunc(display)
+glutKeyboardFunc(key)
+glutReshapeFunc(reshape)
+glutMotionFunc(motion)
+glutMouseFunc(mouse)
+glutSpecialFunc(special)
+glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0)
+ 
+# Make sure that OpenGL 2.0 is supported by the driver
+if Gl.is_available?(2.0)==false
+	major,minor,*rest = glGetString(GL_VERSION).split(/\.| /)
+	puts "GL_VERSION major=#{major} minor=#{minor}"
+	puts "Support for OpenGL 2.0 is required for this demo...exiting"
+	exit(1)
+end
+
+glDepthFunc(GL_LESS)
+glEnable(GL_DEPTH_TEST)
+
+nextClearColor()
+
+key.call('?', 0, 0)
+ 
+success = installBrickShaders("brick.vert","brick.frag")
+glutMainLoop() if success == true
diff -pruN 0.32f-2.1/examples/OrangeBook/brick.vert 0.60.0-0ubuntu3/examples/OrangeBook/brick.vert
--- 0.32f-2.1/examples/OrangeBook/brick.vert	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/brick.vert	2007-07-28 16:18:38.000000000 +0100
@@ -0,0 +1,41 @@
+//
+// Vertex shader for procedural bricks
+//
+// Authors: Dave Baldwin, Steve Koren, Randi Rost
+//          based on a shader by Darwyn Peachey
+//
+// Copyright (c) 2002-2004 3Dlabs Inc. Ltd. 
+//
+// See 3Dlabs-License.txt for license information
+//
+
+uniform vec3 LightPosition;
+
+const float SpecularContribution = 0.3;
+const float DiffuseContribution  = 1.0 - SpecularContribution;
+
+varying float LightIntensity;
+varying vec2  MCposition;
+
+void main(void)
+{
+    vec3 ecPosition = vec3 (gl_ModelViewMatrix * gl_Vertex);
+    vec3 tnorm      = normalize(gl_NormalMatrix * gl_Normal);
+    vec3 lightVec   = normalize(LightPosition - ecPosition);
+    vec3 reflectVec = reflect(-lightVec, tnorm);
+    vec3 viewVec    = normalize(-ecPosition);
+    float diffuse   = max(dot(lightVec, tnorm), 0.0);
+    float spec      = 0.0;
+
+    if (diffuse > 0.0)
+    {
+        spec = max(dot(reflectVec, viewVec), 0.0);
+        spec = pow(spec, 16.0);
+    }
+
+    LightIntensity  = DiffuseContribution * diffuse +
+                      SpecularContribution * spec;
+
+    MCposition      = gl_Vertex.xy;
+    gl_Position     = ftransform();
+}
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/OrangeBook/particle.frag 0.60.0-0ubuntu3/examples/OrangeBook/particle.frag
--- 0.32f-2.1/examples/OrangeBook/particle.frag	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/particle.frag	2007-07-28 16:18:38.000000000 +0100
@@ -0,0 +1,17 @@
+//
+// Fragment shader for rendering a "confetti cannon"
+// via a partcle system
+//
+// Author: Randi Rost
+//
+// Copyright (c) 2003-2004: 3Dlabs, Inc.
+//
+// See 3Dlabs-License.txt for license information
+//
+
+varying vec4 Color;
+
+void main (void)
+{
+    gl_FragColor = Color;
+}
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/OrangeBook/particle.rb 0.60.0-0ubuntu3/examples/OrangeBook/particle.rb
--- 0.32f-2.1/examples/OrangeBook/particle.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/particle.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,406 @@
+#
+# Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#    Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#    Redistributions in binary form must reproduce the above
+#    copyright notice, this list of conditions and the following
+#    disclaimer in the documentation and/or other materials provided
+#    with the distribution.
+#
+#    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+#    contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# 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 HOLDERS 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.
+require 'opengl'
+include Gl,Glu,Glut
+
+$particleTime = 0
+
+# Movement variables
+$fXDiff = 206
+$fYDiff = 16
+$fZDiff = 10
+$xLastIncr = 0
+$yLastIncr = 0
+$fXInertia = -0.5
+$fYInertia = 0
+$fXInertiaOld
+$fYInertiaOld
+$fScale = 0.25
+$ftime = 0
+$xLast = -1
+$yLast = -1
+$bmModifiers = 0
+$rotate = 1
+
+$programObject = 0
+$vertexShaderObject = 0
+$fragmentShaderObject = 0
+
+# Rotation defines
+INERTIA_THRESHOLD = 1.0
+INERTIA_FACTOR = 0.5
+SCALE_FACTOR = 0.01
+SCALE_INCREMENT = 0.5
+TIMER_FREQUENCY_MILLIS = 20
+
+VELOCITY_ARRAY = 3
+START_TIME_ARRAY = 4
+
+$clearColor = [[0,0,0,1], [0.2,0.2,0.3,1], [0.7,0.7,0.7,1]]
+
+$arrayWidth = 0, $arrayHeight = 0
+$verts = []
+$colors = []
+$velocities = []
+$startTimes = []
+
+def nextClearColor
+	glClearColor($clearColor[0][0],
+							 $clearColor[0][1],
+							 $clearColor[0][2],
+							 $clearColor[0][3])
+	$clearColor << $clearColor.shift # rotate
+end
+
+def getUniLoc(program, name)
+	loc = glGetUniformLocation(program, name)
+	
+	if (loc == -1)
+		puts "No such uniform named #{name}"
+	end
+	return loc
+end
+
+def updateAnim
+	location = getUniLoc($programObject,"Time")
+
+	$particleTime += 0.002
+	if $particleTime > 15.0
+		$particleTime = 0.0
+	end
+
+	glUniform1f(location,$particleTime)
+end
+
+def drawPoints
+	glPointSize(2.0)
+	glVertexPointer(3, GL_FLOAT, 0, $verts)
+	glColorPointer(3, GL_FLOAT, 0, $colors)
+	glVertexAttribPointer(VELOCITY_ARRAY,  3, GL_FLOAT, GL_FALSE, 0, $velocities)
+	glVertexAttribPointer(START_TIME_ARRAY, 1, GL_FLOAT, GL_FALSE, 0, $startTimes)
+
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glEnableClientState(GL_COLOR_ARRAY)
+	glEnableVertexAttribArray(VELOCITY_ARRAY)
+	glEnableVertexAttribArray(START_TIME_ARRAY)
+
+	glDrawArrays(GL_POINTS, 0, $arrayWidth * $arrayHeight)
+
+	glDisableClientState(GL_VERTEX_ARRAY)
+	glDisableClientState(GL_COLOR_ARRAY)
+	glDisableVertexAttribArray(VELOCITY_ARRAY)
+	glDisableVertexAttribArray(START_TIME_ARRAY)
+end
+
+def createPoints(w,h)
+	$verts  = []
+	$colors = []
+	$velocities = []
+	$startTimes = []
+
+	i = 0.5 / w - 0.5
+	while (i<0.5)
+		j = 0.5 / h - 0.5
+		while (j<0.5)
+			$verts << i
+			$verts << 0.0
+			$verts << j
+		
+			$colors << rand() * 0.5 + 0.5
+			$colors << rand() * 0.5 + 0.5
+			$colors << rand() * 0.5 + 0.5
+
+			$velocities << rand() + 3.0
+			$velocities << rand() * 10.0
+			$velocities << rand() + 3.0
+
+			$startTimes << rand() * 10.0
+
+			j += 1.0/h
+		end
+		i += 1.0/w
+	end
+	# convert from ruby Array to memory representation of float data that
+	# will be passed as array pointers to GL
+	$verts = $verts.pack("f*")
+	$colors = $colors.pack("f*")
+	$velocities = $velocities.pack("f*")
+	$startTimes = $startTimes.pack("f*")
+
+	$arrayWidth = w
+	$arrayHeight = h
+end
+
+play = lambda do
+	thisTime = glutGet(GLUT_ELAPSED_TIME)
+	updateAnim()
+	glutPostRedisplay()
+end
+
+display = lambda do
+	glLoadIdentity()
+	glTranslatef(0.0, 0.0, -5.0)
+	
+	glRotatef($fYDiff, 1,0,0)
+	glRotatef($fXDiff, 0,1,0)
+	glRotatef($fZDiff, 0,0,1)
+	
+	glScalef($fScale, $fScale, $fScale)
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	drawPoints()
+	
+	glFlush()
+	glutSwapBuffers()
+end
+
+key = lambda do |key,x,y|
+	$particleTime = 0
+
+	case(key)
+	when ?b
+		nextClearColor()
+	when ?q, ?\e # esc
+		exit(0)
+	when ?\s # space
+		$rotate = !$rotate
+
+		if ($rotate==false)
+			$fXInertiaOld = $fXInertia
+			$fYInertiaOld = $fYInertia
+		else
+			$fXInertia = $fXInertiaOld
+			$fYInertia = $fYInertiaOld
+
+      # To prevent confusion, force some rotation
+			if ($fXInertia == 0 && $fYInertia == 0)
+				$fXInertia = -0.5
+			end
+		end
+	when ?+
+		$fScale += SCALE_INCREMENT
+	when ?-
+		$fScale -= SCALE_INCREMENT
+	else
+		puts "Keyboard commands:\n"
+		puts "b - Toggle among background clear colors"
+		puts "q, <esc> - Quit"
+		puts "? - Help"
+		puts "<home>     - reset zoom and rotation"
+		puts "<space> or <click>        - stop rotation"
+		puts "<+>, <-> or <ctrl + drag> - zoom model"
+		puts "<arrow keys> or <drag>    - rotate model\n"
+	end
+end
+
+reshape = lambda do |w,h|
+    vp = 0.8
+		aspect = w/h
+
+    glViewport(0, 0, w, h)
+    glMatrixMode(GL_PROJECTION)
+    glLoadIdentity()
+
+    glFrustum(-vp, vp, -vp / aspect, vp / aspect, 3, 10.0)
+
+    glMatrixMode(GL_MODELVIEW)
+    glLoadIdentity()
+    glTranslatef(0.0, 0.0, -5.0)
+end
+
+motion = lambda do |x,y|
+	if ($xLast != -1 || $yLast != -1)
+		$xLastIncr = x - $xLast
+		$yLastIncr = y - $yLast
+		if ($bmModifiers & GLUT_ACTIVE_CTRL != 0)
+			if ($xLast != -1)
+				$fZDiff += $xLastIncr
+				$fScale += $yLastIncr*SCALE_FACTOR
+			end
+		else
+			if ($xLast != -1)
+				$fXDiff += $xLastIncr
+				$fYDiff += $yLastIncr
+			end
+		end
+	end
+	$xLast = x
+	$yLast = y
+end
+
+mouse = lambda do |button,state,x,y|
+	$bmModifiers = glutGetModifiers()
+	if (button == GLUT_LEFT_BUTTON)
+		if (state == GLUT_UP)
+			$xLast = -1
+			$yLast = -1
+			if $xLastIncr > INERTIA_THRESHOLD
+				$fXInertia = ($xLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+			if -$xLastIncr > INERTIA_THRESHOLD
+				$fXInertia = ($xLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+
+			if $yLastIncr > INERTIA_THRESHOLD
+				$fYInertia = ($yLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+			if -$yLastIncr > INERTIA_THRESHOLD
+				$fYInertia = ($yLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR
+			end
+		else
+			$fXInertia = 0
+			$fYInertia = 0
+		end
+		$xLastIncr = 0
+		$yLastIncr = 0
+	end
+end
+
+special = lambda do |key,x,y|
+	case key
+	when GLUT_KEY_HOME:
+		$fXDiff = 206
+		$fYDiff = 16
+		$fZDiff = 10
+		$xLastIncr = 0
+		$yLastIncr = 0
+		$fXInertia = -0.5
+		$fYInertia = 0
+		$fScale = 0.25
+		$particleTime = 0
+	when GLUT_KEY_LEFT:
+		$fXDiff -= 1
+	when GLUT_KEY_RIGHT:
+		$fXDiff += 1
+	when GLUT_KEY_UP:
+		$fYDiff -= 1
+	when GLUT_KEY_DOWN:
+		$fYDiff += 1
+	end
+end
+
+timer = lambda do |value|
+	$ftime += 0.01
+	if $rotate
+		$fXDiff += $fXInertia
+		$fYDiff += $fYInertia
+	end
+	glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0)
+end
+
+def installParticleShaders(vs_name,fs_name)
+	# Create a vertex shader object and a fragment shader object
+	$vertexShaderObject = glCreateShader(GL_VERTEX_SHADER)
+	$fragmentShaderObject = glCreateShader(GL_FRAGMENT_SHADER)
+
+	# Load source code strings into shaders
+	glShaderSource($vertexShaderObject, File.read(vs_name))
+	glShaderSource($fragmentShaderObject, File.read(fs_name))
+
+	# Compile the particle vertex shader, and print out
+	# the compiler log file.
+	glCompileShader($vertexShaderObject)
+  vertCompiled = glGetShaderiv($vertexShaderObject, GL_COMPILE_STATUS)
+	puts "Shader InfoLog:\n#{glGetShaderInfoLog($vertexShaderObject)}\n"
+
+	# Compile the particle fragment shader, and print out
+	# the compiler log file.
+	glCompileShader($fragmentShaderObject)
+  fragCompiled = glGetShaderiv($fragmentShaderObject, GL_COMPILE_STATUS)
+	puts "Shader InfoLog:\n#{glGetShaderInfoLog($fragmentShaderObject)}\n"
+
+	return false if (vertCompiled == 0 || fragCompiled == 0)
+
+	# Create a program object and attach the two compiled shaders
+	$programObject = glCreateProgram()
+	glAttachShader($programObject, $vertexShaderObject)
+	glAttachShader($programObject, $fragmentShaderObject)
+
+	#Bind generic attribute indices to attribute variable names
+	glBindAttribLocation($programObject, VELOCITY_ARRAY, "Velocity")
+	glBindAttribLocation($programObject, START_TIME_ARRAY, "StartTime");
+
+	# Link the program object and print out the info log
+	glLinkProgram($programObject)
+	linked = glGetProgramiv($programObject, GL_LINK_STATUS)
+	puts "Program InfoLog:\n#{glGetProgramInfoLog($programObject)}\n"
+
+	return false if linked==0
+
+	# Install program object as part of current state
+	glUseProgram($programObject)
+
+	# Set up initial uniform values
+	glUniform4f(getUniLoc($programObject, "Background"), 0.0, 0.0, 0.0, 1.0)
+	glUniform1f(getUniLoc($programObject, "Time"), -5.0)
+
+	return true
+end
+
+# Main
+glutInit()
+glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100,100)
+window = glutCreateWindow("3Dlabs OpenGL Shading Language Particle System Demo")
+    
+glutIdleFunc(play)
+glutDisplayFunc(display)
+glutKeyboardFunc(key)
+glutReshapeFunc(reshape)
+glutMotionFunc(motion)
+glutMouseFunc(mouse)
+glutSpecialFunc(special)
+glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0)
+
+# Make sure that OpenGL 2.0 is supported by the driver
+if Gl.is_available?(2.0)==false
+	major,minor,*rest = glGetString(GL_VERSION).split(/\.| /)
+	puts "GL_VERSION major=#{major} minor=#{minor}"
+	puts "Support for OpenGL 2.0 is required for this demo...exiting"
+	exit(1)
+end
+
+createPoints(100, 100)
+
+glDepthFunc(GL_LESS)
+glEnable(GL_DEPTH_TEST)
+nextClearColor()
+
+key.call('?', 0, 0)
+
+success = installParticleShaders("particle.vert", "particle.frag")
+if (success)
+	glutMainLoop()
+end
diff -pruN 0.32f-2.1/examples/OrangeBook/particle.vert 0.60.0-0ubuntu3/examples/OrangeBook/particle.vert
--- 0.32f-2.1/examples/OrangeBook/particle.vert	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/OrangeBook/particle.vert	2007-07-28 16:18:38.000000000 +0100
@@ -0,0 +1,38 @@
+//
+// Vertex shader for rendering a "confetti cannon"
+// via a partcle system
+//
+// Author: Randi Rost
+//
+// Copyright (c) 2003-2004: 3Dlabs, Inc.
+//
+// See 3Dlabs-License.txt for license information
+//
+
+uniform float Time;            // updated each frame by the application
+uniform vec4  Background;      // constant color equal to background
+ 
+attribute vec3  Velocity;      // initial velocity
+attribute float StartTime;     // time at which particle is activated
+
+varying vec4 Color;
+ 
+void main(void)
+{
+    vec4  vert;
+    float t = Time - StartTime;
+
+    if (t >= 0.0)
+    {
+        vert    = gl_Vertex + vec4 (Velocity * t, 0.0);
+        vert.y -= 4.9 * t * t;
+        Color   = gl_Color;
+    }
+    else
+    {
+        vert  = gl_Vertex;      // Initial position
+        Color = Background;     // "pre-birth" color
+    }
+ 
+    gl_Position  = gl_ModelViewProjectionMatrix * vert;
+}
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/README 0.60.0-0ubuntu3/examples/README
--- 0.32f-2.1/examples/README	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/README	2007-07-28 21:12:39.000000000 +0100
@@ -0,0 +1,16 @@
+Examples
+========
+
+This directory contains OpenGL examples converted to ruby from various sources.
+As such, they are distributed under various terms - see each file for licensing info.
+
+RedBook/
+	Examples from OpenGL Red Book and SGI's example code in general, licensed under
+	SGI open-source license.
+OrangeBook/
+	Examples from OpenGL Orange Book (GLSL), distributed under BSD license
+NeHe/
+  NeHe's opengl tutorials (http://nehe.gamedev.net), licensed under free license.
+Misc/
+	Other examples. If license is not given, MIT is assumed.
+	
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/RedBook/aapoly.rb 0.60.0-0ubuntu3/examples/RedBook/aapoly.rb
--- 0.32f-2.1/examples/RedBook/aapoly.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/aapoly.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,142 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# aapoly.c
+# This program draws filled polygons with antialiased
+# edges.  The special GL_SRC_ALPHA_SATURATE blending 
+# function is used.
+# Pressing the 't' key turns the antialiasing on and off.
+require 'opengl'
+include Gl,Glu,Glut
+
+$polySmooth = true
+
+def init
+	glCullFace(GL_BACK)
+	glEnable(GL_CULL_FACE)
+	glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE)
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+end
+
+NFACE=6
+NVERT=8
+$indices = [
+	[4, 5, 6, 7], [2, 3, 7, 6], [0, 4, 7, 3],
+	[0, 1, 5, 4], [1, 5, 6, 2], [0, 3, 2, 1]
+]
+
+def drawCube(x0, x1, y0, y1, z0, z1)
+	v = [[],[],[],[],[],[],[],[]]
+	c = [
+		[0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 1.0],
+		[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 1.0],
+		[0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 1.0],
+		[0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]
+	]
+	
+	# indices of front, top, left, bottom, right, back faces
+	
+	v[0][0] = v[3][0] = v[4][0] = v[7][0] = x0
+	v[1][0] = v[2][0] = v[5][0] = v[6][0] = x1
+	v[0][1] = v[1][1] = v[4][1] = v[5][1] = y0
+	v[2][1] = v[3][1] = v[6][1] = v[7][1] = y1
+	v[0][2] = v[1][2] = v[2][2] = v[3][2] = z0
+	v[4][2] = v[5][2] = v[6][2] = v[7][2] = z1
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glEnableClientState(GL_COLOR_ARRAY)
+	glVertexPointer(3, GL_FLOAT, 0, v.flatten!.pack("f*"))
+	glColorPointer(4, GL_FLOAT, 0, c.flatten!.pack("f*"))
+	glDrawElements(GL_QUADS, NFACE*4, GL_UNSIGNED_BYTE, $indices.flatten.pack("C*"))
+	glDisableClientState(GL_VERTEX_ARRAY)
+	glDisableClientState(GL_COLOR_ARRAY)
+end
+
+# Note:  polygons must be drawn from front to back
+# for proper blending.
+display = proc do
+	if ($polySmooth)
+		glClear(GL_COLOR_BUFFER_BIT)
+		glEnable(GL_BLEND)
+		glEnable(GL_POLYGON_SMOOTH)
+		glDisable(GL_DEPTH_TEST)
+	else
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+		glDisable(GL_BLEND)
+		glDisable(GL_POLYGON_SMOOTH)
+		glEnable(GL_DEPTH_TEST)
+	end
+	
+	glPushMatrix()
+	glTranslate(0.0, 0.0, -8.0)    
+	glRotate(30.0, 1.0, 0.0, 0.0)
+	glRotate(60.0, 0.0, 1.0, 0.0) 
+	drawCube(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(30.0,  w.to_f/ h.to_f, 1.0, 20.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?t ,?T
+			$polySmooth = !$polySmooth
+			glutPostRedisplay()
+		when ?\e
+			exit(0)  # Escape key
+	end
+end
+
+# Main Loop
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
+
diff -pruN 0.32f-2.1/examples/RedBook/aargb.rb 0.60.0-0ubuntu3/examples/RedBook/aargb.rb
--- 0.32f-2.1/examples/RedBook/aargb.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/aargb.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,119 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# aargb.c
+# This program draws shows how to draw anti-aliased lines. It draws
+# two diagonal lines to form an X when 'r' is typed in the window, 
+# the lines are rotated in opposite directions.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$rotAngle = 0.0
+
+# Initialize antialiasing for RGBA mode, including alpha
+# blending, hint, and line width.  Print out implementation
+# specific info on line width granularity and width.
+def init
+	glEnable(GL_LINE_SMOOTH)
+	glEnable(GL_BLEND)
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+	glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE)
+	glLineWidth(1.5)
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+end
+
+# Draw 2 diagonal lines to form an X
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	glColor(0.0, 1.0, 0.0)
+	glPushMatrix()
+	glRotate(-$rotAngle, 0.0, 0.0, 0.1)
+	glBegin(GL_LINES)
+	glVertex(-0.5, 0.5)
+	glVertex(0.5, -0.5)
+	glEnd()
+	glPopMatrix()
+	
+	glColor(0.0, 0.0, 1.0)
+	glPushMatrix()
+	glRotate($rotAngle, 0.0, 0.0, 0.1)
+	glBegin(GL_LINES)
+	glVertex(0.5, 0.5)
+	glVertex(-0.5, -0.5)
+	glEnd()
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h) 
+		gluOrtho2D(-1.0, 1.0, -1.0*h/w, 1.0*h/w)
+	else 
+		gluOrtho2D(-1.0*w/h, 1.0*w/h, -1.0, 1.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?r,?R
+			$rotAngle = $rotAngle + 20.0
+			$rotAngle = 0.0 if ($rotAngle >= 360.0) 
+			glutPostRedisplay()
+		when ?\e  # Escape Key
+			exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/accanti.rb 0.60.0-0ubuntu3/examples/RedBook/accanti.rb
--- 0.32f-2.1/examples/RedBook/accanti.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/accanti.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,162 @@
+#
+# 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.
+#
+# accanti.c
+
+require 'opengl'
+require 'jitter'
+include Gl,Glu,Glut
+
+#  Initialize lighting and other values.
+def myinit
+	mat_ambient = [ 1.0, 1.0, 1.0, 1.0 ]
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	light_position = [ 0.0, 0.0, 10.0, 1.0 ]
+	lm_ambient = [ 0.2, 0.2, 0.2, 1.0 ]
+	
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, 50.0)
+	glLight(GL_LIGHT0, GL_POSITION, light_position)
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, lm_ambient)
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glDepthFunc(GL_LESS)
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_FLAT)
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glClearAccum(0.0, 0.0, 0.0, 0.0)
+end
+
+def displayObjects
+	torus_diffuse = [ 0.7, 0.7, 0.0, 1.0 ]
+	cube_diffuse = [ 0.0, 0.7, 0.7, 1.0 ]
+	sphere_diffuse = [ 0.7, 0.0, 0.7, 1.0 ]
+	octa_diffuse = [ 0.7, 0.4, 0.4, 1.0 ]
+	
+	glPushMatrix()
+	glRotate(30.0, 1.0, 0.0, 0.0)
+	
+	glPushMatrix()
+	glTranslate(-0.80, 0.35, 0.0) 
+	glRotate(100.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, torus_diffuse)
+	glutSolidTorus(0.275, 0.85, 16, 16)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(-0.75, -0.50, 0.0)
+	glRotate(45.0, 0.0, 0.0, 1.0)
+	glRotate(45.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, cube_diffuse)
+	glutSolidCube(1.5)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(0.75, 0.60, 0.0) 
+	glRotate(30.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, sphere_diffuse)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(0.70, -0.90, 0.25)
+	glMaterial(GL_FRONT, GL_DIFFUSE, octa_diffuse)
+	glutSolidOctahedron()
+	glPopMatrix()
+	
+	glPopMatrix()
+end
+
+ACSIZE=8
+
+myDisplay = proc do
+	viewport = glGetDoublev(GL_VIEWPORT)
+	
+	glClear(GL_ACCUM_BUFFER_BIT)
+	for jitter in 0...ACSIZE
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+		glPushMatrix()
+		#	Note that 4.5 is the distance in world space between
+		#	left and right and bottom and top.
+		#	This formula converts fractional pixel movement to 
+		#	world coordinates.
+		glTranslate($j8[jitter][0]*4.5/viewport[2], $j8[jitter][1]*4.5/viewport[3], 0.0)
+		displayObjects()
+		glPopMatrix()
+		glAccum(GL_ACCUM, 1.0/ACSIZE)
+	end
+	glAccum(GL_RETURN, 1.0)
+	glutSwapBuffers()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h) 
+		glOrtho(-2.25, 2.25, -2.25*h/w, 2.25*h/w, -10.0, 10.0)
+	else 
+		glOrtho(-2.25*w/h, 2.25*w/h, -2.25, 2.25, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+#
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(myDisplay)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/accpersp.rb 0.60.0-0ubuntu3/examples/RedBook/accpersp.rb
--- 0.32f-2.1/examples/RedBook/accpersp.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/accpersp.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,215 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# accpersp.c
+# Use the accumulation buffer to do full-scene antialiasing
+# on a scene with perspective projection, using the special
+# routines accFrustum() and accPerspective().
+
+require 'opengl'
+include Gl,Glu,Glut
+
+$j8 = [
+	[-0.334818,  0.435331],
+	[ 0.286438, -0.393495],
+	[ 0.459462,  0.141540],
+	[-0.414498, -0.192829],
+	[-0.183790,  0.082102],
+	[-0.079263, -0.317383],
+	[ 0.102254,  0.299133],
+	[ 0.164216, -0.054399]
+		]
+
+# accFrustum()
+# The first 6 arguments are identical to the glFrustum() call.
+#  
+# pixdx and pixdy are anti-alias jitter in pixels. 
+# Set both equal to 0.0 for no anti-alias jitter.
+# eyedx and eyedy are depth-of field jitter in pixels. 
+# Set both equal to 0.0 for no depth of field effects.
+#
+# focus is distance from eye to plane in focus. 
+# focus must be greater than, but not equal to 0.0.
+#
+# Note that accFrustum() calls glTranslatef().  You will 
+# probably want to insure that your ModelView matrix has been 
+# initialized to identity before calling accFrustum().
+
+def accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)
+   viewport = glGetDoublev(GL_VIEWPORT)
+	
+   xwsize = right - left
+   ywsize = top - bottom
+	
+   dx = -(pixdx*xwsize/viewport[2] + eyedx*nnear/focus)
+   dy = -(pixdy*ywsize/viewport[3] + eyedy*nnear/focus)
+	
+   glMatrixMode(GL_PROJECTION)
+   glLoadIdentity()
+   glFrustum(left + dx, right + dx, bottom + dy, top + dy, nnear, ffar)
+   glMatrixMode(GL_MODELVIEW)
+   glLoadIdentity()
+   glTranslate(-eyedx, -eyedy, 0.0)
+end
+
+# accPerspective()
+# 
+# The first 4 arguments are identical to the gluPerspective() call.
+# pixdx and pixdy are anti-alias jitter in pixels. 
+# Set both equal to 0.0 for no anti-alias jitter.
+# eyedx and eyedy are depth-of field jitter in pixels. 
+# Set both equal to 0.0 for no depth of field effects.
+#
+# focus is distance from eye to plane in focus. 
+# focus must be greater than, but not equal to 0.0.
+#
+# Note that accPerspective() calls accFrustum().
+
+def  accPerspective(fovy, aspect, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)
+	fov2 = ((fovy*Math::PI) / 180.0) / 2.0
+	
+	top = nnear / (Math::cos(fov2) / Math::sin(fov2))
+	bottom = -top
+	
+	right = top * aspect
+	left = -right
+	
+	accFrustum(left, right, bottom, top, nnear, ffar,	pixdx, pixdy, eyedx, eyedy, focus)
+end
+
+#  Initialize lighting and other values.
+def init
+	mat_ambient = [ 1.0, 1.0, 1.0, 1.0 ]
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	light_position = [ 0.0, 0.0, 10.0, 1.0 ]
+	lm_ambient = [ 0.2, 0.2, 0.2, 1.0 ]
+	
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, 50.0)
+	glLight(GL_LIGHT0, GL_POSITION, light_position)
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, lm_ambient)
+	 
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_FLAT)
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glClearAccum(0.0, 0.0, 0.0, 0.0)
+end
+
+def displayObjects
+	torus_diffuse = [ 0.7, 0.7, 0.0, 1.0 ]
+	cube_diffuse = [ 0.0, 0.7, 0.7, 1.0 ]
+	sphere_diffuse = [ 0.7, 0.0, 0.7, 1.0 ]
+	octa_diffuse = [ 0.7, 0.4, 0.4, 1.0 ]
+	 
+	glPushMatrix()
+	glTranslate(0.0, 0.0, -5.0)
+	glRotate(30.0, 1.0, 0.0, 0.0)
+	
+	glPushMatrix()
+	glTranslate(-0.80, 0.35, 0.0)
+	glRotate(100.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, torus_diffuse)
+	glutSolidTorus(0.275, 0.85, 16, 16)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(-0.75, -0.50, 0.0)
+	glRotate(45.0, 0.0, 0.0, 1.0)
+	glRotate(45.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, cube_diffuse)
+	glutSolidCube(1.5)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(0.75, 0.60, 0.0)
+	glRotate(30.0, 1.0, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, sphere_diffuse)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(0.70, -0.90, 0.25)
+	glMaterial(GL_FRONT, GL_DIFFUSE, octa_diffuse)
+	glutSolidOctahedron()
+	glPopMatrix()
+	
+	glPopMatrix()
+end
+
+ACSIZE=8
+
+display = proc do
+	viewport = glGetDoublev(GL_VIEWPORT)
+	
+	glClear(GL_ACCUM_BUFFER_BIT)
+	for jitter in 0...ACSIZE
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+		accPerspective(50.0, viewport[2]/ viewport[3], 1.0, 15.0, $j8[jitter][0], $j8[jitter][1], 0.0, 0.0, 1.0)
+		displayObjects()
+		glAccum(GL_ACCUM, 1.0/ACSIZE)
+	end
+	glAccum(GL_RETURN, 1.0)
+	glutSwapBuffers()
+end
+
+reshape = proc do |w, h|
+   glViewport(0, 0,  w,  h)
+end
+
+keyboard = proc do |key, x, y|
+   case (key)
+   when ?\e
+     exit(0)
+   end
+end
+
+#  Main Loop
+#  Be certain you request an accumulation buffer.
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/alpha.rb 0.60.0-0ubuntu3/examples/RedBook/alpha.rb
--- 0.32f-2.1/examples/RedBook/alpha.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/alpha.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,123 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# alpha.c
+# This program draws several overlapping filled polygons
+# to demonstrate the effect order has on alpha blending results.
+# Use the 't' key to toggle the order of drawing polygons.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$leftFirst = GL_TRUE
+
+# Initialize alpha blending function.
+def init
+	glEnable(GL_BLEND)
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+	glShadeModel(GL_FLAT)
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+end
+
+def drawLeftTriangle
+	# draw yellow triangle on LHS of screen
+	
+	glBegin(GL_TRIANGLES)
+	glColor(1.0, 1.0, 0.0, 0.75)
+	glVertex(0.1, 0.9, 0.0) 
+	glVertex(0.1, 0.1, 0.0) 
+	glVertex(0.7, 0.5, 0.0) 
+	glEnd()
+end
+
+def drawRightTriangle
+	# draw cyan triangle on RHS of screen
+	
+	glBegin(GL_TRIANGLES)
+	glColor(0.0, 1.0, 1.0, 0.75)
+	glVertex(0.9, 0.9, 0.0) 
+	glVertex(0.3, 0.5, 0.0) 
+	glVertex(0.9, 0.1, 0.0) 
+	glEnd()
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	if ($leftFirst)
+		drawLeftTriangle()
+		drawRightTriangle()
+	else
+		drawRightTriangle()
+		drawLeftTriangle()
+	end
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h) 
+		gluOrtho2D(0.0, 1.0, 0.0, 1.0*h/w)
+	else 
+		gluOrtho2D(0.0, 1.0*w/h, 0.0, 1.0)
+	end
+end
+
+keyboard = Proc.new do|key, x, y|
+	case (key)
+		when ?t,?T
+			$leftFirst = !$leftFirst
+			glutPostRedisplay()	
+		when ?\e  # Escape key
+			exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/alpha3D.rb 0.60.0-0ubuntu3/examples/RedBook/alpha3D.rb
--- 0.32f-2.1/examples/RedBook/alpha3D.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/alpha3D.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,158 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# alpha3D.c
+# This program demonstrates how to intermix opaque and
+# alpha blended polygons in the same scene, by using 
+# glDepthMask.  Press the 'a' key to animate moving the 
+# transparent object through the opaque object.  Press 
+# the 'r' key to reset the scene.
+require 'opengl'
+include Gl,Glu,Glut
+
+MAXZ=1.0
+MINZ=-2.0
+ZINC=0.1
+
+$solidZ = MAXZ
+$transparentZ = MINZ
+$sphereList=nil
+$cubeList=nil
+
+def init
+	mat_specular = [ 1.0, 1.0, 1.0, 0.15 ]
+	mat_shininess = [ 100.0 ]
+	position = [ 0.5, 0.5, 1.0, 0.0 ]
+	
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, mat_shininess)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_DEPTH_TEST)
+	
+	$sphereList = glGenLists(1)
+	glNewList($sphereList, GL_COMPILE)
+	glutSolidSphere(0.4, 16, 16)
+	glEndList()
+	
+	$cubeList = glGenLists(1)
+	glNewList($cubeList, GL_COMPILE)
+	glutSolidCube(0.6)
+	glEndList()
+end
+
+display = proc do
+	mat_solid = [ 0.75, 0.75, 0.0, 1.0 ]
+	mat_zero = [ 0.0, 0.0, 0.0, 1.0 ]
+	mat_transparent = [ 0.0, 0.8, 0.8, 0.6 ]
+	mat_emission = [ 0.0, 0.3, 0.3, 0.6 ]
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	glPushMatrix()
+	glTranslate(-0.15, -0.15, $solidZ)
+	glMaterial(GL_FRONT, GL_EMISSION, mat_zero)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_solid)
+	glCallList($sphereList)
+	glPopMatrix()
+	
+	glPushMatrix()
+	glTranslate(0.15, 0.15, $transparentZ)
+	glRotate(15.0, 1.0, 1.0, 0.0)
+	glRotate(30.0, 0.0, 1.0, 0.0)
+	glMaterial(GL_FRONT, GL_EMISSION, mat_emission)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_transparent)
+	glEnable(GL_BLEND)
+	glDepthMask(GL_FALSE)
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE)
+	glCallList($cubeList)
+	glDepthMask(GL_TRUE)
+	glDisable(GL_BLEND)
+	glPopMatrix()
+	
+	glutSwapBuffers()
+end
+
+reshape = proc do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-1.5, 1.5, -1.5*h.to_f/w, 1.5*h.to_f/w, -10.0, 10.0)
+	else
+		glOrtho(-1.5*w.to_f/h, 1.5*w.to_f/h, -1.5, 1.5, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+animate = proc do
+	if ($solidZ <= MINZ || $transparentZ >= MAXZ)
+		glutIdleFunc(nil)
+	else
+		$solidZ -= ZINC
+		$transparentZ += ZINC
+		glutPostRedisplay()
+	end
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?a,?A
+			$solidZ = MAXZ
+			$transparentZ = MINZ
+			glutIdleFunc(animate)
+		when ?r, ?R
+			$solidZ = MAXZ
+			$transparentZ = MINZ
+			glutPostRedisplay()
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/bezcurve.rb 0.60.0-0ubuntu3/examples/RedBook/bezcurve.rb
--- 0.32f-2.1/examples/RedBook/bezcurve.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/bezcurve.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,105 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# bezcurve.c			
+# This program uses evaluators to draw a Bezier curve.
+
+require "opengl"
+include Gl,Glu,Glut
+
+$ctrlpoints = [
+	[-4.0,-4.0, 0.0],
+	[-2.0, 4.0, 0.0], 
+	[ 2.0,-4.0, 0.0],
+	[ 4.0, 4.0, 0.0]
+	]
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+	glMap1d(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, $ctrlpoints.flatten)
+	glEnable(GL_MAP1_VERTEX_3)
+end
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glBegin(GL_LINE_STRIP)
+	for i in 0..30
+		glEvalCoord1d(i.to_f/30.0)
+	end
+	glEnd()
+	# The following code displays the control points as dots. 
+	glPointSize(5.0)
+	glColor(1.0, 1.0, 0.0)
+	glBegin(GL_POINTS)
+	for i in 0...4
+		glVertex($ctrlpoints[i])
+	end
+	glEnd()
+	glutSwapBuffers()
+end
+
+reshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-5.0, 5.0, -5.0*h/w, 5.0*h/w, -5.0, 5.0)
+	else
+		glOrtho(-5.0*w/h, 5.0*w/h, -5.0, 5.0, -5.0, 5.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+	when ?\e
+		exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/bezmesh.rb 0.60.0-0ubuntu3/examples/RedBook/bezmesh.rb
--- 0.32f-2.1/examples/RedBook/bezmesh.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/bezmesh.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,137 @@
+#
+# 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.
+#
+# bezsurf.c
+# This program renders a lighted, filled Bezier surface,
+# using two-dimensional evaluators.
+#
+
+require 'opengl'
+include Gl,Glu,Glut
+
+$ctrlpoints = [
+	[
+		[-1.5, -1.5, 4.0],
+		[-0.5, -1.5, 2.0],
+		[0.5, -1.5, -1.0],
+		[1.5, -1.5, 2.0]],
+	[
+		[-1.5, -0.5, 1.0],
+		[-0.5, -0.5, 3.0],
+		[0.5, -0.5, 0.0],
+		[1.5, -0.5, -1.0]],
+	[
+		[-1.5, 0.5, 4.0],
+		[-0.5, 0.5, 0.0],
+		[0.5, 0.5, 3.0],
+		[1.5, 0.5, 4.0]],
+	[
+		[-1.5, 1.5, -2.0],
+		[-0.5, 1.5, -2.0],
+		[0.5, 1.5, 0.0],
+		[1.5, 1.5, -1.0]]
+]
+
+def initlights
+	ambient = [0.2, 0.2, 0.2, 1.0]
+	position = [0.0, 0.0, 2.0, 1.0]
+	mat_diffuse = [0.6, 0.6, 0.6, 1.0]
+	mat_specular = [1.0, 1.0, 1.0, 1.0]
+	mat_shininess = [50.0]
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	
+	glLight(GL_LIGHT0, GL_AMBIENT, ambient)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, mat_shininess)
+end
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glPushMatrix()
+	glRotate(85.0, 1.0, 1.0, 1.0)
+	glEvalMesh2(GL_FILL, 0, 20, 0, 20)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+def myinit
+	glClearColor(0.0, 0.0, 0.0, 1.0)
+	glEnable(GL_DEPTH_TEST)
+	glMap2d(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints.flatten)
+	glEnable(GL_MAP2_VERTEX_3)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	glMapGrid2d(20, 0.0, 1.0, 20, 0.0, 1.0)
+	initlights() # for lighted version only
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-4.0, 4.0, -4.0 * h / w, 4.0 * h / w, -4.0, 4.0)
+	else
+		glOrtho(-4.0 * w / h, 4.0 * w / h, -4.0, 4.0, -4.0, 4.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0);
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/checker.rb 0.60.0-0ubuntu3/examples/RedBook/checker.rb
--- 0.32f-2.1/examples/RedBook/checker.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/checker.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,124 @@
+#
+# 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.
+#
+# checker.c
+# This program texture maps a checkerboard image onto
+# two rectangles.  This program clamps the texture, if
+# the texture coordinates fall outside 0.0 and 1.0.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+#	Create checkerboard texture
+CheckImageWidth=64
+CheckImageHeight=64
+$checkImage = []
+
+def makeCheckImage
+	for i in 0..CheckImageWidth-1
+		for j in 0..CheckImageHeight-1
+			c = if ((i&0x8==0) != (j&0x8==0)) then 255 else 0 end
+			$checkImage[(i+CheckImageWidth*j)*3+0] = c
+			$checkImage[(i+CheckImageWidth*j)*3+1] = c
+			$checkImage[(i+CheckImageWidth*j)*3+2] = c
+		end
+	end
+end
+
+def myinit
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+	
+	makeCheckImage()
+	glPixelStore(GL_UNPACK_ALIGNMENT, 1)
+	glTexImage2D(GL_TEXTURE_2D, 0, 3, CheckImageWidth, 
+		CheckImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, 
+		$checkImage.pack("C*"))
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
+	glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
+	glEnable(GL_TEXTURE_2D)
+	glShadeModel(GL_FLAT)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glBegin(GL_QUADS)
+	glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0)
+	glTexCoord(0.0, 1.0); glVertex(-2.0, 1.0, 0.0)
+	glTexCoord(1.0, 1.0); glVertex(0.0, 1.0, 0.0)
+	glTexCoord(1.0, 0.0); glVertex(0.0, -1.0, 0.0)
+	
+	glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0)
+	glTexCoord(0.0, 1.0); glVertex(1.0, 1.0, 0.0)
+	glTexCoord(1.0, 1.0); glVertex(2.41421, 1.0, -1.41421)
+	glTexCoord(1.0, 0.0); glVertex(2.41421, -1.0, -1.41421)
+	glEnd()
+	glutSwapBuffers()
+end
+
+myReshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(60.0, 1.0*w/h, 1.0, 30.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -3.6)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow("checker")
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/clip.rb 0.60.0-0ubuntu3/examples/RedBook/clip.rb
--- 0.32f-2.1/examples/RedBook/clip.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/clip.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# clip.c
+# This program demonstrates arbitrary clipping planes.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+display = Proc.new do
+	eqn = [0.0, 1.0, 0.0, 0.0]
+	eqn2 = [1.0, 0.0, 0.0, 0.0]
+	
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	glColor(1.0, 1.0, 1.0)
+	glPushMatrix()
+	glTranslate(0.0, 0.0, -5.0)
+	
+	# clip lower half -- y < 0
+	glClipPlane(GL_CLIP_PLANE0, eqn)
+	glEnable(GL_CLIP_PLANE0)
+	# clip left half -- x < 0
+	glClipPlane(GL_CLIP_PLANE1, eqn2)
+	glEnable(GL_CLIP_PLANE1)
+	
+	glRotate(90.0, 1.0, 0.0, 0.0)
+	glutWireSphere(1.0, 20, 16)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h) 
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(60.0,  w/ h, 1.0, 20.0)
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/colormat.rb 0.60.0-0ubuntu3/examples/RedBook/colormat.rb
--- 0.32f-2.1/examples/RedBook/colormat.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/colormat.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,135 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# colormat.c
+# After initialization, the program will be in
+# ColorMaterial mode.  Interaction:  pressing the 
+# mouse buttons will change the diffuse reflection values.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$diffuseMaterial = [0.5,0.5,0.5,1.0]
+
+# Initialize material property, light source, lighting model,
+# and depth buffer.
+def init
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	light_position = [ 1.0, 1.0, 1.0, 0.0 ]
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_SMOOTH)
+	glEnable(GL_DEPTH_TEST)
+	glMaterial(GL_FRONT, GL_DIFFUSE, $diffuseMaterial)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, 25.0)
+	glLight(GL_LIGHT0, GL_POSITION, light_position)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	
+	glColorMaterial(GL_FRONT, GL_DIFFUSE)
+	glEnable(GL_COLOR_MATERIAL)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glutSolidSphere(1.0, 20, 16)
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-1.5, 1.5, -1.5*h/w, 1.5*h/w, -10.0, 10.0)
+	else
+		glOrtho(-1.5*w/h, 1.5*w/h, -1.5, 1.5, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+mouse = Proc.new do |button, state, x, y|
+	case (button)
+		when GLUT_LEFT_BUTTON
+			if (state == GLUT_DOWN)
+				$diffuseMaterial[0] = $diffuseMaterial[0] + 0.1
+				if ($diffuseMaterial[0] > 1.0)
+					$diffuseMaterial[0] = 0.0
+				end
+				glColor($diffuseMaterial)
+				glutPostRedisplay()
+			end
+		when GLUT_MIDDLE_BUTTON
+			if (state == GLUT_DOWN)
+				$diffuseMaterial[1] = $diffuseMaterial[1] + 0.1
+				if ($diffuseMaterial[1] > 1.0)
+					$diffuseMaterial[1] = 0.0
+				end
+				glColor($diffuseMaterial)
+				glutPostRedisplay()
+			end
+		when GLUT_RIGHT_BUTTON
+			if (state == GLUT_DOWN)
+				$diffuseMaterial[2] = $diffuseMaterial[2] + 0.1
+				if ($diffuseMaterial[2] > 1.0)
+					$diffuseMaterial[2] = 0.0
+				end
+				glColor($diffuseMaterial)
+				glutPostRedisplay()
+			end
+	end
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutMouseFunc(mouse)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/cube.rb 0.60.0-0ubuntu3/examples/RedBook/cube.rb
--- 0.32f-2.1/examples/RedBook/cube.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/cube.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,69 @@
+#!/usr/bin/env ruby -rubygems
+require 'opengl'
+include Gl,Glu,Glut
+
+$light_diffuse = [1.0, 0.0, 0.0, 1.0]
+$light_position = [1.0, 1.0, 1.0, 0.0]
+$n = [ 
+	[-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] ]
+$faces = [
+	[0, 1, 2, 3], [3, 2, 6, 7], [7, 6, 5, 4],
+	[4, 5, 1, 0], [5, 6, 2, 1], [7, 4, 0, 3] ]
+$v = 0
+
+def drawBox
+	for i in (0..5)
+		glBegin(GL_QUADS)
+		glNormal(*($n[i]))
+		glVertex($v[$faces[i][0]])
+		glVertex($v[$faces[i][1]])
+		glVertex($v[$faces[i][2]])
+		glVertex($v[$faces[i][3]])
+		glEnd()
+	end
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	drawBox
+	glutSwapBuffers
+end
+
+def myinit
+$v = [[-1, -1,1],[-1, -1,-1], [-1,1,-1], [-1,1,1], [1, -1,1],
+	[1, -1,-1], [1, 1,-1], [1,1,1]]
+
+	glLight(GL_LIGHT0, GL_DIFFUSE, $light_diffuse)
+	glLight(GL_LIGHT0, GL_POSITION, $light_position)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_LIGHTING)
+	
+	glEnable(GL_DEPTH_TEST)
+	
+	glMatrixMode(GL_PROJECTION)
+	gluPerspective(40.0, 1.0, 1.0,  10.0)
+	glMatrixMode(GL_MODELVIEW)
+	gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
+	
+	glTranslate(0.0, 0.0, -1.0)
+	glRotate(60, 1.0, 0.0, 0.0)
+	glRotate(-20, 0.0, 0.0, 1.0)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow("red 3D lighted cube")
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+myinit
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/depthcue.rb 0.60.0-0ubuntu3/examples/RedBook/depthcue.rb
--- 0.32f-2.1/examples/RedBook/depthcue.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/depthcue.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,99 @@
+#
+# 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.
+#
+# depthcue.c
+# This program draws a wireframe model, which uses 
+# intensity (brightness) to give clues to distance.
+# Fog is used to achieve this effect.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+# Initialize linear fog for depth cueing.
+def myinit
+	fogColor = [0.0, 0.0, 0.0, 1.0]
+	
+	glEnable(GL_FOG)
+	glFog(GL_FOG_MODE, GL_LINEAR)
+	glHint(GL_FOG_HINT, GL_NICEST)  # per pixel
+	glFog(GL_FOG_START, 3.0)
+	glFog(GL_FOG_END, 5.0)
+	glFog(GL_FOG_COLOR, fogColor)
+	glClearColor(0.0, 0.0, 0.0, 1.0)
+	
+	glDepthFunc(GL_LESS)
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_FLAT)
+end
+
+# display() draws an icosahedron.
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glutWireIcosahedron()
+	glFlush()
+end
+
+myReshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(45.0,  w/h, 3.0, 5.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -4.0)  # move object into view
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+# Main Loop
+glutInit
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/dof.rb 0.60.0-0ubuntu3/examples/RedBook/dof.rb
--- 0.32f-2.1/examples/RedBook/dof.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/dof.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,205 @@
+#
+# 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.
+#
+# dof.c
+# This program demonstrates use of the accumulation buffer to
+# create an out-of-focus depth-of-field effect.  The teapots
+# are drawn several times into the accumulation buffer.  The
+# viewing volume is jittered, except at the focal point, where
+# the viewing volume is at the same position, each time.  In
+# this case, the gold teapot remains in focus.
+require 'opengl'
+require 'jitter'
+include Gl,Glu,Glut
+
+# accFrustum()
+# The first 6 arguments are identical to the glFrustum() call.
+#  
+# pixdx and pixdy are anti-alias jitter in pixels. 
+# Set both equal to 0.0 for no anti-alias jitter.
+# eyedx and eyedy are depth-of field jitter in pixels. 
+# Set both equal to 0.0 for no depth of field effects.
+#
+# focus is distance from eye to plane in focus. 
+# focus must be greater than, but not equal to 0.0.
+#
+# Note that accFrustum() calls glTranslatef().  You will 
+# probably want to insure that your ModelView matrix has been 
+# initialized to identity before calling accFrustum().
+def accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)
+	viewport = glGetDoublev(GL_VIEWPORT)
+	
+	xwsize = right - left
+	ywsize = top - bottom
+	
+	dx = -(pixdx*xwsize/viewport[2] + eyedx*nnear/focus)
+	dy = -(pixdy*ywsize/viewport[3] + eyedy*nnear/focus)
+	
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glFrustum(left + dx, right + dx, bottom + dy, top + dy, nnear, ffar)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(-eyedx, -eyedy, 0.0)
+end
+
+# accPerspective()
+# 
+# The first 4 arguments are identical to the gluPerspective() call.
+# pixdx and pixdy are anti-alias jitter in pixels. 
+# Set both equal to 0.0 for no anti-alias jitter.
+# eyedx and eyedy are depth-of field jitter in pixels. 
+# Set both equal to 0.0 for no depth of field effects.
+#
+# focus is distance from eye to plane in focus. 
+# focus must be greater than, but not equal to 0.0.
+#
+# Note that accPerspective() calls accFrustum().
+def  accPerspective(fovy, aspect, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)
+	fov2 = ((fovy*Math::PI) / 180.0) / 2.0
+	
+	top = nnear / (Math::cos(fov2) / Math::sin(fov2))
+	bottom = -top
+	
+	right = top * aspect
+	left = -right
+	
+	accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)
+end
+
+
+def myinit
+	ambient = [ 0.0, 0.0, 0.0, 1.0 ]
+	diffuse = [ 1.0, 1.0, 1.0, 1.0 ]
+	position = [ 0.0, 3.0, 3.0, 0.0 ]
+	
+	lmodel_ambient = [ 0.2, 0.2, 0.2, 1.0 ]
+	local_view = [ 0.0 ]
+	
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+	
+	glLight(GL_LIGHT0, GL_AMBIENT, ambient)
+	glLight(GL_LIGHT0, GL_DIFFUSE, diffuse)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient)
+	glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
+	
+	glFrontFace(GL_CW)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glClearAccum(0.0, 0.0, 0.0, 0.0)
+end
+
+def renderTeapot (x, y, z, ambr, ambg, ambb, difr, difg, difb, specr, specg, specb, shine)
+	glPushMatrix()
+	glTranslate(x, y, z)
+	mat = []
+	mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0	
+	glMaterial(GL_FRONT, GL_AMBIENT, mat)
+	mat[0] = difr; mat[1] = difg; mat[2] = difb	
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat)
+	mat[0] = specr; mat[1] = specg; mat[2] = specb
+	glMaterial(GL_FRONT, GL_SPECULAR, mat)
+	glMaterial(GL_FRONT, GL_SHININESS, shine*128.0)
+	glutSolidTeapot(0.5)
+	glPopMatrix()
+end
+
+#  display() draws 5 teapots into the accumulation buffer 
+#  several times each time with a jittered perspective.
+#  The focal point is at z = 5.0, so the gold teapot will 
+#  stay in focus.  The amount of jitter is adjusted by the
+#  magnitude of the accPerspective() jitter in this example, 0.33.
+#  In this example, the teapots are drawn 8 times.  See jitter.rb
+display = proc do
+	viewport = glGetDoublev(GL_VIEWPORT)
+	glClear(GL_ACCUM_BUFFER_BIT)
+	
+	for jitter in 0...8
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+		accPerspective(45.0, 
+		viewport[2]/ viewport[3], 
+		1.0, 15.0, 0.0, 0.0,
+		0.33*$j8[jitter][0], 0.33*$j8[jitter][1], 5.0)
+		# ruby, gold, silver, emerald, and cyan teapots
+		renderTeapot(-1.1, -0.5, -4.5, 0.1745, 0.01175, 0.01175, 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6)
+		renderTeapot(-0.5, -0.5, -5.0, 0.24725, 0.1995, 0.0745, 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4)
+		renderTeapot(0.2, -0.5, -5.5, 0.19225, 0.19225, 0.19225, 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4)
+		renderTeapot(1.0, -0.5, -6.0, 0.0215, 0.1745, 0.0215, 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6)
+		renderTeapot(1.8, -0.5, -6.5, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, 0.50196078, 0.50196078, 0.50196078, 0.25)
+		glAccum(GL_ACCUM, 0.125)
+	end
+	
+	glAccum(GL_RETURN, 1.0)
+	glutSwapBuffers()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, depth buffer, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
+
diff -pruN 0.32f-2.1/examples/RedBook/double.rb 0.60.0-0ubuntu3/examples/RedBook/double.rb
--- 0.32f-2.1/examples/RedBook/double.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/double.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,105 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# double.c
+# This is a simple double buffered program.
+# Pressing the left mouse button rotates the rectangle.
+# Pressing the middle mouse button stops the rotation.
+require 'opengl'
+require 'rational'
+include Gl,Glu,Glut
+
+$spin = 0.0
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glPushMatrix()
+	glRotate($spin, 0.0, 0.0, 1.0)
+	glColor(1.0, 1.0, 1.0)
+	glRect(-25.0, -25.0, 25.0, 25.0)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+$spinDisplay = Proc.new do
+	$spin = $spin + 4.0
+	$spin = $spin - 360.0 if ($spin > 360.0) 
+	glutPostRedisplay()
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+mouse = Proc.new do |button, state, x, y|
+	case button
+		when GLUT_LEFT_BUTTON
+			glutIdleFunc($spinDisplay) if (state == GLUT_DOWN)
+		when GLUT_MIDDLE_BUTTON
+			glutIdleFunc(nil) if (state == GLUT_DOWN)
+	end
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+   
+#  Request double buffer display mode.
+#  Register mouse input callback functions
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape) 
+glutKeyboardFunc(keyboard)
+glutMouseFunc(mouse)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/drawf.rb 0.60.0-0ubuntu3/examples/RedBook/drawf.rb
--- 0.32f-2.1/examples/RedBook/drawf.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/drawf.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,91 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# drawf.c
+# Draws the bitmapped letter F on the screen (several times).
+# This demonstrates use of the glBitmap() call.
+require 'opengl'
+include Gl,Glu,Glut
+
+$rasters = [
+	0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
+	0xff, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
+	0xff, 0xc0, 0xff, 0xc0
+].pack("C*")
+
+def init
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glRasterPos2i(20, 20)
+	glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters)
+	glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters)
+	glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters)
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0, w, 0, h, -1.0, 1.0)
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(100, 100)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/feedback.rb 0.60.0-0ubuntu3/examples/RedBook/feedback.rb
--- 0.32f-2.1/examples/RedBook/feedback.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/feedback.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,145 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# feedback.c
+# This program demonstrates use of OpenGL feedback.  First,
+# a lighting environment is set up and a few lines are drawn.
+# Then feedback mode is entered, and the same lines are 
+# drawn.  The results in the feedback buffer are printed.
+require 'opengl'
+include Gl,Glu,Glut
+
+#  Initialize lighting.
+def init
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+end
+
+# Draw a few lines and two points, one of which will 
+# be clipped.  If in feedback mode, a passthrough token 
+# is issued between the each primitive.
+def drawGeometry(mode)
+	glBegin(GL_LINE_STRIP)
+	glNormal(0.0, 0.0, 1.0)
+	glVertex(30.0, 30.0, 0.0)
+	glVertex(50.0, 60.0, 0.0)
+	glVertex(70.0, 40.0, 0.0)
+	glEnd()
+	if (mode == GL_FEEDBACK)
+		glPassThrough(1.0)
+	end
+	glBegin(GL_POINTS)
+	glVertex(-100.0, -100.0, -100.0)  # will be clipped
+	glEnd()
+	if (mode == GL_FEEDBACK)
+		glPassThrough(2.0)
+	end
+	glBegin(GL_POINTS)
+	glNormal(0.0, 0.0, 1.0)
+	glVertex(50.0, 50.0, 0.0)
+	glEnd()
+end
+
+# Write contents of one vertex to stdout.
+def print3DcolorVertex(size, count, buffer)
+	printf("  ")
+	for i in 0...7
+		printf("%4.2f ", buffer[size-count])
+		count -= 1
+	end
+	printf("\n")
+	return count
+end
+
+# Write contents of entire buffer.  (Parse tokens!)
+def  printBuffer(size, buffer)
+	count = size
+	while (count!=0)
+		token = buffer[size-count]
+		count-=1
+		if (token == GL_PASS_THROUGH_TOKEN)
+			printf("GL_PASS_THROUGH_TOKEN\n")
+			printf("  %4.2f\n", buffer[size-count])
+			count-=1
+		elsif (token == GL_POINT_TOKEN)
+			printf("GL_POINT_TOKEN\n")
+			count = print3DcolorVertex(size, count, buffer)
+		elsif (token == GL_LINE_TOKEN)
+			printf("GL_LINE_TOKEN\n")
+			count = print3DcolorVertex(size, count, buffer)
+			count = print3DcolorVertex(size, count, buffer)
+		elsif (token == GL_LINE_RESET_TOKEN)
+			printf("GL_LINE_RESET_TOKEN\n")
+			count = print3DcolorVertex(size, count, buffer)
+			count = print3DcolorVertex(size, count, buffer)
+		end
+	end
+end
+
+display = proc do
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, 100.0, 0.0, 100.0, 0.0, 1.0)
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glClear(GL_COLOR_BUFFER_BIT)
+	drawGeometry(GL_RENDER)
+	
+	feedBuffer = glFeedbackBuffer(1024, GL_3D_COLOR)
+	glRenderMode(GL_FEEDBACK)
+	drawGeometry(GL_FEEDBACK)
+	
+	size = glRenderMode(GL_RENDER)
+	printBuffer(size, feedBuffer.unpack("f#{size}"))
+	glutSwapBuffers()
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(100, 100)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+init()
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/fog.rb 0.60.0-0ubuntu3/examples/RedBook/fog.rb
--- 0.32f-2.1/examples/RedBook/fog.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/fog.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,167 @@
+#
+# 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.
+#
+# fog.c
+# This program draws 5 red teapots, each at a different 
+# z distance from the eye, in different types of fog.  
+# Pressing the left mouse button chooses between 3 types of 
+# fog:  exponential, exponential squared, and linear.  
+# In this program, there is a fixed density value, as well 
+# as fixed start and end values for the linear fog.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$fogMode = 0
+
+selectFog = Proc.new do |mode|
+	if (mode == GL_LINEAR)
+		glFog(GL_FOG_START, 1.0)
+		glFog(GL_FOG_END, 5.0)
+		# falls through
+		glFog(GL_FOG_MODE, mode)
+		glutPostRedisplay()
+	end
+	if (mode == GL_EXP2 || mode == GL_EXP)
+		glFog(GL_FOG_MODE, mode)
+		glutPostRedisplay()
+	end
+	exit(0) if (mode == 0)
+end
+
+# Initialize z-buffer, projection matrix, light source, 
+# and lighting model.  Do not specify a material property here.
+def myinit
+	position = [0.0, 3.0, 3.0, 0.0]
+	local_view = [0.0]
+	
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+	
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
+	
+	glFrontFace(GL_CW)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	glEnable(GL_FOG)
+	fogColor = [0.5, 0.5, 0.5, 1.0]
+	
+	fogMode = GL_EXP
+	glFog(GL_FOG_MODE, fogMode)
+	glFog(GL_FOG_COLOR, fogColor)
+	glFog(GL_FOG_DENSITY, 0.35)
+	glHint(GL_FOG_HINT, GL_DONT_CARE)
+	glClearColor(0.5, 0.5, 0.5, 1.0)
+end
+
+def renderRedTeapot(x, y, z)
+	mat = []
+	glPushMatrix()
+	glTranslate(x, y, z)
+	mat[0] = 0.1745
+	mat[1] = 0.01175
+	mat[2] = 0.01175
+	mat[3] = 1.0
+	glMaterial(GL_FRONT, GL_AMBIENT, mat)
+	mat[0] = 0.61424
+	mat[1] = 0.04136
+	mat[2] = 0.04136
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat)
+	mat[0] = 0.727811
+	mat[1] = 0.626959
+	mat[2] = 0.626959
+	glMaterial(GL_FRONT, GL_SPECULAR, mat)
+	glMaterial(GL_FRONT, GL_SHININESS, 0.6 * 128.0)
+	glutSolidTeapot(1.0)
+	glPopMatrix()
+end
+
+# display() draws 5 teapots at different z positions.
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	renderRedTeapot(-4.0, -0.5, -1.0)
+	renderRedTeapot(-2.0, -0.5, -2.0)
+	renderRedTeapot(0.0, -0.5, -3.0)
+	renderRedTeapot(2.0, -0.5, -4.0)
+	renderRedTeapot(4.0, -0.5, -5.0)
+	glFlush()
+end
+
+myReshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= (h * 3))
+		glOrtho(-6.0, 6.0, -2.0 * h * 3 / w, 2.0 * h * 3 / w, 0.0, 10.0)
+	elsif
+		glOrtho(-6.0 * w / h * 3, 6.0 * w / h * 3, -2.0, 2.0, 0.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, depth buffer, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(800, 300)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutCreateMenu(selectFog)
+glutAddMenuEntry("Fog EXP", GL_EXP)
+glutAddMenuEntry("Fog EXP2", GL_EXP2)
+glutAddMenuEntry("Fog LINEAR", GL_LINEAR)
+glutAddMenuEntry("Quit", 0)
+glutAttachMenu(GLUT_RIGHT_BUTTON)
+glutMainLoop()
+    
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/RedBook/font.rb 0.60.0-0ubuntu3/examples/RedBook/font.rb
--- 0.32f-2.1/examples/RedBook/font.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/font.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,151 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# font.c
+#
+# Draws some text in a bitmapped font.  Uses glBitmap() 
+# and other pixel routines.  Also demonstrates use of 
+# display lists.
+require 'opengl'
+include Gl,Glu,Glut
+
+$space = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
+
+$letters = [
+[0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18], 
+[0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], 
+[0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e], 
+[0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc], 
+[0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff], 
+[0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff], 
+[0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e], 
+[0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], 
+[0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e], 
+[0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06], 
+[0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3], 
+[0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0], 
+[0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3], 
+[0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3], 
+[0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e], 
+[0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], 
+[0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c], 
+[0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], 
+[0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e], 
+[0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff], 
+[0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], 
+[0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], 
+[0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], 
+[0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3], 
+[0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3], 
+[0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff]
+]
+
+$fontOffset = 0
+
+def makeRasterFont
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+	
+	$fontOffset = glGenLists(128)
+	i = 0
+	j = ?A
+	for i in 0...26
+		glNewList($fontOffset + j, GL_COMPILE)
+		glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, $letters[i].pack("C*"))
+		glEndList()
+		j+=1
+	end
+	glNewList($fontOffset + ' '[0], GL_COMPILE)
+	glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, $space.pack("C*"))
+	glEndList()
+end
+
+def init
+	glShadeModel(GL_FLAT)
+	makeRasterFont()
+end
+
+def printString(s)
+	glPushAttrib(GL_LIST_BIT)
+	glListBase($fontOffset)
+	glCallLists(GL_BYTE,s)
+	glPopAttrib()
+end
+
+# Everything above this line could be in a library 
+# that defines a font.  To make it work, you've got 
+# to call makeRasterFont() before you start making 
+# calls to printString().
+display = proc do
+	white = [ 1.0, 1.0, 1.0 ]
+	
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(white)
+	
+	glRasterPos(20, 60)
+	printString("THE QUICK BROWN FOX JUMPS")
+	glRasterPos(20, 40)
+	printString("OVER A LAZY DOG")
+	glutSwapBuffers()
+end
+
+reshape = proc do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, w, 0.0, h, -1.0, 1.0)
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(400, 100)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+init()
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutDisplayFunc(display)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/hello.rb 0.60.0-0ubuntu3/examples/RedBook/hello.rb
--- 0.32f-2.1/examples/RedBook/hello.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/hello.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,79 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# hello.c
+# This is a simple, introductory OpenGL program.
+require 'opengl'
+include Gl,Glu,Glut
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	glColor(1.0, 1.0, 1.0)
+	glBegin(GL_POLYGON)
+	glVertex(0.25, 0.25, 0.0)
+	glVertex(0.75, 0.25, 0.0)
+	glVertex(0.75, 0.75, 0.0)
+	glVertex(0.25, 0.75, 0.0)
+	glEnd()
+	
+	glutSwapBuffers()
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow("hello")
+init()
+glutDisplayFunc(display) 
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/image.rb 0.60.0-0ubuntu3/examples/RedBook/image.rb
--- 0.32f-2.1/examples/RedBook/image.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/image.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,137 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# image.c
+# This program demonstrates drawing pixels and shows the effect
+# of glDrawPixels(), glCopyPixels(), and glPixelZoom().
+# Interaction: moving the mouse while pressing the mouse button
+# will copy the image in the lower-left corner of the window
+# to the mouse position, using the current pixel zoom factors.
+# There is no attempt to prevent you from drawing over the original
+# image.  If you press the 'r' key, the original image and zoom
+# factors are reset.  If you press the 'z' or 'Z' keys, you change
+# the zoom factors.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+# Create checkerboard image
+CheckImageWidth=64
+CheckImageHeight=64
+$checkImage=[]
+
+$zoomFactor = 1.0
+$height = 0.0
+
+def makeCheckImage
+	for i in 0..CheckImageWidth-1
+		for j in 0..CheckImageHeight-1
+			c = if ((i&0x8==0) != (j&0x8==0)) then 255 else 0 end
+			$checkImage[(i+CheckImageWidth*j)*3+0] = c
+			$checkImage[(i+CheckImageWidth*j)*3+1] = c
+			$checkImage[(i+CheckImageWidth*j)*3+2] = c
+		end
+	end
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+	makeCheckImage()
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glRasterPos(0, 0)
+	glDrawPixels(CheckImageWidth, CheckImageHeight, GL_RGB, GL_UNSIGNED_BYTE, $checkImage.pack("C*"))
+	glFlush()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	$height = h
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluOrtho2D(0.0,  w, 0.0, h)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+$screeny = 0.0
+motion = Proc.new do |x, y|
+	$screeny = $height - y
+	glRasterPos(x, $screeny)
+	glPixelZoom($zoomFactor, $zoomFactor)
+	glCopyPixels(0, 0, CheckImageWidth, CheckImageHeight, GL_COLOR)
+	glPixelZoom(1.0, 1.0)
+	glFlush()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?r,?R
+			$zoomFactor = 1.0
+			glutPostRedisplay()
+			printf("zoomFactor reset to 1.0\n")
+		when ?z
+			$zoomFactor = $zoomFactor + 0.5
+			if ($zoomFactor >= 3.0) 
+				$zoomFactor = 3.0
+			end
+			printf("zoomFactor is now %4.1f\n", $zoomFactor)
+		when ?Z
+			$zoomFactor = $zoomFactor - 0.5
+			if ($zoomFactor <= 0.5) 
+				$zoomFactor = 0.5
+			end
+			printf("zoomFactor is now %4.1f\n", $zoomFactor)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
+glutInitWindowSize(250, 250)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMotionFunc(motion)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/jitter.rb 0.60.0-0ubuntu3/examples/RedBook/jitter.rb
--- 0.32f-2.1/examples/RedBook/jitter.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/jitter.rb	2007-07-25 14:40:25.000000000 +0100
@@ -0,0 +1,207 @@
+#
+# (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.
+#
+# jitter.h
+#
+# This file contains jitter point arrays for 2,3,4,8,15,24 and 66 jitters.
+#
+# The arrays are named j2, j3, etc. Each element in the array has the form,
+# for example, j8[0].x and j8[0].y
+#
+# Values are floating point in the range -.5 < x < .5, -.5 < y < .5, and
+# have a gaussian distribution around the origin.
+#
+# Use these to do model jittering for scene anti-aliasing and view volume
+# jittering for depth of field effects. Use in conjunction with the 
+# accwindow() routine.
+#
+
+MAX_SAMPLES=66
+
+# 2 jitter points
+$j2 = [
+	[ 0.246490,  0.249999],
+	[-0.246490, -0.249999]
+]
+
+
+# 3 jitter points
+$j3 = [
+	[-0.373411, -0.250550],
+	[ 0.256263,  0.368119],
+	[ 0.117148, -0.117570]
+]
+
+
+# 4 jitter points
+$j4 = [
+	[-0.208147,  0.353730],
+	[ 0.203849, -0.353780],
+	[-0.292626, -0.149945],
+	[ 0.296924,  0.149994]
+]
+
+
+# 8 jitter points
+$j8 = [
+	[-0.334818,  0.435331],
+	[ 0.286438, -0.393495],
+	[ 0.459462,  0.141540],
+	[-0.414498, -0.192829],
+	[-0.183790,  0.082102],
+	[-0.079263, -0.317383],
+	[ 0.102254,  0.299133],
+	[ 0.164216, -0.054399]
+]
+
+
+# 15 jitter points 
+$j15 = [
+	[ 0.285561,  0.188437],
+	[ 0.360176, -0.065688],
+	[-0.111751,  0.275019],
+	[-0.055918, -0.215197],
+	[-0.080231, -0.470965],
+	[ 0.138721,  0.409168],
+	[ 0.384120,  0.458500],
+	[-0.454968,  0.134088],
+	[ 0.179271, -0.331196],
+	[-0.307049, -0.364927],
+	[ 0.105354, -0.010099],
+	[-0.154180,  0.021794],
+	[-0.370135, -0.116425],
+	[ 0.451636, -0.300013],
+	[-0.370610,  0.387504]
+]
+
+# 24 jitter points 
+$j24 = [
+	[ 0.030245,  0.136384],
+	[ 0.018865, -0.348867],
+	[-0.350114, -0.472309],
+	[ 0.222181,  0.149524],
+	[-0.393670, -0.266873],
+	[ 0.404568,  0.230436],
+	[ 0.098381,  0.465337],
+	[ 0.462671,  0.442116],
+	[ 0.400373, -0.212720],
+	[-0.409988,  0.263345],
+	[-0.115878, -0.001981],
+	[ 0.348425, -0.009237],
+	[-0.464016,  0.066467],
+	[-0.138674, -0.468006],
+	[ 0.144932, -0.022780],
+	[-0.250195,  0.150161],
+	[-0.181400, -0.264219],
+	[ 0.196097, -0.234139],
+	[-0.311082, -0.078815],
+	[ 0.268379,  0.366778],
+	[-0.040601,  0.327109],
+	[-0.234392,  0.354659],
+	[-0.003102, -0.154402],
+	[ 0.297997, -0.417965]
+]
+
+
+# 66 jitter points
+$j66 = [
+	[ 0.266377, -0.218171],
+	[-0.170919, -0.429368],
+	[ 0.047356, -0.387135],
+	[-0.430063,  0.363413],
+	[-0.221638, -0.313768],
+	[ 0.124758, -0.197109],
+	[-0.400021,  0.482195],
+	[ 0.247882,  0.152010],
+	[-0.286709, -0.470214],
+	[-0.426790,  0.004977],
+	[-0.361249, -0.104549],
+	[-0.040643,  0.123453],
+	[-0.189296,  0.438963],
+	[-0.453521, -0.299889],
+	[ 0.408216, -0.457699],
+	[ 0.328973, -0.101914],
+	[-0.055540, -0.477952],
+	[ 0.194421,  0.453510],
+	[ 0.404051,  0.224974],
+	[ 0.310136,  0.419700],
+	[-0.021743,  0.403898],
+	[-0.466210,  0.248839],
+	[ 0.341369,  0.081490],
+	[ 0.124156, -0.016859],
+	[-0.461321, -0.176661],
+	[ 0.013210,  0.234401],
+	[ 0.174258, -0.311854],
+	[ 0.294061,  0.263364],
+	[-0.114836,  0.328189],
+	[ 0.041206, -0.106205],
+	[ 0.079227,  0.345021],
+	[-0.109319, -0.242380],
+	[ 0.425005, -0.332397],
+	[ 0.009146,  0.015098],
+	[-0.339084, -0.355707],
+	[-0.224596, -0.189548],
+	[ 0.083475,  0.117028],
+	[ 0.295962, -0.334699],
+	[ 0.452998,  0.025397],
+	[ 0.206511, -0.104668],
+	[ 0.447544, -0.096004],
+	[-0.108006, -0.002471],
+	[-0.380810,  0.130036],
+	[-0.242440,  0.186934],
+	[-0.200363,  0.070863],
+	[-0.344844, -0.230814],
+	[ 0.408660,  0.345826],
+	[-0.233016,  0.305203],
+	[ 0.158475, -0.430762],
+	[ 0.486972,  0.139163],
+	[-0.301610,  0.009319],
+	[ 0.282245, -0.458671],
+	[ 0.482046,  0.443890],
+	[-0.121527,  0.210223],
+	[-0.477606, -0.424878],
+	[-0.083941, -0.121440],
+	[-0.345773,  0.253779],
+	[ 0.234646,  0.034549],
+	[ 0.394102, -0.210901],
+	[-0.312571,  0.397656],
+	[ 0.200906,  0.333293],
+	[ 0.018703, -0.261792],
+	[-0.209349, -0.065383],
+	[ 0.076248,  0.478538],
+	[-0.073036, -0.355064],
+	[ 0.145087,  0.221726]
+]
diff -pruN 0.32f-2.1/examples/RedBook/lines.rb 0.60.0-0ubuntu3/examples/RedBook/lines.rb
--- 0.32f-2.1/examples/RedBook/lines.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/lines.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,128 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# lines.c
+# This program demonstrates geometric primitives and
+# their attributes.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+def drawOneLine(x1,y1,x2,y2)
+	glBegin(GL_LINES)
+	glVertex((x1),(y1))
+	glVertex((x2),(y2))
+	glEnd()
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	# select white for all lines
+	glColor(1.0, 1.0, 1.0)
+	
+	# in 1st row, 3 lines, each with a different stipple
+	glEnable(GL_LINE_STIPPLE)
+	
+	glLineStipple(1, 0x0101) # dotted
+	drawOneLine(50.0, 125.0, 150.0, 125.0)
+	glLineStipple(1, 0x00FF) # dashed
+	drawOneLine(150.0, 125.0, 250.0, 125.0)
+	glLineStipple(1, 0x1C47)  # dash/dot/dash
+	drawOneLine(250.0, 125.0, 350.0, 125.0)
+	
+	# in 2nd row, 3 wide lines, each with different stipple
+	glLineWidth(5.0)
+	glLineStipple(1, 0x0101) # dotted
+	drawOneLine(50.0, 100.0, 150.0, 100.0)
+	glLineStipple(1, 0x00FF) # dashed
+	drawOneLine(150.0, 100.0, 250.0, 100.0)
+	glLineStipple(1, 0x1C47) # dash/dot/dash
+	drawOneLine(250.0, 100.0, 350.0, 100.0)
+	glLineWidth(1.0)
+	
+	# in 3rd row, 6 lines, with dash/dot/dash stipple
+	# as part of a single connected line strip
+	glLineStipple(1, 0x1C47)  # dash/dot/dash
+	glBegin(GL_LINE_STRIP)
+	for i in  0..6
+		glVertex(50.0 + (i * 50.0), 75.0)
+	end
+	glEnd()
+	
+	# in 4th row, 6 independent lines with same stipple
+	for i in 0..5
+		drawOneLine(50.0 + (i * 50.0), 50.0, 50.0 + ((i+1) * 50.0), 50.0)
+	end
+	
+	# in 5th row, 1 line, with dash/dot/dash stipple
+	# and a stipple repeat factor of 5
+	glLineStipple(5, 0x1C47)  # dash/dot/dash
+	drawOneLine(50.0, 25.0, 350.0, 25.0)
+	
+	glDisable(GL_LINE_STIPPLE)
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	GLU.Ortho2D(0.0,  w, 0.0,  h)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(400, 150) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/list.rb 0.60.0-0ubuntu3/examples/RedBook/list.rb
--- 0.32f-2.1/examples/RedBook/list.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/list.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,111 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+#  list.c
+#  This program demonstrates how to make and execute a 
+#  display list.  Note that attributes, such as current 
+#  color and matrix, are changed.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$listName = 0
+
+def init
+	$listName = glGenLists(1)
+	glNewList($listName, GL_COMPILE)
+	glColor(1.0, 0.0, 0.0)  # /*  current color red  */
+	glBegin(GL_TRIANGLES)
+	glVertex(0.0, 0.0)
+	glVertex(1.0, 0.0)
+	glVertex(0.0, 1.0)
+	glEnd()
+	glTranslate(1.5, 0.0, 0.0) # /*  move position  */
+	glEndList()
+	glShadeModel(GL_FLAT)
+end
+
+def drawLine
+	glBegin(GL_LINES)
+	glVertex(0.0, 0.5)
+	glVertex(15.0, 0.5)
+	glEnd()
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(0.0, 1.0, 0.0)  # current color green
+	for i in (0..9 ) # draw 10 triangles
+		glCallList($listName)
+	end
+	drawLine()  # is this line green?  NO!
+							# where is the line drawn?
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h) 
+		GLU.Ortho2D(0.0, 2.0, -0.5 * h/w, 1.5 * h/w)
+	else
+		GLU.Ortho2D(0.0, 2.0 * w/h, -0.5, 1.5) 
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(650, 100)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/material.rb 0.60.0-0ubuntu3/examples/RedBook/material.rb
--- 0.32f-2.1/examples/RedBook/material.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/material.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,275 @@
+#
+# 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.
+#
+# material.c
+# This program demonstrates the use of the GL lighting model.
+# Several objects are drawn using different material characteristics.
+# A single light source illuminates the objects.
+require 'opengl'
+include Gl,Glu,Glut
+
+# Initialize z-buffer, projection matrix, light source, 
+# and lighting model.  Do not specify a material property here.
+def myinit
+	ambient = [ 0.0, 0.0, 0.0, 1.0 ]
+	diffuse = [ 1.0, 1.0, 1.0, 1.0 ]
+	position = [ 0.0, 3.0, 2.0, 0.0 ]
+	lmodel_ambient = [ 0.4, 0.4, 0.4, 1.0 ]
+	local_view = [ 0.0 ]
+	
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+	
+	glLight(GL_LIGHT0, GL_AMBIENT, ambient)
+	glLight(GL_LIGHT0, GL_DIFFUSE, diffuse)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient)
+	glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	
+	glClearColor(0.0, 0.1, 0.1, 0.0)
+end
+
+# Draw twelve spheres in 3 rows with 4 columns.  
+# The spheres in the first row have materials with no ambient reflection.
+# The second row has materials with significant ambient reflection.
+# The third row has materials with colored ambient reflection.
+#
+# The first column has materials with blue, diffuse reflection only.
+# The second column has blue diffuse reflection, as well as specular
+# reflection with a low shininess exponent.
+# The third column has blue diffuse reflection, as well as specular
+# reflection with a high shininess exponent (a more concentrated highlight).
+# The fourth column has materials which also include an emissive component.
+#
+# glTranslatef() is used to move spheres to their appropriate locations.
+display = proc do
+	no_mat = [ 0.0, 0.0, 0.0, 1.0 ]
+	mat_ambient = [ 0.7, 0.7, 0.7, 1.0 ]
+	mat_ambient_color = [ 0.8, 0.8, 0.2, 1.0 ]
+	mat_diffuse = [ 0.1, 0.5, 0.8, 1.0 ]
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	no_shininess = [ 0.0 ]
+	low_shininess = [ 5.0 ]
+	high_shininess = [ 100.0 ]
+	mat_emission = [0.3, 0.2, 0.2, 0.0]
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	# draw sphere in first row, first column
+	# diffuse reflection only no ambient or specular  
+	glPushMatrix()
+	glTranslate(-3.75, 3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, no_mat)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in first row, second column
+	# diffuse and specular reflection low shininess no ambient
+	glPushMatrix()
+	glTranslate(-1.25, 3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, no_mat)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, low_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in first row, third column
+	# diffuse and specular reflection high shininess no ambient
+	glPushMatrix()
+	glTranslate(1.25, 3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, no_mat)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, high_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in first row, fourth column
+	# diffuse reflection emission no ambient or specular reflection
+	glPushMatrix()
+	glTranslate(3.75, 3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, no_mat)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, mat_emission)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in second row, first column
+	# ambient and diffuse reflection no specular  
+	glPushMatrix()
+	glTranslate(-3.75, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in second row, second column
+	# ambient, diffuse and specular reflection low shininess
+	glPushMatrix()
+	glTranslate(-1.25, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, low_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in second row, third column
+	# ambient, diffuse and specular reflection high shininess
+	glPushMatrix()
+	glTranslate(1.25, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, high_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in second row, fourth column
+	# ambient and diffuse reflection emission no specular
+	glPushMatrix()
+	glTranslate(3.75, 0.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, mat_emission)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in third row, first column
+	# colored ambient and diffuse reflection no specular  
+	glPushMatrix()
+	glTranslate(-3.75, -3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in third row, second column
+	# colored ambient, diffuse and specular reflection low shininess
+	glPushMatrix()
+	glTranslate(-1.25, -3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, low_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in third row, third column
+	# colored ambient, diffuse and specular reflection high shininess
+	glPushMatrix()
+	glTranslate(1.25, -3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, high_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, no_mat)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	# draw sphere in third row, fourth column
+	# colored ambient and diffuse reflection emission no specular
+	glPushMatrix()
+	glTranslate(3.75, -3.0, 0.0)
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, no_mat)
+	glMaterial(GL_FRONT, GL_SHININESS, no_shininess)
+	glMaterial(GL_FRONT, GL_EMISSION, mat_emission)
+	glutSolidSphere(1.0, 16, 16)
+	glPopMatrix()
+	
+	glutSwapBuffers()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= (h * 2))
+		glOrtho(-6.0, 6.0, -3.0*(h.to_f*2)/w,	3.0*(h.to_f*2)/w, -10.0, 10.0)
+	else
+		glOrtho(-6.0*w.to_f/(h*2), 6.0*w.to_f/(h*2), -3.0, 3.0, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(600, 600)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
+
diff -pruN 0.32f-2.1/examples/RedBook/mipmap.rb 0.60.0-0ubuntu3/examples/RedBook/mipmap.rb
--- 0.32f-2.1/examples/RedBook/mipmap.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/mipmap.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,156 @@
+#
+# 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.
+#
+# mipmap.c
+# This program demonstrates using mipmaps for texture maps.
+# To overtly show the effect of mipmaps, each mipmap reduction
+# level has a solidly colored, contrasting texture image.
+# Thus, the quadrilateral which is drawn is drawn with several
+# different colors.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$mipmapImage32 = []
+$mipmapImage16 = []
+$mipmapImage8 = []
+$mipmapImage4 = []
+$mipmapImage2 = []
+$mipmapImage1 = []
+
+def makeImages
+	for i in 0..31
+		for j in 0..31
+			$mipmapImage32[(j*32+i)*3+0] = 255
+			$mipmapImage32[(j*32+i)*3+1] = 255
+			$mipmapImage32[(j*32+i)*3+2] = 0
+		end
+	end
+	for i in 0..15
+		for j in 0..15
+			$mipmapImage16[(j*16+i)*3+0] = 255
+			$mipmapImage16[(j*16+i)*3+1] = 0
+			$mipmapImage16[(j*16+i)*3+2] = 255
+		end
+	end
+	for i in 0..7
+		for j in 0..7
+			$mipmapImage8[(j*8+i)*3+0] = 255
+			$mipmapImage8[(j*8+i)*3+1] = 0
+			$mipmapImage8[(j*8+i)*3+2] = 0
+		end
+	end
+	for i in 0..3
+		for j in 0..3
+			$mipmapImage4[(j*4+i)*3+0] = 0
+			$mipmapImage4[(j*4+i)*3+1] = 255
+			$mipmapImage4[(j*4+i)*3+2] = 0
+		end
+	end
+	for i in 0..1
+		for j in 0..1
+			$mipmapImage2[(j*2+i)*3+0] = 0
+			$mipmapImage2[(j*2+i)*3+1] = 0
+			$mipmapImage2[(j*2+i)*3+2] = 255
+		end
+	end
+	$mipmapImage1[0] = 255
+	$mipmapImage1[1] = 255
+	$mipmapImage1[2] = 255
+end
+
+def myinit
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+	glShadeModel(GL_FLAT)
+	
+	glTranslate(0.0, 0.0, -3.6)
+	makeImages()
+	glPixelStore(GL_UNPACK_ALIGNMENT, 1)
+	glTexImage2D(GL_TEXTURE_2D, 0, 3, 32, 32, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage32.pack("C*"))
+	glTexImage2D(GL_TEXTURE_2D, 1, 3, 16, 16, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage16.pack("C*"))
+	glTexImage2D(GL_TEXTURE_2D, 2, 3, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage8.pack("C*"))
+	glTexImage2D(GL_TEXTURE_2D, 3, 3, 4, 4, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage4.pack("C*"))
+	glTexImage2D(GL_TEXTURE_2D, 4, 3, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage2.pack("C*"))
+	glTexImage2D(GL_TEXTURE_2D, 5, 3, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage1.pack("C*"))
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
+	GL_NEAREST_MIPMAP_NEAREST)
+	glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
+	glEnable(GL_TEXTURE_2D)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glBegin(GL_QUADS)
+	glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0)
+	glTexCoord(0.0, 8.0); glVertex(-2.0, 1.0, 0.0)
+	glTexCoord(8.0, 8.0); glVertex(2000.0, 1.0, -6000.0)
+	glTexCoord(8.0, 0.0); glVertex(2000.0, -1.0, -6000.0)
+	glEnd()
+	glutSwapBuffers()
+end
+
+myReshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(60.0, 1.0*w/h, 1.0, 30000.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/model.rb 0.60.0-0ubuntu3/examples/RedBook/model.rb
--- 0.32f-2.1/examples/RedBook/model.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/model.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,113 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+#  model.c
+#  This program demonstrates modeling transformations
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+def draw_triangle
+	glBegin(GL_LINE_LOOP)
+	glVertex(0.0, 25.0)
+	glVertex(25.0, -25.0)
+	glVertex(-25.0, -25.0)
+	glEnd()
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	
+	glLoadIdentity()
+	glColor(1.0, 1.0, 1.0)
+	draw_triangle()
+	
+	glEnable(GL_LINE_STIPPLE)
+	glLineStipple(1, 0xF0F0)
+	glLoadIdentity()
+	glTranslate(-20.0, 0.0, 0.0)
+	draw_triangle()
+	
+	glLineStipple(1, 0xF00F)
+	glLoadIdentity()
+	glScale(1.5, 0.5, 1.0)
+	draw_triangle()
+	
+	glLineStipple(1, 0x8888)
+	glLoadIdentity()
+	glRotate(90.0, 0.0, 0.0, 1.0)
+	draw_triangle()
+	glDisable(GL_LINE_STIPPLE)
+	
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-50.0, 50.0, -50.0*h/w,	50.0*h/w, -1.0, 1.0)
+	else
+		glOrtho(-50.0*w/h,50.0*w/h, -50.0, 50.0, -1.0, 1.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case key
+		when ?\e
+			exit(0)
+	end
+end
+
+# main
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/movelight.rb 0.60.0-0ubuntu3/examples/RedBook/movelight.rb
--- 0.32f-2.1/examples/RedBook/movelight.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/movelight.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,132 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+#  movelight.c
+#  This program demonstrates when to issue lighting and
+#  transformation commands to render a model with a light
+#  which is moved by a modeling transformation (rotate or
+#  translate).  The light position is reset after the modeling
+#  transformation is called.  The eye position does not change.
+#
+#  A sphere is drawn using a grey material characteristic.
+#  A single light source illuminates the object.
+#
+#  Interaction:  pressing the left mouse button alters
+#  the modeling transformation (x rotation) by 30 degrees.
+#  The scene is then redrawn with the light in a new position.
+
+require 'opengl'
+require 'rational'
+require 'mathn'
+include Gl,Glu,Glut
+
+$spin = 0
+
+#  Initialize material property, light source, lighting model,
+#  and depth buffer.
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_SMOOTH)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_DEPTH_TEST)
+end
+
+#  Here is where the light position is reset after the modeling
+#  transformation (glRotated) is called.  This places the
+#  light at a new position in world coordinates.  The cube
+#  represents the position of the light.
+display = Proc.new do
+	position = [ 0.0, 0.0, 1.5, 1.0 ]
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glPushMatrix()
+	GLU.LookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
+	
+	glPushMatrix()
+	glRotate($spin, 1.0, 0.0, 0.0)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	
+	glTranslate(0.0, 0.0, 1.5)
+	glDisable(GL_LIGHTING)
+	glColor(0.0, 1.0, 1.0)
+	glutWireCube(0.1)
+	glEnable(GL_LIGHTING)
+	glPopMatrix()
+	
+	glutSolidTorus(0.275, 0.85, 8, 15)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(40.0,  w/h, 1.0, 20.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+mouse = Proc.new do |button, state, x, y|
+	case button
+		when GLUT_LEFT_BUTTON
+			if (state == GLUT_DOWN)
+				$spin = ($spin + 30) % 360
+				glutPostRedisplay()
+			end
+	end
+end
+
+keyboard = Proc.new do |key, x, y|
+	case key
+		when ?\e
+			exit(0)
+	end
+end
+
+# main
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutMouseFunc(mouse)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/pickdepth.rb 0.60.0-0ubuntu3/examples/RedBook/pickdepth.rb
--- 0.32f-2.1/examples/RedBook/pickdepth.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/pickdepth.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,179 @@
+#
+# 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.
+#
+#  pickdepth.c
+#  Picking is demonstrated in this program.  In 
+#  rendering mode, three overlapping rectangles are 
+#  drawn.  When the left mouse button is pressed, 
+#  selection mode is entered with the picking matrix.  
+#  Rectangles which are drawn under the cursor position
+#  are "picked."  Pay special attention to the depth 
+#  value range, which is returned.
+require 'opengl'
+include Gl,Glu,Glut
+
+def myinit
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glDepthFunc(GL_LESS)
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_FLAT)
+	glDepthRange(0.0, 1.0)  #/* The default z mapping */
+end
+
+# The three rectangles are drawn.  In selection mode, 
+# each rectangle is given the same name.  Note that 
+# each rectangle is drawn with a different z value.
+def drawRects(mode)
+	if (mode == GL_SELECT)
+		glLoadName(1)
+	end
+	glBegin(GL_QUADS)
+	glColor(1.0, 1.0, 0.0)
+	glVertex(2, 0, 0)
+	glVertex(2, 6, 0)
+	glVertex(6, 6, 0)
+	glVertex(6, 0, 0)
+	glEnd()
+	if (mode == GL_SELECT)
+		glLoadName(2)
+	end
+	glBegin(GL_QUADS)
+	glColor(0.0, 1.0, 1.0)
+	glVertex(3, 2, -1)
+	glVertex(3, 8, -1)
+	glVertex(8, 8, -1)
+	glVertex(8, 2, -1)
+	glEnd()
+	if (mode == GL_SELECT)
+		glLoadName(3)
+	end
+	glBegin(GL_QUADS)
+	glColor(1.0, 0.0, 1.0)
+	glVertex(0, 2, -2)
+	glVertex(0, 7, -2)
+	glVertex(5, 7, -2)
+	glVertex(5, 2, -2)
+	glEnd()
+end
+
+# processHits() prints out the contents of the 
+# selection array.
+def processHits(hits, buffer)
+	printf("hits = %d\n", hits)
+	ptr = buffer.unpack("I*")
+	p = 0
+	for i in 0...hits 	# for each hit
+		names = ptr[p]
+		printf(" number of names for hit = %d\n", names); p+=1
+		printf("  z1 is %g",  ptr[p].to_f/0xffffffff); p+=1
+		printf(" z2 is %g\n",  ptr[p].to_f/0xffffffff); p+=1
+		printf("   the name is ")
+		for j in 0...names  # for each name
+			printf("%d ", ptr[p]) ; p+=1
+		end
+		printf("\n")
+	end
+end
+
+# pickRects() sets up selection mode, name stack, 
+# and projection matrix for picking.  Then the objects 
+# are drawn.
+BUFSIZE=512
+
+pickRects = proc do |button, state, x, y|
+	if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
+		viewport = glGetDoublev(GL_VIEWPORT)
+		
+		selectBuf = glSelectBuffer(BUFSIZE)
+		glRenderMode(GL_SELECT)
+		
+		glInitNames()
+		glPushName(~0)
+		
+		glMatrixMode(GL_PROJECTION)
+		glPushMatrix()
+		glLoadIdentity()
+		# create 5x5 pixel picking region near cursor location
+		gluPickMatrix( x, viewport[3] - y, 5.0, 5.0, viewport)
+		glOrtho(0.0, 8.0, 0.0, 8.0, -0.5, 2.5)
+		drawRects(GL_SELECT)
+		glPopMatrix()
+		glFlush()
+		
+		hits = glRenderMode(GL_RENDER)
+		processHits(hits, selectBuf)
+	end
+end
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	drawRects(GL_RENDER)
+	glutSwapBuffers()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, 8.0, 0.0, 8.0, -0.5, 2.5)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0)
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, depth buffer, and handle input events.
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInit()
+glutCreateWindow()
+myinit()
+glutMouseFunc(pickRects)
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/planet.rb 0.60.0-0ubuntu3/examples/RedBook/planet.rb
--- 0.32f-2.1/examples/RedBook/planet.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/planet.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,108 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# planet.c
+# This program shows how to composite modeling transformations
+# to draw translated and rotated models.
+# Interaction:  pressing the d and y keys (day and year)
+# alters the rotation of the planet around the sun.
+require 'opengl'
+require 'rational'
+include Gl,Glu,Glut
+
+STDOUT.sync = TRUE
+
+$year = 0
+$day = 0
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	
+	glPushMatrix()
+	glutWireSphere(1.0, 20, 16)   # draw sun
+	glRotate($year, 0.0, 1.0, 0.0)
+	glTranslate(2.0, 0.0, 0.0)
+	glRotate($day, 0.0, 1.0, 0.0)
+	glutWireSphere(0.2, 10, 8)    # draw smaller planet
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h) 
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(60.0,  w.to_f/h.to_f, 1.0, 20.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?d
+			$day = ($day + 10) % 360
+			glutPostRedisplay()
+		when ?D
+			$day = ($day - 10) % 360
+			glutPostRedisplay()
+		when ?y
+			$year = ($year + 5) % 360
+			glutPostRedisplay()
+		when ?Y
+			$year = ($year - 5) % 360
+			glutPostRedisplay()
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/quadric.rb 0.60.0-0ubuntu3/examples/RedBook/quadric.rb
--- 0.32f-2.1/examples/RedBook/quadric.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/quadric.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,158 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# quadric.c
+# This program demonstrates the use of some of the gluQuadric*
+# routines. Quadric objects are created with some quadric
+# properties and the callback routine to handle errors.
+# Note that the cylinder has no top or bottom and the circle
+# has a hole in it.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$startList = nil
+
+def init
+	mat_ambient = [ 0.5, 0.5, 0.5, 1.0 ]
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	mat_shininess = [ 50.0 ]
+	light_position = [ 1.0, 1.0, 1.0, 0.0 ]
+	model_ambient = [ 0.5, 0.5, 0.5, 1.0 ]
+	
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	
+	glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, mat_shininess)
+	glLight(GL_LIGHT0, GL_POSITION, light_position)
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, model_ambient)
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_DEPTH_TEST)
+	
+	# Create 4 display lists, each with a different quadric object.
+	# Different drawing styles and surface normal specifications
+	# are demonstrated.
+	$startList = glGenLists(4)
+	qobj = gluNewQuadric()
+	
+	gluQuadricDrawStyle(qobj, GLU_FILL) # smooth shaded
+	gluQuadricNormals(qobj, GLU_SMOOTH)
+	glNewList($startList, GL_COMPILE)
+	gluSphere(qobj, 0.75, 15, 10)
+	glEndList()
+	
+	gluQuadricDrawStyle(qobj, GLU_FILL) # flat shaded
+	gluQuadricNormals(qobj, GLU_FLAT)
+	glNewList($startList+1, GL_COMPILE)
+	gluCylinder(qobj, 0.5, 0.3, 1.0, 15, 5)
+	glEndList()
+	
+	gluQuadricDrawStyle(qobj, GLU_LINE) # all polygons wireframe
+	gluQuadricNormals(qobj, GLU_NONE)
+	glNewList($startList+2, GL_COMPILE)
+	gluDisk(qobj, 0.25, 1.0, 20, 4)
+	glEndList()
+	
+	gluQuadricDrawStyle(qobj, GLU_SILHOUETTE) # boundary only
+	gluQuadricNormals(qobj, GLU_NONE)
+	glNewList($startList+3, GL_COMPILE)
+	gluPartialDisk(qobj, 0.0, 1.0, 20, 4, 0.0, 225.0)
+	glEndList()
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glPushMatrix()
+	
+	glEnable(GL_LIGHTING)
+	glShadeModel(GL_SMOOTH)
+	glTranslate(-1.0, -1.0, 0.0)
+	glCallList($startList)
+	
+	glShadeModel(GL_FLAT)
+	glTranslate(0.0, 2.0, 0.0)
+	glPushMatrix()
+	glRotate(300.0, 1.0, 0.0, 0.0)
+	glCallList($startList+1)
+	glPopMatrix()
+	
+	glDisable(GL_LIGHTING)
+	glColor(0.0, 1.0, 1.0)
+	glTranslate(2.0, -2.0, 0.0)
+	glCallList($startList+2)
+	
+	glColor(1.0, 1.0, 0.0)
+	glTranslate(0.0, 2.0, 0.0)
+	glCallList($startList+3)
+	
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-2.5, 2.5, -2.5*h/w, 2.5*h/w, -10.0, 10.0)
+	else
+		glOrtho(-2.5*w/h, 2.5*w/h, -2.5, 2.5, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# main
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/robot.rb 0.60.0-0ubuntu3/examples/RedBook/robot.rb
--- 0.32f-2.1/examples/RedBook/robot.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/robot.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,115 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# robot.c
+# This program shows how to composite modeling transformations
+# to draw translated and rotated hierarchical models.
+# Interaction:  pressing the s and e keys (shoulder and elbow)
+# alters the rotation of the robot arm.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+$shoulder = 0
+$elbow = 0
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glPushMatrix()
+	glTranslate(-1.0, 0.0, 0.0)
+	glRotate($shoulder, 0.0, 0.0, 1.0)
+	glTranslate(1.0, 0.0, 0.0)
+	glPushMatrix()
+	glScale(2.0, 0.4, 1.0)
+	glutWireCube(1.0)
+	glPopMatrix()
+	
+	glTranslate(1.0, 0.0, 0.0)
+	glRotate($elbow, 0.0, 0.0, 1.0)
+	glTranslate(1.0, 0.0, 0.0)
+	glPushMatrix()
+	glScale(2.0, 0.4, 1.0)
+	glutWireCube(1.0)
+	glPopMatrix()
+	
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape  = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h) 
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(65.0,  w/ h, 1.0, 20.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -5.0)
+end
+
+keyboard = Proc.new do|key, x, y|
+	case  (key)
+		when ?s
+			$shoulder = ($shoulder + 5) % 360
+			glutPostRedisplay()
+		when ?S
+			$shoulder = ($shoulder - 5) % 360
+			glutPostRedisplay()
+		when ?e
+			$elbow = ($elbow + 5) % 360
+			glutPostRedisplay()
+		when ?E
+			$elbow = ($elbow - 5) % 360
+			glutPostRedisplay()
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500) 
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/select.rb 0.60.0-0ubuntu3/examples/RedBook/select.rb
--- 0.32f-2.1/examples/RedBook/select.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/select.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,196 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+#
+# select.c
+# This is an illustration of the selection mode and 
+# name stack, which detects whether objects which collide 
+# with a viewing volume.  First, four triangles and a 
+# rectangular box representing a viewing volume are drawn 
+# (drawScene routine).  The green triangle and yellow 
+# triangles appear to lie within the viewing volume, but 
+# the red triangle appears to lie outside it.  Then the 
+# selection mode is entered (selectObjects routine).  
+# Drawing to the screen ceases.  To see if any collisions 
+# occur, the four triangles are called.  In this example, 
+# the green triangle causes one hit with the name 1, and 
+# the yellow triangles cause one hit with the name 3.
+require 'opengl'
+include Gl,Glu,Glut
+
+# draw a triangle with vertices at (x1, y1), (x2, y2) 
+# and (x3, y3) at z units away from the origin.
+def drawTriangle(x1, y1, x2, y2, x3, y3, z)
+	glBegin(GL_TRIANGLES)
+	glVertex(x1, y1, z)
+	glVertex(x2, y2, z)
+	glVertex(x3, y3, z)
+	glEnd()
+end
+
+# draw a rectangular box with these outer x, y, and z values
+def drawViewVolume(x1, x2, y1, y2, z1, z2)
+	glColor(1.0, 1.0, 1.0)
+	glBegin(GL_LINE_LOOP)
+	glVertex(x1, y1, -z1)
+	glVertex(x2, y1, -z1)
+	glVertex(x2, y2, -z1)
+	glVertex(x1, y2, -z1)
+	glEnd()
+	
+	glBegin(GL_LINE_LOOP)
+	glVertex(x1, y1, -z2)
+	glVertex(x2, y1, -z2)
+	glVertex(x2, y2, -z2)
+	glVertex(x1, y2, -z2)
+	glEnd()
+	
+	glBegin(GL_LINES)# 4 lines
+	glVertex(x1, y1, -z1)
+	glVertex(x1, y1, -z2)
+	glVertex(x1, y2, -z1)
+	glVertex(x1, y2, -z2)
+	glVertex(x2, y1, -z1)
+	glVertex(x2, y1, -z2)
+	glVertex(x2, y2, -z1)
+	glVertex(x2, y2, -z2)
+	glEnd()
+end
+
+# drawScene draws 4 triangles and a wire frame
+# which represents the viewing volume.
+def drawScene()
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(40.0, 4.0/3.0, 1.0, 100.0)
+	
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	gluLookAt(7.5, 7.5, 12.5, 2.5, 2.5, -5.0, 0.0, 1.0, 0.0)
+	glColor(0.0, 1.0, 0.0)# green triangle
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0)
+	glColor(1.0, 0.0, 0.0)# red triangle
+	drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0)
+	glColor(1.0, 1.0, 0.0)# yellow triangles
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0)
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0)
+	drawViewVolume(0.0, 5.0, 0.0, 5.0, 0.0, 10.0)
+end
+
+# processHits prints out the contents of the selection array
+def processHits(hits, buffer)
+	printf("hits = %d\n", hits)
+	ptr = buffer.unpack("I*")
+	p = 0
+	for i in 0...hits 	# for each hit
+		names = ptr[p]
+		printf(" number of names for hit = %d\n", names); p+=1
+		printf("  z1 is %g",  ptr[p].to_f/0xffffffff); p+=1
+		printf(" z2 is %g\n",  ptr[p].to_f/0xffffffff); p+=1
+		printf("   the name is ")
+		for j in 0...names  # for each name
+			printf("%d ", ptr[p]); p+=1
+		end
+		printf("\n")
+	end
+end
+
+# selectObjects "draws" the triangles in selection mode, 
+# assigning names for the triangles.  Note that the third
+# and fourth triangles share one name, so that if either 
+# or both triangles intersects the viewing/clipping volume, 
+# only one hit will be registered.
+
+BUFSIZE=512
+
+def selectObjects
+	selectBuf = glSelectBuffer(BUFSIZE)
+	glRenderMode(GL_SELECT)
+	
+	glInitNames()
+	glPushName(0)
+	
+	glPushMatrix()
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, 5.0, 0.0, 5.0, 0.0, 10.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glLoadName(1)
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0)
+	glLoadName(2)
+	drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0)
+	glLoadName(3)
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0)
+	drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0)
+	glPopMatrix()
+	glFlush()
+	
+	hits = glRenderMode(GL_RENDER)
+	processHits(hits, selectBuf)
+end 
+
+def init
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_FLAT)
+end
+
+display = proc do
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	drawScene()
+	selectObjects()
+	glFlush()
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# Main Loop
+
+GLUT.Init
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow $0
+init()
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/smooth.rb 0.60.0-0ubuntu3/examples/RedBook/smooth.rb
--- 0.32f-2.1/examples/RedBook/smooth.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/smooth.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# smooth.c
+# This program demonstrates smooth shading.
+# A smooth shaded polygon is drawn in a 2-D projection.
+
+require 'opengl'
+include Gl,Glu,Glut
+
+def init
+	glClearColor(0,0,0,0)
+	glShadeModel(GL_SMOOTH)
+end
+
+def triangle
+	glBegin(GL_TRIANGLES)
+	glColor3f(1.0, 0.0, 0.0)
+	glVertex2f(5, 5)
+	glColor3f(0.0, 1.0, 0.0)
+	glVertex2f(25, 5)
+	glColor3f(0.0, 0.0, 1.0)
+	glVertex2f(5, 25)
+	glEnd()
+end
+
+
+display = Proc.new do 
+	glClear(GL_COLOR_BUFFER_BIT)
+	triangle
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity
+	if w<=h
+		gluOrtho2D(0,30,0, 30 * h/w)
+	else
+		gluOrtho2D(0,30 * w/h, 0,30)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = lambda do |key, x, y|
+	case(key)
+	when ?\e
+		exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/stencil.rb 0.60.0-0ubuntu3/examples/RedBook/stencil.rb
--- 0.32f-2.1/examples/RedBook/stencil.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/stencil.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,163 @@
+#
+# 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.
+#
+# stencil.c
+# This program draws two rotated tori in a window.  
+# A diamond in the center of the window masks out part 
+# of the scene.  Within this mask, a different model 
+# (a sphere) is drawn in a different color.
+#
+require 'opengl'
+require 'rational'
+include Gl,Glu,Glut
+
+YELLOWMAT=1
+BLUEMAT=2
+
+def myinit
+	yellow_diffuse = [ 0.7, 0.7, 0.0, 1.0 ]
+	yellow_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	
+	blue_diffuse = [ 0.1, 0.1, 0.7, 1.0 ]
+	blue_specular = [ 0.1, 1.0, 1.0, 1.0 ]
+	
+	position_one = [ 1.0, 1.0, 1.0, 0.0 ]
+	
+	glNewList(YELLOWMAT, GL_COMPILE)
+	glMaterial(GL_FRONT, GL_DIFFUSE, yellow_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, yellow_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, 64.0)
+	glEndList()
+	
+	glNewList(BLUEMAT, GL_COMPILE)
+	glMaterial(GL_FRONT, GL_DIFFUSE, blue_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, blue_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, 45.0)
+	glEndList()
+	
+	glLight(GL_LIGHT0, GL_POSITION, position_one)
+	
+	glEnable(GL_LIGHT0)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_DEPTH_TEST)
+	
+	glClearStencil(0x0)
+	glEnable(GL_STENCIL_TEST)
+end
+
+#  Draw a sphere in a diamond-shaped section in the
+#  middle of a window with 2 tori.
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	# draw blue sphere where the stencil is 1
+	glStencilFunc(GL_EQUAL, 0x1, 0x1)
+	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)
+	glCallList(BLUEMAT)
+	glutSolidSphere(0.5, 15, 15)
+	
+	# draw the tori where the stencil is not 1
+	glStencilFunc(GL_NOTEQUAL, 0x1, 0x1)
+	glPushMatrix()
+	glRotate(45.0, 0.0, 0.0, 1.0)
+	glRotate(45.0, 0.0, 1.0, 0.0)
+	glCallList(YELLOWMAT)
+	glutSolidTorus(0.275, 0.85, 15, 15)
+	glPushMatrix()
+	glRotate(90.0, 1.0, 0.0, 0.0)
+	glutSolidTorus(0.275, 0.85, 15, 15)
+	glPopMatrix()
+	glPopMatrix()
+
+	glutSwapBuffers()
+end
+
+#  Whenever the window is reshaped, redefine the 
+#  coordinate system and redraw the stencil area.
+myReshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	
+	# create a diamond shaped stencil area
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if w<=h
+		gluOrtho2D(-3.0, 3.0, -3.0*h/w, 3*h/w)
+	else
+		gluOrtho2D(-3.0*w/h, 3.0*w/h, -3.0, 3)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	
+	glClear(GL_STENCIL_BUFFER_BIT)
+	glStencilFunc(GL_ALWAYS, 0x1, 0x1)
+	glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE)
+	glBegin(GL_QUADS)
+	glVertex2f(-1.0, 0.0)
+	glVertex2f(0.0, 1.0)
+	glVertex2f(1.0, 0.0)
+	glVertex2f(0.0, -1.0)
+	glEnd()
+	
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	GLU.Perspective(45.0,  w.to_f/h.to_f, 3.0, 7.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -5.0)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+#  Main Loop
+#  Open window with initial window size, title bar, 
+#  RGB display mode, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/stroke.rb 0.60.0-0ubuntu3/examples/RedBook/stroke.rb
--- 0.32f-2.1/examples/RedBook/stroke.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/stroke.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,167 @@
+#
+# 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.
+#
+# stroke.c 
+# This program demonstrates some characters of a 
+# stroke (vector) font.  The characters are represented
+# by display lists, which are given numbers which 
+# correspond to the ASCII values of the characters.
+# Use of glCallLists() is demonstrated.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+PT=1
+STROKE=2
+END_=3
+
+Adata = [
+	[[0, 0], PT], [[0, 9], PT], [[1, 10], PT], [[4, 10], PT], 
+	[[5, 9], PT], [[5, 0], STROKE], [[0, 5], PT], [[5, 5], END_]
+]
+
+Edata = [
+	[[5, 0], PT], [[0, 0], PT], [[0, 10], PT], [[5, 10], STROKE],
+	[[0, 5], PT], [[4, 5], END_]
+]
+
+Pdata = [
+	[[0, 0], PT], [[0, 10], PT],  [[4, 10], PT], [[5, 9], PT], [[5, 6], PT], 
+	[[4, 5], PT], [[0, 5], END_]
+]
+
+Rdata = [
+	[[0, 0], PT], [[0, 10], PT],  [[4, 10], PT], [[5, 9], PT], [[5, 6], PT], 
+	[[4, 5], PT], [[0, 5], STROKE], [[3, 5], PT], [[5, 0], END_]
+]
+
+Sdata = [
+	[[0, 1], PT], [[1, 0], PT], [[4, 0], PT], [[5, 1], PT], [[5, 4], PT], 
+	[[4, 5], PT], [[1, 5], PT], [[0, 6], PT], [[0, 9], PT], [[1, 10], PT], 
+	[[4, 10], PT], [[5, 9], END_]
+]
+
+# drawLetter() interprets the instructions from the array
+# for that letter and renders the letter with line segments.
+def drawLetter(l)
+	i = 0
+	glBegin(GL_LINE_STRIP)
+	while true
+		case (l[i][1])
+			when PT
+				glVertex(l[i][0])
+			when STROKE
+				glVertex(l[i][0])
+				glEnd()
+				glBegin(GL_LINE_STRIP)
+			when END_
+				glVertex(l[i][0])
+				glEnd()
+				glTranslate(8.0, 0.0, 0.0)
+				return
+		end
+		i += 1
+	end
+end
+
+# Create a display list for each of 6 characters
+def myinit
+	glShadeModel(GL_FLAT)
+	
+	base = glGenLists(128)
+	glListBase(base)
+	glNewList(base+'A'[0], GL_COMPILE); drawLetter(Adata); glEndList()
+	glNewList(base+'E'[0], GL_COMPILE); drawLetter(Edata); glEndList()
+	glNewList(base+'P'[0], GL_COMPILE); drawLetter(Pdata); glEndList()
+	glNewList(base+'R'[0], GL_COMPILE); drawLetter(Rdata); glEndList()
+	glNewList(base+'S'[0], GL_COMPILE); drawLetter(Sdata); glEndList()
+	glNewList(base+' '[0], GL_COMPILE); glTranslate(8.0, 0.0, 0.0); glEndList()
+end
+
+$test1 = "A SPARE SERAPE APPEARS AS"
+$test2 = "APES PREPARE RARE PEPPERS"
+
+def printStrokedString(s)
+	glCallLists(GL_BYTE,s)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glPushMatrix()
+	glScale(2.0, 2.0, 2.0)
+	glTranslate(10.0, 30.0, 0.0)
+	printStrokedString($test1)
+	glPopMatrix()
+	glPushMatrix()
+	glScale(2.0, 2.0, 2.0)
+	glTranslate(10.0, 13.0, 0.0)
+	printStrokedString($test2)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, w, 0.0, h, -1.0, 1.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(440, 120)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/surface.rb 0.60.0-0ubuntu3/examples/RedBook/surface.rb
--- 0.32f-2.1/examples/RedBook/surface.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/surface.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,166 @@
+#
+# (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.
+#
+#
+# surface.c
+# This program draws a NURBS surface in the shape of a 
+# symmetrical hill.
+#
+require 'opengl'
+include Gl,Glu,Glut
+
+$ctlpoints = Array.new(4).collect { Array.new(4).collect { Array.new(3, nil) } } # 4*4*3 array
+$showPoints = 0
+
+$theNurb = nil
+
+# Initializes the control points of the surface to a small hill.
+# The control points range from -3 to +3 in x, y, and z
+def init_surface
+	for u in 0..3
+		for v in 0..3
+			$ctlpoints[u][v][0] = 2.0*(u - 1.5)
+			$ctlpoints[u][v][1] = 2.0*(v - 1.5)
+			
+			if ( (u == 1 || u == 2) && (v == 1 || v == 2))
+				$ctlpoints[u][v][2] = 3
+			else
+				$ctlpoints[u][v][2] = -3
+			end
+		end
+	end
+end			
+			
+# Initialize material property and depth buffer.
+def myinit
+	mat_diffuse = [ 0.7, 0.7, 0.7, 1.0 ]
+	mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]
+	mat_shininess = [ 100.0 ]
+	
+	glClearColor(0.0, 0.0, 0.0, 1.0)
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse)
+	glMaterial(GL_FRONT, GL_SPECULAR, mat_specular)
+	glMaterial(GL_FRONT, GL_SHININESS, mat_shininess)
+	
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glDepthFunc(GL_LESS)
+	glEnable(GL_DEPTH_TEST)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	
+	init_surface()
+	
+	$theNurb = gluNewNurbsRenderer()
+	gluNurbsProperty($theNurb, GLU_SAMPLING_TOLERANCE, 25.0)
+	gluNurbsProperty($theNurb, GLU_DISPLAY_MODE, GLU_FILL)
+end
+
+display = Proc.new do
+	knots = [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0]
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	glPushMatrix()
+	glRotate(330.0, 1.0,0.0,0.0)
+	glScale(0.5, 0.5, 0.5)
+	
+	gluBeginSurface($theNurb)
+	gluNurbsSurface($theNurb, 
+		8, knots,
+		8, knots,
+		4 * 3,
+		3,
+		$ctlpoints.flatten, 
+		4, 4,
+		GL_MAP2_VERTEX_3)
+	gluEndSurface($theNurb)
+	
+	if($showPoints==1)
+		glPointSize(5.0)
+		glDisable(GL_LIGHTING)
+		glColor(1.0, 1.0, 0.0)
+		glBegin(GL_POINTS)
+		for i in 0..3
+			for j in 0..3
+				glVertex($ctlpoints[i][j][0], $ctlpoints[i][j][1], $ctlpoints[i][j][2])
+			end
+		end
+		glEnd()
+		glEnable(GL_LIGHTING)
+	end
+		
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(45.0, w/h, 3.0, 8.0)
+	
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -5.0)
+end
+
+menu = Proc.new do |value|
+	$showPoints = value
+	glutPostRedisplay()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+myinit()
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutCreateMenu(menu)
+glutAddMenuEntry("Show control points", 1)
+glutAddMenuEntry("Hide control points", 0)
+glutAttachMenu(GLUT_RIGHT_BUTTON)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/teaambient.rb 0.60.0-0ubuntu3/examples/RedBook/teaambient.rb
--- 0.32f-2.1/examples/RedBook/teaambient.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/teaambient.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,132 @@
+#
+# 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.
+#
+# teaambient.c
+# This program renders three lighted, shaded teapots, with
+# different ambient values.
+require 'opengl'
+include Gl,Glu,Glut
+
+# Initialize light source and lighting model.
+def myinit
+	light_ambient = [0.0, 0.0, 0.0, 1.0]
+	light_diffuse = [1.0, 1.0, 1.0, 1.0]
+	light_specular = [1.0, 1.0, 1.0, 1.0]
+	# light_position is NOT default value
+	light_position = [1.0, 0.0, 0.0, 0.0]
+	global_ambient = [0.75, 0.75, 0.75, 1.0]
+	
+	glLight(GL_LIGHT0, GL_AMBIENT, light_ambient)
+	glLight(GL_LIGHT0, GL_DIFFUSE, light_diffuse)
+	glLight(GL_LIGHT0, GL_SPECULAR, light_specular)
+	glLight(GL_LIGHT0, GL_POSITION, light_position)
+	
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, global_ambient)
+	
+	glFrontFace(GL_CW)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	glDepthFunc(GL_LESS)
+	glEnable(GL_DEPTH_TEST)
+end
+
+display = proc do
+	low_ambient = [0.1, 0.1, 0.1, 1.0]
+	more_ambient = [0.4, 0.4, 0.4, 1.0]
+	most_ambient = [1.0, 1.0, 1.0, 1.0]
+	
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	
+	# material has small ambient reflection
+	glMaterial(GL_FRONT, GL_AMBIENT, low_ambient)
+	glMaterial(GL_FRONT, GL_SHININESS, 40.0)
+	glPushMatrix()
+	glTranslate(0.0, 2.0, 0.0)
+	glutSolidTeapot(1.0)
+	glPopMatrix()
+	
+	# material has moderate ambient reflection
+	glMaterial(GL_FRONT, GL_AMBIENT, more_ambient)
+	glPushMatrix()
+	glTranslate(0.0, 0.0, 0.0)
+	glutSolidTeapot(1.0)
+	glPopMatrix()
+	
+	# material has large ambient reflection
+	glMaterial(GL_FRONT, GL_AMBIENT, most_ambient)
+	glPushMatrix()
+	glTranslate(0.0, -2.0, 0.0)
+	glutSolidTeapot(1.0)
+	glPopMatrix()
+	glFlush()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-4.0, 4.0, -4.0 *  h /  w, 4.0 *  h / w, -10.0, 10.0)
+	else
+		glOrtho(-4.0 *  w /  h, 4.0 *  w /  h, -4.0, 4.0, -10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+# Main Loop
+# Open window with initial window size, title bar, 
+# RGBA display mode, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/teapots.rb 0.60.0-0ubuntu3/examples/RedBook/teapots.rb
--- 0.32f-2.1/examples/RedBook/teapots.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/teapots.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,182 @@
+#
+# 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.
+#
+# teapots.c
+# This program demonstrates lots of material properties.
+# A single light source illuminates the objects.
+require 'opengl'
+include Gl,Glu,Glut
+
+# Initialize depth buffer, projection matrix, light source, and lighting
+# model.  Do not specify a material property here.
+def myinit
+	ambient = [0.0, 0.0, 0.0, 1.0]
+	diffuse = [1.0, 1.0, 1.0, 1.0]
+	position = [0.0, 3.0, 3.0, 0.0]
+	
+	lmodel_ambient = [0.2, 0.2, 0.2, 1.0]
+	local_view = [0.0]
+	
+	glLight(GL_LIGHT0, GL_AMBIENT, ambient)
+	glLight(GL_LIGHT0, GL_DIFFUSE, diffuse)
+	glLight(GL_LIGHT0, GL_POSITION, position)
+	glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient)
+	glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
+	
+	glFrontFace(GL_CW)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	glEnable(GL_DEPTH_TEST)
+	glDepthFunc(GL_LESS)
+end
+
+# Move object into position.  Use 3rd through 12th parameters to specify the
+# material property.  Draw a teapot.
+def renderTeapot(x, y, ambr, ambg, ambb, difr, difg, difb, specr, specg, specb, shine)
+	mat = []
+	glPushMatrix()
+	glTranslate(x, y, 0.0)
+	mat[0] = ambr
+	mat[1] = ambg
+	mat[2] = ambb
+	mat[3] = 1.0
+	glMaterial(GL_FRONT, GL_AMBIENT, mat)
+	mat[0] = difr
+	mat[1] = difg
+	mat[2] = difb
+	glMaterial(GL_FRONT, GL_DIFFUSE, mat)
+	mat[0] = specr
+	mat[1] = specg
+	mat[2] = specb
+	glMaterial(GL_FRONT, GL_SPECULAR, mat)
+	glMaterial(GL_FRONT, GL_SHININESS, shine * 128.0)
+	glutSolidTeapot(1.0)
+	glPopMatrix()
+end
+
+# First column:  emerald, jade, obsidian, pearl, ruby, turquoise
+# 2nd column:  brass, bronze, chrome, copper, gold, silver
+# 3rd column:  black, cyan, green, red, white, yellow plastic
+# 4th column:  black, cyan, green, red, white, yellow rubber
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	renderTeapot(2.0, 17.0, 0.0215, 0.1745, 0.0215,
+		0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6)
+	renderTeapot(2.0, 14.0, 0.135, 0.2225, 0.1575,
+		0.54, 0.89, 0.63, 0.316228, 0.316228, 0.316228, 0.1)
+	renderTeapot(2.0, 11.0, 0.05375, 0.05, 0.06625,
+		0.18275, 0.17, 0.22525, 0.332741, 0.328634, 0.346435, 0.3)
+	renderTeapot(2.0, 8.0, 0.25, 0.20725, 0.20725,
+		1, 0.829, 0.829, 0.296648, 0.296648, 0.296648, 0.088)
+	renderTeapot(2.0, 5.0, 0.1745, 0.01175, 0.01175,
+		0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6)
+	renderTeapot(2.0, 2.0, 0.1, 0.18725, 0.1745,
+		0.396, 0.74151, 0.69102, 0.297254, 0.30829, 0.306678, 0.1)
+	renderTeapot(6.0, 17.0, 0.329412, 0.223529, 0.027451,
+		0.780392, 0.568627, 0.113725, 0.992157, 0.941176, 0.807843,
+		0.21794872)
+	renderTeapot(6.0, 14.0, 0.2125, 0.1275, 0.054,
+		0.714, 0.4284, 0.18144, 0.393548, 0.271906, 0.166721, 0.2)
+	renderTeapot(6.0, 11.0, 0.25, 0.25, 0.25,
+		0.4, 0.4, 0.4, 0.774597, 0.774597, 0.774597, 0.6)
+	renderTeapot(6.0, 8.0, 0.19125, 0.0735, 0.0225,
+		0.7038, 0.27048, 0.0828, 0.256777, 0.137622, 0.086014, 0.1)
+	renderTeapot(6.0, 5.0, 0.24725, 0.1995, 0.0745,
+		0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4)
+	renderTeapot(6.0, 2.0, 0.19225, 0.19225, 0.19225,
+		0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4)
+	renderTeapot(10.0, 17.0, 0.0, 0.0, 0.0, 0.01, 0.01, 0.01,
+		0.50, 0.50, 0.50, 0.25)
+	renderTeapot(10.0, 14.0, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392,
+		0.50196078, 0.50196078, 0.50196078, 0.25)
+	renderTeapot(10.0, 11.0, 0.0, 0.0, 0.0,
+		0.1, 0.35, 0.1, 0.45, 0.55, 0.45, 0.25)
+	renderTeapot(10.0, 8.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0,
+		0.7, 0.6, 0.6, 0.25)
+	renderTeapot(10.0, 5.0, 0.0, 0.0, 0.0, 0.55, 0.55, 0.55,
+		0.70, 0.70, 0.70, 0.25)
+	renderTeapot(10.0, 2.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0,
+		0.60, 0.60, 0.50, 0.25)
+	renderTeapot(14.0, 17.0, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01,
+		0.4, 0.4, 0.4, 0.078125)
+	renderTeapot(14.0, 14.0, 0.0, 0.05, 0.05, 0.4, 0.5, 0.5,
+		0.04, 0.7, 0.7, 0.078125)
+	renderTeapot(14.0, 11.0, 0.0, 0.05, 0.0, 0.4, 0.5, 0.4,
+		0.04, 0.7, 0.04, 0.078125)
+	renderTeapot(14.0, 8.0, 0.05, 0.0, 0.0, 0.5, 0.4, 0.4,
+		0.7, 0.04, 0.04, 0.078125)
+	renderTeapot(14.0, 5.0, 0.05, 0.05, 0.05, 0.5, 0.5, 0.5,
+		0.7, 0.7, 0.7, 0.078125)
+	renderTeapot(14.0, 2.0, 0.05, 0.05, 0.0, 0.5, 0.5, 0.4,
+		0.7, 0.7, 0.04, 0.078125)
+	glutSwapBuffers()
+end
+
+myReshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(0.0, 16.0, 0.0, 16.0 *  h.to_f / w,	-10.0, 10.0)
+	else
+		glOrtho(0.0, 16.0 * w.to_f / h, 0.0, 16.0,-10.0, 10.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+# Main Loop Open window with initial window size, title bar, RGBA display
+# mode, and handle input events.
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/tess.rb 0.60.0-0ubuntu3/examples/RedBook/tess.rb
--- 0.32f-2.1/examples/RedBook/tess.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/tess.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,183 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# tess.c
+# This program demonstrates polygon tessellation.
+# Two tesselated objects are drawn.  The first is a
+# rectangle with a triangular hole.  The second is a
+# smooth shaded, self-intersecting star.
+#
+# Note the exterior rectangle is drawn with its vertices
+# in counter-clockwise order, but its interior clockwise.
+# Note the combineCallback is needed for the self-intersecting
+# star.  Also note that removing the TessProperty for the 
+# star will make the interior unshaded (WINDING_ODD).
+require 'opengl'
+include Gl,Glu,Glut
+
+$startList = nil
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glCallList($startList)
+	glCallList($startList + 1)
+	glutSwapBuffers()
+end
+
+$beginCallback = proc do |which|
+	glBegin(which)
+end
+
+$errorCallback = proc do |errorCode|
+	print "Tessellation Error: #{gluErrorString(errorCode)}"
+	exit(0)
+end
+
+$endCallback = proc do
+	glEnd()
+end
+
+$vertexCallback = proc do |vertex|
+	glColor(vertex[3], vertex[4], vertex[5])
+	glVertex(vertex[0], vertex[1], vertex[2])
+end
+
+# combineCallback is used to create a new vertex when edges
+# intersect.  coordinate location is trivial to calculate,
+# but weight[4] may be used to average color, normal, or texture
+# coordinate data.  In this program, color is weighted.
+$combineCallback = proc do |coords, vertex_data, weight|
+	vertex = []
+	vertex[0] = coords[0]
+	vertex[1] = coords[1]
+	vertex[2] = coords[2]
+	for i in 3...6
+		vertex[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[1][i] + weight[2] * vertex_data[2][i] + weight[3] * vertex_data[3][i]
+	end
+	vertex
+end
+
+def init
+	rect = [[50.0, 50.0, 0.0],
+		[200.0, 50.0, 0.0],
+		[200.0, 200.0, 0.0],
+		[50.0, 200.0, 0.0]]
+	tri = [[75.0, 75.0, 0.0],
+		[125.0, 175.0, 0.0],
+		[175.0, 75.0, 0.0]]
+	star= [[250.0, 50.0, 0.0, 1.0, 0.0, 1.0],
+		[325.0, 200.0, 0.0, 1.0, 1.0, 0.0],
+		[400.0, 50.0, 0.0, 0.0, 1.0, 1.0],
+		[250.0, 150.0, 0.0, 1.0, 0.0, 0.0],
+		[400.0, 150.0, 0.0, 0.0, 1.0, 0.0]]
+
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	
+	$startList = glGenLists(2)
+	
+	tobj = gluNewTess()
+	gluTessCallback(tobj, GLU_TESS_VERTEX, proc do |v| glVertex(v) end )
+	gluTessCallback(tobj, GLU_TESS_BEGIN, $beginCallback)
+	gluTessCallback(tobj, GLU_TESS_END, $endCallback)
+	gluTessCallback(tobj, GLU_TESS_ERROR, $errorCallback)
+
+	# rectangle with triangular hole inside
+	glNewList($startList, GL_COMPILE)
+	glShadeModel(GL_FLAT)    
+	gluTessBeginPolygon(tobj, nil)
+	gluTessBeginContour(tobj)
+	gluTessVertex(tobj, rect[0], rect[0])
+	gluTessVertex(tobj, rect[1], rect[1])
+	gluTessVertex(tobj, rect[2], rect[2])
+	gluTessVertex(tobj, rect[3], rect[3])
+	gluTessEndContour(tobj)
+	gluTessBeginContour(tobj)
+	gluTessVertex(tobj, tri[0], tri[0])
+	gluTessVertex(tobj, tri[1], tri[1])
+	gluTessVertex(tobj, tri[2], tri[2])
+	gluTessEndContour(tobj)
+	gluTessEndPolygon(tobj)
+	glEndList()
+
+	gluTessCallback(tobj, GLU_TESS_VERTEX, $vertexCallback)
+	gluTessCallback(tobj, GLU_TESS_BEGIN, $beginCallback)
+	gluTessCallback(tobj, GLU_TESS_END, $endCallback)
+	gluTessCallback(tobj, GLU_TESS_ERROR, $errorCallback)
+	gluTessCallback(tobj, GLU_TESS_COMBINE, $combineCallback)
+
+
+# smooth shaded, self-intersecting star
+	glNewList($startList + 1, GL_COMPILE)
+	glShadeModel(GL_SMOOTH)    
+	gluTessProperty(tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE)
+	gluTessBeginPolygon(tobj, nil)
+	gluTessBeginContour(tobj)
+	gluTessVertex(tobj, star[0], star[0])
+	gluTessVertex(tobj, star[1], star[1])
+	gluTessVertex(tobj, star[2], star[2])
+	gluTessVertex(tobj, star[3], star[3])
+	gluTessVertex(tobj, star[4], star[4])
+	gluTessEndContour(tobj)
+	gluTessEndPolygon(tobj)
+	glEndList()
+	gluDeleteTess(tobj)
+end
+
+reshape = proc do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluOrtho2D(0.0, w, 0.0, h)
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/texbind.rb 0.60.0-0ubuntu3/examples/RedBook/texbind.rb
--- 0.32f-2.1/examples/RedBook/texbind.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/texbind.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,147 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+
+# texbind.c
+# This program demonstrates using glBindTexture() by 
+# creating and managing two textures.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+CheckImageWidth = 64
+CheckImageHeight = 64
+$checkImage = []
+$otherImage = []
+
+$texName = []
+
+def makeCheckImages
+	for i in (0..CheckImageHeight-1)
+		for j in (0..CheckImageWidth-1)
+			if ((i&0x8==0)!=(j&0x8==0)) then tmp = 1 else tmp=0 end
+			#c = ((((i&0x8)==0)^((j&0x8))==0))*255
+			c = tmp * 255
+			$checkImage[i*CheckImageWidth*4+j*4+0] = c
+			$checkImage[i*CheckImageWidth*4+j*4+1] = c
+			$checkImage[i*CheckImageWidth*4+j*4+2] = c
+			$checkImage[i*CheckImageWidth*4+j*4+3] = 255
+			#c = ((((i&0x10)==0)^((j&0x10))==0))*255
+			if ((i&0x10==0)!=(j&0x10==0)) then tmp = 1 else tmp=0 end
+			c = tmp * 255
+			$otherImage[i*CheckImageWidth*4+j*4+0] = c
+			$otherImage[i*CheckImageWidth*4+j*4+1] = 0
+			$otherImage[i*CheckImageWidth*4+j*4+2] = 0
+			$otherImage[i*CheckImageWidth*4+j*4+3] = 255
+		end
+	end
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+	glEnable(GL_DEPTH_TEST)
+	
+	makeCheckImages()
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+	
+	$texName = glGenTextures(2)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST)
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth,
+	CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,	$checkImage.pack("C*"))
+	
+	glBindTexture(GL_TEXTURE_2D, $texName[1])
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
+	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth, CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 
+		$otherImage.pack("C*"))
+	glEnable(GL_TEXTURE_2D)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	glBegin(GL_QUADS)
+	glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0)
+	glTexCoord(0.0, 1.0); glVertex(-2.0, 1.0, 0.0)
+	glTexCoord(1.0, 1.0); glVertex(0.0, 1.0, 0.0)
+	glTexCoord(1.0, 0.0); glVertex(0.0, -1.0, 0.0)
+	glEnd()
+	glBindTexture(GL_TEXTURE_2D, $texName[1])
+	glBegin(GL_QUADS)
+	glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0)
+	glTexCoord(0.0, 1.0); glVertex(1.0, 1.0, 0.0)
+	glTexCoord(1.0, 1.0); glVertex(2.41421, 1.0, -1.41421)
+	glTexCoord(1.0, 0.0); glVertex(2.41421, -1.0, -1.41421)
+	glEnd()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluPerspective(60.0, w/h, 1.0, 30.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -3.6)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+# main
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/texgen.rb 0.60.0-0ubuntu3/examples/RedBook/texgen.rb
--- 0.32f-2.1/examples/RedBook/texgen.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/texgen.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,169 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# texgen.c
+# This program draws a texture mapped teapot with 
+# automatically generated texture coordinates.  The
+# texture is rendered as stripes on the teapot.
+# Initially, the object is drawn with texture coordinates
+# based upon the object coordinates of the vertex
+# and distance from the plane x = 0.  Pressing the 'e'
+# key changes the coordinate generation to eye coordinates
+# of the vertex.  Pressing the 'o' key switches it back
+# to the object coordinates.  Pressing the 's' key 
+# changes the plane to a slanted one (x + y + z = 0).
+# Pressing the 'x' key switches it back to x = 0.
+
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+StripeImageWidth =  32
+$stripeImage = []
+
+$texName
+
+def makeStripeImage
+	for j in (0..StripeImageWidth-1)
+		$stripeImage[4*j] = if (j<=4) then 255 else 0 end
+		$stripeImage[4*j+1] = if (j>4) then 255 else 0 end
+		$stripeImage[4*j+2] = 0
+		$stripeImage[4*j+3] = 255
+	end
+end
+
+# planes for texture coordinate generation
+$xequalzero = [1.0, 0.0, 0.0, 0.0]
+$slanted = [1.0, 1.0, 1.0, 0.0]
+$currentCoeff = nil
+$currentPlane = nil
+$currentGenMode = nil
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glEnable(GL_DEPTH_TEST)
+	glShadeModel(GL_SMOOTH)
+	
+	makeStripeImage()
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+	
+	$texName = glGenTextures(1)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, StripeImageWidth, 1, 0,
+		GL_RGBA, GL_UNSIGNED_BYTE, $stripeImage.pack("C*"))
+	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE)
+	$currentCoeff = $xequalzero
+	$currentGenMode = GL_OBJECT_LINEAR
+	$currentPlane = GL_OBJECT_PLANE
+	glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode)
+	glTexGen(GL_S, $currentPlane, $currentCoeff)
+	
+	glEnable(GL_TEXTURE_GEN_S)
+	glEnable(GL_TEXTURE_2D)
+	glEnable(GL_CULL_FACE)
+	glEnable(GL_LIGHTING)
+	glEnable(GL_LIGHT0)
+	glEnable(GL_AUTO_NORMAL)
+	glEnable(GL_NORMALIZE)
+	glFrontFace(GL_CW)
+	glCullFace(GL_BACK)
+	glMaterial(GL_FRONT, GL_SHININESS, 64.0)
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glPushMatrix()
+	glRotate(45.0, 0.0, 0.0, 1.0)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	glutSolidTeapot(2.0)
+	glPopMatrix()
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-3.5, 3.5, -3.5*h/w,3.5*h/w, -3.5, 3.5)
+	else
+		glOrtho(-3.5*w/h, 3.5*w/h, -3.5, 3.5, -3.5, 3.5)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?e,?E
+			$currentGenMode = GL_EYE_LINEAR
+			$currentPlane = GL_EYE_PLANE
+			glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode)
+			glTexGen(GL_S, $currentPlane, $currentCoeff)
+			glutPostRedisplay()
+		when ?o, ?O
+			$currentGenMode = GL_OBJECT_LINEAR
+			$currentPlane = GL_OBJECT_PLANE
+			glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode)
+			glTexGen(GL_S, $currentPlane, $currentCoeff)
+			glutPostRedisplay()
+		when ?s,?S
+			$currentCoeff = $slanted
+			glTexGen(GL_S, $currentPlane, $currentCoeff)
+			glutPostRedisplay()
+		when ?x,?X
+			$currentCoeff = $xequalzero
+			glTexGen(GL_S, $currentPlane, $currentCoeff)
+			glutPostRedisplay()
+		when ?\e
+			exit(0)
+	end
+end
+
+# main
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/texturesurf.rb 0.60.0-0ubuntu3/examples/RedBook/texturesurf.rb
--- 0.32f-2.1/examples/RedBook/texturesurf.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/texturesurf.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,128 @@
+#
+# 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.
+#
+# texturesurf.c
+# This program uses evaluators to generate a curved
+# surface and automatically generated texture coordinates.
+require 'opengl'
+include Gl,Glu,Glut
+
+$ctrlpoints = [
+	[[ -1.5, -1.5, 4.0], [ -0.5, -1.5, 2.0], [0.5, -1.5, -1.0], [1.5, -1.5, 2.0]], 
+	[[ -1.5, -0.5, 1.0], [ -0.5, -0.5, 3.0], [0.5, -0.5, 0.0], [1.5, -0.5, -1.0]], 
+	[[ -1.5, 0.5, 4.0], [ -0.5, 0.5, 0.0], [0.5, 0.5, 3.0], [1.5, 0.5, 4.0]], 
+	[[ -1.5, 1.5, -2.0], [ -0.5, 1.5, -2.0], [0.5, 1.5, 0.0], [1.5, 1.5, -1.0]]
+].flatten
+
+$texpts = [[[0.0, 0.0], [0.0, 1.0]], [[1.0, 0.0], [1.0, 1.0]]].flatten
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glColor(1.0, 1.0, 1.0)
+	glEvalMesh2(GL_FILL, 0, 20, 0, 20)
+	glutSwapBuffers()
+end
+
+ImageWidth=64
+ImageHeight=64
+$image = []
+
+def makeImage
+	for i in 0...ImageWidth
+		ti = 2.0*Math::PI*i/ImageWidth.to_f
+		for j in 0...ImageHeight
+			tj = 2.0*Math::PI*j/ImageHeight.to_f
+
+			$image[3*(ImageHeight*i+j)] =  127*(1.0+Math::sin(ti))
+			$image[3*(ImageHeight*i+j)+1] =  127*(1.0+Math::cos(2*tj))
+			$image[3*(ImageHeight*i+j)+2] =  127*(1.0+Math::cos(ti+tj))
+		end
+	end
+end
+
+def myinit
+	glMap2d(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints)
+	glMap2d(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, $texpts)
+	glEnable(GL_MAP2_TEXTURE_COORD_2)
+	glEnable(GL_MAP2_VERTEX_3)
+	glMapGrid2d(20, 0.0, 1.0, 20, 0.0, 1.0)
+	makeImage()
+	glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
+	glTexImage2D(GL_TEXTURE_2D, 0, 3, ImageWidth, ImageHeight, 0,
+		GL_RGB, GL_UNSIGNED_BYTE, $image.pack("C*"))
+	glEnable(GL_TEXTURE_2D)
+	glEnable(GL_DEPTH_TEST)
+	glEnable(GL_NORMALIZE)
+	glShadeModel(GL_FLAT)
+end
+
+myReshape = proc do|w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h)
+		glOrtho(-4.0, 4.0, -4.0*h.to_f/w, 4.0*h.to_f/w, -4.0, 4.0)
+	else
+		glOrtho(-4.0*w.to_f/h, 4.0*w.to_f/h, -4.0, 4.0, -4.0, 4.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glRotate(85.0, 1.0, 1.0, 1.0)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+myinit()
+glutReshapeFunc(myReshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/varray.rb 0.60.0-0ubuntu3/examples/RedBook/varray.rb
--- 0.32f-2.1/examples/RedBook/varray.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/varray.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,159 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# varray.c
+# This program demonstrates vertex arrays.
+require 'opengl'
+include Gl,Glu,Glut
+
+POINTER=1
+INTERLEAVED=2
+
+DRAWARRAY=1
+ARRAYELEMENT=2
+DRAWELEMENTS=3
+
+$setupMethod = POINTER
+$derefMethod = DRAWARRAY
+
+def setupPointers
+	$vertices = [25, 25,
+		100, 325,
+		175, 25,
+		175, 325,
+		250, 25,
+		325, 325].pack("i*")
+	$colors = [1.0, 0.2, 0.2,
+		0.2, 0.2, 1.0,
+		0.8, 1.0, 0.2,
+		0.75, 0.75, 0.75,
+		0.35, 0.35, 0.35,
+		0.5, 0.5, 0.5].pack("f*")
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glEnableClientState(GL_COLOR_ARRAY)
+	
+	glVertexPointer(2, GL_INT, 0, $vertices)
+	glColorPointer(3, GL_FLOAT, 0, $colors)
+end
+
+def  setupInterleave
+	$intertwined =
+	[1.0, 0.2, 1.0, 100.0, 100.0, 0.0,
+		1.0, 0.2, 0.2, 0.0, 200.0, 0.0,
+		1.0, 1.0, 0.2, 100.0, 300.0, 0.0,
+		0.2, 1.0, 0.2, 200.0, 300.0, 0.0,
+		0.2, 1.0, 1.0, 300.0, 200.0, 0.0,
+		0.2, 0.2, 1.0, 200.0, 100.0, 0.0].pack("f*")
+	
+	glInterleavedArrays(GL_C3F_V3F, 0, $intertwined)
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_SMOOTH)
+	setupPointers()
+end
+
+display = proc do
+	glClear(GL_COLOR_BUFFER_BIT)
+	if ($derefMethod == DRAWARRAY) 
+		glDrawArrays(GL_TRIANGLES, 0, 6)
+	elsif ($derefMethod == ARRAYELEMENT)
+		glBegin(GL_TRIANGLES)
+		glArrayElement(2)
+		glArrayElement(3)
+		glArrayElement(5)
+		glEnd()
+	elsif ($derefMethod == DRAWELEMENTS)
+		$indices = [0, 1, 3, 4].pack("I*")
+		glDrawElements(GL_POLYGON, 4, GL_UNSIGNED_INT, $indices)
+	end
+	glutSwapBuffers()
+end
+
+reshape = proc do|w, h|
+	glViewport(0, 0, w, h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	gluOrtho2D(0.0, w, 0.0, h)
+end
+
+mouse = proc do |button, state, x, y|
+	case (button)
+		when GLUT_LEFT_BUTTON
+			if (state == GLUT_DOWN)
+				if ($setupMethod == POINTER)
+					$setupMethod = INTERLEAVED
+					setupInterleave()
+				elsif ($setupMethod == INTERLEAVED)
+					$setupMethod = POINTER
+					setupPointers()
+				end
+				glutPostRedisplay()
+			end
+		when GLUT_MIDDLE_BUTTON,GLUT_RIGHT_BUTTON
+			if (state == GLUT_DOWN)
+				if ($derefMethod == DRAWARRAY) 
+					$derefMethod = ARRAYELEMENT
+				elsif ($derefMethod == ARRAYELEMENT) 
+					$derefMethod = DRAWELEMENTS
+				elsif ($derefMethod == DRAWELEMENTS) 
+					$derefMethod = DRAWARRAY
+				end
+				glutPostRedisplay()
+			end
+	end
+end
+
+keyboard = proc do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit()
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(350, 350)
+glutInitWindowPosition(100, 100)
+glutCreateWindow()
+init()
+glutDisplayFunc(display) 
+glutReshapeFunc(reshape)
+glutMouseFunc(mouse)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/RedBook/wrap.rb 0.60.0-0ubuntu3/examples/RedBook/wrap.rb
--- 0.32f-2.1/examples/RedBook/wrap.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/RedBook/wrap.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,148 @@
+#
+# Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
+#
+# wrap.c
+# This program texture maps a checkerboard image onto
+# two rectangles.  This program demonstrates the wrapping
+# modes, if the texture coordinates fall outside 0.0 and 1.0.
+# Interaction: Pressing the 's' and 'S' keys switch the
+# wrapping between clamping and repeating for the s parameter.
+# The 't' and 'T' keys control the wrapping for the t parameter.
+# 
+# If running this program on OpenGL 1.0, texture objects are
+# not used.
+require 'opengl'
+require 'mathn'
+include Gl,Glu,Glut
+
+#	Create checkerboard texture
+CheckImageWidth=64
+CheckImageHeight=64
+$checkImage = []
+
+$texName = 0
+
+def makeCheckImage
+	for i in 0..CheckImageHeight-1
+		for j in 0..CheckImageWidth-1
+			c = if (((i&0x8)==0)!=((j&0x8)==0)) then 255 else 0 end
+			$checkImage[(i*CheckImageWidth+j)*4+0] = c
+			$checkImage[(i*CheckImageWidth+j)*4+1] = c
+			$checkImage[(i*CheckImageWidth+j)*4+2] = c
+			$checkImage[(i*CheckImageWidth+j)*4+3] = 255
+		end
+	end
+end
+
+def init
+	glClearColor(0.0, 0.0, 0.0, 0.0)
+	glShadeModel(GL_FLAT)
+	glEnable(GL_DEPTH_TEST)
+	
+	makeCheckImage()
+	glPixelStore(GL_UNPACK_ALIGNMENT, 1)
+	
+	$texName = glGenTextures(1)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+	glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth,
+		CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, $checkImage.pack("C*"))
+end
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glEnable(GL_TEXTURE_2D)
+	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
+	glBindTexture(GL_TEXTURE_2D, $texName[0])
+	
+	glBegin(GL_QUADS)
+	glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0)
+	glTexCoord(0.0, 3.0); glVertex(-2.0, 1.0, 0.0)
+	glTexCoord(3.0, 3.0); glVertex(0.0, 1.0, 0.0)
+	glTexCoord(3.0, 0.0); glVertex(0.0, -1.0, 0.0)
+	
+	glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0)
+	glTexCoord(0.0, 3.0); glVertex(1.0, 1.0, 0.0)
+	glTexCoord(3.0, 3.0); glVertex(2.41421, 1.0, -1.41421)
+	glTexCoord(3.0, 0.0); glVertex(2.41421, -1.0, -1.41421)
+	glEnd()
+	glutSwapBuffers()
+	glDisable(GL_TEXTURE_2D)
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	GLU.Perspective(60.0,  w/h, 1.0, 30.0)
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+	glTranslate(0.0, 0.0, -3.6)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?s
+			glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
+			glutPostRedisplay()
+		when ?S
+			glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+			glutPostRedisplay()
+		when ?t
+			glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)
+			glutPostRedisplay()
+		when ?T
+			glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
+			glutPostRedisplay()
+		when ?\e
+			exit(0)
+	end
+end
+
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+init()
+glutDisplayFunc(display)
+glutReshapeFunc(reshape)
+glutKeyboardFunc(keyboard)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/misc/OGLBench.rb 0.60.0-0ubuntu3/examples/misc/OGLBench.rb
--- 0.32f-2.1/examples/misc/OGLBench.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/OGLBench.rb	2007-12-26 16:50:14.000000000 +0000
@@ -0,0 +1,337 @@
+#!/usr/bin/env ruby
+
+# Purpose: Factor out and clean up common code from OpenGL benchmarks
+
+# Copyright (c) 2006, Geoff Broadwell; this module is released
+# as open source and may be distributed and modified under the terms
+# of either the Artistic License or the GNU General Public License,
+# in the same manner as Perl itself.  These licenses should have been
+# distributed to you as part of your Perl distribution, and can be
+# read using `perldoc perlartistic` and `perldoc perlgpl` respectively.
+
+# Conversion to ruby by Jan Dvorak <jan.dvorak@kraxnet.cz>
+
+module OGLBench
+
+require 'opengl'
+include Gl,Glu,Glut
+
+require 'getoptlong'
+
+$VERSION = '0.1.4'
+
+# Cached config and state, for simpler API
+$CACHED = {}
+
+# All resolutions listed in landscape orientation,
+# even for natively portrait devices such as handhelds.
+# Also, 'q' is annoyingly used as a prefix to mean both
+# 'quarter' and 'quad'.
+$KNOWN_RES = {
+    'qqvga'     => [  160,  120, 'Quarter Quarter VGA' ],
+    'palm'      => [  160,  160, 'Original Palm OS Devices' ],
+    'eigthvga'  => [  240,  160, '1/8 VGA' ],
+    'vcrntsc'   => [  240,  480, 'VCR NTSC' ],
+    'vcrpal'    => [  240,  576, 'VCR PAL' ],
+    'qcif'      => [  176,  144, 'Quarter CIF' ],
+    'gears'     => [  300,  300, 'OpenGL Gears Benchmark' ],
+    'glxgears'  => [  300,  300, 'OpenGL Gears Benchmark' ],
+    'cga'       => [  320,  200, 'IBM PC CGA (Color Graphics Adapter)' ],
+    'atarist16' => [  320,  200, 'Atari ST 16 Color' ],
+    'qvga'      => [  320,  240, 'Quarter VGA' ],
+    'modex'     => [  320,  240, 'VGA Mode X' ],
+    'pocketpc'  => [  320,  240, 'Common Pocket PCs' ],
+    'clie'      => [  320,  320, 'Sony Clie (Palm OS)' ],
+    'vcdntsc'   => [  352,  240, 'VCD (Video CD) NTSC' ],
+    'vcdpal'    => [  352,  288, 'VCD (Video CD) PAL' ],
+    'cif'       => [  352,  288, 'CIF (Common Image Format)' ],
+    'tweakvga'  => [  360,  480, 'Highest 256-color mode for VGA monitors' ],
+    'svhsntsc'  => [  400,  480, 'S-VHS NTSC' ],
+    'svhspal'   => [  400,  576, 'S-VHS PAL' ],
+    'tungsten'  => [  480,  320, 'Tungsten (Palm OS)' ],
+    'bwmac9'    => [  512,  342, 'Black & White 9" Mac' ],
+    'maclc'     => [  512,  384, 'Mac LC' ],
+    'ldntsc'    => [  560,  480, 'Laserdisc NTSC' ],
+    'ldpal'     => [  560,  576, 'Laserdisc PAL' ],
+    'atarist4'  => [  640,  200, 'Atari ST 4 Color' ],
+    'ega'       => [  640,  350, 'IBM PC-AT EGA (Extended Graphics Adapter)' ],
+    'atarist2'  => [  640,  400, 'Atari ST 2 Color' ],
+    'qcga'      => [  640,  400, 'Quad CGA' ],
+    'vga400'    => [  640,  400, 'VGA 400 Line' ],
+    'pgc'       => [  640,  480, 'Professional Graphics Controller' ],
+    'mcga'      => [  640,  480, 'IBM PS/2 MultiColor Graphics Adapter' ],
+    'vga'       => [  640,  480, 'IBM PS/2 VGA (Video Graphics Array)' ],
+    'edtv1'     => [  640,  480, 'EDTV 1' ],
+    'edtv2'     => [  704,  480, 'EDTV 2' ],
+    'hgc'       => [  720,  348, 'Hercules Graphics Controller' ],
+    'mda'       => [  720,  350, 'IBM PC MDA (Monochrome Display Adapter)' ],
+    'lisa'      => [  720,  360, 'Apple Lisa' ],
+    'dv525'     => [  720,  480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ],
+    'd1ntsc'    => [  720,  480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ],
+    'dvdntsc'   => [  720,  480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ],
+    'sp525'     => [  720,  540, 'Digital Video 525/60 (D-1 NTSC Square Pix)' ],
+    'spd1ntsc'  => [  720,  540, 'Digital Video 525/60 (D-1 NTSC Square Pix)' ],
+    'dv625'     => [  720,  576, 'Digital Video 625/50 (PAL, DVD PAL)' ],
+    'dvpal'     => [  720,  576, 'Digital Video 625/50 (PAL, DVD PAL)' ],
+    'dvdpal'    => [  720,  576, 'Digital Video 625/50 (PAL, DVD PAL)' ],
+    'ns525'     => [  768,  483, 'Non-Standard DV 525/60' ],
+    'sp625'     => [  768,  576, 'Square Pixel DV 625/50' ],
+    'wga'       => [  800,  480, 'Wide VGA' ],
+    'svga'      => [  800,  600, 'Super VGA' ],
+    'edtv3'     => [  852,  480, 'EDTV 3' ],
+    'ws480'     => [  854,  480, 'Wide Screen 480 Line' ],
+    'ns625'     => [  948,  576, 'Non-Standard DV 625/60' ],
+    'aacsict'   => [  960,  540, 'AACS Image Constraint Token, Degraded 1080' ],
+    'ws576'     => [ 1024,  576, 'Wide Screen 576 Line' ],
+    '8514'      => [ 1024,  768, 'IBM 8514/A' ],
+    '8514a'     => [ 1024,  768, 'IBM 8514/A' ],
+    'evga'      => [ 1024,  768, 'VESA Extended VGA' ],
+    'xga'       => [ 1024,  768, 'IBM XGA (eXtended Graphics Array)' ],
+    'nextcube'  => [ 1120,  832, 'NeXT Cube' ],
+    'apple1mp'  => [ 1152,  864, 'Apple "1 Megapixel"' ],
+    'xga+'      => [ 1152,  864, 'XGA+' ],
+    'olpcmono'  => [ 1200,  900, 'One Laptop Per Child Mono Mode (true res)' ],
+    'olpc'      => [ 1200,  900, 'One Laptop Per Child Mono Mode (true res)' ],
+    '720i'      => [ 1280,  720, 'HDTV 720 Line Interlaced' ],
+    '720p'      => [ 1280,  720, 'HDTV 720 Line Progressive' ],
+    'hd720'     => [ 1280,  720, 'HDTV 720 Line' ],
+    'xga43'     => [ 1280,  960, '4:3 XGA Alternative' ],
+    'xga960'    => [ 1280,  960, '4:3 XGA Alternative' ],
+    'sxga'      => [ 1280, 1024, 'Super XGA' ],
+    'wxga'      => [ 1366,  768, 'Wide XGA' ],
+    'wxga768'   => [ 1366,  768, 'Wide XGA' ],
+    'wsxga'     => [ 1440,  900, 'Wide Super XGA (Low Variant)' ],
+    'wsxga1'    => [ 1440,  900, 'Wide Super XGA (Low Variant)' ],
+    'wxga+'     => [ 1440,  900, 'Wide XGA+' ],
+    'sxga+'     => [ 1440, 1050, 'Super XGA+' ],
+    'wsxga2'    => [ 1600, 1024, 'Wide Super XGA (High Variant)' ],
+    'uxga'      => [ 1600, 1200, 'Ultra XGA' ],
+    'wsxga+'    => [ 1680, 1050, 'Wide Super XGA+' ],
+    'academy2k' => [ 1828, 1332, 'Digital Film Academy 1.375:1 @ 2K' ],
+    '1080i'     => [ 1920, 1080, 'HDTV 1080 Line Interlaced' ],
+    '1080p'     => [ 1920, 1080, 'HDTV 1080 Line Progressive' ],
+    'hd1080'    => [ 1920, 1080, 'HDTV 1080 Line' ],
+    'wuxga'     => [ 1920, 1200, 'Wide Ultra XGA' ],
+    'dc2k1'     => [ 1998, 1080, 'Digital Film Digital Cinema 1.85:1 @ 2K ' ],
+    'dc2k2'     => [ 2048,  858, 'Digital Film Digital Cinema 2.39:1 @ 2K ' ],
+    'eurohd'    => [ 2048, 1152, 'European HDTV' ],
+    'qxga'      => [ 2048, 1536, 'Quad XGA' ],
+    'wqxga'     => [ 2560, 1600, 'Wide Quad XGA' ],
+    'qsxga'     => [ 2560, 2048, 'Quad Super XGA' ],
+    'wqsxga'    => [ 3200, 2048, 'Wide Quad Super XGA' ],
+    'quxga'     => [ 3200, 2400, 'Quad Ultra XGA' ],
+    'academy4k' => [ 3656, 2664, 'Digital Film Academy 1.375:1 @ 4K' ],
+    'wquxga'    => [ 3840, 2400, 'Wide Quad Ultra XGA' ],
+    'dc4k1'     => [ 3996, 2160, 'Digital Film Digital Cinema 1.85:1 @ 4K ' ],
+    'dc4k2'     => [ 4096, 1714, 'Digital Film Digital Cinema 2.39:1 @ 4K ' ],
+    'hxga'      => [ 4096, 3072, 'Hexadecatuple XGA' ],
+    'whxga'     => [ 5120, 3200, 'Wide Hexadecatuple XGA' ],
+    'hsxga'     => [ 5120, 4096, 'Hexadecatuple Super XGA' ],
+    'whsxga'    => [ 6400, 4096, 'Wide Hexadecatuple Super XGA' ],
+    'huxga'     => [ 6400, 4800, 'Hexadecatuple Ultra XGA' ],
+    'whuxga'    => [ 7680, 4800, 'Wide Hexadecatuple Ultra XGA' ],
+}
+
+def OGLBench.w_h_from_geometry(geom) 
+	geometry = geom.downcase
+
+	return $~[1,2] if geometry =~ /^(\d+)x(\d+)$/
+
+  dims = $KNOWN_RES[geometry] || [0, 0]
+	dims[0,2]
+end
+
+def OGLBench.show_known_geometries 
+	puts "Known geometries:"
+
+	# convert the hash to array, sort by resolution and iterate
+	$KNOWN_RES.sort {|a,b| a[1][0,2] <=> b[1][0,2] }.each do |row|
+		name, res = row
+		x,y,fullname = res
+		printf "%-10s  %4d x %4d  %s\n", name, x, y, fullname
+	end
+end
+
+def OGLBench.show_usage(conf = $CACHED[:conf])
+	usage = conf[:usage]
+
+	if (not conf[:extra_usage].empty?)
+		conf[:_USAGE_LABEL_GENERAL] = "\nGENERAL OPTIONS:"
+		usage = "#{conf[:usage]}\nOTHER OPTIONS:\n#{conf[:extra_usage]}"
+	else
+		conf[:_USAGE_LABEL_GENERAL] = ''
+	end
+
+	usage.gsub!(/\$(\w+)/) do conf[$1.to_sym] end
+
+	print usage
+end
+
+def OGLBench.show_basic_config(conf,gl_info,version)
+    print <<CONFIG
+#{conf[:title]}, version #{version}, with Ruby #{RUBY_VERSION}
+
+window size:      #{conf[:width]} x #{conf[:height]}
+full screen:      #{conf[:fs]}
+rgba bits:        #{gl_info[:r]} #{gl_info[:g]} #{gl_info[:b]} #{gl_info[:a]}
+depth bits:       #{gl_info[:d]}
+min frames/test:  #{conf[:frames]}
+min seconds/test: #{conf[:seconds]}
+CONFIG
+end
+
+def OGLBench.friendly_booleans(conf)
+	booleans = conf[:booleans].update(conf[:extra_booleans])
+
+	booleans.each_pair do	|logical,readable|
+		conf[readable] = (conf[logical] ? 'yes' : 'no')
+	end
+end
+
+def OGLBench.basic_init(extra_conf = nil,extra_options = nil)
+    usage = <<'USAGE';
+$title
+
+usage: $0 [options...]
+$_USAGE_LABEL_GENERAL
+  -f  |--frames=[NNN]          Set minimum frame count [$frames]
+  -s  |--seconds=[NNN]         Set minimum time        [$seconds seconds]
+  --fs|--fullscreen            Try to use full screen  [$fs]
+  -g  |--geometry=[WWW]x[HHH]  Set viewport size       [$width x $height]
+  -g  |--geometry=<name>       Set viewport size via well-known name
+  -k  |--known-geometries      Show list of known geometry names
+  -h  |-?|--help               Show this help message
+USAGE
+
+#  conf = {:usage => usage, :frames => "150"}
+#  show_usage(conf)
+# FIXME: $0 ?
+
+	conf = {
+		:title       => 'Ruby-OpenGL Benchmark',
+		:usage       => usage,
+		:extra_usage => '',
+		"0".to_sym   => $0,
+	
+		:frames      => 100,
+		:seconds     => 10,
+		:geometry    => '300x300',
+		
+		:fullscreen  => false,
+		:known       => false,
+		:help        => false,
+		
+		:booleans    => {
+				:fullscreen => :fs,
+				:known      => :show_known,
+				:help       => :show_help,
+		},
+		:extra_booleans => {},
+	}
+
+	conf.update(extra_conf) if extra_conf
+
+	opts = GetoptLong.new(
+		[ "--frames", "-f", GetoptLong::REQUIRED_ARGUMENT ],
+		[ "--seconds", "-s", GetoptLong::REQUIRED_ARGUMENT ],
+		[ "--geometry", "-g", GetoptLong::REQUIRED_ARGUMENT ],
+		[ "--fullscreen", "--fs", GetoptLong::NO_ARGUMENT ],
+		[ "--known", "-k","--known-geometries", GetoptLong::NO_ARGUMENT ],
+		[ "--help", "-h",  "-?", GetoptLong::NO_ARGUMENT ]
+	)
+
+	opts.each do |opt, arg|
+		name = opt.tr('-','')
+		if arg.empty?
+			conf[name.to_sym] = true
+		else
+			conf[name.to_sym] = arg 
+		end
+	end
+
+	friendly_booleans(conf)
+
+
+  geometry  = conf[:geometry]
+  w,h = w_h_from_geometry(geometry)
+	conf[:width] = w.to_i
+	conf[:height] = h.to_i
+
+	$stdout.sync = true
+
+	if (conf[:help])
+		show_usage(conf)
+		exit(0)
+	end
+
+	if (conf[:known])
+		show_known_geometries()
+		exit(0)
+	end
+
+
+	app = init_opengl(conf)
+	gl_info = get_gl_info(app)
+
+	[conf, app, gl_info]
+end
+
+
+def OGLBench.init_opengl(conf)
+	w,h = conf[:width], conf[:height]
+
+	raise "Could not determine sane width and height from '#{conf[:geometry]}'.\n" 	unless w > 0 && h > 0;
+
+	glutInit()
+	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH)
+	glutInitWindowSize(w,h)
+	app = glutCreateWindow(conf[:title])
+	glViewport(0, 0, w, h)
+
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity
+
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity
+
+	$CACHED[:conf] = conf
+	$CACHED[:app] = app
+
+	app
+end
+
+def OGLBench.get_gl_info(app = $CACHED[:app])
+	gl_info = {}
+
+	# These values are faked
+	conf = $CACHED[:conf]
+	gl_info[:r] = 8
+	gl_info[:g] = 8
+	gl_info[:b] = 8
+	gl_info[:a] = 0
+	gl_info[:d] = 24
+
+	$CACHED[:gl_info] = gl_info
+
+	gl_info
+end
+
+def OGLBench.fade_to_white(frac)
+	glColor4f(frac, frac, frac, 1)
+	glClearColor(frac, frac, frac, 1)
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+	glFinish
+end
+
+def OGLBench.draw_string(font_style,str,x,y)
+  glRasterPos2i(x,y)
+	str.each_byte do |char|
+    glutBitmapCharacter(font_style, char)
+	end
+end
+
+# def init_bitmap_font
+# def texture_from_texels
+
+end # end module
+	
\ No newline at end of file
diff -pruN 0.32f-2.1/examples/misc/anisotropic.rb 0.60.0-0ubuntu3/examples/misc/anisotropic.rb
--- 0.32f-2.1/examples/misc/anisotropic.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/anisotropic.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,194 @@
+#
+# Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
+#
+# This program is distributed under the terms of the MIT license.
+# See the included MIT-LICENSE file for the terms of this license.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
+#
+
+#
+# Showcase for anisotropic texture filtering
+#
+
+require 'opengl'
+include Gl,Glu,Glut
+
+# extend Array class with new function
+class Array
+	def rotate!
+		self << self.shift
+	end
+end
+
+class App
+	@@filters = [[GL_NEAREST,"None"],[GL_LINEAR_MIPMAP_NEAREST,"Bilinear"],[GL_LINEAR_MIPMAP_LINEAR,"Trilinear"]]
+	@@anisotropy = [1,2,4,8,16,32]
+	@@color_tint = ["Off","On"]
+
+	def checker_texture(size,divide,color_a,color_b)
+		strip_a = color_a * (size/divide)
+		strip_b = color_b * (size/divide)
+		line_strip_a = (strip_a + strip_b) * (size/2)
+		line_strip_b = (strip_b + strip_a) * (size/2)
+		(line_strip_a + line_strip_b) * (divide/2)
+	end
+
+	def printGlutBitmapFont(string, font, x,y, r,g,b)
+		glDisable(GL_TEXTURE_2D)
+		glColor3f(r, g, b)
+		glRasterPos2i(x, y)
+		string.each_byte do |x|
+			glutBitmapCharacter(font, x)
+		end
+	end
+
+	def ortho(w,h)
+		glMatrixMode(GL_PROJECTION)
+		glLoadIdentity()
+		gluOrtho2D(0,w,0,h)
+		glScalef(1,-1,1)
+		glTranslatef(0,-h,0)
+	
+		glMatrixMode(GL_MODELVIEW)
+		glLoadIdentity()
+	end
+
+	def persp(w,h)
+		glMatrixMode(GL_PROJECTION)
+		glLoadIdentity
+		gluPerspective(90,w.to_f/h.to_f,1,100)
+
+		glMatrixMode(GL_MODELVIEW)
+		glLoadIdentity
+	end
+
+	def reshape(w,h)
+		@@w,@@h = w,h
+		glViewport(0, 0, w, h)
+		persp(w,h)
+	end
+
+	def initialize
+		if (not Gl.is_available?("GL_EXT_texture_filter_anisotropic"))
+			puts "This program needs GL_EXT_texture_filter_anisotropic extension"
+			exit
+		end
+		@@w,@@h = glutGet(GLUT_WINDOW_WIDTH),glutGet(GLUT_WINDOW_HEIGHT)
+
+		@t = glGenTextures(2)
+
+		# default checkerboard texture
+		glBindTexture(GL_TEXTURE_2D,@t[0])
+		data = checker_texture(64,4,[1,1,1],[0,0,0])
+		gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,64,64,GL_RGB,GL_FLOAT,data.pack("f*"))
+
+		# second texture with color tinted mipmaps
+		glBindTexture(GL_TEXTURE_2D,@t[1])
+		data = checker_texture(64,4,[1,1,1],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,64,64,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = checker_texture(32,4,[1,0,0],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,1,GL_RGBA,32,32,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = checker_texture(16,4,[0,1,0],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,2,GL_RGBA,16,16,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = checker_texture(8,4,[0,0,1],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,3,GL_RGBA,8,8,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = checker_texture(4,4,[1,1,0],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,4,GL_RGBA,4,4,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = checker_texture(2,2,[1,0,1],[0,0,0])
+		glTexImage2D(GL_TEXTURE_2D,5,GL_RGBA,2,2,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+		data = [0.5,0.5,0.5] # single pixel texture, just average it
+		glTexImage2D(GL_TEXTURE_2D,6,GL_RGBA,1,1,0,GL_RGB,GL_FLOAT,data.pack("f*"))
+	end
+
+	def display_text
+		ortho(@@w,@@h)
+		printGlutBitmapFont("Texture Filtering ('f'): #{@@filters[0][1]}", GLUT_BITMAP_9_BY_15, 20, 20, 1.0, 1.0, 1.0)
+		printGlutBitmapFont("Anisotropy factor ('a'): #{@@anisotropy[0]}x", GLUT_BITMAP_9_BY_15, 20, 40, 1.0, 1.0, 1.0)
+		printGlutBitmapFont("Colored Mipmaps ('c'): #{@@color_tint[0]}", GLUT_BITMAP_9_BY_15, 20, 60, 1.0, 1.0, 1.0)
+		persp(@@w,@@h)
+	end
+
+	def display_plane()
+		glEnable(GL_TEXTURE_2D)
+		t_repeat = 16
+		# x,y,z,u,v
+		quad = [[-4,-1,1,  0,t_repeat],[4,-1,1,  t_repeat,t_repeat],[4,1,-8,  t_repeat,0],[-4,1,-8,  0,0]]
+		glBegin(GL_QUADS)
+		quad.each do |v|
+			glTexCoord2f(v[3],v[4])
+			glVertex3f(v[0],v[1],v[2])
+		end
+		glEnd()
+		glDisable(GL_TEXTURE_2D)
+	end
+
+	def display
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
+
+		persp(@@w,@@h)
+
+		# move back from scene
+		glTranslatef(0,0,-2)
+
+		# set anisotropy
+		glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,@@anisotropy[0])
+
+		# set color tint
+		if (@@color_tint[0] == "On")
+			glBindTexture(GL_TEXTURE_2D,@t[1])
+		else			
+			glBindTexture(GL_TEXTURE_2D,@t[0])
+		end
+
+		# set filters
+		f = @@filters[0][0]
+		glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,f)
+
+		# draw scene	
+		display_plane()
+		display_text()
+
+		sleep(0.001) # microsleep to avoid consuming all CPU time
+		glutSwapBuffers()
+	end
+
+	def idle
+		glutPostRedisplay()
+	end
+
+	def keyboard(key,x,y)
+		case (key)
+		when ?f
+			@@filters.rotate!
+		when ?a
+			max_anisotropy = glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)
+			begin	@@anisotropy.rotate! end until @@anisotropy[0]<=max_anisotropy
+		when ?c
+			@@color_tint.rotate!
+		when ?\e # Escape
+			exit(0)
+		end
+		glutPostRedisplay()
+	end
+end
+
+# main
+glutInit()
+glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE )
+glutInitWindowPosition(150,50)
+glutInitWindowSize(500,500)
+glutCreateWindow($0)
+
+app = App.new
+glutReshapeFunc(app.method(:reshape).to_proc)
+glutDisplayFunc(app.method(:display).to_proc)
+glutIdleFunc(app.method(:idle).to_proc)
+glutKeyboardFunc(app.method(:keyboard).to_proc)
+glutMainLoop()
diff -pruN 0.32f-2.1/examples/misc/font-glut.rb 0.60.0-0ubuntu3/examples/misc/font-glut.rb
--- 0.32f-2.1/examples/misc/font-glut.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/font-glut.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,46 @@
+require 'opengl'
+include Gl,Glu,Glut
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	GL.LoadIdentity
+	
+	glRasterPos2d(100,100)
+	"Hello Bitmap".each_byte { |x| glutBitmapCharacter(GLUT_BITMAP_9_BY_15, x) }
+	
+	GL.Translate(100, 250, 0)
+	GL.Scale(0.5, 0.5, 1)
+	"Hello Stroke".each_byte { |x| glutStrokeCharacter(GLUT_STROKE_ROMAN, x) }
+	
+	glutSwapBuffers()
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	glOrtho(0.0, w, 0.0, h, -1.0, 1.0)
+	glMatrixMode(GL_MODELVIEW)
+end
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+			exit(0)
+	end
+end
+
+#  Main Loop
+#  Open window with initial window size, title bar, 
+#  color index display mode, and handle input events.
+#
+glutInit
+glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
+glutInitWindowSize(500, 500)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop
diff -pruN 0.32f-2.1/examples/misc/glfwtest.rb 0.60.0-0ubuntu3/examples/misc/glfwtest.rb
--- 0.32f-2.1/examples/misc/glfwtest.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/glfwtest.rb	2007-11-09 02:49:54.000000000 +0000
@@ -0,0 +1,30 @@
+require 'opengl'
+require 'glfw'
+
+#init
+Glfw.glfwOpenWindow( 500,500, 0,0,0,0, 32,0, Glfw::GLFW_WINDOW )
+
+# main loop
+while true
+	if( Glfw.glfwGetWindowParam( Glfw::GLFW_OPENED ) == false ||
+		  Glfw.glfwGetKey(Glfw::GLFW_KEY_ESC) == Glfw::GLFW_PRESS )
+		break
+	end
+
+	Gl.glClear( Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT )
+
+	Gl.glBegin( Gl::GL_POLYGON )
+	Gl.glColor3f( 1.0, 0.0, 0.0 )
+	Gl.glVertex2f( -0.5, -0.5 )
+	Gl.glColor3f( 0.0, 1.0, 0.0 )
+	Gl.glVertex2f( -0.5,  0.5 )
+	Gl.glColor3f( 0.0, 0.0, 1.0 )
+	Gl.glVertex2f(  0.5,  0.5 )
+	Gl.glColor3f( 1.0, 0.0, 1.0 )
+	Gl.glVertex2f(  0.5, -0.5 )
+	Gl.glEnd
+
+  Glfw.glfwSwapBuffers()
+
+	sleep 0.01 # to avoid consuming all CPU power
+end
diff -pruN 0.32f-2.1/examples/misc/plane.rb 0.60.0-0ubuntu3/examples/misc/plane.rb
--- 0.32f-2.1/examples/misc/plane.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/plane.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,161 @@
+#!/usr/bin/env ruby -rubygems
+#/* 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.
+# */
+#/*
+# *  plane.c
+# *  This program demonstrates the use of local versus 
+# *  infinite lighting on a flat plane.
+# */
+
+require "gl"
+require "glut"
+require "mathn"
+
+# /*  Initialize material property, light source, and lighting model.
+# */
+def myinit
+    mat_ambient = [ 0.0, 0.0, 0.0, 1.0 ];
+#/*   mat_specular and mat_shininess are NOT default values	*/
+    mat_diffuse = [ 0.4, 0.4, 0.4, 1.0 ];
+    mat_specular = [ 1.0, 1.0, 1.0, 1.0 ];
+    mat_shininess = [ 15.0 ];
+
+    light_ambient = [ 0.0, 0.0, 0.0, 1.0 ];
+    light_diffuse = [ 1.0, 1.0, 1.0, 1.0 ];
+    light_specular = [ 1.0, 1.0, 1.0, 1.0 ];
+    lmodel_ambient = [ 0.2, 0.2, 0.2, 1.0 ];
+
+    Gl.glMaterial(Gl::GL_FRONT, Gl::GL_AMBIENT, mat_ambient);
+    Gl.glMaterial(Gl::GL_FRONT, Gl::GL_DIFFUSE, mat_diffuse);
+    Gl.glMaterial(Gl::GL_FRONT, Gl::GL_SPECULAR, mat_specular);
+    Gl.glMaterial(Gl::GL_FRONT, Gl::GL_SHININESS, *mat_shininess);
+    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_AMBIENT, light_ambient);
+    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_DIFFUSE, light_diffuse);
+    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_SPECULAR, light_specular);
+    Gl.glLightModel(Gl::GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+
+    Gl.glEnable(Gl::GL_LIGHTING);
+    Gl.glEnable(Gl::GL_LIGHT0);
+    Gl.glDepthFunc(Gl::GL_LESS);
+    Gl.glEnable(Gl::GL_DEPTH_TEST);
+end
+
+def drawPlane
+    Gl.glBegin(Gl::GL_QUADS);
+    Gl.glNormal(0.0, 0.0, 1.0);
+    Gl.glVertex(-1.0, -1.0, 0.0);
+    Gl.glVertex(0.0, -1.0, 0.0);
+    Gl.glVertex(0.0, 0.0, 0.0);
+    Gl.glVertex(-1.0, 0.0, 0.0);
+
+    Gl.glNormal(0.0, 0.0, 1.0);
+    Gl.glVertex(0.0, -1.0, 0.0);
+    Gl.glVertex(1.0, -1.0, 0.0);
+    Gl.glVertex(1.0, 0.0, 0.0);
+    Gl.glVertex(0.0, 0.0, 0.0);
+
+    Gl.glNormal(0.0, 0.0, 1.0);
+    Gl.glVertex(0.0, 0.0, 0.0);
+    Gl.glVertex(1.0, 0.0, 0.0);
+    Gl.glVertex(1.0, 1.0, 0.0);
+    Gl.glVertex(0.0, 1.0, 0.0);
+
+    Gl.glNormal(0.0, 0.0, 1.0);
+    Gl.glVertex(0.0, 0.0, 0.0);
+    Gl.glVertex(0.0, 1.0, 0.0);
+    Gl.glVertex(-1.0, 1.0, 0.0);
+    Gl.glVertex(-1.0, 0.0, 0.0);
+    Gl.glEnd();
+end
+
+display = Proc.new {
+    infinite_light = [ 1.0, 1.0, 1.0, 0.0 ];
+    local_light = [ 1.0, 1.0, 1.0, 1.0 ];
+
+    Gl.glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT);
+
+    Gl.glPushMatrix();
+    Gl.glTranslate(-1.5, 0.0, 0.0);
+    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_POSITION, infinite_light);
+    drawPlane();
+    Gl.glPopMatrix();
+
+    Gl.glPushMatrix();
+    Gl.glTranslate(1.5, 0.0, 0.0);
+    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_POSITION, local_light);
+    drawPlane();
+    Gl.glPopMatrix();
+    Gl.glFlush();
+}
+
+myReshape = Proc.new {|w, h|
+    Gl.glViewport(0, 0, w, h);
+    Gl.glMatrixMode(Gl::GL_PROJECTION);
+    Gl.glLoadIdentity();
+    if (w <= h) 
+	Gl.glOrtho(-1.5, 1.5, -1.5*h/w, 1.5*h/w, -10.0, 10.0);
+    else 
+	Gl.glOrtho(-1.5*w/h, 1.5*w/h, -1.5, 1.5, -10.0, 10.0);
+    end
+    Gl.glMatrixMode(Gl::GL_MODELVIEW);
+}
+
+# Keyboard handler to exit when ESC is typed
+keyboard = lambda do |key, x, y|
+  case(key)
+  when ?\e
+    exit(0)
+  end
+end
+
+#/*  Main Loop
+# *  Open window with initial window size, title bar, 
+# *  RGBA display mode, and handle input events.
+# */
+#int main(int argc, char** argv)
+#{
+    Glut.glutInit
+    Glut.glutInitDisplayMode(Glut::GLUT_SINGLE | Glut::GLUT_RGB | Glut::GLUT_DEPTH);
+    Glut.glutInitWindowSize(500, 200);
+    Glut.glutCreateWindow($0);
+    myinit();
+    Glut.glutReshapeFunc(myReshape);
+    Glut.glutDisplayFunc(display);
+    Glut.glutKeyboardFunc(keyboard);
+    Glut.glutMainLoop();
diff -pruN 0.32f-2.1/examples/misc/readpixel.rb 0.60.0-0ubuntu3/examples/misc/readpixel.rb
--- 0.32f-2.1/examples/misc/readpixel.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/readpixel.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,65 @@
+require 'opengl'
+include Gl,Glu,Glut
+
+begin
+	require "RMagick"
+rescue Exception
+	print "This sample needs RMagick Module.\n"
+	exit
+end
+
+WIDTH = 500
+HEIGHT = 500
+
+display = Proc.new do
+	glClear(GL_COLOR_BUFFER_BIT)
+	
+	glBegin(GL_LINES)
+	glVertex(0.5, 0.5)
+	glVertex(-0.5, -0.5)
+	glEnd
+	
+	glFlush()
+	
+	pixels = glReadPixels(0, 0, WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_SHORT)
+	
+	image = Magick::Image.new(WIDTH, HEIGHT)
+	image.import_pixels(0, 0, WIDTH, HEIGHT, "RGBA", pixels,Magick::ShortPixel)
+	image.flip!
+	image.write("opengl_window.gif")
+end
+
+reshape = Proc.new do |w, h|
+	glViewport(0, 0,  w,  h)
+	glMatrixMode(GL_PROJECTION)
+	glLoadIdentity()
+	if (w <= h) 
+		gluOrtho2D(-1.0, 1.0, -h.to_f/w.to_f, h.to_f/w.to_f)
+	else 
+		gluOrtho2D(w.to_f/h.to_f, w.to_f/h.to_f, -1.0, 1.0)
+	end
+	glMatrixMode(GL_MODELVIEW)
+	glLoadIdentity()
+end
+
+
+keyboard = Proc.new do |key, x, y|
+	case (key)
+		when ?\e
+		exit(0);
+	end
+end
+
+#  Main Loop
+#  Open window with initial window size, title bar, 
+#  color index display mode, and handle input events.
+glutInit
+glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA)
+glutInitWindowSize(WIDTH, HEIGHT)
+glutInitWindowPosition(100, 100)
+glutCreateWindow($0)
+glutReshapeFunc(reshape)
+glutDisplayFunc(display)
+glutKeyboardFunc(keyboard)
+glutMainLoop
+
diff -pruN 0.32f-2.1/examples/misc/sdltest.rb 0.60.0-0ubuntu3/examples/misc/sdltest.rb
--- 0.32f-2.1/examples/misc/sdltest.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/sdltest.rb	2007-11-09 02:49:54.000000000 +0000
@@ -0,0 +1,34 @@
+require 'opengl'
+require 'sdl'
+
+#init
+SDL.init(SDL::INIT_VIDEO)
+SDL.setGLAttr(SDL::GL_DOUBLEBUFFER,1)
+SDL.setVideoMode(512,512,32,SDL::OPENGL)
+
+# main loop
+while true
+	while event = SDL::Event2.poll
+		case event
+		when SDL::Event2::KeyDown, SDL::Event2::Quit
+			exit
+		end
+	end
+
+	Gl.glClear( Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT )
+
+	Gl.glBegin( Gl::GL_POLYGON )
+	Gl.glColor3f( 1.0, 0.0, 0.0 )
+	Gl.glVertex2f( -0.5, -0.5 )
+	Gl.glColor3f( 0.0, 1.0, 0.0 )
+	Gl.glVertex2f( -0.5,  0.5 )
+	Gl.glColor3f( 0.0, 0.0, 1.0 )
+	Gl.glVertex2f(  0.5,  0.5 )
+	Gl.glColor3f( 1.0, 0.0, 1.0 )
+	Gl.glVertex2f(  0.5, -0.5 )
+	Gl.glEnd
+
+	SDL.GLSwapBuffers()
+
+	sleep 0.01 # to avoid consuming all CPU power
+end
diff -pruN 0.32f-2.1/examples/misc/trislam.rb 0.60.0-0ubuntu3/examples/misc/trislam.rb
--- 0.32f-2.1/examples/misc/trislam.rb	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/examples/misc/trislam.rb	2007-12-28 17:20:22.000000000 +0000
@@ -0,0 +1,828 @@
+#!/usr/bin/env ruby
+
+# Purpose: Determine performance curves for various methods of pushing
+#          triangles and quads through the OpenGL pipeline
+
+# Copyright (c) 2004-2006, Geoff Broadwell; this script is released
+# as open source and may be distributed and modified under the terms
+# of either the Artistic License or the GNU General Public License,
+# in the same manner as Perl itself.  These licenses should have been
+# distributed to you as part of your Perl distribution, and can be
+# read using `perldoc perlartistic` and `perldoc perlgpl` respectively.
+
+# Conversion to ruby by Jan Dvorak <jan.dvorak@kraxnet.cz>
+
+require 'opengl'
+include Gl,Glu,Glut
+
+require 'mathn'
+
+require 'OGLBench'
+
+$VERSION = '0.1.24-ruby-p1'
+
+$test = 0
+$run = 0
+$done = false
+$ready = false
+
+### USER CONFIG
+
+# Primitive sizes (and therefore counts) are integer divisors of
+# (A^i * B^j * C^k ...) where good A, B, C, ... are relatively prime;
+# this number is used for the draw area height and width and defaults to:
+#     2^4 * 3^2 * 5 = 720
+# You may also want to get fewer data points across the same range by
+# directly using higher powers; for example:
+#     16  * 9   * 5 = 720
+#
+# my @max_powers = (16 => 1, 9 => 1, 5 => 1);
+$max_powers = { 2 => 4, 3 => 2, 5 => 1 }.to_a.flatten
+
+# Maximum quads along each axis for known slow versus usually fast tests;
+# chosen to be somewhat reasonable for most common settings of @max_powers
+# my $max_count_slow = 60;
+$max_count_slow = 154
+$max_count_fast = 154
+
+# Font to use to label graphs
+$font_style = GLUT_BITMAP_HELVETICA_10
+
+### MISC GLOBALS
+
+$conf = $app = $gl_info = nil
+$MIN_FRAMES = $MIN_SECONDS = 0
+$w = $h = 0
+$dls = {}
+$vas = {}
+$combos = $slow = $fast = 0
+$showing_graph = false
+$empty_time = $empty_frames = $total = 0
+$max = []
+$stats = []
+$stats_fixed = []
+
+### CODE
+
+def main
+	init()
+	print "Benchmarks:"
+
+	glutDisplayFunc(method(:cbDraw).to_proc)
+	glutIdleFunc(method(:cbDraw).to_proc)
+	glutKeyboardFunc(method(:cbKeyPressed).to_proc)
+	glutMainLoop()
+end
+
+def init
+	$stdout.sync = true
+
+	$combos = recurse_combos($max_powers)
+	$combos.sort!
+	$slow = $combos.select { |a| a <= $max_count_slow }
+	$fast = $combos.select { |a| a > $max_count_slow &&
+	                             a <= $max_count_slow }
+
+	# Choose drawing area size to match counts
+	$h = $w = $combos.last
+
+  default_conf = {
+			:title    => 'Triangle Slammer OpenGL Benchmark',
+			:geometry => "#{$w}x#{$h}",
+			:frames   => 10,
+			:seconds  => 1,
+	}
+  $conf, $app, $gl_info = OGLBench.basic_init(default_conf)
+
+
+	# Reduce indirections in inner loops
+	$MIN_FRAMES, $MIN_SECONDS = $conf[:frames], $conf[:seconds]
+	
+	# Let user know what's going on
+	show_user_message()
+
+	# Change projection to integer-pixel ortho
+	glMatrixMode(GL_PROJECTION)
+	glOrtho(0, $w, 0, $h, -1, 1)
+	glMatrixMode(GL_MODELVIEW)
+
+	# Make sure GL state is consistent for VA and DL creation
+	start_frame()
+	
+	# Create vertex arrays and display lists outside timing loop
+	init_vertex_arrays()
+	init_display_lists()
+	
+	# Clean up GL state
+	end_frame()
+end
+
+def recurse_combos(powers)
+	base, max_power, *rest = powers
+
+	return [1] if powers.size<1
+
+	combos = []	
+	(0..max_power).each do |power|
+		multiplier = base ** power
+		recurse_combos(rest).each do |item|
+			combos << (item*multiplier)
+		end
+	end
+	combos
+end
+
+def show_user_message
+	print <<"EOM";
+TRISLAM benchmarks several methods of pushing OpenGL primitives,
+testing each method with various primitive counts and sizes.
+During the benchmark, the test window will start out black, slowly
+brightening to white as testing progresses.  Once benchmarking is
+complete, the collected data will be dumped in tabular form.
+
+The configuration for this series of tests will be as follows:
+
+EOM
+
+	OGLBench.show_basic_config($conf, $gl_info, $VERSION)
+	
+	puts "standard runs:    #{$slow.join(' ')}"
+	puts "extra fast runs:  #{$fast.join(' ')}"
+	puts '-' * 79
+end
+
+
+def init_vertex_arrays
+	print "Init vertex arrays:"
+
+	$va_types.keys.sort.each do |type|
+		print " #{type}"
+		($slow + $fast).each do |count|
+			data = $va_types[type].call(count, $w / count.to_f)
+			va = data.pack("f*")
+			$vas["#{type}_#{count}"] = va
+		end
+	end	
+
+	print ".\n";
+end
+
+def init_display_lists
+	print "Init display lists:"
+
+	num_lists = $dl_types.size * ($slow + $fast).size
+	current = glGenLists(num_lists)
+
+	$dl_types.keys.sort.each do |type|
+		print " #{type}"
+		($slow + $fast).each do |count|
+			$dls["#{type}_#{count}"] = current
+			glNewList(current, GL_COMPILE)
+			$dl_types[type].call(count, $w / count.to_f)
+			glEndList()
+			current += 1
+		end
+	end    
+	puts "."
+end
+
+def benchmark
+	if ($test >= $tests.size)
+		print ".\n" if (!$done)
+		$done = true
+		return
+	end
+	name,draw,stats,class_ = $tests[$test]
+
+	counts = class_ == 'single' ? [1] : (class_ == 'slow' ? $slow : $slow + $fast)
+
+	if ($run == 0)
+		print " #{name}";
+
+		# After printing current test name, busy wait for a second
+		# so that the terminal can catch up and not do work while
+		# the GL timing is in progress
+		a = Time.now
+		while 1 > (Time.now - a) do end
+	end
+
+	count = counts[$run]
+  size  = $w / count
+
+	OGLBench.fade_to_white(($test + ($run.to_f / counts.size)) / $tests.size)
+
+	run_done = 0
+  frames   = 0
+  start    = Time.now
+
+  while (run_done==0)
+		start_frame()
+    draw.call(count, size.to_f)
+    end_frame()
+   
+    frames += 1
+    run_done = 1 if ($MIN_FRAMES <= frames &&
+             $MIN_SECONDS <= Time.now - start)
+	end
+	glFinish()
+  end_ = Time.now
+  time = end_ - start
+    
+	$stats << [name,count,time,frames] + stats.call(count,size.to_f)
+
+	$run += 1
+	if ($run >= counts.size)
+		$test += 1
+		$run = 0
+	end
+end
+
+def cleanup
+	fixup_stats()
+	show_stats()
+	draw_stats()
+end
+
+def start_frame
+	glClear(GL_COLOR_BUFFER_BIT |
+	        GL_DEPTH_BUFFER_BIT)
+end
+
+def end_frame
+	glFinish()
+end
+
+def fixup_stats
+	empty = $stats.shift
+    
+	$empty_time   = empty[2]
+  $empty_frames = empty[3]
+  empty_tpf = $empty_time.to_f / $empty_frames
+
+	$total = ['totl,','avg'] + [0] * 12
+	$max = ['max','max'] + [0] * 12
+
+	$stats.each do |stat|
+		name, count, time, frames, pixpf, prmpf, tpf, vpf = stat
+
+		# Subtract out empty loop time, and loop if negative result
+		# $time -= $empty_tpf * $frames;
+		if (time <= 0)
+			stat += [0] * 5
+			next
+		end
+    
+		# Calc "work", the geometric mean of pixels and vertices
+		workpf = Math::sqrt(pixpf * vpf)
+    
+		# Calc fps
+		fps = frames / time
+    
+		# Calc other perf stats
+		pixps = pixpf  * fps
+		prmps = prmpf  * fps
+		tps   = tpf    * fps
+		vps   = vpf    * fps
+		wps   = workpf * fps  
+		
+		# Add them to stat row
+		stat += [fps, pixps, prmps, tps, vps, wps]
+    
+		# Convert per frame counts to totals
+		(4..7).each { |i| stat[i] *= frames }
+
+		# Update running totals
+		(2..7).each { |i| $total[i] += stat[i] }
+			
+		# Update running maximums
+		(2..13).each do |i|
+			$max[i] = stat[i] if $max[i] < stat[i]
+		end
+	
+		$stats_fixed << stat
+	end
+
+	# Calc averages for totals line
+	(8..13).each { |i| $total[i] = $total[i-5] / $total[2].to_f }
+
+	$ready = true
+	$stats = $stats_fixed
+end
+
+
+def show_stats
+	basic = ["Name","Cnt","Time"]
+	raw =   ["Frms","Mpix","Kprim","Ktri","Kvert"]
+	calc = raw
+	scale = [ 0,   6,    3,    3,   3,    ] * 2
+	header = basic + raw + calc
+	scale.map! {|n| 10 ** n }
+	
+	g_form = "%9s%-*s %s\n"
+	h_form = '%-5s%3s %6s'   + ' %5s' * raw.size + ' ' + ' %5s' * calc.size + "\n"
+	format = '%-5s%3s %6.3f' + ' %5d' * raw.size + ' ' + ' %5d' * calc.size + "\n"
+
+	printf(g_form, '', 6 * 5 + 8, 'MEASURED', 'PER SECOND')
+  printf(h_form, *header)
+  printf(format, "empty", 1, $empty_time, $empty_frames, *([0] * 9))
+    #
+
+	($stats + [$total]).each do |stat|
+		st = stat.clone()
+		(0..scale.size-1).each do |i|
+			st[i + 3] /= scale[i]
+		end
+		printf(format,*st)
+	end
+end
+
+
+def make_quads_va(count,size)
+	data = []
+	(0 .. count-1).each do |y|
+		(0 .. count-1).each do |x|
+			data << x * size        << y * size + size
+			data << x * size        << y * size
+			data << x * size + size << y * size
+			data << x * size + size << y * size + size
+		end
+	end
+	data
+end
+
+def make_tris_va(count,size)
+	data = []
+	(0 .. count-1).each do |y|
+		(0 .. count-1).each do |x|
+			data << x * size        <<  y * size + size
+			data << x * size        <<  y * size
+			data << x * size + size <<  y * size + size
+	
+			data << x * size + size <<  y * size + size
+			data << x * size        <<  y * size
+			data << x * size + size <<  y * size
+		end
+	end
+	data
+end
+
+def make_qs_va(count,size)
+	data = []
+	(0 .. count-1).each do |y|
+		(0 .. count).each do |x|
+			data << x * size << y * size + size
+			data << x * size << y * size
+    end
+	end
+	data
+end
+
+def make_ts_va(count,size)
+	data = []
+	(0 .. count-1).each do |y|
+		(0 .. count).each do |x|
+			data << x * size << y * size + size
+			data << x * size << y * size
+    end
+	end
+	data
+end
+
+def draw_qs(count,size)
+	(0 .. count-1).each do |y|
+		glBegin(GL_QUAD_STRIP)
+		(0 .. count).each do |x|
+			glVertex2f(x * size, y * size + size)
+			glVertex2f(x * size, y * size )
+		end
+		glEnd()
+	end
+end
+
+def draw_ts(count,size)
+	(0 .. count-1).each do |y|
+		glBegin(GL_TRIANGLE_STRIP)
+		(0 .. count).each do |x|
+			glVertex2f(x * size, y * size + size)
+			glVertex2f(x * size, y * size )
+		end
+		glEnd()
+	end
+end
+
+def draw_qs_va(count,size)
+	va  = $vas["qs_#{count}"]
+	row = 2 * (count + 1)
+
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	(0 .. count-1).each do |y|
+		glDrawArrays(GL_QUAD_STRIP, y * row, row)
+	end
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+def draw_ts_va(count,size)
+	va  = $vas["ts_#{count}"]
+	row = 2 * (count + 1)
+
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	(0 .. count-1).each do |y|
+		glDrawArrays(GL_TRIANGLE_STRIP, y * row, row)
+	end
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+def draw_tris(count,size)
+	glBegin(GL_TRIANGLES)
+	(0 .. count-1).each do |y|
+		(0 .. count-1).each do |x|
+			glVertex2f(x * size       , y * size + size)
+			glVertex2f(x * size       , y * size       )
+			glVertex2f(x * size + size, y * size + size)
+	
+			glVertex2f(x * size + size, y * size + size)
+			glVertex2f(x * size       , y * size       )
+			glVertex2f(x * size + size, y * size       )
+		end
+	end
+	glEnd
+end
+
+def stats_tris(count,size)
+	length = size * count
+	area   = length * length
+	prims  = 2 * count * count
+	tris   =     prims
+	verts  = 3 * prims
+	
+	[area, prims, tris, verts]
+end
+
+def draw_empty(count,size)
+end
+
+def stats_empty(count,size)
+   [0,0,0,0]
+end
+
+def draw_quads(count,size)
+	glBegin(GL_QUADS)
+	(0 .. count-1).each do |y|
+		(0 .. count-1).each do |x|
+			glVertex2f(x * size       , y * size + size)
+			glVertex2f(x * size       , y * size       )
+			glVertex2f(x * size + size, y * size       )
+			glVertex2f(x * size + size, y * size + size)
+		end
+	end
+	glEnd
+end
+
+def stats_quads(count,size)
+	length = size * count
+	area   = length * length
+	prims  = count * count
+	tris   = 2 * prims
+	verts  = 4 * prims
+
+	[area, prims, tris, verts]
+end
+
+def stats_ts(count,size)
+	length = size * count
+	area   = length * length
+	prims  = count
+	tris   = 2 *  count      * prims
+	verts  = 2 * (count + 1) * prims
+	
+	[area, prims, tris, verts]
+end
+
+def stats_qs(count,size)
+	length = size * count
+	area   = length * length
+	prims  = count
+	tris   = 2 *  count      * prims
+	verts  = 2 * (count + 1) * prims
+	
+	[area, prims, tris, verts]
+end
+
+def draw_ts_dl(count,size)
+	glCallList($dls["ts_#{count}"]);
+end
+
+def draw_qs_dl(count,size)
+  glCallList($dls["qs_#{count}"]);
+end
+
+def draw_tris_va(count,size)
+	va = $vas["t_#{count}"]
+	
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glDrawArrays(GL_TRIANGLES, 0, 6 * count * count)
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+def draw_quads_va(count,size)
+	va = $vas["q_#{count}"]
+	
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glDrawArrays(GL_QUADS, 0, 4 * count * count)
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+
+def draw_ts_va_dl(count,size)
+	va = $vas["ts_#{count}"]
+	
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glCallList($dls["tsv_#{count}"])
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+def draw_qs_va_dl(count,size)
+	va = $vas["qs_#{count}"]
+	
+	glVertexPointer(2, GL_FLOAT, 0, va)
+	
+	glEnableClientState(GL_VERTEX_ARRAY)
+	glCallList($dls["qsv_#{count}"])
+	glDisableClientState(GL_VERTEX_ARRAY)
+end
+
+
+def draw_stats
+	return if (!$ready)
+
+	# Graph config
+	x_off     = 10
+	y_off     = 10
+	tick_size = 3
+	val_space = 50
+	key_size  = 20
+	x_scale   = ($w - 4 * x_off) / (2 * ($fast.last || $slow.last))
+	key_scale = ($h - 4 * y_off) / (2 * $tests.size)
+
+	# Get a fresh black frame for graphing
+	glClearColor(0, 0, 0, 1)
+	start_frame()
+
+	# Use antialiased lines
+	glEnable(GL_BLEND)
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+	glEnable(GL_LINE_SMOOTH)
+	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST)
+
+	# Draw axis ticks
+	glColor3f(1, 1, 1);
+	glBegin(GL_LINES);
+
+	([0] + $slow + $fast).each do |count|
+		x_tick = count * x_scale + x_off
+		glVertex2f(x_tick, y_off)
+		glVertex2f(x_tick, y_off - tick_size)
+		glVertex2f(x_tick, y_off + $h / 2)
+		glVertex2f(x_tick, y_off + $h / 2 - tick_size)
+		glVertex2f(x_tick + $w / 2, y_off + $h / 2)
+		glVertex2f(x_tick + $w / 2, y_off + $h / 2 - tick_size)
+	end
+	glEnd
+
+	x_tick = x_off + 3
+	val_max = (($h / 2 - 2 * y_off) / val_space).to_i
+
+	# Work
+	(0..val_max).each do |value|
+		y_tick = value * val_space + y_off
+
+		glBegin(GL_LINES)
+			glVertex2f(x_off,             y_tick)
+			glVertex2f(x_off - tick_size, y_tick)
+		glEnd
+	end
+
+	# Pixels
+	value = 0
+	val_max = $max[9] / mag_scale($max[9])
+	y_scale = ($h - 4 * y_off) / (2 * val_max)
+	val_inc = tick_inc(val_max,5)
+
+	while (value < val_max)
+		y_tick = (value * y_scale)  + y_off
+
+		glBegin(GL_LINES)
+		glVertex2f(x_off,              y_tick + $h / 2)
+		glVertex2f(x_off - tick_size, y_tick + $h / 2)
+		glEnd
+		OGLBench.draw_string($font_style, value.to_s, x_tick, y_tick + $h / 2) if (value!=0)
+		value += val_inc
+	end
+
+	# Vertices
+	value = 0
+	val_max = $max[12] / mag_scale($max[12])
+	y_scale = ($h - 4 * y_off) / (2 * val_max)
+	val_inc = tick_inc(val_max,5)
+	while (value < val_max)
+		y_tick = (value * y_scale)  + y_off
+
+		glBegin(GL_LINES)
+		glVertex2f(x_off + $w / 2,              y_tick + $h / 2)
+		glVertex2f(x_off + $w / 2 - tick_size,  y_tick + $h / 2)
+		glEnd
+
+		OGLBench.draw_string($font_style, value.to_s, x_tick + $w / 2, y_tick + $h / 2) if (value!=0)
+		value += val_inc
+	end
+
+	# Draw axes
+	glBegin(GL_LINE_STRIP)
+	glVertex2f(x_off,          $h / 2 - y_off)
+	glVertex2f(x_off,          y_off)
+	glVertex2f($w / 2 - x_off, y_off)
+	glEnd
+	glBegin(GL_LINE_STRIP)
+	glVertex2f(x_off,          $h - y_off)
+	glVertex2f(x_off,          $h / 2 + y_off)
+	glVertex2f($w / 2 - x_off, $h / 2 + y_off)
+	glEnd
+	glBegin(GL_LINE_STRIP)
+	glVertex2f($w / 2 + x_off, $h - y_off)
+	glVertex2f($w / 2 + x_off, $h / 2 + y_off)
+	glVertex2f($w - x_off,     $h / 2 + y_off)
+	glEnd
+
+  # Draw color key
+	(0..$tests.size - 1).each do |num|
+		test = $tests[num]
+		name,color,stipple = [test[0]] + test[-2,2]
+		glEnable(GL_LINE_STIPPLE)
+		glLineStipple(3, stipple)
+
+		glBegin(GL_LINES)
+		glColor3fv(color)
+		glVertex2f(x_off + $w / 2,            y_off + num * key_scale)
+		glVertex2f(x_off + $w / 2 + key_size, y_off + num * key_scale)
+		glEnd()
+
+		glDisable(GL_LINE_STIPPLE)
+
+		OGLBench.draw_string($font_style, name, x_off + $w / 2 + key_size * 2,  y_off + num * key_scale)
+	end
+
+	# Draw performance graph lines
+
+	# Pixels per second
+	draw_one_stat(x_off, y_off + $h / 2, y_off, x_scale, 9)
+	glColor3f(1, 1, 1)
+
+	OGLBench.draw_string($font_style, mag_char($max[9]) + " Pixels/Sec", $w / 4, $h - 2 * y_off)
+
+	# Vertices per second
+	draw_one_stat(x_off + $w / 2, y_off + $h / 2, y_off, x_scale, 12)
+	glColor3f(1, 1, 1)
+	OGLBench.draw_string($font_style, mag_char($max[12]) + " Vertices/Sec", 3 * $w / 4, $h - 2 * y_off)
+
+	# "Work" per second, the geometric mean of pixels and vertices
+	draw_one_stat(x_off, y_off, y_off, x_scale, 13)
+	glColor3f(1, 1, 1)
+
+	OGLBench.draw_string($font_style, "Work/Sec", $w / 4, $h / 2 - 2 * y_off)
+
+	# Show our graph
+	end_frame();
+	$showing_graph = true
+end
+
+def draw_one_stat(x_loc,y_loc,y_off,x_scale,num)
+	max     = $max[num]
+	y_scale = ($h - 4 * y_off) / (2 * max)
+	colors = {}
+	$tests.each do |test| colors[test[0]] = test[-2] end
+
+	stipple = {}
+	$tests.each do |test| stipple[test[0]] = test[-1] end
+
+	last = ''
+	
+	glEnable(GL_LINE_STIPPLE)
+	glBegin(GL_LINE_STRIP)
+	$stats.each_with_index do |stat,run|
+		name,count, st = stat[0,2] + [stat[num]]
+
+		if name != last
+			glEnd
+			glLineStipple(3, stipple[name])
+			glBegin(GL_LINE_STRIP)
+			last = name
+		end
+
+		glColor3fv(colors[name])
+		glVertex2f(count * x_scale + x_loc, st * y_scale + y_loc)
+	end
+	glEnd
+	glDisable(GL_LINE_STIPPLE)
+end
+
+
+def kilo_mag(num)
+	mag = (Math::log(num) / Math::log(10)).to_i
+	(mag / 3)
+end
+
+def mag_char(num)
+	['','K','M','G','T','P','E','Z','Y'][kilo_mag(num)]
+end
+
+def mag_scale(num)
+	10 ** (3*kilo_mag(num))
+end
+
+def tick_inc(max,parts = 5)
+	return (max / parts.to_f) if (max < 1)
+
+	mag = (Math::log(max) / Math::log(10)).to_i
+	scl = (10 ** (mag - 1))
+	inc = max / (scl * parts)
+	
+	if (inc > 7.5)
+		inc = 10
+	elsif (inc > 3.5)
+		inc = 5
+	elsif (inc > 1.5)
+		inc = 2
+	else
+		inc = 1
+	end	
+	(inc * scl.to_f)
+end
+
+# State engine
+def cbDraw
+	if (!$done)
+		benchmark()
+	elsif (!$ready)
+		cleanup()
+	else
+		sleep(1)
+		draw_stats()
+	end
+end
+
+# Keyboard handler
+def cbKeyPressed(key,x,y)
+  if (key == ?\e or key == ?q)
+		glutDestroyWindow($app)
+		exit(0)
+	end
+	if ($done && key == ?r)
+		draw_stats()
+	end
+end
+
+
+### METHODS TO BENCHMARK
+
+$va_types = {
+	"q"   => method(:make_quads_va),
+	"t"   => method(:make_tris_va),
+	"qs"  => method(:make_qs_va),
+	"ts"  => method(:make_ts_va),
+}
+
+$dl_types = {
+	"qs"  => method(:draw_qs),
+  "ts"  => method(:draw_ts),
+  "qsv" => method(:draw_qs_va),
+	"tsv" => method(:draw_ts_va),
+}
+
+$tests = [
+	# Nick    Draw Routine          Stats Calc           Type     Graph Color
+#	["empty",method(:draw_empty),   method(:stats_empty),'single',[1 ,  1,  1], 0xFFFF],
+	["t"    ,method(:draw_tris),    method(:stats_tris) ,'slow',  [1 ,  0,  0], 0xAAAA],
+	["q"    ,method(:draw_quads),   method(:stats_quads),'slow',  [1 ,0.5,  0], 0xAAAA],
+	["ts"   ,method(:draw_ts),      method(:stats_ts),   'slow',  [1 ,  1,  0], 0xAAAA],
+	["qs"   ,method(:draw_qs),      method(:stats_qs),   'slow',  [0 ,  1,  0], 0xAAAA],
+	["tsd"  ,method(:draw_ts_dl),   method(:stats_ts),   'fast',  [0 ,  1,  1], 0xAAAA],
+	["qsd"  ,method(:draw_qs_dl),   method(:stats_qs),   'fast',  [0 ,  0,  1], 0xAAAA],
+	["tv"   ,method(:draw_tris_va), method(:stats_tris), 'fast',  [0.8,  0, 0], 0xFFFF],
+	["qv"   ,method(:draw_quads_va),method(:stats_quads),'fast',  [0.8,0.4, 0], 0xFFFF],
+	["tsv"  ,method(:draw_ts_va),   method(:stats_ts),   'fast',  [0.8,0.8, 0], 0xFFFF],
+	["qsv"  ,method(:draw_qs_va),   method(:stats_qs),   'fast',  [0 ,0.8,  0], 0xFFFF],
+	["tsvd" ,method(:draw_ts_va_dl),method(:stats_ts),   'fast',  [0 ,0.8,0.8], 0xFFFF],
+	["qsvd" ,method(:draw_qs_va_dl),method(:stats_qs),   'fast',  [0 ,  0,0.8], 0xFFFF],
+]
+
+# Start from main function ()
+main()
+
diff -pruN 0.32f-2.1/ext/common/common.h 0.60.0-0ubuntu3/ext/common/common.h
--- 0.32f-2.1/ext/common/common.h	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/ext/common/common.h	2007-12-28 01:32:13.000000000 +0000
@@ -0,0 +1,423 @@
+/*
+ * Last edit by previous maintainer:
+ * 2000/01/06 16:37:43, kusano
+ *
+ * Copyright (C) 1999 - 2005 Yoshi <yoshi@giganet.net>
+ * Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
+ * Copyright (C) 2007 James Adam <james@lazyatom.com>
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
+ *
+ * This program is distributed under the terms of the MIT license.
+ * See the included MIT-LICENSE file for the terms of this license.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#include <ruby.h>
+
+#include <ctype.h>
+
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#include <GLUT/glut.h>
+#include <mach-o/dyld.h>
+#include <stdlib.h>
+#include <string.h>
+#elif defined WIN32
+#include <windows.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glut.h>
+#else
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glu.h>
+#include <GL/glut.h>
+#endif
+
+#include "gl-types.h"
+#include "gl-enums.h"
+#include "glu-enums.h"
+#include "gl-error.h"
+
+#include "funcdef.h"
+#include "conv.h"
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+
+#ifndef CALLBACK
+#define CALLBACK
+#endif
+
+#ifndef GLUTCALLBACK
+#define GLUTCALLBACK
+#endif
+
+#ifdef WIN32
+#define DLLEXPORT __declspec(dllexport)
+#else
+#define DLLEXPORT
+#endif
+
+/* */
+
+/* at least GL_MAX_VERTEX_ATTRIBS - usually 16 or 32 on today's high-end cards */
+#define _MAX_VERTEX_ATTRIBS 64
+
+typedef struct RArray RArray;
+
+extern VALUE cProc;
+
+/* For now we do not honor pixel store modes, so we need to
+  force them to defaults on each affected function call for
+  correct size requirement calculations */
+#define FORCE_PIXEL_STORE_MODE \
+	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); \
+	glPixelStorei(GL_PACK_ALIGNMENT, 1); \
+	glPixelStorei(GL_PACK_SKIP_PIXELS, 0); \
+	glPixelStorei(GL_PACK_SKIP_ROWS, 0); \
+	glPixelStorei(GL_PACK_ROW_LENGTH, 0); \
+	glPixelStorei(GL_PACK_SKIP_IMAGES, 0); \
+	glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0); \
+	if (CheckVersionExtension("GL_SGIS_texture4D")) { \
+		glPixelStorei(GL_PACK_SKIP_VOLUMES_SGIS, 0); \
+		glPixelStorei(GL_PACK_IMAGE_DEPTH_SGIS, 0); \
+	}
+
+#define RESTORE_PIXEL_STORE_MODE \
+	glPopClientAttrib();
+
+GLboolean CheckVersionExtension(const char *name);
+GLint CheckBufferBinding(GLint buffer);
+
+/* -------------------------------------------------------------------- */
+
+/* gets number of components for given format */
+static inline int glformat_size(GLenum format)
+{
+	switch(format)
+	{
+		case GL_COLOR_INDEX:
+		case GL_RED:
+		case GL_GREEN:
+		case GL_BLUE:
+		case GL_ALPHA:
+		case GL_RED_INTEGER_EXT:
+		case GL_GREEN_INTEGER_EXT:
+		case GL_BLUE_INTEGER_EXT:
+		case GL_ALPHA_INTEGER_EXT:
+		case GL_STENCIL_INDEX:
+		case GL_DEPTH_COMPONENT:
+		case GL_LUMINANCE:
+		case GL_LUMINANCE_INTEGER_EXT:
+			return 1;
+		
+		case GL_LUMINANCE_ALPHA:
+		case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+		case GL_422_EXT:
+		case GL_422_REV_EXT:
+		case GL_422_AVERAGE_EXT:
+		case GL_422_REV_AVERAGE_EXT:
+		case GL_YCRCB_422_SGIX:
+		case GL_YCBCR_422_APPLE:
+		case GL_YCBCR_MESA:
+		case GL_DEPTH_STENCIL_NV:
+		case GL_HILO_NV:
+		case GL_DSDT_NV:
+		case GL_DUDV_ATI:
+		case GL_DU8DV8_ATI:
+		case GL_FORMAT_SUBSAMPLE_24_24_OML:
+			return 2;
+		
+		case GL_RGB:
+		case GL_RGB_INTEGER_EXT:
+		case GL_BGR_EXT:
+		case GL_BGR_INTEGER_EXT:
+		case GL_YCRCB_444_SGIX:
+		case GL_DSDT_MAG_NV:
+		case GL_FORMAT_SUBSAMPLE_244_244_OML:
+			return 3;
+		
+		case GL_RGBA:
+		case GL_RGBA_INTEGER_EXT:
+		case GL_BGRA_EXT:
+		case GL_BGRA_INTEGER_EXT:
+		case GL_ABGR_EXT:
+		case GL_CMYK_EXT:
+		case GL_DSDT_MAG_VIB_NV:
+			return 4;
+
+		case GL_CMYKA_EXT:
+			return 5;
+
+		/* GL spec permits passing direct format size instead of enum (now obsolete) */
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			return format;
+
+		default:
+			rb_raise(rb_eArgError, "Unknown GL format enum %i",format);
+			return -1; /* not reached */
+	}
+}
+
+/* computes unit (pixel) size for given type and format */
+static inline int gltype_glformat_unit_size(GLenum type,GLenum format)
+{
+	unsigned int format_size;
+	
+	format_size = glformat_size(format);
+	
+	switch(type)
+	{
+		case GL_BYTE:
+		case GL_UNSIGNED_BYTE:
+		case GL_BITMAP:
+			return 1*format_size;
+
+		case GL_SHORT:
+		case GL_UNSIGNED_SHORT:
+		case GL_HALF_FLOAT_ARB:
+			return 2*format_size;
+
+		case GL_INT:
+		case GL_UNSIGNED_INT:
+		case GL_FLOAT:
+			return 4*format_size;
+
+		/* in packed formats all components are packed into/unpacked from single datatype,
+		   so number of components(format_size) doesn't matter for total size calculation */
+		case GL_UNSIGNED_BYTE_3_3_2:
+		case GL_UNSIGNED_BYTE_2_3_3_REV:
+			return 1;
+
+		case GL_UNSIGNED_SHORT_5_6_5:
+		case GL_UNSIGNED_SHORT_5_6_5_REV:
+		case GL_UNSIGNED_SHORT_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:
+			return 2;
+
+		case GL_UNSIGNED_INT_8_8_8_8:
+		case GL_UNSIGNED_INT_8_8_8_8_REV:
+		case GL_UNSIGNED_INT_10_10_10_2:
+		case GL_UNSIGNED_INT_2_10_10_10_REV:
+		case GL_UNSIGNED_INT_24_8_NV:
+		case GL_UNSIGNED_INT_S8_S8_8_8_NV:
+		case GL_UNSIGNED_INT_8_8_S8_S8_REV_NV:
+		case GL_UNSIGNED_INT_10F_11F_11F_REV_EXT:
+		case GL_UNSIGNED_INT_5_9_9_9_REV_EXT:
+		case GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV:
+			return 4;
+	
+		default:
+			rb_raise(rb_eArgError, "Unknown GL type enum %i",type);
+			return -1; /* not reached */
+	}
+}
+
+/* returns size(units) for given type of shader uniform var */
+static inline int get_uniform_size(GLenum uniform_type)
+{
+	int uniform_size = 0;
+
+	switch (uniform_type) { 
+		case GL_FLOAT: 
+		case GL_INT: 
+		case GL_UNSIGNED_INT: 
+		case GL_BOOL: 
+		case GL_SAMPLER_1D: 
+		case GL_SAMPLER_2D: 
+		case GL_SAMPLER_3D: 
+		case GL_SAMPLER_CUBE: 
+		case GL_SAMPLER_1D_SHADOW: 
+		case GL_SAMPLER_2D_SHADOW: 
+		case GL_SAMPLER_2D_RECT_ARB: 
+		case GL_SAMPLER_2D_RECT_SHADOW_ARB: 
+		case GL_SAMPLER_1D_ARRAY_EXT: 
+		case GL_SAMPLER_2D_ARRAY_EXT: 
+		case GL_SAMPLER_BUFFER_EXT: 
+		case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: 
+		case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: 
+		case GL_SAMPLER_CUBE_SHADOW_EXT: 
+		case GL_INT_SAMPLER_1D_EXT: 
+		case GL_INT_SAMPLER_2D_EXT: 
+		case GL_INT_SAMPLER_3D_EXT: 
+		case GL_INT_SAMPLER_CUBE_EXT: 
+		case GL_INT_SAMPLER_2D_RECT_EXT: 
+		case GL_INT_SAMPLER_1D_ARRAY_EXT: 
+		case GL_INT_SAMPLER_2D_ARRAY_EXT: 
+		case GL_INT_SAMPLER_BUFFER_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_1D_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_2D_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_3D_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_CUBE_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT: 
+		case GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT: 
+			uniform_size = 1; 
+			break; 
+		case GL_FLOAT_VEC2: 
+		case GL_INT_VEC2: 
+		case GL_UNSIGNED_INT_VEC2_EXT: 
+		case GL_BOOL_VEC2: 
+			uniform_size = 2; 
+			break; 
+		case GL_FLOAT_VEC3: 
+		case GL_INT_VEC3: 
+		case GL_UNSIGNED_INT_VEC3_EXT: 
+		case GL_BOOL_VEC3: 
+			uniform_size = 3; 
+			break; 
+		case GL_FLOAT_VEC4: 
+		case GL_INT_VEC4: 
+		case GL_UNSIGNED_INT_VEC4_EXT: 
+		case GL_BOOL_VEC4: 
+		case GL_FLOAT_MAT2: 
+			uniform_size = 4; 
+			break; 
+		case GL_FLOAT_MAT2x3: 
+		case GL_FLOAT_MAT3x2: 
+			uniform_size = 6; 
+			break; 
+		case GL_FLOAT_MAT2x4: 
+		case GL_FLOAT_MAT4x2: 
+			uniform_size = 8; 
+			break; 
+		case GL_FLOAT_MAT3: 
+			uniform_size = 9; 
+			break; 
+		case GL_FLOAT_MAT4x3: 
+		case GL_FLOAT_MAT3x4: 
+			uniform_size = 12; 
+			break; 
+		case GL_FLOAT_MAT4: 
+			uniform_size = 16; 
+			break; 
+		default: 
+			rb_raise(rb_eTypeError, "Unsupported uniform type '%i'",uniform_type);
+	}
+	return uniform_size;
+}
+
+static inline int GetDataSize(GLenum type,GLenum format,int num)
+{
+	int size;
+	int unit_size;
+
+	unit_size = gltype_glformat_unit_size(type,format);
+	
+	if (type==GL_BITMAP)
+		size = unit_size*(num/8); /* FIXME account for alignment */
+	else
+		size = unit_size*num;
+
+	return size;
+}
+
+/* Checks if data size of 'data' string confirms to passed format values */
+/* 'num' is number of elements, each of size 'format' * 'type' */
+static inline void CheckDataSize(GLenum type,GLenum format,int num,VALUE data)
+{
+	int size;
+
+	size = GetDataSize(type,format,num);
+	
+	if (RSTRING_LEN(data) < size)
+		rb_raise(rb_eArgError, "Length of specified data doesn't correspond to format and type parameters passed. Calculated length: %i",size);
+}
+
+/* -------------------------------------------------------------------- */
+static inline VALUE allocate_buffer_with_string( int size )
+{
+    return rb_str_new(NULL, size);
+}
+
+/* -------------------------------------------------------------------- */
+static inline void *load_gl_function(const char *name,int raise) 
+{
+	void *func_ptr = NULL;
+
+#if defined(__APPLE__)
+	static const struct mach_header* library = NULL;
+	char* symbolName;
+	NSSymbol symbol;
+	if (library == NULL)
+		library = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+
+	if (library == NULL)
+		rb_raise(rb_eRuntimeError,"Can't load OpenGL library for dynamic loading");
+		
+	/*  prepend a '_' for the Unix C symbol mangling convention  */
+	symbolName = ALLOC_N(char,strlen(name) + 2);
+	symbolName[0] = '_';
+	strcpy(symbolName+1, name);
+
+	symbol = NSLookupSymbolInImage(library,symbolName,NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+	xfree(symbolName);
+
+	if (symbol == NULL)
+		func_ptr = NULL;
+	else
+		func_ptr = NSAddressOfSymbol(symbol);
+#elif defined(WIN32) || defined(_WIN32)
+	func_ptr = wglGetProcAddress((LPCSTR)name);
+#elif defined(GLX_VERSION_1_4)
+	func_ptr = glXGetProcAddress((const GLubyte *)name);
+#else
+	func_ptr = glXGetProcAddressARB((const GLubyte *)name);
+#endif
+
+	if (func_ptr == NULL && raise == 1)
+		rb_raise(rb_eNotImpError,"Function %s is not available on this system",name);
+
+	return func_ptr;
+}
+
+static inline VALUE pack_array_or_pass_string(GLenum type,VALUE ary)
+{
+	char *type_str;
+
+	if (TYPE(ary)==T_STRING)
+		return ary;
+
+	Check_Type(ary,T_ARRAY);
+
+	switch(type) {
+		case GL_FLOAT:          type_str = "f*"; break;
+		case GL_DOUBLE:         type_str = "d*"; break;
+		case GL_BYTE:	          type_str = "c*"; break;
+		case GL_SHORT:          type_str = "s*"; break;
+		case GL_INT:            type_str = "i*"; break;
+		case GL_UNSIGNED_BYTE:  type_str = "C*"; break;
+		case GL_UNSIGNED_SHORT: type_str = "S*"; break;
+		case GL_UNSIGNED_INT:	  type_str = "I*"; break;
+		default:
+			rb_raise(rb_eTypeError,"Unknown type %i",type);
+			return Qnil; /* not reached */
+	}
+
+	return rb_funcall(ary,rb_intern("pack"),1,rb_str_new2(type_str));
+}
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _COMMON_H_ */
diff -pruN 0.32f-2.1/ext/common/conv.h 0.60.0-0ubuntu3/ext/common/conv.h
--- 0.32f-2.1/ext/common/conv.h	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/ext/common/conv.h	2007-12-28 15:15:58.000000000 +0000
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
+ *
+ * This program is distributed under the terms of the MIT license.
+ * See the included MIT-LICENSE file for the terms of this license.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
+ */
+
+/* Functions and macros for datatype conversion between Ruby and C */
+
+/*
+   Fast inline conversion functions as a replacement for the ones in libruby.
+   FIXNUM_P is simple logical AND check so it comes first, TYPE() is simple function,
+   and specified in header file so it can be inlined. For conversion, FIX2LONG is
+   simple right shift, and RFLOAT()-> just pointer dereference. For converting
+   Fixnum and Float types (which accounts for 99.9% of things you would want to pass
+   to OpenGL), there is large performance boost as result.
+
+	 Also ruby 'true' and 'false' are converted to GL_TRUE/GL_FALSE for compatibility, and
+	 finally, we fallback to library functions for any other data types (and error handling).
+*/
+
+#if RUBY_VERSION <190
+#define	FLOAT_VAL_ACCESS(val) RFLOAT(val)->value
+#else
+#define	FLOAT_VAL_ACCESS(val) RFLOAT(val)->float_value
+#endif
+
+#define FASTCONV(_name_,_type_,_convfix_,_convfallback_) \
+static inline _type_ _name_(val) \
+VALUE val; \
+{ \
+	if (FIXNUM_P(val)) \
+		return (_type_) _convfix_(val); \
+\
+	if (TYPE(val) == T_FLOAT) \
+		return (_type_)FLOAT_VAL_ACCESS(val); \
+\
+	if ((val) == Qtrue) \
+		return (_type_)(GL_TRUE); \
+\
+	if ((val) == Qfalse || (val) == Qnil) \
+		return (_type_)(GL_FALSE); \
+\
+	return (_convfallback_(val)); \
+}
+
+FASTCONV(num2double,double,FIX2LONG,rb_num2dbl)
+#if SIZEOF_INT < SIZEOF_LONG
+/* For 64bit platforms with LP64 mode */
+FASTCONV(num2int,long,FIX2LONG,rb_num2int)
+FASTCONV(num2uint,unsigned long,FIX2ULONG,rb_num2uint)
+#else
+/* All other platforms */
+FASTCONV(num2int,long,FIX2LONG,(int)NUM2LONG)
+FASTCONV(num2uint,unsigned long,FIX2ULONG,(unsigned int)NUM2ULONG)
+#endif
+
+#undef NUM2DBL
+#define NUM2DBL num2double
+
+#undef NUM2INT
+#define NUM2INT num2int
+
+#undef NUM2UINT
+#define NUM2UINT num2uint
+
+#undef FASTCONV
+
+/* For conversion between ruby and GL boolean values */
+#define GLBOOL2RUBY(x) (x)==GL_TRUE? Qtrue :( (x)==GL_FALSE? Qfalse : INT2NUM((x)))
+#define RUBYBOOL2GL(x) (x)==Qtrue? GL_TRUE : GL_FALSE
+
+#define cond_GLBOOL2RUBY_FUNC(_name_,_type_,_conv_) \
+static inline VALUE _name_(GLenum pname,_type_ value) \
+{ \
+	switch (pname) { \
+	case GL_DELETE_STATUS: \
+	case GL_LINK_STATUS: \
+	case GL_VALIDATE_STATUS: \
+	case GL_COMPILE_STATUS: \
+	case GL_MINMAX_SINK: \
+	case GL_HISTOGRAM_SINK: \
+	case GL_COORD_REPLACE: \
+	case GL_TEXTURE_COMPRESSED: \
+	case GL_GENERATE_MIPMAP: \
+	case GL_TEXTURE_RESIDENT: \
+	case GL_BUFFER_MAPPED: \
+	case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: \
+	case GL_VERTEX_ATTRIB_ARRAY_ENABLED: \
+	case GL_QUERY_RESULT_AVAILABLE: \
+	case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: \
+	case GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT: \
+	case GL_FENCE_STATUS_NV: \
+	case GL_TEXTURE_FLOAT_COMPONENTS_NV: \
+	case GL_SHADER_CONSISTENT_NV: \
+	case GL_TEXTURE_COMPARE_SGIX: \
+	case GLU_TESS_BOUNDARY_ONLY: \
+	case GLU_CULLING: \
+	case GLU_AUTO_LOAD_MATRIX: \
+		return GLBOOL2RUBY(value); \
+	default: \
+		return _conv_(value); \
+	} \
+}
+
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY,GLint,INT2NUM)
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_U,GLuint,UINT2NUM)
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_LL,GLint64EXT,LL2NUM)
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_ULL,GLuint64EXT,ULL2NUM)
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_F,GLfloat,rb_float_new)
+cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_D,GLdouble,rb_float_new)
+
+
+/* For conversion between ruby array (or object that can be converted to array) and C array.
+   The C array has to be preallocated by calling function. */
+#define ARY2CTYPE(_type_,_convert_) \
+static inline int ary2c##_type_( arg, cary, maxlen ) \
+VALUE arg; \
+GL##_type_ cary[]; \
+int maxlen; \
+{ \
+    int i; \
+    struct RArray* ary; \
+    ary = RARRAY(rb_Array(arg)); \
+    if (maxlen < 1) \
+        maxlen = ary->len; \
+    else \
+        maxlen = maxlen < ary->len ? maxlen : ary->len; \
+    for (i=0; i < maxlen; i++) \
+        cary[i] = (GL##_type_)_convert_(rb_ary_entry((VALUE)ary,i)); \
+    return i; \
+}
+
+ARY2CTYPE(int,NUM2INT)
+ARY2CTYPE(uint,NUM2UINT)
+ARY2CTYPE(byte,NUM2INT)
+ARY2CTYPE(ubyte,NUM2INT)
+ARY2CTYPE(short,NUM2INT)
+ARY2CTYPE(ushort,NUM2INT)
+ARY2CTYPE(boolean,NUM2INT)
+ARY2CTYPE(float,NUM2DBL)
+ARY2CTYPE(double,NUM2DBL)
+
+#define ary2cflt ary2cfloat
+#define ary2cdbl ary2cdouble
+
+#undef ARY2CTYPE
+
+/* Converts either array or object responding to #to_a to C-style array */
+#define ARY2CMAT(_type_) \
+static inline void ary2cmat##_type_(rary, cary, cols, rows, count) \
+VALUE rary; \
+_type_ cary[]; \
+int cols,rows; \
+{ \
+	int i; \
+\
+	rary = rb_Array(rary); \
+	rary = rb_funcall(rary,rb_intern("flatten"),0); \
+\
+	if (RARRAY(rary)->len != cols*rows) \
+		rb_raise(rb_eArgError, "passed array/matrix must have %i*%i elements",cols,rows); \
+\
+	for (i=0; i < cols*rows; i++) \
+		cary[i] = (_type_) NUM2DBL(rb_ary_entry(rary,i)); \
+}
+
+ARY2CMAT(double)
+ARY2CMAT(float)
+#undef ARY2CMAT
+
+#define ARY2CMATCNT(_type_) \
+static inline void ary2cmat##_type_##count(rary, cary, cols, rows) \
+VALUE rary; \
+_type_ cary[]; \
+int cols,rows; \
+{ \
+	int i; \
+\
+	rary = rb_Array(rary); \
+	rary = rb_funcall(rary,rb_intern("flatten"),0); \
+\
+	if (RARRAY_LEN(rary)<1 || (RARRAY_LEN(rary) % (cols*rows) != 0)) {\
+		xfree(cary); \
+		rb_raise(rb_eArgError, "passed array/matrix must conatain n x (%i*%i) elements",cols,rows); \
+	} \
+\
+	for (i=0; i < RARRAY_LEN(rary); i++) \
+		cary[i] = (_type_) NUM2DBL(rb_ary_entry(rary,i)); \
+}
+
+ARY2CMATCNT(double)
+ARY2CMATCNT(float)
+#undef ARY2CMATCNT
+
+
+#define EMPTY
+#define FREE(_x_) xfree(_x_);
+
+#define RET_ARRAY_OR_SINGLE(_size_,_conv_,_params_) RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,EMPTY)
+#define RET_ARRAY_OR_SINGLE_FREE(_size_,_conv_,_params_) RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,FREE(_params_))
+
+#define RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,_extra_) \
+{ \
+	int iter; \
+	VALUE return_array; \
+	if (_size_ == 1) { \
+		return_array = _conv_(_params_[0]); \
+	} else { \
+		return_array = rb_ary_new2(_size_); \
+		for(iter=0;iter<_size_;iter++) \
+			rb_ary_push(return_array, _conv_(_params_[iter])); \
+	} \
+	_extra_ \
+	CHECK_GLERROR \
+	return return_array; \
+}
+
+#define RET_ARRAY_OR_SINGLE_BOOL(_size_,_conv_,_enum_,_params_) RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,EMPTY)
+#define RET_ARRAY_OR_SINGLE_BOOL_FREE(_size_,_conv_,_enum_,_params_) RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,FREE(_params_))
+
+#define RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,_extra_) \
+{ \
+	int iter; \
+	VALUE return_array; \
+	if (_size_ == 1) { \
+		return_array = _conv_(_enum_,_params_[0]); \
+	} else { \
+		return_array = rb_ary_new2(_size_); \
+		for(iter=0;iter<_size_;iter++) \
+			rb_ary_push(return_array, _conv_(_enum_,_params_[iter])); \
+	} \
+	_extra_ \
+	CHECK_GLERROR \
+	return return_array; \
+}
diff -pruN 0.32f-2.1/ext/common/funcdef.h 0.60.0-0ubuntu3/ext/common/funcdef.h
--- 0.32f-2.1/ext/common/funcdef.h	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/ext/common/funcdef.h	2007-12-16 01:26:09.000000000 +0000
@@ -0,0 +1,280 @@
+/*
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
+ *
+ * This program is distributed under the terms of the MIT license.
+ * See the included MIT-LICENSE file for the terms of this license.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
+ */
+
+/* These macros are for simplification of function definition, as passing
+  arguments from/to OpenGL usually follows the same few patterns. It would
+  be probably wise to adapt the whole bindings to C++ (templates, overloaded
+  functions, etc.), but for now supporting ruby extension for Windows means
+  MSVC6, and that in turn means unspeakable horrors and pains for everyone
+  attempting to merely write, much less debug or maintain any template-based
+  code.
+*/
+
+/* Will load function pointer for function _NAME_ on first call to the
+  function, or raise if the OpenGL version is less then required or the
+  required extension is not supported */
+#define LOAD_GL_FUNC(_NAME_,_VEREXT_) \
+if (fptr_##_NAME_==NULL) { \
+	if (CheckVersionExtension(_VEREXT_)==GL_FALSE) { \
+		if (isdigit(_VEREXT_[0])) \
+			rb_raise(rb_eNotImpError,"OpenGL version %s is not available on this system",_VEREXT_); \
+		else \
+			rb_raise(rb_eNotImpError,"Extension %s is not available on this system",_VEREXT_); \
+	} \
+	fptr_##_NAME_ = load_gl_function(#_NAME_, 1); \
+}
+
+/* Macroset for defining simple functions, i.e. functions that take n arguments and
+  pass them to GL API function without any additional processing.
+
+  Some checking is implicit in _conversion_ argument - e.g. NUM2INT makes sure that
+  user is really passing type that can be converted to INT, otherwire raises.
+  
+  *_LOAD version of macros are for defining functions where we load function pointer
+  instead of direct call - that means all functions above OpenGL 1.1 (including all extensions)
+*/
+
+#define ARGLIST0 
+#define ARGLIST1 ,arg1
+#define ARGLIST2 ,arg1,arg2
+#define ARGLIST3 ,arg1,arg2,arg3
+#define ARGLIST4 ,arg1,arg2,arg3,arg4
+#define ARGLIST5 ,arg1,arg2,arg3,arg4,arg5
+#define ARGLIST6 ,arg1,arg2,arg3,arg4,arg5,arg6
+#define ARGLIST7 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7
+#define ARGLIST8 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8
+#define ARGLIST9 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9
+#define ARGLIST10 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10
+
+#define CONV_GLenum (GLenum)NUM2UINT
+#define CONV_GLboolean (GLboolean)NUM2UINT
+#define CONV_GLbitfield (GLbitfield)NUM2UINT
+#define CONV_GLbyte (GLbyte)NUM2INT
+#define CONV_GLshort (GLshort)NUM2INT
+#define CONV_GLint (GLint)NUM2INT
+#define CONV_GLubyte (GLubyte)NUM2UINT
+#define CONV_GLushort (GLushort)NUM2UINT
+#define CONV_GLuint (GLuint)NUM2UINT
+#define CONV_GLsizei (GLsizei)NUM2INT
+#define CONV_GLfloat (GLfloat)NUM2DBL
+#define CONV_GLclampf (GLclampf)NUM2DBL
+#define CONV_GLdouble (GLdouble)NUM2DBL
+#define CONV_GLclampd (GLclampd)NUM2DBL
+
+#define RETDECL_BASE(_t_) _t_ ret = (_t_) 0;
+#define RETDECL_GLvoid
+#define RETDECL_void
+#define RETDECL_GLenum RETDECL_BASE(GLenum)
+#define RETDECL_GLboolean RETDECL_BASE(GLboolean)
+#define RETDECL_GLbitfield RETDECL_BASE(GLbitfield)
+#define RETDECL_GLbyte RETDECL_BASE(GLbyte)
+#define RETDECL_GLshort RETDECL_BASE(GLshort)
+#define RETDECL_GLint RETDECL_BASE(GLint)
+#define RETDECL_GLubyte RETDECL_BASE(GLubyte)
+#define RETDECL_GLushort RETDECL_BASE(GLushort)
+#define RETDECL_GLuint RETDECL_BASE(GLuint)
+#define RETDECL_GLsizei RETDECL_BASE(GLsizei)
+#define RETDECL_GLfloat RETDECL_BASE(GLfloat)
+#define RETDECL_GLclampf RETDECL_BASE(GLclampf)
+#define RETDECL_GLdouble RETDECL_BASE(GLdouble)
+#define RETDECL_GLclampd RETDECL_BASE(GLclampd)
+
+#define RETSTAT_GLvoid
+#define RETSTAT_void
+#define RETSTAT_GLenum ret=
+#define RETSTAT_GLboolean ret=
+#define RETSTAT_GLbitfield ret=
+#define RETSTAT_GLbyte ret=
+#define RETSTAT_GLshort ret=
+#define RETSTAT_GLint ret=
+#define RETSTAT_GLubyte ret=
+#define RETSTAT_GLushort ret=
+#define RETSTAT_GLuint ret=
+#define RETSTAT_GLsizei ret=
+#define RETSTAT_GLfloat ret=
+#define RETSTAT_GLclampf ret=
+#define RETSTAT_GLdouble ret=
+#define RETSTAT_GLclampd ret=
+
+#define RETCONV_GLvoid(x) Qnil
+#define RETCONV_void(x) Qnil
+#define RETCONV_GLenum(x) UINT2NUM(x)
+#define RETCONV_GLboolean(x) GLBOOL2RUBY(x)
+#define RETCONV_GLbitfield(x) UINT2NUM(x)
+#define RETCONV_GLbyte(x) INT2NUM(x)
+#define RETCONV_GLshort(x) INT2NUM(x)
+#define RETCONV_GLint(x) INT2NUM(x)
+#define RETCONV_GLubyte(x) UINT2NUM(x)
+#define RETCONV_GLushort(x) UINT2NUM(x)
+#define RETCONV_GLuint(x) UINT2NUM(x)
+#define RETCONV_GLsizei(x) INT2NUM(x)
+#define RETCONV_GLfloat(x) rb_float_new(x)
+#define RETCONV_GLclampf(x) rb_float_new(x)
+#define RETCONV_GLdouble(x) rb_float_new(x)
+#define RETCONV_GLclampd(x) rb_float_new(x)
+
+#define PROTOPARAM0(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) void
+#define PROTOPARAM1(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1
+#define PROTOPARAM2(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2
+#define PROTOPARAM3(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3
+#define PROTOPARAM4(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4
+#define PROTOPARAM5(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5
+#define PROTOPARAM6(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6
+#define PROTOPARAM7(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7
+#define PROTOPARAM8(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8
+#define PROTOPARAM9(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8,p9
+#define PROTOPARAM10(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8,p9,p10
+
+#define CALLCONV0(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) 
+#define CALLCONV1(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1)
+#define CALLCONV2(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2)
+#define CALLCONV3(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3)
+#define CALLCONV4(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4)
+#define CALLCONV5(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5)
+#define CALLCONV6(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6)
+#define CALLCONV7(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7)
+#define CALLCONV8(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8)
+#define CALLCONV9(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8),CONV_##cv9(arg9)
+#define CALLCONV10(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8),CONV_##cv9(arg9),CONV_##cv10(arg10)
+
+#define GL_FUNC_LOAD(_num_,_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_) \
+static _returntype_ (APIENTRY * fptr_gl##_name_)(PROTOPARAM##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \
+static VALUE \
+gl_##_name_(obj ARGLIST##_num_) \
+VALUE obj ARGLIST##_num_; \
+{ \
+	RETDECL_##_returntype_ \
+	LOAD_GL_FUNC(gl##_name_,_ver_) \
+	RETSTAT_##_returntype_ fptr_gl##_name_(CALLCONV##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \
+	CHECK_GLERROR \
+	return RETCONV_##_returntype_(ret) ; \
+}
+
+#define GL_FUNC_STATIC(_num_,_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10) \
+static VALUE \
+gl_##_name_(obj ARGLIST##_num_) \
+VALUE obj ARGLIST##_num_; \
+{ \
+	RETDECL_##_returntype_ \
+	RETSTAT_##_returntype_ gl##_name_(CALLCONV##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \
+	CHECK_GLERROR \
+	return RETCONV_##_returntype_(ret) ; \
+}
+
+#define GL_FUNC_LOAD_0(_name_,_returntype_,_ver_) GL_FUNC_LOAD(0, _name_,_returntype_,0,0,0,0,0,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_1(_name_,_returntype_,targ1,_ver_) GL_FUNC_LOAD(1, _name_,_returntype_,targ1,0,0,0,0,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_2(_name_,_returntype_,targ1,targ2,_ver_) GL_FUNC_LOAD(2, _name_,_returntype_,targ1,targ2,0,0,0,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_3(_name_,_returntype_,targ1,targ2,targ3,_ver_) GL_FUNC_LOAD(3, _name_,_returntype_,targ1,targ2,targ3,0,0,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_4(_name_,_returntype_,targ1,targ2,targ3,targ4,_ver_) GL_FUNC_LOAD(4, _name_,_returntype_,targ1,targ2,targ3,targ4,0,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_5(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,_ver_) GL_FUNC_LOAD(5, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,0,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_6(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,_ver_) GL_FUNC_LOAD(6, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,0,0,0,0,_ver_)
+#define GL_FUNC_LOAD_7(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,_ver_) GL_FUNC_LOAD(7, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,0,0,0,_ver_)
+#define GL_FUNC_LOAD_8(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,_ver_) GL_FUNC_LOAD(8, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,0,0,_ver_)
+#define GL_FUNC_LOAD_9(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,_ver_) GL_FUNC_LOAD(9, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,0,_ver_)
+#define GL_FUNC_LOAD_10(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_) GL_FUNC_LOAD(10, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_)
+
+#define GL_FUNC_STATIC_0(_name_,_returntype_) GL_FUNC_STATIC(0, _name_,_returntype_,0,0,0,0,0,0,0,0,0,0)
+#define GL_FUNC_STATIC_1(_name_,_returntype_,targ1) GL_FUNC_STATIC(1, _name_,_returntype_,targ1,0,0,0,0,0,0,0,0,0)
+#define GL_FUNC_STATIC_2(_name_,_returntype_,targ1,targ2) GL_FUNC_STATIC(2, _name_,_returntype_,targ1,targ2,0,0,0,0,0,0,0,0)
+#define GL_FUNC_STATIC_3(_name_,_returntype_,targ1,targ2,targ3) GL_FUNC_STATIC(3, _name_,_returntype_,targ1,targ2,targ3,0,0,0,0,0,0,0)
+#define GL_FUNC_STATIC_4(_name_,_returntype_,targ1,targ2,targ3,targ4) GL_FUNC_STATIC(4, _name_,_returntype_,targ1,targ2,targ3,targ4,0,0,0,0,0,0)
+#define GL_FUNC_STATIC_5(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5) GL_FUNC_STATIC(5, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,0,0,0,0,0)
+#define GL_FUNC_STATIC_6(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6) GL_FUNC_STATIC(6, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,0,0,0,0)
+#define GL_FUNC_STATIC_7(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7) GL_FUNC_STATIC(7, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,0,0,0)
+#define GL_FUNC_STATIC_8(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8) GL_FUNC_STATIC(8, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,0,0)
+#define GL_FUNC_STATIC_9(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9) GL_FUNC_STATIC(9, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,0)
+#define GL_FUNC_STATIC_10(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10_ver_) GL_FUNC_STATIC(10, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)
+
+/* Templates for glGen* and glDelete* */
+
+#define GL_FUNC_GENOBJECTS_LOAD(_name_,_ver_) \
+static void (APIENTRY * fptr_gl##_name_)(GLsizei,GLuint *); \
+static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
+{ \
+	GLsizei n; \
+	GLuint *objects; \
+	VALUE ret; \
+	unsigned int i; \
+	LOAD_GL_FUNC(gl##_name_,_ver_) \
+	n = CONV_GLsizei(arg1); \
+	objects = ALLOC_N(GLuint, n); \
+	fptr_gl##_name_(n,objects); \
+	ret = rb_ary_new2(n); \
+	for (i = 0; i < n; i++) \
+		rb_ary_push(ret, RETCONV_GLuint(objects[i])); \
+	xfree(objects); \
+	CHECK_GLERROR \
+	return ret; \
+}
+
+#define GL_FUNC_GENOBJECTS(_name_) \
+static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
+{ \
+	GLsizei n; \
+	GLuint *objects; \
+	VALUE ret; \
+	unsigned int i; \
+	n = CONV_GLsizei(arg1); \
+	objects = ALLOC_N(GLuint, n); \
+	gl##_name_(n,objects); \
+	ret = rb_ary_new2(n); \
+	for (i = 0; i < n; i++) \
+		rb_ary_push(ret, RETCONV_GLuint(objects[i])); \
+	xfree(objects); \
+	CHECK_GLERROR \
+	return ret; \
+}
+
+#define GL_FUNC_DELETEOBJECTS_LOAD(_name_,_ver_) \
+static void (APIENTRY * fptr_gl##_name_)(GLsizei,const GLuint *); \
+static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
+{ \
+	GLsizei n; \
+	LOAD_GL_FUNC(gl##_name_,_ver_) \
+	if (TYPE(arg1)==T_ARRAY) { \
+		GLuint *objects; \
+		n = RARRAY(arg1)->len; \
+		objects = ALLOC_N(GLuint,n); \
+		ary2cuint(arg1,objects,n);  \
+		fptr_gl##_name_(n,objects); \
+		xfree(objects); \
+	} else { \
+		GLuint object; \
+		object = CONV_GLsizei(arg1); \
+		fptr_gl##_name_(1,&object);  \
+	} \
+	CHECK_GLERROR \
+	return Qnil; \
+}
+
+#define GL_FUNC_DELETEOBJECTS(_name_) \
+static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
+{ \
+	GLsizei n; \
+	if (TYPE(arg1)==T_ARRAY) { \
+		GLuint *objects; \
+		n = RARRAY(arg1)->len; \
+		objects = ALLOC_N(GLuint,n); \
+		ary2cuint(arg1,objects,n);  \
+		gl##_name_(n,objects); \
+		xfree(objects); \
+	} else { \
+		GLuint object; \
+		object = CONV_GLsizei(arg1); \
+		gl##_name_(1,&object);  \
+	} \
+	CHECK_GLERROR \
+	return Qnil; \
+}
diff -pruN 0.32f-2.1/ext/common/gl-enums.h 0.60.0-0ubuntu3/ext/common/gl-enums.h
--- 0.32f-2.1/ext/common/gl-enums.h	1970-01-01 01:00:00.000000000 +0100
+++ 0.60.0-0ubuntu3/ext/common/gl-enums.h	2007-07-23 13:43:48.000000000 +0100
@@ -0,0 +1,9155 @@
+/* This file was genereated on Mon Jul 23 13:56:17 +0200 2007
+   source: http://www.opengl.org/registry/api/enum.spec
+   source: http://www.opengl.org/registry/api/enumext.spec
+*/
+
+#ifndef GL_1PASS_EXT
+#define GL_1PASS_EXT 0x80A1
+#endif
+#ifndef GL_1PASS_SGIS
+#define GL_1PASS_SGIS 0x80A1
+#endif
+#ifndef GL_2D
+#define GL_2D 0x0600
+#endif
+#ifndef GL_2PASS_0_EXT
+#define GL_2PASS_0_EXT 0x80A2
+#endif
+#ifndef GL_2PASS_0_SGIS
+#define GL_2PASS_0_SGIS 0x80A2
+#endif
+#ifndef GL_2PASS_1_EXT
+#define GL_2PASS_1_EXT 0x80A3
+#endif
+#ifndef GL_2PASS_1_SGIS
+#define GL_2PASS_1_SGIS 0x80A3
+#endif
+#ifndef GL_2X_BIT_ATI
+#define GL_2X_BIT_ATI 0x00000001
+#endif
+#ifndef GL_2_BYTES
+#define GL_2_BYTES 0x1407
+#endif
+#ifndef GL_3D
+#define GL_3D 0x0601
+#endif
+#ifndef GL_3D_COLOR
+#define GL_3D_COLOR 0x0602
+#endif
+#ifndef GL_3D_COLOR_TEXTURE
+#define GL_3D_COLOR_TEXTURE 0x0603
+#endif
+#ifndef GL_3_BYTES
+#define GL_3_BYTES 0x1408
+#endif
+#ifndef GL_422_AVERAGE_EXT
+#define GL_422_AVERAGE_EXT 0x80CE
+#endif
+#ifndef GL_422_EXT
+#define GL_422_EXT 0x80CC
+#endif
+#ifndef GL_422_REV_AVERAGE_EXT
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+#ifndef GL_422_REV_EXT
+#define GL_422_REV_EXT 0x80CD
+#endif
+#ifndef GL_4D_COLOR_TEXTURE
+#define GL_4D_COLOR_TEXTURE 0x0604
+#endif
+#ifndef GL_4PASS_0_EXT
+#define GL_4PASS_0_EXT 0x80A4
+#endif
+#ifndef GL_4PASS_0_SGIS
+#define GL_4PASS_0_SGIS 0x80A4
+#endif
+#ifndef GL_4PASS_1_EXT
+#define GL_4PASS_1_EXT 0x80A5
+#endif
+#ifndef GL_4PASS_1_SGIS
+#define GL_4PASS_1_SGIS 0x80A5
+#endif
+#ifndef GL_4PASS_2_EXT
+#define GL_4PASS_2_EXT 0x80A6
+#endif
+#ifndef GL_4PASS_2_SGIS
+#define GL_4PASS_2_SGIS 0x80A6
+#endif
+#ifndef GL_4PASS_3_EXT
+#define GL_4PASS_3_EXT 0x80A7
+#endif
+#ifndef GL_4PASS_3_SGIS
+#define GL_4PASS_3_SGIS 0x80A7
+#endif
+#ifndef GL_4X_BIT_ATI
+#define GL_4X_BIT_ATI 0x00000002
+#endif
+#ifndef GL_4_BYTES
+#define GL_4_BYTES 0x1409
+#endif
+#ifndef GL_8X_BIT_ATI
+#define GL_8X_BIT_ATI 0x00000004
+#endif
+#ifndef GL_ABGR_EXT
+#define GL_ABGR_EXT 0x8000
+#endif
+#ifndef GL_ACCUM
+#define GL_ACCUM 0x0100
+#endif
+#ifndef GL_ACCUM_ALPHA_BITS
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#endif
+#ifndef GL_ACCUM_BLUE_BITS
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#endif
+#ifndef GL_ACCUM_BUFFER_BIT
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#endif
+#ifndef GL_ACCUM_CLEAR_VALUE
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#endif
+#ifndef GL_ACCUM_GREEN_BITS
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#endif
+#ifndef GL_ACCUM_RED_BITS
+#define GL_ACCUM_RED_BITS 0x0D58
+#endif
+#ifndef GL_ACTIVE_ATTRIBUTES
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#endif
+#ifndef GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#endif
+#ifndef GL_ACTIVE_STENCIL_FACE_EXT
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+#ifndef GL_ACTIVE_TEXTURE
+#define GL_ACTIVE_TEXTURE 0x84E0
+#endif
+#ifndef GL_ACTIVE_TEXTURE_ARB
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#endif
+#ifndef GL_ACTIVE_UNIFORMS
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#endif
+#ifndef GL_ACTIVE_UNIFORM_MAX_LENGTH
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#endif
+#ifndef GL_ACTIVE_VARYINGS_NV
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#endif
+#ifndef GL_ACTIVE_VARYING_MAX_LENGTH_NV
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#endif
+#ifndef GL_ACTIVE_VERTEX_UNITS_ARB
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#endif
+#ifndef GL_ADD
+#define GL_ADD 0x0104
+#endif
+#ifndef GL_ADD_ATI
+#define GL_ADD_ATI 0x8963
+#endif
+#ifndef GL_ADD_SIGNED
+#define GL_ADD_SIGNED 0x8574
+#endif
+#ifndef GL_ADD_SIGNED_ARB
+#define GL_ADD_SIGNED_ARB 0x8574
+#endif
+#ifndef GL_ADD_SIGNED_EXT
+#define GL_ADD_SIGNED_EXT 0x8574
+#endif
+#ifndef GL_ALIASED_LINE_WIDTH_RANGE
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+#ifndef GL_ALIASED_POINT_SIZE_RANGE
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#endif
+#ifndef GL_ALLOW_DRAW_FRG_HINT_PGI
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#endif
+#ifndef GL_ALLOW_DRAW_MEM_HINT_PGI
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#endif
+#ifndef GL_ALLOW_DRAW_OBJ_HINT_PGI
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#endif
+#ifndef GL_ALLOW_DRAW_WIN_HINT_PGI
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#endif
+#ifndef GL_ALL_ATTRIB_BITS
+#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
+#endif
+#ifndef GL_ALL_COMPLETED_NV
+#define GL_ALL_COMPLETED_NV 0x84F2
+#endif
+#ifndef GL_ALPHA
+#define GL_ALPHA 0x1906
+#endif
+#ifndef GL_ALPHA12
+#define GL_ALPHA12 0x803D
+#endif
+#ifndef GL_ALPHA12_EXT
+#define GL_ALPHA12_EXT 0x803D
+#endif
+#ifndef GL_ALPHA16
+#define GL_ALPHA16 0x803E
+#endif
+#ifndef GL_ALPHA16F_ARB
+#define GL_ALPHA16F_ARB 0x881C
+#endif
+#ifndef GL_ALPHA16I_EXT
+#define GL_ALPHA16I_EXT 0x8D8A
+#endif
+#ifndef GL_ALPHA16UI_EXT
+#define GL_ALPHA16UI_EXT 0x8D78
+#endif
+#ifndef GL_ALPHA16_EXT
+#define GL_ALPHA16_EXT 0x803E
+#endif
+#ifndef GL_ALPHA32F_ARB
+#define GL_ALPHA32F_ARB 0x8816
+#endif
+#ifndef GL_ALPHA32I_EXT
+#define GL_ALPHA32I_EXT 0x8D84
+#endif
+#ifndef GL_ALPHA32UI_EXT
+#define GL_ALPHA32UI_EXT 0x8D72
+#endif
+#ifndef GL_ALPHA4
+#define GL_ALPHA4 0x803B
+#endif
+#ifndef GL_ALPHA4_EXT
+#define GL_ALPHA4_EXT 0x803B
+#endif
+#ifndef GL_ALPHA8
+#define GL_ALPHA8 0x803C
+#endif
+#ifndef GL_ALPHA8I_EXT
+#define GL_ALPHA8I_EXT 0x8D90
+#endif
+#ifndef GL_ALPHA8UI_EXT
+#define GL_ALPHA8UI_EXT 0x8D7E
+#endif
+#ifndef GL_ALPHA8_EXT
+#define GL_ALPHA8_EXT 0x803C
+#endif
+#ifndef GL_ALPHA_BIAS
+#define GL_ALPHA_BIAS 0x0D1D
+#endif
+#ifndef GL_ALPHA_BITS
+#define GL_ALPHA_BITS 0x0D55
+#endif
+#ifndef GL_ALPHA_FLOAT16_ATI
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#endif
+#ifndef GL_ALPHA_FLOAT32_ATI
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#endif
+#ifndef GL_ALPHA_INTEGER_EXT
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#endif
+#ifndef GL_ALPHA_MAX_CLAMP_INGR
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+#ifndef GL_ALPHA_MAX_SGIX
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+#ifndef GL_ALPHA_MIN_CLAMP_INGR
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#endif
+#ifndef GL_ALPHA_MIN_SGIX
+#define GL_ALPHA_MIN_SGIX 0x8320
+#endif
+#ifndef GL_ALPHA_SCALE
+#define GL_ALPHA_SCALE 0x0D1C
+#endif
+#ifndef GL_ALPHA_TEST
+#define GL_ALPHA_TEST 0x0BC0
+#endif
+#ifndef GL_ALPHA_TEST_FUNC
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#endif
+#ifndef GL_ALPHA_TEST_REF
+#define GL_ALPHA_TEST_REF 0x0BC2
+#endif
+#ifndef GL_ALWAYS
+#define GL_ALWAYS 0x0207
+#endif
+#ifndef GL_ALWAYS_FAST_HINT_PGI
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#endif
+#ifndef GL_ALWAYS_SOFT_HINT_PGI
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#endif
+#ifndef GL_AMBIENT
+#define GL_AMBIENT 0x1200
+#endif
+#ifndef GL_AMBIENT_AND_DIFFUSE
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#endif
+#ifndef GL_AND
+#define GL_AND 0x1501
+#endif
+#ifndef GL_AND_INVERTED
+#define GL_AND_INVERTED 0x1504
+#endif
+#ifndef GL_AND_REVERSE
+#define GL_AND_REVERSE 0x1502
+#endif
+#ifndef GL_ARB_imaging
+#define GL_ARB_imaging 1
+#endif
+#ifndef GL_ARRAY_BUFFER
+#define GL_ARRAY_BUFFER 0x8892
+#endif
+#ifndef GL_ARRAY_BUFFER_ARB
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#endif
+#ifndef GL_ARRAY_BUFFER_BINDING
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#endif
+#ifndef GL_ARRAY_BUFFER_BINDING_ARB
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#endif
+#ifndef GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+#ifndef GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#endif
+#ifndef GL_ARRAY_OBJECT_BUFFER_ATI
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#endif
+#ifndef GL_ARRAY_OBJECT_OFFSET_ATI
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+#ifndef GL_ASYNC_DRAW_PIXELS_SGIX
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#endif
+#ifndef GL_ASYNC_HISTOGRAM_SGIX
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#endif
+#ifndef GL_ASYNC_MARKER_SGIX
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+#ifndef GL_ASYNC_READ_PIXELS_SGIX
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#endif
+#ifndef GL_ASYNC_TEX_IMAGE_SGIX
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#endif
+#ifndef GL_ATTACHED_SHADERS
+#define GL_ATTACHED_SHADERS 0x8B85
+#endif
+#ifndef GL_ATTENUATION_EXT
+#define GL_ATTENUATION_EXT 0x834D
+#endif
+#ifndef GL_ATTRIB_ARRAY_POINTER_NV
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#endif
+#ifndef GL_ATTRIB_ARRAY_SIZE_NV
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#endif
+#ifndef GL_ATTRIB_ARRAY_STRIDE_NV
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#endif
+#ifndef GL_ATTRIB_ARRAY_TYPE_NV
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#endif
+#ifndef GL_ATTRIB_STACK_DEPTH
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#endif
+#ifndef GL_AUTO_NORMAL
+#define GL_AUTO_NORMAL 0x0D80
+#endif
+#ifndef GL_AUX0
+#define GL_AUX0 0x0409
+#endif
+#ifndef GL_AUX1
+#define GL_AUX1 0x040A
+#endif
+#ifndef GL_AUX2
+#define GL_AUX2 0x040B
+#endif
+#ifndef GL_AUX3
+#define GL_AUX3 0x040C
+#endif
+#ifndef GL_AUX_BUFFERS
+#define GL_AUX_BUFFERS 0x0C00
+#endif
+#ifndef GL_AVERAGE_EXT
+#define GL_AVERAGE_EXT 0x8335
+#endif
+#ifndef GL_AVERAGE_HP
+#define GL_AVERAGE_HP 0x8160
+#endif
+#ifndef GL_BACK
+#define GL_BACK 0x0405
+#endif
+#ifndef GL_BACK_LEFT
+#define GL_BACK_LEFT 0x0402
+#endif
+#ifndef GL_BACK_NORMALS_HINT_PGI
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+#ifndef GL_BACK_PRIMARY_COLOR_NV
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#endif
+#ifndef GL_BACK_RIGHT
+#define GL_BACK_RIGHT 0x0403
+#endif
+#ifndef GL_BACK_SECONDARY_COLOR_NV
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#endif
+#ifndef GL_BGR
+#define GL_BGR 0x80E0
+#endif
+#ifndef GL_BGRA
+#define GL_BGRA 0x80E1
+#endif
+#ifndef GL_BGRA_EXT
+#define GL_BGRA_EXT 0x80E1
+#endif
+#ifndef GL_BGRA_INTEGER_EXT
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#endif
+#ifndef GL_BGR_EXT
+#define GL_BGR_EXT 0x80E0
+#endif
+#ifndef GL_BGR_INTEGER_EXT
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#endif
+#ifndef GL_BIAS_BIT_ATI
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+#ifndef GL_BIAS_BY_NEGATIVE_ONE_HALF_NV
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#endif
+#ifndef GL_BINORMAL_ARRAY_EXT
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#endif
+#ifndef GL_BINORMAL_ARRAY_POINTER_EXT
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#endif
+#ifndef GL_BINORMAL_ARRAY_STRIDE_EXT
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#endif
+#ifndef GL_BINORMAL_ARRAY_TYPE_EXT
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#endif
+#ifndef GL_BITMAP
+#define GL_BITMAP 0x1A00
+#endif
+#ifndef GL_BITMAP_TOKEN
+#define GL_BITMAP_TOKEN 0x0704
+#endif
+#ifndef GL_BLEND
+#define GL_BLEND 0x0BE2
+#endif
+#ifndef GL_BLEND_COLOR
+#define GL_BLEND_COLOR 0x8005
+#endif
+#ifndef GL_BLEND_COLOR_EXT
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+#ifndef GL_BLEND_DST
+#define GL_BLEND_DST 0x0BE0
+#endif
+#ifndef GL_BLEND_DST_ALPHA
+#define GL_BLEND_DST_ALPHA 0x80CA
+#endif
+#ifndef GL_BLEND_DST_ALPHA_EXT
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#endif
+#ifndef GL_BLEND_DST_RGB
+#define GL_BLEND_DST_RGB 0x80C8
+#endif
+#ifndef GL_BLEND_DST_RGB_EXT
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#endif
+#ifndef GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION 0x8009
+#endif
+#ifndef GL_BLEND_EQUATION_ALPHA
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#endif
+#ifndef GL_BLEND_EQUATION_ALPHA_EXT
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+#ifndef GL_BLEND_EQUATION_EXT
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+#ifndef GL_BLEND_EQUATION_RGB
+#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
+#endif
+#ifndef GL_BLEND_EQUATION_RGB_EXT
+#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
+#endif
+#ifndef GL_BLEND_SRC
+#define GL_BLEND_SRC 0x0BE1
+#endif
+#ifndef GL_BLEND_SRC_ALPHA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#endif
+#ifndef GL_BLEND_SRC_ALPHA_EXT
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+#ifndef GL_BLEND_SRC_RGB
+#define GL_BLEND_SRC_RGB 0x80C9
+#endif
+#ifndef GL_BLEND_SRC_RGB_EXT
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#endif
+#ifndef GL_BLUE
+#define GL_BLUE 0x1905
+#endif
+#ifndef GL_BLUE_BIAS
+#define GL_BLUE_BIAS 0x0D1B
+#endif
+#ifndef GL_BLUE_BITS
+#define GL_BLUE_BITS 0x0D54
+#endif
+#ifndef GL_BLUE_BIT_ATI
+#define GL_BLUE_BIT_ATI 0x00000004
+#endif
+#ifndef GL_BLUE_INTEGER_EXT
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#endif
+#ifndef GL_BLUE_MAX_CLAMP_INGR
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#endif
+#ifndef GL_BLUE_MIN_CLAMP_INGR
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#endif
+#ifndef GL_BLUE_SCALE
+#define GL_BLUE_SCALE 0x0D1A
+#endif
+#ifndef GL_BOOL
+#define GL_BOOL 0x8B56
+#endif
+#ifndef GL_BOOL_ARB
+#define GL_BOOL_ARB 0x8B56
+#endif
+#ifndef GL_BOOL_VEC2
+#define GL_BOOL_VEC2 0x8B57
+#endif
+#ifndef GL_BOOL_VEC2_ARB
+#define GL_BOOL_VEC2_ARB 0x8B57
+#endif
+#ifndef GL_BOOL_VEC3
+#define GL_BOOL_VEC3 0x8B58
+#endif
+#ifndef GL_BOOL_VEC3_ARB
+#define GL_BOOL_VEC3_ARB 0x8B58
+#endif
+#ifndef GL_BOOL_VEC4
+#define GL_BOOL_VEC4 0x8B59
+#endif
+#ifndef GL_BOOL_VEC4_ARB
+#define GL_BOOL_VEC4_ARB 0x8B59
+#endif
+#ifndef GL_BUFFER_ACCESS
+#define GL_BUFFER_ACCESS 0x88BB
+#endif
+#ifndef GL_BUFFER_ACCESS_ARB
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#endif
+#ifndef GL_BUFFER_FLUSHING_UNMAP_APPLE
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+#endif
+#ifndef GL_BUFFER_MAPPED
+#define GL_BUFFER_MAPPED 0x88BC
+#endif
+#ifndef GL_BUFFER_MAPPED_ARB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#endif
+#ifndef GL_BUFFER_MAP_POINTER
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#endif
+#ifndef GL_BUFFER_MAP_POINTER_ARB
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#endif
+#ifndef GL_BUFFER_SERIALIZED_MODIFY_APPLE
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#endif
+#ifndef GL_BUFFER_SIZE
+#define GL_BUFFER_SIZE 0x8764
+#endif
+#ifndef GL_BUFFER_SIZE_ARB
+#define GL_BUFFER_SIZE_ARB 0x8764
+#endif
+#ifndef GL_BUFFER_USAGE
+#define GL_BUFFER_USAGE 0x8765
+#endif
+#ifndef GL_BUFFER_USAGE_ARB
+#define GL_BUFFER_USAGE_ARB 0x8765
+#endif
+#ifndef GL_BUMP_ENVMAP_ATI
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#endif
+#ifndef GL_BUMP_NUM_TEX_UNITS_ATI
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#endif
+#ifndef GL_BUMP_ROT_MATRIX_ATI
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#endif
+#ifndef GL_BUMP_ROT_MATRIX_SIZE_ATI
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#endif
+#ifndef GL_BUMP_TARGET_ATI
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+#ifndef GL_BUMP_TEX_UNITS_ATI
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#endif
+#ifndef GL_BYTE
+#define GL_BYTE 0x1400
+#endif
+#ifndef GL_C3F_V3F
+#define GL_C3F_V3F 0x2A24
+#endif
+#ifndef GL_C4F_N3F_V3F
+#define GL_C4F_N3F_V3F 0x2A26
+#endif
+#ifndef GL_C4UB_V2F
+#define GL_C4UB_V2F 0x2A22
+#endif
+#ifndef GL_C4UB_V3F
+#define GL_C4UB_V3F 0x2A23
+#endif
+#ifndef GL_CALLIGRAPHIC_FRAGMENT_SGIX
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+#ifndef GL_CCW
+#define GL_CCW 0x0901
+#endif
+#ifndef GL_CLAMP
+#define GL_CLAMP 0x2900
+#endif
+#ifndef GL_CLAMP_FRAGMENT_COLOR_ARB
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#endif
+#ifndef GL_CLAMP_READ_COLOR_ARB
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#endif
+#ifndef GL_CLAMP_TO_BORDER
+#define GL_CLAMP_TO_BORDER 0x812D
+#endif
+#ifndef GL_CLAMP_TO_BORDER_ARB
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+#ifndef GL_CLAMP_TO_BORDER_SGIS
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+#ifndef GL_CLAMP_TO_EDGE
+#define GL_CLAMP_TO_EDGE 0x812F
+#endif
+#ifndef GL_CLAMP_TO_EDGE_SGIS
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+#ifndef GL_CLAMP_VERTEX_COLOR_ARB
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#endif
+#ifndef GL_CLEAR
+#define GL_CLEAR 0x1500
+#endif
+#ifndef GL_CLIENT_ACTIVE_TEXTURE
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#endif
+#ifndef GL_CLIENT_ACTIVE_TEXTURE_ARB
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#endif
+#ifndef GL_CLIENT_ALL_ATTRIB_BITS
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+#endif
+#ifndef GL_CLIENT_ATTRIB_STACK_DEPTH
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#endif
+#ifndef GL_CLIENT_PIXEL_STORE_BIT
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#endif
+#ifndef GL_CLIENT_VERTEX_ARRAY_BIT
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#endif
+#ifndef GL_CLIP_DISTANCE_NV
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#endif
+#ifndef GL_CLIP_FAR_HINT_PGI
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#endif
+#ifndef GL_CLIP_NEAR_HINT_PGI
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#endif
+#ifndef GL_CLIP_PLANE0
+#define GL_CLIP_PLANE0 0x3000
+#endif
+#ifndef GL_CLIP_PLANE1
+#define GL_CLIP_PLANE1 0x3001
+#endif
+#ifndef GL_CLIP_PLANE2
+#define GL_CLIP_PLANE2 0x3002
+#endif
+#ifndef GL_CLIP_PLANE3
+#define GL_CLIP_PLANE3 0x3003
+#endif
+#ifndef GL_CLIP_PLANE4
+#define GL_CLIP_PLANE4 0x3004
+#endif
+#ifndef GL_CLIP_PLANE5
+#define GL_CLIP_PLANE5 0x3005
+#endif
+#ifndef GL_CLIP_VOLUME_CLIPPING_HINT_EXT
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+#ifndef GL_CMYKA_EXT
+#define GL_CMYKA_EXT 0x800D
+#endif
+#ifndef GL_CMYK_EXT
+#define GL_CMYK_EXT 0x800C
+#endif
+#ifndef GL_CND0_ATI
+#define GL_CND0_ATI 0x896B
+#endif
+#ifndef GL_CND_ATI
+#define GL_CND_ATI 0x896A
+#endif
+#ifndef GL_COEFF
+#define GL_COEFF 0x0A00
+#endif
+#ifndef GL_COLOR
+#define GL_COLOR 0x1800
+#endif
+#ifndef GL_COLOR3_BIT_PGI
+#define GL_COLOR3_BIT_PGI 0x00010000
+#endif
+#ifndef GL_COLOR4_BIT_PGI
+#define GL_COLOR4_BIT_PGI 0x00020000
+#endif
+#ifndef GL_COLOR_ALPHA_PAIRING_ATI
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#endif
+#ifndef GL_COLOR_ARRAY
+#define GL_COLOR_ARRAY 0x8076
+#endif
+#ifndef GL_COLOR_ARRAY_BUFFER_BINDING
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#endif
+#ifndef GL_COLOR_ARRAY_BUFFER_BINDING_ARB
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#endif
+#ifndef GL_COLOR_ARRAY_COUNT_EXT
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#endif
+#ifndef GL_COLOR_ARRAY_EXT
+#define GL_COLOR_ARRAY_EXT 0x8076
+#endif
+#ifndef GL_COLOR_ARRAY_LIST_IBM
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#endif
+#ifndef GL_COLOR_ARRAY_LIST_STRIDE_IBM
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#endif
+#ifndef GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#endif
+#ifndef GL_COLOR_ARRAY_POINTER
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#endif
+#ifndef GL_COLOR_ARRAY_POINTER_EXT
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#endif
+#ifndef GL_COLOR_ARRAY_SIZE
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#endif
+#ifndef GL_COLOR_ARRAY_SIZE_EXT
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#endif
+#ifndef GL_COLOR_ARRAY_STRIDE
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#endif
+#ifndef GL_COLOR_ARRAY_STRIDE_EXT
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#endif
+#ifndef GL_COLOR_ARRAY_TYPE
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#endif
+#ifndef GL_COLOR_ARRAY_TYPE_EXT
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#endif
+#ifndef GL_COLOR_ATTACHMENT0_EXT
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#endif
+#ifndef GL_COLOR_ATTACHMENT10_EXT
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#endif
+#ifndef GL_COLOR_ATTACHMENT11_EXT
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#endif
+#ifndef GL_COLOR_ATTACHMENT12_EXT
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#endif
+#ifndef GL_COLOR_ATTACHMENT13_EXT
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#endif
+#ifndef GL_COLOR_ATTACHMENT14_EXT
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#endif
+#ifndef GL_COLOR_ATTACHMENT15_EXT
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#endif
+#ifndef GL_COLOR_ATTACHMENT1_EXT
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#endif
+#ifndef GL_COLOR_ATTACHMENT2_EXT
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#endif
+#ifndef GL_COLOR_ATTACHMENT3_EXT
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#endif
+#ifndef GL_COLOR_ATTACHMENT4_EXT
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#endif
+#ifndef GL_COLOR_ATTACHMENT5_EXT
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#endif
+#ifndef GL_COLOR_ATTACHMENT6_EXT
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#endif
+#ifndef GL_COLOR_ATTACHMENT7_EXT
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#endif
+#ifndef GL_COLOR_ATTACHMENT8_EXT
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#endif
+#ifndef GL_COLOR_ATTACHMENT9_EXT
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#endif
+#ifndef GL_COLOR_BUFFER_BIT
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#endif
+#ifndef GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+#ifndef GL_COLOR_CLEAR_VALUE
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#endif
+#ifndef GL_COLOR_INDEX
+#define GL_COLOR_INDEX 0x1900
+#endif
+#ifndef GL_COLOR_INDEX12_EXT
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#endif
+#ifndef GL_COLOR_INDEX16_EXT
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#endif
+#ifndef GL_COLOR_INDEX1_EXT
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#endif
+#ifndef GL_COLOR_INDEX2_EXT
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#endif
+#ifndef GL_COLOR_INDEX4_EXT
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#endif
+#ifndef GL_COLOR_INDEX8_EXT
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#endif
+#ifndef GL_COLOR_INDEXES
+#define GL_COLOR_INDEXES 0x1603
+#endif
+#ifndef GL_COLOR_LOGIC_OP
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#endif
+#ifndef GL_COLOR_MATERIAL
+#define GL_COLOR_MATERIAL 0x0B57
+#endif
+#ifndef GL_COLOR_MATERIAL_FACE
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#endif
+#ifndef GL_COLOR_MATERIAL_PARAMETER
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#endif
+#ifndef GL_COLOR_MATRIX
+#define GL_COLOR_MATRIX 0x80B1
+#endif
+#ifndef GL_COLOR_MATRIX_SGI
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#endif
+#ifndef GL_COLOR_MATRIX_STACK_DEPTH
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#endif
+#ifndef GL_COLOR_MATRIX_STACK_DEPTH_SGI
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#endif
+#ifndef GL_COLOR_SUM
+#define GL_COLOR_SUM 0x8458
+#endif
+#ifndef GL_COLOR_SUM_ARB
+#define GL_COLOR_SUM_ARB 0x8458
+#endif
+#ifndef GL_COLOR_SUM_CLAMP_NV
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#endif
+#ifndef GL_COLOR_SUM_EXT
+#define GL_COLOR_SUM_EXT 0x8458
+#endif
+#ifndef GL_COLOR_TABLE
+#define GL_COLOR_TABLE 0x80D0
+#endif
+#ifndef GL_COLOR_TABLE_ALPHA_SIZE
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#endif
+#ifndef GL_COLOR_TABLE_ALPHA_SIZE_SGI
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#endif
+#ifndef GL_COLOR_TABLE_BIAS
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#endif
+#ifndef GL_COLOR_TABLE_BIAS_SGI
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#endif
+#ifndef GL_COLOR_TABLE_BLUE_SIZE
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#endif
+#ifndef GL_COLOR_TABLE_BLUE_SIZE_SGI
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#endif
+#ifndef GL_COLOR_TABLE_FORMAT
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#endif
+#ifndef GL_COLOR_TABLE_FORMAT_SGI
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#endif
+#ifndef GL_COLOR_TABLE_GREEN_SIZE
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#endif
+#ifndef GL_COLOR_TABLE_GREEN_SIZE_SGI
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#endif
+#ifndef GL_COLOR_TABLE_INTENSITY_SIZE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#endif
+#ifndef GL_COLOR_TABLE_INTENSITY_SIZE_SGI
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+#ifndef GL_COLOR_TABLE_LUMINANCE_SIZE
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#endif
+#ifndef GL_COLOR_TABLE_LUMINANCE_SIZE_SGI
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#endif
+#ifndef GL_COLOR_TABLE_RED_SIZE
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#endif
+#ifndef GL_COLOR_TABLE_RED_SIZE_SGI
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#endif
+#ifndef GL_COLOR_TABLE_SCALE
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#endif
+#ifndef GL_COLOR_TABLE_SCALE_SGI
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#endif
+#ifndef GL_COLOR_TABLE_SGI
+#define GL_COLOR_TABLE_SGI 0x80D0
+#endif
+#ifndef GL_COLOR_TABLE_WIDTH
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#endif
+#ifndef GL_COLOR_TABLE_WIDTH_SGI
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#endif
+#ifndef GL_COLOR_WRITEMASK
+#define GL_COLOR_WRITEMASK 0x0C23
+#endif
+#ifndef GL_COMBINE
+#define GL_COMBINE 0x8570
+#endif
+#ifndef GL_COMBINE4_NV
+#define GL_COMBINE4_NV 0x8503
+#endif
+#ifndef GL_COMBINER0_NV
+#define GL_COMBINER0_NV 0x8550
+#endif
+#ifndef GL_COMBINER1_NV
+#define GL_COMBINER1_NV 0x8551
+#endif
+#ifndef GL_COMBINER2_NV
+#define GL_COMBINER2_NV 0x8552
+#endif
+#ifndef GL_COMBINER3_NV
+#define GL_COMBINER3_NV 0x8553
+#endif
+#ifndef GL_COMBINER4_NV
+#define GL_COMBINER4_NV 0x8554
+#endif
+#ifndef GL_COMBINER5_NV
+#define GL_COMBINER5_NV 0x8555
+#endif
+#ifndef GL_COMBINER6_NV
+#define GL_COMBINER6_NV 0x8556
+#endif
+#ifndef GL_COMBINER7_NV
+#define GL_COMBINER7_NV 0x8557
+#endif
+#ifndef GL_COMBINER_AB_DOT_PRODUCT_NV
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#endif
+#ifndef GL_COMBINER_AB_OUTPUT_NV
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#endif
+#ifndef GL_COMBINER_BIAS_NV
+#define GL_COMBINER_BIAS_NV 0x8549
+#endif
+#ifndef GL_COMBINER_CD_DOT_PRODUCT_NV
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#endif
+#ifndef GL_COMBINER_CD_OUTPUT_NV
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#endif
+#ifndef GL_COMBINER_COMPONENT_USAGE_NV
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#endif
+#ifndef GL_COMBINER_INPUT_NV
+#define GL_COMBINER_INPUT_NV 0x8542
+#endif
+#ifndef GL_COMBINER_MAPPING_NV
+#define GL_COMBINER_MAPPING_NV 0x8543
+#endif
+#ifndef GL_COMBINER_MUX_SUM_NV
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#endif
+#ifndef GL_COMBINER_SCALE_NV
+#define GL_COMBINER_SCALE_NV 0x8548
+#endif
+#ifndef GL_COMBINER_SUM_OUTPUT_NV
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#endif
+#ifndef GL_COMBINE_ALPHA
+#define GL_COMBINE_ALPHA 0x8572
+#endif
+#ifndef GL_COMBINE_ALPHA_ARB
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#endif
+#ifndef GL_COMBINE_ALPHA_EXT
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#endif
+#ifndef GL_COMBINE_ARB
+#define GL_COMBINE_ARB 0x8570
+#endif
+#ifndef GL_COMBINE_EXT
+#define GL_COMBINE_EXT 0x8570
+#endif
+#ifndef GL_COMBINE_RGB
+#define GL_COMBINE_RGB 0x8571
+#endif
+#ifndef GL_COMBINE_RGB_ARB
+#define GL_COMBINE_RGB_ARB 0x8571
+#endif
+#ifndef GL_COMBINE_RGB_EXT
+#define GL_COMBINE_RGB_EXT 0x8571
+#endif
+#ifndef GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+#endif
+#ifndef GL_COMPARE_R_TO_TEXTURE
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+#ifndef GL_COMPILE
+#define GL_COMPILE 0x1300
+#endif
+#ifndef GL_COMPILE_AND_EXECUTE
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#endif
+#ifndef GL_COMPILE_STATUS
+#define GL_COMPILE_STATUS 0x8B81
+#endif
+#ifndef GL_COMPRESSED_ALPHA
+#define GL_COMPRESSED_ALPHA 0x84E9
+#endif
+#ifndef GL_COMPRESSED_ALPHA_ARB
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#endif
+#ifndef GL_COMPRESSED_INTENSITY
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#endif
+#ifndef GL_COMPRESSED_INTENSITY_ARB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE_ALPHA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE_ALPHA_ARB
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE_ARB
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#endif
+#ifndef GL_COMPRESSED_LUMINANCE_LATC1_EXT
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#endif
+#ifndef GL_COMPRESSED_RED_GREEN_RGTC2_EXT
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#endif
+#ifndef GL_COMPRESSED_RED_RGTC1_EXT
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#endif
+#ifndef GL_COMPRESSED_RGB
+#define GL_COMPRESSED_RGB 0x84ED
+#endif
+#ifndef GL_COMPRESSED_RGBA
+#define GL_COMPRESSED_RGBA 0x84EE
+#endif
+#ifndef GL_COMPRESSED_RGBA_ARB
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#endif
+#ifndef GL_COMPRESSED_RGBA_FXT1_3DFX
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+#ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#endif
+#ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#endif
+#ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+#ifndef GL_COMPRESSED_RGB_ARB
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#endif
+#ifndef GL_COMPRESSED_RGB_FXT1_3DFX
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#endif
+#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#endif
+#ifndef GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif
+#ifndef GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#endif
+#ifndef GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif
+#ifndef GL_COMPRESSED_SIGNED_RED_RGTC1_EXT
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#endif
+#ifndef GL_COMPRESSED_SLUMINANCE
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#endif
+#ifndef GL_COMPRESSED_SLUMINANCE_ALPHA
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#endif
+#ifndef GL_COMPRESSED_SLUMINANCE_ALPHA_EXT
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#endif
+#ifndef GL_COMPRESSED_SLUMINANCE_EXT
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#endif
+#ifndef GL_COMPRESSED_SRGB
+#define GL_COMPRESSED_SRGB 0x8C48
+#endif
+#ifndef GL_COMPRESSED_SRGB_ALPHA
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#endif
+#ifndef GL_COMPRESSED_SRGB_ALPHA_EXT
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#endif
+#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#endif
+#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#endif
+#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
+#ifndef GL_COMPRESSED_SRGB_EXT
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#endif
+#ifndef GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#endif
+#ifndef GL_COMPRESSED_TEXTURE_FORMATS
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#endif
+#ifndef GL_COMPRESSED_TEXTURE_FORMATS_ARB
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+#ifndef GL_COMP_BIT_ATI
+#define GL_COMP_BIT_ATI 0x00000002
+#endif
+#ifndef GL_CONSERVE_MEMORY_HINT_PGI
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#endif
+#ifndef GL_CONSTANT
+#define GL_CONSTANT 0x8576
+#endif
+#ifndef GL_CONSTANT_ALPHA
+#define GL_CONSTANT_ALPHA 0x8003
+#endif
+#ifndef GL_CONSTANT_ALPHA_EXT
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#endif
+#ifndef GL_CONSTANT_ARB
+#define GL_CONSTANT_ARB 0x8576
+#endif
+#ifndef GL_CONSTANT_ATTENUATION
+#define GL_CONSTANT_ATTENUATION 0x1207
+#endif
+#ifndef GL_CONSTANT_BORDER
+#define GL_CONSTANT_BORDER 0x8151
+#endif
+#ifndef GL_CONSTANT_BORDER_HP
+#define GL_CONSTANT_BORDER_HP 0x8151
+#endif
+#ifndef GL_CONSTANT_COLOR
+#define GL_CONSTANT_COLOR 0x8001
+#endif
+#ifndef GL_CONSTANT_COLOR0_NV
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#endif
+#ifndef GL_CONSTANT_COLOR1_NV
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#endif
+#ifndef GL_CONSTANT_COLOR_EXT
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#endif
+#ifndef GL_CONSTANT_EXT
+#define GL_CONSTANT_EXT 0x8576
+#endif
+#ifndef GL_CONST_EYE_NV
+#define GL_CONST_EYE_NV 0x86E5
+#endif
+#ifndef GL_CONVOLUTION_1D
+#define GL_CONVOLUTION_1D 0x8010
+#endif
+#ifndef GL_CONVOLUTION_1D_EXT
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#endif
+#ifndef GL_CONVOLUTION_2D
+#define GL_CONVOLUTION_2D 0x8011
+#endif
+#ifndef GL_CONVOLUTION_2D_EXT
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#endif
+#ifndef GL_CONVOLUTION_BORDER_COLOR
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+#ifndef GL_CONVOLUTION_BORDER_COLOR_HP
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+#ifndef GL_CONVOLUTION_BORDER_MODE
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#endif
+#ifndef GL_CONVOLUTION_BORDER_MODE_EXT
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#endif
+#ifndef GL_CONVOLUTION_FILTER_BIAS
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#endif
+#ifndef GL_CONVOLUTION_FILTER_BIAS_EXT
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#endif
+#ifndef GL_CONVOLUTION_FILTER_SCALE
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#endif
+#ifndef GL_CONVOLUTION_FILTER_SCALE_EXT
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#endif
+#ifndef GL_CONVOLUTION_FORMAT
+#define GL_CONVOLUTION_FORMAT 0x8017
+#endif
+#ifndef GL_CONVOLUTION_FORMAT_EXT
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#endif
+#ifndef GL_CONVOLUTION_HEIGHT
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#endif
+#ifndef GL_CONVOLUTION_HEIGHT_EXT
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#endif
+#ifndef GL_CONVOLUTION_HINT_SGIX
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+#ifndef GL_CONVOLUTION_WIDTH
+#define GL_CONVOLUTION_WIDTH 0x8018
+#endif
+#ifndef GL_CONVOLUTION_WIDTH_EXT
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#endif
+#ifndef GL_CON_0_ATI
+#define GL_CON_0_ATI 0x8941
+#endif
+#ifndef GL_CON_10_ATI
+#define GL_CON_10_ATI 0x894B
+#endif
+#ifndef GL_CON_11_ATI
+#define GL_CON_11_ATI 0x894C
+#endif
+#ifndef GL_CON_12_ATI
+#define GL_CON_12_ATI 0x894D
+#endif
+#ifndef GL_CON_13_ATI
+#define GL_CON_13_ATI 0x894E
+#endif
+#ifndef GL_CON_14_ATI
+#define GL_CON_14_ATI 0x894F
+#endif
+#ifndef GL_CON_15_ATI
+#define GL_CON_15_ATI 0x8950
+#endif
+#ifndef GL_CON_16_ATI
+#define GL_CON_16_ATI 0x8951
+#endif
+#ifndef GL_CON_17_ATI
+#define GL_CON_17_ATI 0x8952
+#endif
+#ifndef GL_CON_18_ATI
+#define GL_CON_18_ATI 0x8953
+#endif
+#ifndef GL_CON_19_ATI
+#define GL_CON_19_ATI 0x8954
+#endif
+#ifndef GL_CON_1_ATI
+#define GL_CON_1_ATI 0x8942
+#endif
+#ifndef GL_CON_20_ATI
+#define GL_CON_20_ATI 0x8955
+#endif
+#ifndef GL_CON_21_ATI
+#define GL_CON_21_ATI 0x8956
+#endif
+#ifndef GL_CON_22_ATI
+#define GL_CON_22_ATI 0x8957
+#endif
+#ifndef GL_CON_23_ATI
+#define GL_CON_23_ATI 0x8958
+#endif
+#ifndef GL_CON_24_ATI
+#define GL_CON_24_ATI 0x8959
+#endif
+#ifndef GL_CON_25_ATI
+#define GL_CON_25_ATI 0x895A
+#endif
+#ifndef GL_CON_26_ATI
+#define GL_CON_26_ATI 0x895B
+#endif
+#ifndef GL_CON_27_ATI
+#define GL_CON_27_ATI 0x895C
+#endif
+#ifndef GL_CON_28_ATI
+#define GL_CON_28_ATI 0x895D
+#endif
+#ifndef GL_CON_29_ATI
+#define GL_CON_29_ATI 0x895E
+#endif
+#ifndef GL_CON_2_ATI
+#define GL_CON_2_ATI 0x8943
+#endif
+#ifndef GL_CON_30_ATI
+#define GL_CON_30_ATI 0x895F
+#endif
+#ifndef GL_CON_31_ATI
+#define GL_CON_31_ATI 0x8960
+#endif
+#ifndef GL_CON_3_ATI
+#define GL_CON_3_ATI 0x8944
+#endif
+#ifndef GL_CON_4_ATI
+#define GL_CON_4_ATI 0x8945
+#endif
+#ifndef GL_CON_5_ATI
+#define GL_CON_5_ATI 0x8946
+#endif
+#ifndef GL_CON_6_ATI
+#define GL_CON_6_ATI 0x8947
+#endif
+#ifndef GL_CON_7_ATI
+#define GL_CON_7_ATI 0x8948
+#endif
+#ifndef GL_CON_8_ATI
+#define GL_CON_8_ATI 0x8949
+#endif
+#ifndef GL_CON_9_ATI
+#define GL_CON_9_ATI 0x894A
+#endif
+#ifndef GL_COORD_REPLACE
+#define GL_COORD_REPLACE 0x8862
+#endif
+#ifndef GL_COORD_REPLACE_ARB
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+#ifndef GL_COORD_REPLACE_NV
+#define GL_COORD_REPLACE_NV 0x8862
+#endif
+#ifndef GL_COPY
+#define GL_COPY 0x1503
+#endif
+#ifndef GL_COPY_INVERTED
+#define GL_COPY_INVERTED 0x150C
+#endif
+#ifndef GL_COPY_PIXEL_TOKEN
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#endif
+#ifndef GL_CUBIC_EXT
+#define GL_CUBIC_EXT 0x8334
+#endif
+#ifndef GL_CUBIC_HP
+#define GL_CUBIC_HP 0x815F
+#endif
+#ifndef GL_CULL_FACE
+#define GL_CULL_FACE 0x0B44
+#endif
+#ifndef GL_CULL_FACE_MODE
+#define GL_CULL_FACE_MODE 0x0B45
+#endif
+#ifndef GL_CULL_FRAGMENT_NV
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#endif
+#ifndef GL_CULL_MODES_NV
+#define GL_CULL_MODES_NV 0x86E0
+#endif
+#ifndef GL_CULL_VERTEX_EXT
+#define GL_CULL_VERTEX_EXT 0x81AA
+#endif
+#ifndef GL_CULL_VERTEX_EYE_POSITION_EXT
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#endif
+#ifndef GL_CULL_VERTEX_IBM
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+#ifndef GL_CULL_VERTEX_OBJECT_POSITION_EXT
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+#ifndef GL_CURRENT_ATTRIB_NV
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#endif
+#ifndef GL_CURRENT_BINORMAL_EXT
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#endif
+#ifndef GL_CURRENT_BIT
+#define GL_CURRENT_BIT 0x00000001
+#endif
+#ifndef GL_CURRENT_COLOR
+#define GL_CURRENT_COLOR 0x0B00
+#endif
+#ifndef GL_CURRENT_FOG_COORD
+#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
+#endif
+#ifndef GL_CURRENT_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#endif
+#ifndef GL_CURRENT_FOG_COORDINATE_EXT
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#endif
+#ifndef GL_CURRENT_INDEX
+#define GL_CURRENT_INDEX 0x0B01
+#endif
+#ifndef GL_CURRENT_MATRIX_ARB
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#endif
+#ifndef GL_CURRENT_MATRIX_INDEX_ARB
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#endif
+#ifndef GL_CURRENT_MATRIX_NV
+#define GL_CURRENT_MATRIX_NV 0x8641
+#endif
+#ifndef GL_CURRENT_MATRIX_STACK_DEPTH_ARB
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#endif
+#ifndef GL_CURRENT_MATRIX_STACK_DEPTH_NV
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#endif
+#ifndef GL_CURRENT_NORMAL
+#define GL_CURRENT_NORMAL 0x0B02
+#endif
+#ifndef GL_CURRENT_OCCLUSION_QUERY_ID_NV
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#endif
+#ifndef GL_CURRENT_PALETTE_MATRIX_ARB
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#endif
+#ifndef GL_CURRENT_PROGRAM
+#define GL_CURRENT_PROGRAM 0x8B8D
+#endif
+#ifndef GL_CURRENT_QUERY
+#define GL_CURRENT_QUERY 0x8865
+#endif
+#ifndef GL_CURRENT_QUERY_ARB
+#define GL_CURRENT_QUERY_ARB 0x8865
+#endif
+#ifndef GL_CURRENT_RASTER_COLOR
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#endif
+#ifndef GL_CURRENT_RASTER_DISTANCE
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#endif
+#ifndef GL_CURRENT_RASTER_INDEX
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#endif
+#ifndef GL_CURRENT_RASTER_NORMAL_SGIX
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#endif
+#ifndef GL_CURRENT_RASTER_POSITION
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#endif
+#ifndef GL_CURRENT_RASTER_POSITION_VALID
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#endif
+#ifndef GL_CURRENT_RASTER_SECONDARY_COLOR
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#endif
+#ifndef GL_CURRENT_RASTER_TEXTURE_COORDS
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#endif
+#ifndef GL_CURRENT_SECONDARY_COLOR
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#endif
+#ifndef GL_CURRENT_SECONDARY_COLOR_EXT
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#endif
+#ifndef GL_CURRENT_TANGENT_EXT
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#endif
+#ifndef GL_CURRENT_TEXTURE_COORDS
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#endif
+#ifndef GL_CURRENT_VERTEX_ATTRIB
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#endif
+#ifndef GL_CURRENT_VERTEX_ATTRIB_ARB
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#endif
+#ifndef GL_CURRENT_VERTEX_EXT
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#endif
+#ifndef GL_CURRENT_VERTEX_WEIGHT_EXT
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#endif
+#ifndef GL_CURRENT_WEIGHT_ARB
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#endif
+#ifndef GL_CW
+#define GL_CW 0x0900
+#endif
+#ifndef GL_DECAL
+#define GL_DECAL 0x2101
+#endif
+#ifndef GL_DECR
+#define GL_DECR 0x1E03
+#endif
+#ifndef GL_DECR_WRAP
+#define GL_DECR_WRAP 0x8508
+#endif
+#ifndef GL_DECR_WRAP_EXT
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+#ifndef GL_DEFORMATIONS_MASK_SGIX
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#endif
+#ifndef GL_DELETE_STATUS
+#define GL_DELETE_STATUS 0x8B80
+#endif
+#ifndef GL_DEPENDENT_AR_TEXTURE_2D_NV
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#endif
+#ifndef GL_DEPENDENT_GB_TEXTURE_2D_NV
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#endif
+#ifndef GL_DEPENDENT_HILO_TEXTURE_2D_NV
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#endif
+#ifndef GL_DEPENDENT_RGB_TEXTURE_3D_NV
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#endif
+#ifndef GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#endif
+#ifndef GL_DEPTH
+#define GL_DEPTH 0x1801
+#endif
+#ifndef GL_DEPTH24_STENCIL8_EXT
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#endif
+#ifndef GL_DEPTH32F_STENCIL8_NV
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#endif
+#ifndef GL_DEPTH_ATTACHMENT_EXT
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#endif
+#ifndef GL_DEPTH_BIAS
+#define GL_DEPTH_BIAS 0x0D1F
+#endif
+#ifndef GL_DEPTH_BITS
+#define GL_DEPTH_BITS 0x0D56
+#endif
+#ifndef GL_DEPTH_BOUNDS_EXT
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+#ifndef GL_DEPTH_BOUNDS_TEST_EXT
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#endif
+#ifndef GL_DEPTH_BUFFER_BIT
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#endif
+#ifndef GL_DEPTH_BUFFER_FLOAT_MODE_NV
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+#endif
+#ifndef GL_DEPTH_CLAMP_NV
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+#ifndef GL_DEPTH_CLEAR_VALUE
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#endif
+#ifndef GL_DEPTH_COMPONENT
+#define GL_DEPTH_COMPONENT 0x1902
+#endif
+#ifndef GL_DEPTH_COMPONENT16
+#define GL_DEPTH_COMPONENT16 0x81A5
+#endif
+#ifndef GL_DEPTH_COMPONENT16_ARB
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#endif
+#ifndef GL_DEPTH_COMPONENT16_SGIX
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#endif
+#ifndef GL_DEPTH_COMPONENT24
+#define GL_DEPTH_COMPONENT24 0x81A6
+#endif
+#ifndef GL_DEPTH_COMPONENT24_ARB
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#endif
+#ifndef GL_DEPTH_COMPONENT24_SGIX
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#endif
+#ifndef GL_DEPTH_COMPONENT32
+#define GL_DEPTH_COMPONENT32 0x81A7
+#endif
+#ifndef GL_DEPTH_COMPONENT32F_NV
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#endif
+#ifndef GL_DEPTH_COMPONENT32_ARB
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#endif
+#ifndef GL_DEPTH_COMPONENT32_SGIX
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+#ifndef GL_DEPTH_FUNC
+#define GL_DEPTH_FUNC 0x0B74
+#endif
+#ifndef GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#endif
+#ifndef GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+#ifndef GL_DEPTH_PASS_INSTRUMENT_SGIX
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#endif
+#ifndef GL_DEPTH_RANGE
+#define GL_DEPTH_RANGE 0x0B70
+#endif
+#ifndef GL_DEPTH_SCALE
+#define GL_DEPTH_SCALE 0x0D1E
+#endif
+#ifndef GL_DEPTH_STENCIL_EXT
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#endif
+#ifndef GL_DEPTH_STENCIL_NV
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#endif
+#ifndef GL_DEPTH_STENCIL_TO_BGRA_NV
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+#ifndef GL_DEPTH_STENCIL_TO_RGBA_NV
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#endif
+#ifndef GL_DEPTH_TEST
+#define GL_DEPTH_TEST 0x0B71
+#endif
+#ifndef GL_DEPTH_TEXTURE_MODE
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#endif
+#ifndef GL_DEPTH_TEXTURE_MODE_ARB
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+#ifndef GL_DEPTH_WRITEMASK
+#define GL_DEPTH_WRITEMASK 0x0B72
+#endif
+#ifndef GL_DETAIL_TEXTURE_2D_BINDING_SGIS
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#endif
+#ifndef GL_DETAIL_TEXTURE_2D_SGIS
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#endif
+#ifndef GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+#ifndef GL_DETAIL_TEXTURE_LEVEL_SGIS
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#endif
+#ifndef GL_DETAIL_TEXTURE_MODE_SGIS
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#endif
+#ifndef GL_DIFFUSE
+#define GL_DIFFUSE 0x1201
+#endif
+#ifndef GL_DISCARD_ATI
+#define GL_DISCARD_ATI 0x8763
+#endif
+#ifndef GL_DISCARD_NV
+#define GL_DISCARD_NV 0x8530
+#endif
+#ifndef GL_DISTANCE_ATTENUATION_EXT
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+#ifndef GL_DISTANCE_ATTENUATION_SGIS
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+#ifndef GL_DITHER
+#define GL_DITHER 0x0BD0
+#endif
+#ifndef GL_DOMAIN
+#define GL_DOMAIN 0x0A02
+#endif
+#ifndef GL_DONT_CARE
+#define GL_DONT_CARE 0x1100
+#endif
+#ifndef GL_DOT2_ADD_ATI
+#define GL_DOT2_ADD_ATI 0x896C
+#endif
+#ifndef GL_DOT3_ATI
+#define GL_DOT3_ATI 0x8966
+#endif
+#ifndef GL_DOT3_RGB
+#define GL_DOT3_RGB 0x86AE
+#endif
+#ifndef GL_DOT3_RGBA
+#define GL_DOT3_RGBA 0x86AF
+#endif
+#ifndef GL_DOT3_RGBA_ARB
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+#ifndef GL_DOT3_RGBA_EXT
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+#ifndef GL_DOT3_RGB_ARB
+#define GL_DOT3_RGB_ARB 0x86AE
+#endif
+#ifndef GL_DOT3_RGB_EXT
+#define GL_DOT3_RGB_EXT 0x8740
+#endif
+#ifndef GL_DOT4_ATI
+#define GL_DOT4_ATI 0x8967
+#endif
+#ifndef GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#endif
+#ifndef GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#endif
+#ifndef GL_DOT_PRODUCT_DEPTH_REPLACE_NV
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#endif
+#ifndef GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#endif
+#ifndef GL_DOT_PRODUCT_NV
+#define GL_DOT_PRODUCT_NV 0x86EC
+#endif
+#ifndef GL_DOT_PRODUCT_PASS_THROUGH_NV
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#endif
+#ifndef GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#endif
+#ifndef GL_DOT_PRODUCT_TEXTURE_1D_NV
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#endif
+#ifndef GL_DOT_PRODUCT_TEXTURE_2D_NV
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#endif
+#ifndef GL_DOT_PRODUCT_TEXTURE_3D_NV
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+#ifndef GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#endif
+#ifndef GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#endif
+#ifndef GL_DOUBLE
+#define GL_DOUBLE 0x140A
+#endif
+#ifndef GL_DOUBLEBUFFER
+#define GL_DOUBLEBUFFER 0x0C32
+#endif
+#ifndef GL_DOUBLE_EXT
+#define GL_DOUBLE_EXT 0x140A
+#endif
+#ifndef GL_DRAW_BUFFER
+#define GL_DRAW_BUFFER 0x0C01
+#endif
+#ifndef GL_DRAW_BUFFER0
+#define GL_DRAW_BUFFER0 0x8825
+#endif
+#ifndef GL_DRAW_BUFFER0_ARB
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#endif
+#ifndef GL_DRAW_BUFFER0_ATI
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#endif
+#ifndef GL_DRAW_BUFFER1
+#define GL_DRAW_BUFFER1 0x8826
+#endif
+#ifndef GL_DRAW_BUFFER10
+#define GL_DRAW_BUFFER10 0x882F
+#endif
+#ifndef GL_DRAW_BUFFER10_ARB
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#endif
+#ifndef GL_DRAW_BUFFER10_ATI
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#endif
+#ifndef GL_DRAW_BUFFER11
+#define GL_DRAW_BUFFER11 0x8830
+#endif
+#ifndef GL_DRAW_BUFFER11_ARB
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#endif
+#ifndef GL_DRAW_BUFFER11_ATI
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#endif
+#ifndef GL_DRAW_BUFFER12
+#define GL_DRAW_BUFFER12 0x8831
+#endif
+#ifndef GL_DRAW_BUFFER12_ARB
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#endif
+#ifndef GL_DRAW_BUFFER12_ATI
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#endif
+#ifndef GL_DRAW_BUFFER13
+#define GL_DRAW_BUFFER13 0x8832
+#endif
+#ifndef GL_DRAW_BUFFER13_ARB
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#endif
+#ifndef GL_DRAW_BUFFER13_ATI
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#endif
+#ifndef GL_DRAW_BUFFER14
+#define GL_DRAW_BUFFER14 0x8833
+#endif
+#ifndef GL_DRAW_BUFFER14_ARB
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#endif
+#ifndef GL_DRAW_BUFFER14_ATI
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#endif
+#ifndef GL_DRAW_BUFFER15
+#define GL_DRAW_BUFFER15 0x8834
+#endif
+#ifndef GL_DRAW_BUFFER15_ARB
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+#ifndef GL_DRAW_BUFFER15_ATI
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+#ifndef GL_DRAW_BUFFER1_ARB
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#endif
+#ifndef GL_DRAW_BUFFER1_ATI
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#endif
+#ifndef GL_DRAW_BUFFER2
+#define GL_DRAW_BUFFER2 0x8827
+#endif
+#ifndef GL_DRAW_BUFFER2_ARB
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#endif
+#ifndef GL_DRAW_BUFFER2_ATI
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#endif
+#ifndef GL_DRAW_BUFFER3
+#define GL_DRAW_BUFFER3 0x8828
+#endif
+#ifndef GL_DRAW_BUFFER3_ARB
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#endif
+#ifndef GL_DRAW_BUFFER3_ATI
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#endif
+#ifndef GL_DRAW_BUFFER4
+#define GL_DRAW_BUFFER4 0x8829
+#endif
+#ifndef GL_DRAW_BUFFER4_ARB
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#endif
+#ifndef GL_DRAW_BUFFER4_ATI
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#endif
+#ifndef GL_DRAW_BUFFER5
+#define GL_DRAW_BUFFER5 0x882A
+#endif
+#ifndef GL_DRAW_BUFFER5_ARB
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#endif
+#ifndef GL_DRAW_BUFFER5_ATI
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#endif
+#ifndef GL_DRAW_BUFFER6
+#define GL_DRAW_BUFFER6 0x882B
+#endif
+#ifndef GL_DRAW_BUFFER6_ARB
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#endif
+#ifndef GL_DRAW_BUFFER6_ATI
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#endif
+#ifndef GL_DRAW_BUFFER7
+#define GL_DRAW_BUFFER7 0x882C
+#endif
+#ifndef GL_DRAW_BUFFER7_ARB
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#endif
+#ifndef GL_DRAW_BUFFER7_ATI
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#endif
+#ifndef GL_DRAW_BUFFER8
+#define GL_DRAW_BUFFER8 0x882D
+#endif
+#ifndef GL_DRAW_BUFFER8_ARB
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#endif
+#ifndef GL_DRAW_BUFFER8_ATI
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#endif
+#ifndef GL_DRAW_BUFFER9
+#define GL_DRAW_BUFFER9 0x882E
+#endif
+#ifndef GL_DRAW_BUFFER9_ARB
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#endif
+#ifndef GL_DRAW_BUFFER9_ATI
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#endif
+#ifndef GL_DRAW_FRAMEBUFFER_BINDING_EXT
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CAA
+#endif
+#ifndef GL_DRAW_FRAMEBUFFER_EXT
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#endif
+#ifndef GL_DRAW_PIXELS_APPLE
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#endif
+#ifndef GL_DRAW_PIXEL_TOKEN
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#endif
+#ifndef GL_DSDT8_MAG8_INTENSITY8_NV
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#endif
+#ifndef GL_DSDT8_MAG8_NV
+#define GL_DSDT8_MAG8_NV 0x870A
+#endif
+#ifndef GL_DSDT8_NV
+#define GL_DSDT8_NV 0x8709
+#endif
+#ifndef GL_DSDT_MAG_INTENSITY_NV
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#endif
+#ifndef GL_DSDT_MAG_NV
+#define GL_DSDT_MAG_NV 0x86F6
+#endif
+#ifndef GL_DSDT_MAG_VIB_NV
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#endif
+#ifndef GL_DSDT_NV
+#define GL_DSDT_NV 0x86F5
+#endif
+#ifndef GL_DST_ALPHA
+#define GL_DST_ALPHA 0x0304
+#endif
+#ifndef GL_DST_COLOR
+#define GL_DST_COLOR 0x0306
+#endif
+#ifndef GL_DS_BIAS_NV
+#define GL_DS_BIAS_NV 0x8716
+#endif
+#ifndef GL_DS_SCALE_NV
+#define GL_DS_SCALE_NV 0x8710
+#endif
+#ifndef GL_DT_BIAS_NV
+#define GL_DT_BIAS_NV 0x8717
+#endif
+#ifndef GL_DT_SCALE_NV
+#define GL_DT_SCALE_NV 0x8711
+#endif
+#ifndef GL_DU8DV8_ATI
+#define GL_DU8DV8_ATI 0x877A
+#endif
+#ifndef GL_DUAL_ALPHA12_SGIS
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#endif
+#ifndef GL_DUAL_ALPHA16_SGIS
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#endif
+#ifndef GL_DUAL_ALPHA4_SGIS
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#endif
+#ifndef GL_DUAL_ALPHA8_SGIS
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#endif
+#ifndef GL_DUAL_INTENSITY12_SGIS
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#endif
+#ifndef GL_DUAL_INTENSITY16_SGIS
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#endif
+#ifndef GL_DUAL_INTENSITY4_SGIS
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#endif
+#ifndef GL_DUAL_INTENSITY8_SGIS
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#endif
+#ifndef GL_DUAL_LUMINANCE12_SGIS
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#endif
+#ifndef GL_DUAL_LUMINANCE16_SGIS
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#endif
+#ifndef GL_DUAL_LUMINANCE4_SGIS
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#endif
+#ifndef GL_DUAL_LUMINANCE8_SGIS
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#endif
+#ifndef GL_DUAL_LUMINANCE_ALPHA4_SGIS
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#endif
+#ifndef GL_DUAL_LUMINANCE_ALPHA8_SGIS
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#endif
+#ifndef GL_DUAL_TEXTURE_SELECT_SGIS
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#endif
+#ifndef GL_DUDV_ATI
+#define GL_DUDV_ATI 0x8779
+#endif
+#ifndef GL_DYNAMIC_ATI
+#define GL_DYNAMIC_ATI 0x8761
+#endif
+#ifndef GL_DYNAMIC_COPY
+#define GL_DYNAMIC_COPY 0x88EA
+#endif
+#ifndef GL_DYNAMIC_COPY_ARB
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+#ifndef GL_DYNAMIC_DRAW
+#define GL_DYNAMIC_DRAW 0x88E8
+#endif
+#ifndef GL_DYNAMIC_DRAW_ARB
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#endif
+#ifndef GL_DYNAMIC_READ
+#define GL_DYNAMIC_READ 0x88E9
+#endif
+#ifndef GL_DYNAMIC_READ_ARB
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#endif
+#ifndef GL_EDGEFLAG_BIT_PGI
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#endif
+#ifndef GL_EDGE_FLAG
+#define GL_EDGE_FLAG 0x0B43
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_BUFFER_BINDING
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_COUNT_EXT
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_EXT
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_LIST_IBM
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_POINTER
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_POINTER_EXT
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_STRIDE
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#endif
+#ifndef GL_EDGE_FLAG_ARRAY_STRIDE_EXT
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#endif
+#ifndef GL_EIGHTH_BIT_ATI
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#endif
+#ifndef GL_ELEMENT_ARRAY_APPLE
+#define GL_ELEMENT_ARRAY_APPLE 0x8768
+#endif
+#ifndef GL_ELEMENT_ARRAY_ATI
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#endif
+#ifndef GL_ELEMENT_ARRAY_BUFFER
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#endif
+#ifndef GL_ELEMENT_ARRAY_BUFFER_ARB
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#endif
+#ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#endif
+#ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#endif
+#ifndef GL_ELEMENT_ARRAY_POINTER_APPLE
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
+#endif
+#ifndef GL_ELEMENT_ARRAY_POINTER_ATI
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+#ifndef GL_ELEMENT_ARRAY_TYPE_APPLE
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
+#endif
+#ifndef GL_ELEMENT_ARRAY_TYPE_ATI
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#endif
+#ifndef GL_EMBOSS_CONSTANT_NV
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#endif
+#ifndef GL_EMBOSS_LIGHT_NV
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#endif
+#ifndef GL_EMBOSS_MAP_NV
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+#ifndef GL_EMISSION
+#define GL_EMISSION 0x1600
+#endif
+#ifndef GL_ENABLE_BIT
+#define GL_ENABLE_BIT 0x00002000
+#endif
+#ifndef GL_EQUAL
+#define GL_EQUAL 0x0202
+#endif
+#ifndef GL_EQUIV
+#define GL_EQUIV 0x1509
+#endif
+#ifndef GL_EVAL_2D_NV
+#define GL_EVAL_2D_NV 0x86C0
+#endif
+#ifndef GL_EVAL_BIT
+#define GL_EVAL_BIT 0x00010000
+#endif
+#ifndef GL_EVAL_FRACTIONAL_TESSELLATION_NV
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#endif
+#ifndef GL_EVAL_TRIANGULAR_2D_NV
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB0_NV
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB10_NV
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB11_NV
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB12_NV
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB13_NV
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB14_NV
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB15_NV
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB1_NV
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB2_NV
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB3_NV
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB4_NV
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB5_NV
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB6_NV
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB7_NV
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB8_NV
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#endif
+#ifndef GL_EVAL_VERTEX_ATTRIB9_NV
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#endif
+#ifndef GL_EXP
+#define GL_EXP 0x0800
+#endif
+#ifndef GL_EXP2
+#define GL_EXP2 0x0801
+#endif
+#ifndef GL_EXPAND_NEGATE_NV
+#define GL_EXPAND_NEGATE_NV 0x8539
+#endif
+#ifndef GL_EXPAND_NORMAL_NV
+#define GL_EXPAND_NORMAL_NV 0x8538
+#endif
+#ifndef GL_EXTENSIONS
+#define GL_EXTENSIONS 0x1F03
+#endif
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#endif
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#endif
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#endif
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#endif
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#endif
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#endif
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#endif
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#endif
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#endif
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#endif
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#endif
+#ifndef GL_EYE_DISTANCE_TO_LINE_SGIS
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#endif
+#ifndef GL_EYE_DISTANCE_TO_POINT_SGIS
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#endif
+#ifndef GL_EYE_LINEAR
+#define GL_EYE_LINEAR 0x2400
+#endif
+#ifndef GL_EYE_LINE_SGIS
+#define GL_EYE_LINE_SGIS 0x81F6
+#endif
+#ifndef GL_EYE_PLANE
+#define GL_EYE_PLANE 0x2502
+#endif
+#ifndef GL_EYE_PLANE_ABSOLUTE_NV
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+#endif
+#ifndef GL_EYE_POINT_SGIS
+#define GL_EYE_POINT_SGIS 0x81F4
+#endif
+#ifndef GL_EYE_RADIAL_NV
+#define GL_EYE_RADIAL_NV 0x855B
+#endif
+#ifndef GL_E_TIMES_F_NV
+#define GL_E_TIMES_F_NV 0x8531
+#endif
+#ifndef GL_FALSE
+#define GL_FALSE 0
+#endif
+#ifndef GL_FASTEST
+#define GL_FASTEST 0x1101
+#endif
+#ifndef GL_FEEDBACK
+#define GL_FEEDBACK 0x1C01
+#endif
+#ifndef GL_FEEDBACK_BUFFER_POINTER
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#endif
+#ifndef GL_FEEDBACK_BUFFER_SIZE
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#endif
+#ifndef GL_FEEDBACK_BUFFER_TYPE
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+#endif
+#ifndef GL_FENCE_APPLE
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+#ifndef GL_FENCE_CONDITION_NV
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+#ifndef GL_FENCE_STATUS_NV
+#define GL_FENCE_STATUS_NV 0x84F3
+#endif
+#ifndef GL_FILL
+#define GL_FILL 0x1B02
+#endif
+#ifndef GL_FILTER4_SGIS
+#define GL_FILTER4_SGIS 0x8146
+#endif
+#ifndef GL_FIXED_ONLY_ARB
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+#ifndef GL_FLAT
+#define GL_FLAT 0x1D00
+#endif
+#ifndef GL_FLOAT
+#define GL_FLOAT 0x1406
+#endif
+#ifndef GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#endif
+#ifndef GL_FLOAT_CLEAR_COLOR_VALUE_NV
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#endif
+#ifndef GL_FLOAT_MAT2
+#define GL_FLOAT_MAT2 0x8B5A
+#endif
+#ifndef GL_FLOAT_MAT2_ARB
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#endif
+#ifndef GL_FLOAT_MAT2x3
+#define GL_FLOAT_MAT2x3 0x8B65
+#endif
+#ifndef GL_FLOAT_MAT2x4
+#define GL_FLOAT_MAT2x4 0x8B66
+#endif
+#ifndef GL_FLOAT_MAT3
+#define GL_FLOAT_MAT3 0x8B5B
+#endif
+#ifndef GL_FLOAT_MAT3_ARB
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#endif
+#ifndef GL_FLOAT_MAT3x2
+#define GL_FLOAT_MAT3x2 0x8B67
+#endif
+#ifndef GL_FLOAT_MAT3x4
+#define GL_FLOAT_MAT3x4 0x8B68
+#endif
+#ifndef GL_FLOAT_MAT4
+#define GL_FLOAT_MAT4 0x8B5C
+#endif
+#ifndef GL_FLOAT_MAT4_ARB
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#endif
+#ifndef GL_FLOAT_MAT4x2
+#define GL_FLOAT_MAT4x2 0x8B69
+#endif
+#ifndef GL_FLOAT_MAT4x3
+#define GL_FLOAT_MAT4x3 0x8B6A
+#endif
+#ifndef GL_FLOAT_R16_NV
+#define GL_FLOAT_R16_NV 0x8884
+#endif
+#ifndef GL_FLOAT_R32_NV
+#define GL_FLOAT_R32_NV 0x8885
+#endif
+#ifndef GL_FLOAT_RG16_NV
+#define GL_FLOAT_RG16_NV 0x8886
+#endif
+#ifndef GL_FLOAT_RG32_NV
+#define GL_FLOAT_RG32_NV 0x8887
+#endif
+#ifndef GL_FLOAT_RGB16_NV
+#define GL_FLOAT_RGB16_NV 0x8888
+#endif
+#ifndef GL_FLOAT_RGB32_NV
+#define GL_FLOAT_RGB32_NV 0x8889
+#endif
+#ifndef GL_FLOAT_RGBA16_NV
+#define GL_FLOAT_RGBA16_NV 0x888A
+#endif
+#ifndef GL_FLOAT_RGBA32_NV
+#define GL_FLOAT_RGBA32_NV 0x888B
+#endif
+#ifndef GL_FLOAT_RGBA_MODE_NV
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+#ifndef GL_FLOAT_RGBA_NV
+#define GL_FLOAT_RGBA_NV 0x8883
+#endif
+#ifndef GL_FLOAT_RGB_NV
+#define GL_FLOAT_RGB_NV 0x8882
+#endif
+#ifndef GL_FLOAT_RG_NV
+#define GL_FLOAT_RG_NV 0x8881
+#endif
+#ifndef GL_FLOAT_R_NV
+#define GL_FLOAT_R_NV 0x8880
+#endif
+#ifndef GL_FLOAT_VEC2
+#define GL_FLOAT_VEC2 0x8B50
+#endif
+#ifndef GL_FLOAT_VEC2_ARB
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#endif
+#ifndef GL_FLOAT_VEC3
+#define GL_FLOAT_VEC3 0x8B51
+#endif
+#ifndef GL_FLOAT_VEC3_ARB
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#endif
+#ifndef GL_FLOAT_VEC4
+#define GL_FLOAT_VEC4 0x8B52
+#endif
+#ifndef GL_FLOAT_VEC4_ARB
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#endif
+#ifndef GL_FOG
+#define GL_FOG 0x0B60
+#endif
+#ifndef GL_FOG_BIT
+#define GL_FOG_BIT 0x00000080
+#endif
+#ifndef GL_FOG_COLOR
+#define GL_FOG_COLOR 0x0B66
+#endif
+#ifndef GL_FOG_COORD
+#define GL_FOG_COORD GL_FOG_COORDINATE
+#endif
+#ifndef GL_FOG_COORDINATE
+#define GL_FOG_COORDINATE 0x8451
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_EXT
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_LIST_IBM
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_POINTER_EXT
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#endif
+#ifndef GL_FOG_COORDINATE_ARRAY_TYPE_EXT
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#endif
+#ifndef GL_FOG_COORDINATE_EXT
+#define GL_FOG_COORDINATE_EXT 0x8451
+#endif
+#ifndef GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#endif
+#ifndef GL_FOG_COORDINATE_SOURCE_EXT
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#endif
+#ifndef GL_FOG_COORD_ARRAY
+#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
+#endif
+#ifndef GL_FOG_COORD_ARRAY_BUFFER_BINDING
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#endif
+#ifndef GL_FOG_COORD_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
+#endif
+#ifndef GL_FOG_COORD_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
+#endif
+#ifndef GL_FOG_COORD_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
+#endif
+#ifndef GL_FOG_COORD_SRC
+#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
+#endif
+#ifndef GL_FOG_DENSITY
+#define GL_FOG_DENSITY 0x0B62
+#endif
+#ifndef GL_FOG_DISTANCE_MODE_NV
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#endif
+#ifndef GL_FOG_END
+#define GL_FOG_END 0x0B64
+#endif
+#ifndef GL_FOG_FACTOR_TO_ALPHA_SGIX
+#define GL_FOG_FACTOR_TO_ALPHA_SGIX 0x836F
+#endif
+#ifndef GL_FOG_FUNC_POINTS_SGIS
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#endif
+#ifndef GL_FOG_FUNC_SGIS
+#define GL_FOG_FUNC_SGIS 0x812A
+#endif
+#ifndef GL_FOG_HINT
+#define GL_FOG_HINT 0x0C54
+#endif
+#ifndef GL_FOG_INDEX
+#define GL_FOG_INDEX 0x0B61
+#endif
+#ifndef GL_FOG_MODE
+#define GL_FOG_MODE 0x0B65
+#endif
+#ifndef GL_FOG_OFFSET_SGIX
+#define GL_FOG_OFFSET_SGIX 0x8198
+#endif
+#ifndef GL_FOG_OFFSET_VALUE_SGIX
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+#ifndef GL_FOG_SCALE_SGIX
+#define GL_FOG_SCALE_SGIX 0x81FC
+#endif
+#ifndef GL_FOG_SCALE_VALUE_SGIX
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+#ifndef GL_FOG_SPECULAR_TEXTURE_WIN
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+#ifndef GL_FOG_START
+#define GL_FOG_START 0x0B63
+#endif
+#ifndef GL_FORCE_BLUE_TO_ONE_NV
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+#ifndef GL_FORMAT_SUBSAMPLE_244_244_OML
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+#ifndef GL_FORMAT_SUBSAMPLE_24_24_OML
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#endif
+#ifndef GL_FRAGMENT_COLOR_EXT
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#endif
+#ifndef GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#endif
+#ifndef GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#endif
+#ifndef GL_FRAGMENT_COLOR_MATERIAL_SGIX
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#endif
+#ifndef GL_FRAGMENT_DEPTH
+#define GL_FRAGMENT_DEPTH 0x8452
+#endif
+#ifndef GL_FRAGMENT_DEPTH_EXT
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#endif
+#ifndef GL_FRAGMENT_LIGHT0_SGIX
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#endif
+#ifndef GL_FRAGMENT_LIGHT1_SGIX
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#endif
+#ifndef GL_FRAGMENT_LIGHT2_SGIX
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#endif
+#ifndef GL_FRAGMENT_LIGHT3_SGIX
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#endif
+#ifndef GL_FRAGMENT_LIGHT4_SGIX
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#endif
+#ifndef GL_FRAGMENT_LIGHT5_SGIX
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#endif
+#ifndef GL_FRAGMENT_LIGHT6_SGIX
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#endif
+#ifndef GL_FRAGMENT_LIGHT7_SGIX
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+#ifndef GL_FRAGMENT_LIGHTING_SGIX
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#endif
+#ifndef GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#endif
+#ifndef GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#endif
+#ifndef GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#endif
+#ifndef GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#endif
+#ifndef GL_FRAGMENT_MATERIAL_EXT
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#endif
+#ifndef GL_FRAGMENT_NORMAL_EXT
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#endif
+#ifndef GL_FRAGMENT_PROGRAM_ARB
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#endif
+#ifndef GL_FRAGMENT_PROGRAM_BINDING_NV
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#endif
+#ifndef GL_FRAGMENT_PROGRAM_NV
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#endif
+#ifndef GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#endif
+#ifndef GL_FRAGMENT_SHADER
+#define GL_FRAGMENT_SHADER 0x8B30
+#endif
+#ifndef GL_FRAGMENT_SHADER_ARB
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#endif
+#ifndef GL_FRAGMENT_SHADER_ATI
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#endif
+#ifndef GL_FRAGMENT_SHADER_DERIVATIVE_HINT
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#endif
+#ifndef GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#endif
+#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#endif
+#ifndef GL_FRAMEBUFFER_BINDING_EXT
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#endif
+#ifndef GL_FRAMEBUFFER_COMPLETE_EXT
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#endif
+#ifndef GL_FRAMEBUFFER_EXT
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#endif
+#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE_EXT
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif
+#ifndef GL_FRAMEBUFFER_SRGB_EXT
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#endif
+#ifndef GL_FRAMEBUFFER_UNSUPPORTED_EXT
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#endif
+#ifndef GL_FRAMEZOOM_FACTOR_SGIX
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#endif
+#ifndef GL_FRAMEZOOM_SGIX
+#define GL_FRAMEZOOM_SGIX 0x818B
+#endif
+#ifndef GL_FRONT
+#define GL_FRONT 0x0404
+#endif
+#ifndef GL_FRONT_AND_BACK
+#define GL_FRONT_AND_BACK 0x0408
+#endif
+#ifndef GL_FRONT_FACE
+#define GL_FRONT_FACE 0x0B46
+#endif
+#ifndef GL_FRONT_LEFT
+#define GL_FRONT_LEFT 0x0400
+#endif
+#ifndef GL_FRONT_RIGHT
+#define GL_FRONT_RIGHT 0x0401
+#endif
+#ifndef GL_FULL_RANGE_EXT
+#define GL_FULL_RANGE_EXT 0x87E1
+#endif
+#ifndef GL_FULL_STIPPLE_HINT_PGI
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#endif
+#ifndef GL_FUNC_ADD
+#define GL_FUNC_ADD 0x8006
+#endif
+#ifndef GL_FUNC_ADD_EXT
+#define GL_FUNC_ADD_EXT 0x8006
+#endif
+#ifndef GL_FUNC_REVERSE_SUBTRACT
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#endif
+#ifndef GL_FUNC_REVERSE_SUBTRACT_EXT
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+#ifndef GL_FUNC_SUBTRACT
+#define GL_FUNC_SUBTRACT 0x800A
+#endif
+#ifndef GL_FUNC_SUBTRACT_EXT
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#endif
+#ifndef GL_GENERATE_MIPMAP
+#define GL_GENERATE_MIPMAP 0x8191
+#endif
+#ifndef GL_GENERATE_MIPMAP_HINT
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#endif
+#ifndef GL_GENERATE_MIPMAP_HINT_SGIS
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+#ifndef GL_GENERATE_MIPMAP_SGIS
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#endif
+#ifndef GL_GENERIC_ATTRIB_NV
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#endif
+#ifndef GL_GEOMETRY_DEFORMATION_BIT_SGIX
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+#ifndef GL_GEOMETRY_DEFORMATION_SGIX
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#endif
+#ifndef GL_GEOMETRY_INPUT_TYPE_EXT
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#endif
+#ifndef GL_GEOMETRY_OUTPUT_TYPE_EXT
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#endif
+#ifndef GL_GEOMETRY_PROGRAM_NV
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#endif
+#ifndef GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#endif
+#ifndef GL_GEOMETRY_SHADER_EXT
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+#endif
+#ifndef GL_GEOMETRY_VERTICES_OUT_EXT
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#endif
+#ifndef GL_GEQUAL
+#define GL_GEQUAL 0x0206
+#endif
+#ifndef GL_GLOBAL_ALPHA_FACTOR_SUN
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+#ifndef GL_GLOBAL_ALPHA_SUN
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#endif
+#ifndef GL_GREATER
+#define GL_GREATER 0x0204
+#endif
+#ifndef GL_GREEN
+#define GL_GREEN 0x1904
+#endif
+#ifndef GL_GREEN_BIAS
+#define GL_GREEN_BIAS 0x0D19
+#endif
+#ifndef GL_GREEN_BITS
+#define GL_GREEN_BITS 0x0D53
+#endif
+#ifndef GL_GREEN_BIT_ATI
+#define GL_GREEN_BIT_ATI 0x00000002
+#endif
+#ifndef GL_GREEN_INTEGER_EXT
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#endif
+#ifndef GL_GREEN_MAX_CLAMP_INGR
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#endif
+#ifndef GL_GREEN_MIN_CLAMP_INGR
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#endif
+#ifndef GL_GREEN_SCALE
+#define GL_GREEN_SCALE 0x0D18
+#endif
+#ifndef GL_HALF_BIAS_NEGATE_NV
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#endif
+#ifndef GL_HALF_BIAS_NORMAL_NV
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#endif
+#ifndef GL_HALF_BIT_ATI
+#define GL_HALF_BIT_ATI 0x00000008
+#endif
+#ifndef GL_HALF_FLOAT_ARB
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+#ifndef GL_HALF_FLOAT_NV
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+#ifndef GL_HILO16_NV
+#define GL_HILO16_NV 0x86F8
+#endif
+#ifndef GL_HILO8_NV
+#define GL_HILO8_NV 0x885E
+#endif
+#ifndef GL_HILO_NV
+#define GL_HILO_NV 0x86F4
+#endif
+#ifndef GL_HINT_BIT
+#define GL_HINT_BIT 0x00008000
+#endif
+#ifndef GL_HISTOGRAM
+#define GL_HISTOGRAM 0x8024
+#endif
+#ifndef GL_HISTOGRAM_ALPHA_SIZE
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#endif
+#ifndef GL_HISTOGRAM_ALPHA_SIZE_EXT
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#endif
+#ifndef GL_HISTOGRAM_BLUE_SIZE
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#endif
+#ifndef GL_HISTOGRAM_BLUE_SIZE_EXT
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#endif
+#ifndef GL_HISTOGRAM_EXT
+#define GL_HISTOGRAM_EXT 0x8024
+#endif
+#ifndef GL_HISTOGRAM_FORMAT
+#define GL_HISTOGRAM_FORMAT 0x8027
+#endif
+#ifndef GL_HISTOGRAM_FORMAT_EXT
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#endif
+#ifndef GL_HISTOGRAM_GREEN_SIZE
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#endif
+#ifndef GL_HISTOGRAM_GREEN_SIZE_EXT
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#endif
+#ifndef GL_HISTOGRAM_LUMINANCE_SIZE
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#endif
+#ifndef GL_HISTOGRAM_LUMINANCE_SIZE_EXT
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#endif
+#ifndef GL_HISTOGRAM_RED_SIZE
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#endif
+#ifndef GL_HISTOGRAM_RED_SIZE_EXT
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#endif
+#ifndef GL_HISTOGRAM_SINK
+#define GL_HISTOGRAM_SINK 0x802D
+#endif
+#ifndef GL_HISTOGRAM_SINK_EXT
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#endif
+#ifndef GL_HISTOGRAM_WIDTH
+#define GL_HISTOGRAM_WIDTH 0x8026
+#endif
+#ifndef GL_HISTOGRAM_WIDTH_EXT
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#endif
+#ifndef GL_HI_BIAS_NV
+#define GL_HI_BIAS_NV 0x8714
+#endif
+#ifndef GL_HI_SCALE_NV
+#define GL_HI_SCALE_NV 0x870E
+#endif
+#ifndef GL_IDENTITY_NV
+#define GL_IDENTITY_NV 0x862A
+#endif
+#ifndef GL_IGNORE_BORDER_HP
+#define GL_IGNORE_BORDER_HP 0x8150
+#endif
+#ifndef GL_IMAGE_CUBIC_WEIGHT_HP
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#endif
+#ifndef GL_IMAGE_MAG_FILTER_HP
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#endif
+#ifndef GL_IMAGE_MIN_FILTER_HP
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#endif
+#ifndef GL_IMAGE_ROTATE_ANGLE_HP
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#endif
+#ifndef GL_IMAGE_ROTATE_ORIGIN_X_HP
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#endif
+#ifndef GL_IMAGE_ROTATE_ORIGIN_Y_HP
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#endif
+#ifndef GL_IMAGE_SCALE_X_HP
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#endif
+#ifndef GL_IMAGE_SCALE_Y_HP
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#endif
+#ifndef GL_IMAGE_TRANSFORM_2D_HP
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#endif
+#ifndef GL_IMAGE_TRANSLATE_X_HP
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#endif
+#ifndef GL_IMAGE_TRANSLATE_Y_HP
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#endif
+#ifndef GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+#ifndef GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#endif
+#ifndef GL_INCR
+#define GL_INCR 0x1E02
+#endif
+#ifndef GL_INCR_WRAP
+#define GL_INCR_WRAP 0x8507
+#endif
+#ifndef GL_INCR_WRAP_EXT
+#define GL_INCR_WRAP_EXT 0x8507
+#endif
+#ifndef GL_INDEX_ARRAY
+#define GL_INDEX_ARRAY 0x8077
+#endif
+#ifndef GL_INDEX_ARRAY_BUFFER_BINDING
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#endif
+#ifndef GL_INDEX_ARRAY_BUFFER_BINDING_ARB
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#endif
+#ifndef GL_INDEX_ARRAY_COUNT_EXT
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#endif
+#ifndef GL_INDEX_ARRAY_EXT
+#define GL_INDEX_ARRAY_EXT 0x8077
+#endif
+#ifndef GL_INDEX_ARRAY_LIST_IBM
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#endif
+#ifndef GL_INDEX_ARRAY_LIST_STRIDE_IBM
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#endif
+#ifndef GL_INDEX_ARRAY_POINTER
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#endif
+#ifndef GL_INDEX_ARRAY_POINTER_EXT
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#endif
+#ifndef GL_INDEX_ARRAY_STRIDE
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#endif
+#ifndef GL_INDEX_ARRAY_STRIDE_EXT
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#endif
+#ifndef GL_INDEX_ARRAY_TYPE
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#endif
+#ifndef GL_INDEX_ARRAY_TYPE_EXT
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#endif
+#ifndef GL_INDEX_BITS
+#define GL_INDEX_BITS 0x0D51
+#endif
+#ifndef GL_INDEX_BIT_PGI
+#define GL_INDEX_BIT_PGI 0x00080000
+#endif
+#ifndef GL_INDEX_CLEAR_VALUE
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#endif
+#ifndef GL_INDEX_LOGIC_OP
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#endif
+#ifndef GL_INDEX_MATERIAL_EXT
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#endif
+#ifndef GL_INDEX_MATERIAL_FACE_EXT
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+#ifndef GL_INDEX_MATERIAL_PARAMETER_EXT
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#endif
+#ifndef GL_INDEX_MODE
+#define GL_INDEX_MODE 0x0C30
+#endif
+#ifndef GL_INDEX_OFFSET
+#define GL_INDEX_OFFSET 0x0D13
+#endif
+#ifndef GL_INDEX_SHIFT
+#define GL_INDEX_SHIFT 0x0D12
+#endif
+#ifndef GL_INDEX_TEST_EXT
+#define GL_INDEX_TEST_EXT 0x81B5
+#endif
+#ifndef GL_INDEX_TEST_FUNC_EXT
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#endif
+#ifndef GL_INDEX_TEST_REF_EXT
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+#ifndef GL_INDEX_WRITEMASK
+#define GL_INDEX_WRITEMASK 0x0C21
+#endif
+#ifndef GL_INFO_LOG_LENGTH
+#define GL_INFO_LOG_LENGTH 0x8B84
+#endif
+#ifndef GL_INSTRUMENT_BUFFER_POINTER_SGIX
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#endif
+#ifndef GL_INSTRUMENT_MEASUREMENTS_SGIX
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+#ifndef GL_INT
+#define GL_INT 0x1404
+#endif
+#ifndef GL_INTENSITY
+#define GL_INTENSITY 0x8049
+#endif
+#ifndef GL_INTENSITY12
+#define GL_INTENSITY12 0x804C
+#endif
+#ifndef GL_INTENSITY12_EXT
+#define GL_INTENSITY12_EXT 0x804C
+#endif
+#ifndef GL_INTENSITY16
+#define GL_INTENSITY16 0x804D
+#endif
+#ifndef GL_INTENSITY16F_ARB
+#define GL_INTENSITY16F_ARB 0x881D
+#endif
+#ifndef GL_INTENSITY16I_EXT
+#define GL_INTENSITY16I_EXT 0x8D8B
+#endif
+#ifndef GL_INTENSITY16UI_EXT
+#define GL_INTENSITY16UI_EXT 0x8D79
+#endif
+#ifndef GL_INTENSITY16_EXT
+#define GL_INTENSITY16_EXT 0x804D
+#endif
+#ifndef GL_INTENSITY32F_ARB
+#define GL_INTENSITY32F_ARB 0x8817
+#endif
+#ifndef GL_INTENSITY32I_EXT
+#define GL_INTENSITY32I_EXT 0x8D85
+#endif
+#ifndef GL_INTENSITY32UI_EXT
+#define GL_INTENSITY32UI_EXT 0x8D73
+#endif
+#ifndef GL_INTENSITY4
+#define GL_INTENSITY4 0x804A
+#endif
+#ifndef GL_INTENSITY4_EXT
+#define GL_INTENSITY4_EXT 0x804A
+#endif
+#ifndef GL_INTENSITY8
+#define GL_INTENSITY8 0x804B
+#endif
+#ifndef GL_INTENSITY8I_EXT
+#define GL_INTENSITY8I_EXT 0x8D91
+#endif
+#ifndef GL_INTENSITY8UI_EXT
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#endif
+#ifndef GL_INTENSITY8_EXT
+#define GL_INTENSITY8_EXT 0x804B
+#endif
+#ifndef GL_INTENSITY_EXT
+#define GL_INTENSITY_EXT 0x8049
+#endif
+#ifndef GL_INTENSITY_FLOAT16_ATI
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#endif
+#ifndef GL_INTENSITY_FLOAT32_ATI
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#endif
+#ifndef GL_INTERLACE_OML
+#define GL_INTERLACE_OML 0x8980
+#endif
+#ifndef GL_INTERLACE_READ_INGR
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+#ifndef GL_INTERLACE_READ_OML
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+#ifndef GL_INTERLACE_SGIX
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+#ifndef GL_INTERLEAVED_ATTRIBS_NV
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#endif
+#ifndef GL_INTERPOLATE
+#define GL_INTERPOLATE 0x8575
+#endif
+#ifndef GL_INTERPOLATE_ARB
+#define GL_INTERPOLATE_ARB 0x8575
+#endif
+#ifndef GL_INTERPOLATE_EXT
+#define GL_INTERPOLATE_EXT 0x8575
+#endif
+#ifndef GL_INT_SAMPLER_1D_ARRAY_EXT
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#endif
+#ifndef GL_INT_SAMPLER_1D_EXT
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#endif
+#ifndef GL_INT_SAMPLER_2D_ARRAY_EXT
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#endif
+#ifndef GL_INT_SAMPLER_2D_EXT
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#endif
+#ifndef GL_INT_SAMPLER_2D_RECT_EXT
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#endif
+#ifndef GL_INT_SAMPLER_3D_EXT
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#endif
+#ifndef GL_INT_SAMPLER_BUFFER_EXT
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#endif
+#ifndef GL_INT_SAMPLER_CUBE_EXT
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#endif
+#ifndef GL_INT_VEC2
+#define GL_INT_VEC2 0x8B53
+#endif
+#ifndef GL_INT_VEC2_ARB
+#define GL_INT_VEC2_ARB 0x8B53
+#endif
+#ifndef GL_INT_VEC3
+#define GL_INT_VEC3 0x8B54
+#endif
+#ifndef GL_INT_VEC3_ARB
+#define GL_INT_VEC3_ARB 0x8B54
+#endif
+#ifndef GL_INT_VEC4
+#define GL_INT_VEC4 0x8B55
+#endif
+#ifndef GL_INT_VEC4_ARB
+#define GL_INT_VEC4_ARB 0x8B55
+#endif
+#ifndef GL_INVALID_ENUM
+#define GL_INVALID_ENUM 0x0500
+#endif
+#ifndef GL_INVALID_FRAMEBUFFER_OPERATION_EXT
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#endif
+#ifndef GL_INVALID_OPERATION
+#define GL_INVALID_OPERATION 0x0502
+#endif
+#ifndef GL_INVALID_VALUE
+#define GL_INVALID_VALUE 0x0501
+#endif
+#ifndef GL_INVARIANT_DATATYPE_EXT
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#endif
+#ifndef GL_INVARIANT_EXT
+#define GL_INVARIANT_EXT 0x87C2
+#endif
+#ifndef GL_INVARIANT_VALUE_EXT
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#endif
+#ifndef GL_INVERSE_NV
+#define GL_INVERSE_NV 0x862B
+#endif
+#ifndef GL_INVERSE_TRANSPOSE_NV
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#endif
+#ifndef GL_INVERT
+#define GL_INVERT 0x150A
+#endif
+#ifndef GL_INVERTED_SCREEN_W_REND
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+#ifndef GL_IR_INSTRUMENT1_SGIX
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+#ifndef GL_IUI_N3F_V2F_EXT
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#endif
+#ifndef GL_IUI_N3F_V3F_EXT
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#endif
+#ifndef GL_IUI_V2F_EXT
+#define GL_IUI_V2F_EXT 0x81AD
+#endif
+#ifndef GL_IUI_V3F_EXT
+#define GL_IUI_V3F_EXT 0x81AE
+#endif
+#ifndef GL_KEEP
+#define GL_KEEP 0x1E00
+#endif
+#ifndef GL_LEFT
+#define GL_LEFT 0x0406
+#endif
+#ifndef GL_LEQUAL
+#define GL_LEQUAL 0x0203
+#endif
+#ifndef GL_LERP_ATI
+#define GL_LERP_ATI 0x8969
+#endif
+#ifndef GL_LESS
+#define GL_LESS 0x0201
+#endif
+#ifndef GL_LIGHT0
+#define GL_LIGHT0 0x4000
+#endif
+#ifndef GL_LIGHT1
+#define GL_LIGHT1 0x4001
+#endif
+#ifndef GL_LIGHT2
+#define GL_LIGHT2 0x4002
+#endif
+#ifndef GL_LIGHT3
+#define GL_LIGHT3 0x4003
+#endif
+#ifndef GL_LIGHT4
+#define GL_LIGHT4 0x4004
+#endif
+#ifndef GL_LIGHT5
+#define GL_LIGHT5 0x4005
+#endif
+#ifndef GL_LIGHT6
+#define GL_LIGHT6 0x4006
+#endif
+#ifndef GL_LIGHT7
+#define GL_LIGHT7 0x4007
+#endif
+#ifndef GL_LIGHTING
+#define GL_LIGHTING 0x0B50
+#endif
+#ifndef GL_LIGHTING_BIT
+#define GL_LIGHTING_BIT 0x00000040
+#endif
+#ifndef GL_LIGHT_ENV_MODE_SGIX
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#endif
+#ifndef GL_LIGHT_MODEL_AMBIENT
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#endif
+#ifndef GL_LIGHT_MODEL_COLOR_CONTROL
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#endif
+#ifndef GL_LIGHT_MODEL_COLOR_CONTROL_EXT
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#endif
+#ifndef GL_LIGHT_MODEL_LOCAL_VIEWER
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#endif
+#ifndef GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+#ifndef GL_LIGHT_MODEL_TWO_SIDE
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#endif
+#ifndef GL_LINE
+#define GL_LINE 0x1B01
+#endif
+#ifndef GL_LINEAR
+#define GL_LINEAR 0x2601
+#endif
+#ifndef GL_LINEAR_ATTENUATION
+#define GL_LINEAR_ATTENUATION 0x1208
+#endif
+#ifndef GL_LINEAR_CLIPMAP_LINEAR_SGIX
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#endif
+#ifndef GL_LINEAR_CLIPMAP_NEAREST_SGIX
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+#ifndef GL_LINEAR_DETAIL_ALPHA_SGIS
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#endif
+#ifndef GL_LINEAR_DETAIL_COLOR_SGIS
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#endif
+#ifndef GL_LINEAR_DETAIL_SGIS
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#endif
+#ifndef GL_LINEAR_MIPMAP_LINEAR
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#endif
+#ifndef GL_LINEAR_MIPMAP_NEAREST
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#endif
+#ifndef GL_LINEAR_SHARPEN_ALPHA_SGIS
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#endif
+#ifndef GL_LINEAR_SHARPEN_COLOR_SGIS
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#endif
+#ifndef GL_LINEAR_SHARPEN_SGIS
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#endif
+#ifndef GL_LINES
+#define GL_LINES 0x0001
+#endif
+#ifndef GL_LINES_ADJACENCY_EXT
+#define GL_LINES_ADJACENCY_EXT 0x000A
+#endif
+#ifndef GL_LINE_BIT
+#define GL_LINE_BIT 0x00000004
+#endif
+#ifndef GL_LINE_LOOP
+#define GL_LINE_LOOP 0x0002
+#endif
+#ifndef GL_LINE_RESET_TOKEN
+#define GL_LINE_RESET_TOKEN 0x0707
+#endif
+#ifndef GL_LINE_SMOOTH
+#define GL_LINE_SMOOTH 0x0B20
+#endif
+#ifndef GL_LINE_SMOOTH_HINT
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#endif
+#ifndef GL_LINE_STIPPLE
+#define GL_LINE_STIPPLE 0x0B24
+#endif
+#ifndef GL_LINE_STIPPLE_PATTERN
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#endif
+#ifndef GL_LINE_STIPPLE_REPEAT
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#endif
+#ifndef GL_LINE_STRIP
+#define GL_LINE_STRIP 0x0003
+#endif
+#ifndef GL_LINE_STRIP_ADJACENCY_EXT
+#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
+#endif
+#ifndef GL_LINE_TOKEN
+#define GL_LINE_TOKEN 0x0702
+#endif
+#ifndef GL_LINE_WIDTH
+#define GL_LINE_WIDTH 0x0B21
+#endif
+#ifndef GL_LINE_WIDTH_GRANULARITY
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#endif
+#ifndef GL_LINE_WIDTH_RANGE
+#define GL_LINE_WIDTH_RANGE 0x0B22
+#endif
+#ifndef GL_LINK_STATUS
+#define GL_LINK_STATUS 0x8B82
+#endif
+#ifndef GL_LIST_BASE
+#define GL_LIST_BASE 0x0B32
+#endif
+#ifndef GL_LIST_BIT
+#define GL_LIST_BIT 0x00020000
+#endif
+#ifndef GL_LIST_INDEX
+#define GL_LIST_INDEX 0x0B33
+#endif
+#ifndef GL_LIST_MODE
+#define GL_LIST_MODE 0x0B30
+#endif
+#ifndef GL_LIST_PRIORITY_SGIX
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+#ifndef GL_LOAD
+#define GL_LOAD 0x0101
+#endif
+#ifndef GL_LOCAL_CONSTANT_DATATYPE_EXT
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+#ifndef GL_LOCAL_CONSTANT_EXT
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#endif
+#ifndef GL_LOCAL_CONSTANT_VALUE_EXT
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#endif
+#ifndef GL_LOCAL_EXT
+#define GL_LOCAL_EXT 0x87C4
+#endif
+#ifndef GL_LOGIC_OP
+#define GL_LOGIC_OP 0x0BF1
+#endif
+#ifndef GL_LOGIC_OP_MODE
+#define GL_LOGIC_OP_MODE 0x0BF0
+#endif
+#ifndef GL_LOWER_LEFT
+#define GL_LOWER_LEFT 0x8CA1
+#endif
+#ifndef GL_LO_BIAS_NV
+#define GL_LO_BIAS_NV 0x8715
+#endif
+#ifndef GL_LO_SCALE_NV
+#define GL_LO_SCALE_NV 0x870F
+#endif
+#ifndef GL_LUMINANCE
+#define GL_LUMINANCE 0x1909
+#endif
+#ifndef GL_LUMINANCE12
+#define GL_LUMINANCE12 0x8041
+#endif
+#ifndef GL_LUMINANCE12_ALPHA12
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#endif
+#ifndef GL_LUMINANCE12_ALPHA12_EXT
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#endif
+#ifndef GL_LUMINANCE12_ALPHA4
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#endif
+#ifndef GL_LUMINANCE12_ALPHA4_EXT
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#endif
+#ifndef GL_LUMINANCE12_EXT
+#define GL_LUMINANCE12_EXT 0x8041
+#endif
+#ifndef GL_LUMINANCE16
+#define GL_LUMINANCE16 0x8042
+#endif
+#ifndef GL_LUMINANCE16F_ARB
+#define GL_LUMINANCE16F_ARB 0x881E
+#endif
+#ifndef GL_LUMINANCE16I_EXT
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#endif
+#ifndef GL_LUMINANCE16UI_EXT
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#endif
+#ifndef GL_LUMINANCE16_ALPHA16
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#endif
+#ifndef GL_LUMINANCE16_ALPHA16_EXT
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#endif
+#ifndef GL_LUMINANCE16_EXT
+#define GL_LUMINANCE16_EXT 0x8042
+#endif
+#ifndef GL_LUMINANCE32F_ARB
+#define GL_LUMINANCE32F_ARB 0x8818
+#endif
+#ifndef GL_LUMINANCE32I_EXT
+#define GL_LUMINANCE32I_EXT 0x8D86
+#endif
+#ifndef GL_LUMINANCE32UI_EXT
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#endif
+#ifndef GL_LUMINANCE4
+#define GL_LUMINANCE4 0x803F
+#endif
+#ifndef GL_LUMINANCE4_ALPHA4
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#endif
+#ifndef GL_LUMINANCE4_ALPHA4_EXT
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#endif
+#ifndef GL_LUMINANCE4_EXT
+#define GL_LUMINANCE4_EXT 0x803F
+#endif
+#ifndef GL_LUMINANCE6_ALPHA2
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#endif
+#ifndef GL_LUMINANCE6_ALPHA2_EXT
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#endif
+#ifndef GL_LUMINANCE8
+#define GL_LUMINANCE8 0x8040
+#endif
+#ifndef GL_LUMINANCE8I_EXT
+#define GL_LUMINANCE8I_EXT 0x8D92
+#endif
+#ifndef GL_LUMINANCE8UI_EXT
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#endif
+#ifndef GL_LUMINANCE8_ALPHA8
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#endif
+#ifndef GL_LUMINANCE8_ALPHA8_EXT
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#endif
+#ifndef GL_LUMINANCE8_EXT
+#define GL_LUMINANCE8_EXT 0x8040
+#endif
+#ifndef GL_LUMINANCE_ALPHA
+#define GL_LUMINANCE_ALPHA 0x190A
+#endif
+#ifndef GL_LUMINANCE_ALPHA16F_ARB
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+#ifndef GL_LUMINANCE_ALPHA16I_EXT
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#endif
+#ifndef GL_LUMINANCE_ALPHA16UI_EXT
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#endif
+#ifndef GL_LUMINANCE_ALPHA32F_ARB
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#endif
+#ifndef GL_LUMINANCE_ALPHA32I_EXT
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#endif
+#ifndef GL_LUMINANCE_ALPHA32UI_EXT
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#endif
+#ifndef GL_LUMINANCE_ALPHA8I_EXT
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#endif
+#ifndef GL_LUMINANCE_ALPHA8UI_EXT
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#endif
+#ifndef GL_LUMINANCE_ALPHA_FLOAT16_ATI
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+#ifndef GL_LUMINANCE_ALPHA_FLOAT32_ATI
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#endif
+#ifndef GL_LUMINANCE_ALPHA_INTEGER_EXT
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#endif
+#ifndef GL_LUMINANCE_FLOAT16_ATI
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#endif
+#ifndef GL_LUMINANCE_FLOAT32_ATI
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#endif
+#ifndef GL_LUMINANCE_INTEGER_EXT
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#endif
+#ifndef GL_MAD_ATI
+#define GL_MAD_ATI 0x8968
+#endif
+#ifndef GL_MAGNITUDE_BIAS_NV
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#endif
+#ifndef GL_MAGNITUDE_SCALE_NV
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#endif
+#ifndef GL_MAP1_BINORMAL_EXT
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#endif
+#ifndef GL_MAP1_COLOR_4
+#define GL_MAP1_COLOR_4 0x0D90
+#endif
+#ifndef GL_MAP1_GRID_DOMAIN
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#endif
+#ifndef GL_MAP1_GRID_SEGMENTS
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#endif
+#ifndef GL_MAP1_INDEX
+#define GL_MAP1_INDEX 0x0D91
+#endif
+#ifndef GL_MAP1_NORMAL
+#define GL_MAP1_NORMAL 0x0D92
+#endif
+#ifndef GL_MAP1_TANGENT_EXT
+#define GL_MAP1_TANGENT_EXT 0x8444
+#endif
+#ifndef GL_MAP1_TEXTURE_COORD_1
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#endif
+#ifndef GL_MAP1_TEXTURE_COORD_2
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#endif
+#ifndef GL_MAP1_TEXTURE_COORD_3
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#endif
+#ifndef GL_MAP1_TEXTURE_COORD_4
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#endif
+#ifndef GL_MAP1_VERTEX_3
+#define GL_MAP1_VERTEX_3 0x0D97
+#endif
+#ifndef GL_MAP1_VERTEX_4
+#define GL_MAP1_VERTEX_4 0x0D98
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB0_4_NV
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB10_4_NV
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB11_4_NV
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB12_4_NV
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB13_4_NV
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB14_4_NV
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB15_4_NV
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB1_4_NV
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB2_4_NV
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB3_4_NV
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB4_4_NV
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB5_4_NV
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB6_4_NV
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB7_4_NV
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB8_4_NV
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#endif
+#ifndef GL_MAP1_VERTEX_ATTRIB9_4_NV
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#endif
+#ifndef GL_MAP2_BINORMAL_EXT
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+#ifndef GL_MAP2_COLOR_4
+#define GL_MAP2_COLOR_4 0x0DB0
+#endif
+#ifndef GL_MAP2_GRID_DOMAIN
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#endif
+#ifndef GL_MAP2_GRID_SEGMENTS
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#endif
+#ifndef GL_MAP2_INDEX
+#define GL_MAP2_INDEX 0x0DB1
+#endif
+#ifndef GL_MAP2_NORMAL
+#define GL_MAP2_NORMAL 0x0DB2
+#endif
+#ifndef GL_MAP2_TANGENT_EXT
+#define GL_MAP2_TANGENT_EXT 0x8445
+#endif
+#ifndef GL_MAP2_TEXTURE_COORD_1
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#endif
+#ifndef GL_MAP2_TEXTURE_COORD_2
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#endif
+#ifndef GL_MAP2_TEXTURE_COORD_3
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#endif
+#ifndef GL_MAP2_TEXTURE_COORD_4
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#endif
+#ifndef GL_MAP2_VERTEX_3
+#define GL_MAP2_VERTEX_3 0x0DB7
+#endif
+#ifndef GL_MAP2_VERTEX_4
+#define GL_MAP2_VERTEX_4 0x0DB8
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB0_4_NV
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB10_4_NV
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB11_4_NV
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB12_4_NV
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB13_4_NV
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB14_4_NV
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB15_4_NV
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB1_4_NV
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB2_4_NV
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB3_4_NV
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB4_4_NV
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB5_4_NV
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB6_4_NV
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB7_4_NV
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB8_4_NV
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#endif
+#ifndef GL_MAP2_VERTEX_ATTRIB9_4_NV
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#endif
+#ifndef GL_MAP_ATTRIB_U_ORDER_NV
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#endif
+#ifndef GL_MAP_ATTRIB_V_ORDER_NV
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#endif
+#ifndef GL_MAP_COLOR
+#define GL_MAP_COLOR 0x0D10
+#endif
+#ifndef GL_MAP_STENCIL
+#define GL_MAP_STENCIL 0x0D11
+#endif
+#ifndef GL_MAP_TESSELLATION_NV
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#endif
+#ifndef GL_MATERIAL_SIDE_HINT_PGI
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#endif
+#ifndef GL_MATRIX0_ARB
+#define GL_MATRIX0_ARB 0x88C0
+#endif
+#ifndef GL_MATRIX0_NV
+#define GL_MATRIX0_NV 0x8630
+#endif
+#ifndef GL_MATRIX10_ARB
+#define GL_MATRIX10_ARB 0x88CA
+#endif
+#ifndef GL_MATRIX11_ARB
+#define GL_MATRIX11_ARB 0x88CB
+#endif
+#ifndef GL_MATRIX12_ARB
+#define GL_MATRIX12_ARB 0x88CC
+#endif
+#ifndef GL_MATRIX13_ARB
+#define GL_MATRIX13_ARB 0x88CD
+#endif
+#ifndef GL_MATRIX14_ARB
+#define GL_MATRIX14_ARB 0x88CE
+#endif
+#ifndef GL_MATRIX15_ARB
+#define GL_MATRIX15_ARB 0x88CF
+#endif
+#ifndef GL_MATRIX16_ARB
+#define GL_MATRIX16_ARB 0x88D0
+#endif
+#ifndef GL_MATRIX17_ARB
+#define GL_MATRIX17_ARB 0x88D1
+#endif
+#ifndef GL_MATRIX18_ARB
+#define GL_MATRIX18_ARB 0x88D2
+#endif
+#ifndef GL_MATRIX19_ARB
+#define GL_MATRIX19_ARB 0x88D3
+#endif
+#ifndef GL_MATRIX1_ARB
+#define GL_MATRIX1_ARB 0x88C1
+#endif
+#ifndef GL_MATRIX1_NV
+#define GL_MATRIX1_NV 0x8631
+#endif
+#ifndef GL_MATRIX20_ARB
+#define GL_MATRIX20_ARB 0x88D4
+#endif
+#ifndef GL_MATRIX21_ARB
+#define GL_MATRIX21_ARB 0x88D5
+#endif
+#ifndef GL_MATRIX22_ARB
+#define GL_MATRIX22_ARB 0x88D6
+#endif
+#ifndef GL_MATRIX23_ARB
+#define GL_MATRIX23_ARB 0x88D7
+#endif
+#ifndef GL_MATRIX24_ARB
+#define GL_MATRIX24_ARB 0x88D8
+#endif
+#ifndef GL_MATRIX25_ARB
+#define GL_MATRIX25_ARB 0x88D9
+#endif
+#ifndef GL_MATRIX26_ARB
+#define GL_MATRIX26_ARB 0x88DA
+#endif
+#ifndef GL_MATRIX27_ARB
+#define GL_MATRIX27_ARB 0x88DB
+#endif
+#ifndef GL_MATRIX28_ARB
+#define GL_MATRIX28_ARB 0x88DC
+#endif
+#ifndef GL_MATRIX29_ARB
+#define GL_MATRIX29_ARB 0x88DD
+#endif
+#ifndef GL_MATRIX2_ARB
+#define GL_MATRIX2_ARB 0x88C2
+#endif
+#ifndef GL_MATRIX2_NV
+#define GL_MATRIX2_NV 0x8632
+#endif
+#ifndef GL_MATRIX30_ARB
+#define GL_MATRIX30_ARB 0x88DE
+#endif
+#ifndef GL_MATRIX31_ARB
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+#ifndef GL_MATRIX3_ARB
+#define GL_MATRIX3_ARB 0x88C3
+#endif
+#ifndef GL_MATRIX3_NV
+#define GL_MATRIX3_NV 0x8633
+#endif
+#ifndef GL_MATRIX4_ARB
+#define GL_MATRIX4_ARB 0x88C4
+#endif
+#ifndef GL_MATRIX4_NV
+#define GL_MATRIX4_NV 0x8634
+#endif
+#ifndef GL_MATRIX5_ARB
+#define GL_MATRIX5_ARB 0x88C5
+#endif
+#ifndef GL_MATRIX5_NV
+#define GL_MATRIX5_NV 0x8635
+#endif
+#ifndef GL_MATRIX6_ARB
+#define GL_MATRIX6_ARB 0x88C6
+#endif
+#ifndef GL_MATRIX6_NV
+#define GL_MATRIX6_NV 0x8636
+#endif
+#ifndef GL_MATRIX7_ARB
+#define GL_MATRIX7_ARB 0x88C7
+#endif
+#ifndef GL_MATRIX7_NV
+#define GL_MATRIX7_NV 0x8637
+#endif
+#ifndef GL_MATRIX8_ARB
+#define GL_MATRIX8_ARB 0x88C8
+#endif
+#ifndef GL_MATRIX9_ARB
+#define GL_MATRIX9_ARB 0x88C9
+#endif
+#ifndef GL_MATRIX_EXT
+#define GL_MATRIX_EXT 0x87C0
+#endif
+#ifndef GL_MATRIX_INDEX_ARRAY_ARB
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#endif
+#ifndef GL_MATRIX_INDEX_ARRAY_POINTER_ARB
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+#ifndef GL_MATRIX_INDEX_ARRAY_SIZE_ARB
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#endif
+#ifndef GL_MATRIX_INDEX_ARRAY_STRIDE_ARB
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB