diff options
-rw-r--r-- | packages/Makefile | 122 | ||||
-rw-r--r-- | packages/Makefile.fpc | 23 | ||||
-rw-r--r-- | packages/extra/Makefile | 117 | ||||
-rw-r--r-- | packages/extra/Makefile.fpc | 16 | ||||
-rw-r--r-- | packages/opengl/Makefile | 2713 | ||||
-rw-r--r-- | packages/opengl/Makefile.fpc | 37 | ||||
-rw-r--r-- | packages/opengl/examples/Makefile | 2172 | ||||
-rw-r--r-- | packages/opengl/examples/Makefile.fpc | 26 | ||||
-rw-r--r-- | packages/opengl/examples/bounce.pp | 246 | ||||
-rw-r--r-- | packages/opengl/examples/glutdemo.pp | 134 | ||||
-rw-r--r-- | packages/opengl/examples/glxtest.pp | 110 | ||||
-rw-r--r-- | packages/opengl/examples/morph3d.pp | 915 | ||||
-rw-r--r-- | packages/opengl/examples/radblur.pp | 375 | ||||
-rw-r--r-- | packages/opengl/fpmake.pp | 37 | ||||
-rw-r--r-- | packages/opengl/glunits.txt | 46 | ||||
-rw-r--r-- | packages/opengl/readme | 22 | ||||
-rw-r--r-- | packages/opengl/src/gl.pp | 2346 | ||||
-rw-r--r-- | packages/opengl/src/glext.pp | 9547 | ||||
-rw-r--r-- | packages/opengl/src/glu.pp | 572 | ||||
-rw-r--r-- | packages/opengl/src/glut.pp | 2102 | ||||
-rw-r--r-- | packages/opengl/src/glx.pp | 240 | ||||
-rw-r--r-- | packages/opengl/src/tinygl.inc | 846 | ||||
-rw-r--r-- | packages/opengl/src/tinyglh.inc | 165 |
23 files changed, 22796 insertions, 133 deletions
diff --git a/packages/Makefile b/packages/Makefile index 72d7382360..0f823daa4a 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -241,28 +241,28 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) ifeq ($(FULL_TARGET),i386-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl libc unixutil +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl libc unixutil endif ifeq ($(FULL_TARGET),i386-go32v2) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),i386-win32) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint libpng mad tcl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint libpng mad tcl opengl endif ifeq ($(FULL_TARGET),i386-os2) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr zlib libpng x11 tcl endif ifeq ($(FULL_TARGET),i386-freebsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),i386-beos) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),i386-netbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),i386-solaris) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),i386-qnx) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -271,13 +271,13 @@ ifeq ($(FULL_TARGET),i386-netware) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr zlib endif ifeq ($(FULL_TARGET),i386-openbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),i386-wdosx) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),i386-darwin) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),i386-emx) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr zlib libpng x11 tcl @@ -298,13 +298,13 @@ ifeq ($(FULL_TARGET),i386-symbian) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),m68k-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),m68k-freebsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),m68k-netbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),m68k-amiga) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -313,7 +313,7 @@ ifeq ($(FULL_TARGET),m68k-atari) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),m68k-openbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),m68k-palmos) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -322,10 +322,10 @@ ifeq ($(FULL_TARGET),m68k-embedded) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),powerpc-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),powerpc-netbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),powerpc-amiga) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -334,7 +334,7 @@ ifeq ($(FULL_TARGET),powerpc-macos) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),powerpc-darwin) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),powerpc-morphos) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -343,34 +343,34 @@ ifeq ($(FULL_TARGET),powerpc-embedded) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),sparc-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),sparc-netbsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),sparc-solaris) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),sparc-embedded) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),x86_64-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),x86_64-freebsd) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),x86_64-darwin) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),x86_64-win64) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint tcl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint tcl opengl endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),arm-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),arm-palmos) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -391,10 +391,10 @@ ifeq ($(FULL_TARGET),arm-symbian) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr endif ifeq ($(FULL_TARGET),powerpc64-linux) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),powerpc64-darwin) -override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl +override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl endif ifeq ($(FULL_TARGET),powerpc64-embedded) override TARGET_DIRS+=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr @@ -1524,6 +1524,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 TARGET_DIRS_LIBC=1 TARGET_DIRS_UNIXUTIL=1 endif @@ -1583,6 +1584,7 @@ TARGET_DIRS_GDBINT=1 TARGET_DIRS_LIBPNG=1 TARGET_DIRS_MAD=1 TARGET_DIRS_TCL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-os2) TARGET_DIRS_BASE=1 @@ -1648,6 +1650,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-beos) TARGET_DIRS_BASE=1 @@ -1709,6 +1712,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-solaris) TARGET_DIRS_BASE=1 @@ -1749,6 +1753,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-qnx) TARGET_DIRS_BASE=1 @@ -1832,6 +1837,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-wdosx) TARGET_DIRS_BASE=1 @@ -1893,6 +1899,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),i386-emx) TARGET_DIRS_BASE=1 @@ -2075,6 +2082,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),m68k-freebsd) TARGET_DIRS_BASE=1 @@ -2115,6 +2123,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),m68k-netbsd) TARGET_DIRS_BASE=1 @@ -2155,6 +2164,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),m68k-amiga) TARGET_DIRS_BASE=1 @@ -2237,6 +2247,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),m68k-palmos) TARGET_DIRS_BASE=1 @@ -2326,6 +2337,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),powerpc-netbsd) TARGET_DIRS_BASE=1 @@ -2366,6 +2378,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),powerpc-amiga) TARGET_DIRS_BASE=1 @@ -2448,6 +2461,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),powerpc-morphos) TARGET_DIRS_BASE=1 @@ -2537,6 +2551,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),sparc-netbsd) TARGET_DIRS_BASE=1 @@ -2577,6 +2592,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),sparc-solaris) TARGET_DIRS_BASE=1 @@ -2617,6 +2633,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),sparc-embedded) TARGET_DIRS_BASE=1 @@ -2685,6 +2702,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),x86_64-freebsd) TARGET_DIRS_BASE=1 @@ -2725,6 +2743,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),x86_64-darwin) TARGET_DIRS_BASE=1 @@ -2765,6 +2784,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),x86_64-win64) TARGET_DIRS_BASE=1 @@ -2799,6 +2819,7 @@ TARGET_DIRS_SQLITE=1 TARGET_DIRS_IMAGEMAGICK=1 TARGET_DIRS_GDBINT=1 TARGET_DIRS_TCL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),x86_64-embedded) TARGET_DIRS_BASE=1 @@ -2867,6 +2888,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),arm-palmos) TARGET_DIRS_BASE=1 @@ -3044,6 +3066,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),powerpc64-darwin) TARGET_DIRS_BASE=1 @@ -3084,6 +3107,7 @@ TARGET_DIRS_GDBM=1 TARGET_DIRS_TCL=1 TARGET_DIRS_SYSLOG=1 TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 endif ifeq ($(FULL_TARGET),powerpc64-embedded) TARGET_DIRS_BASE=1 @@ -5086,6 +5110,51 @@ libcurl: $(MAKE) -C libcurl all .PHONY: libcurl_all libcurl_debug libcurl_smart libcurl_release libcurl_units libcurl_examples libcurl_shared libcurl_install libcurl_sourceinstall libcurl_exampleinstall libcurl_distinstall libcurl_zipinstall libcurl_zipsourceinstall libcurl_zipexampleinstall libcurl_zipdistinstall libcurl_clean libcurl_distclean libcurl_cleanall libcurl_info libcurl_makefiles libcurl endif +ifdef TARGET_DIRS_OPENGL +opengl_all: + $(MAKE) -C opengl all +opengl_debug: + $(MAKE) -C opengl debug +opengl_smart: + $(MAKE) -C opengl smart +opengl_release: + $(MAKE) -C opengl release +opengl_units: + $(MAKE) -C opengl units +opengl_examples: + $(MAKE) -C opengl examples +opengl_shared: + $(MAKE) -C opengl shared +opengl_install: + $(MAKE) -C opengl install +opengl_sourceinstall: + $(MAKE) -C opengl sourceinstall +opengl_exampleinstall: + $(MAKE) -C opengl exampleinstall +opengl_distinstall: + $(MAKE) -C opengl distinstall +opengl_zipinstall: + $(MAKE) -C opengl zipinstall +opengl_zipsourceinstall: + $(MAKE) -C opengl zipsourceinstall +opengl_zipexampleinstall: + $(MAKE) -C opengl zipexampleinstall +opengl_zipdistinstall: + $(MAKE) -C opengl zipdistinstall +opengl_clean: + $(MAKE) -C opengl clean +opengl_distclean: + $(MAKE) -C opengl distclean +opengl_cleanall: + $(MAKE) -C opengl cleanall +opengl_info: + $(MAKE) -C opengl info +opengl_makefiles: + $(MAKE) -C opengl makefiles +opengl: + $(MAKE) -C opengl all +.PHONY: opengl_all opengl_debug opengl_smart opengl_release opengl_units opengl_examples opengl_shared opengl_install opengl_sourceinstall opengl_exampleinstall opengl_distinstall opengl_zipinstall opengl_zipsourceinstall opengl_zipexampleinstall opengl_zipdistinstall opengl_clean opengl_distclean opengl_cleanall opengl_info opengl_makefiles opengl +endif ifdef TARGET_DIRS_LIBC libc_all: $(MAKE) -C libc all @@ -5376,3 +5445,8 @@ libpng_debug: zlib_debug libpng_smart: zlib_smart libpng_release: zlib_release libpng_shared: zlib_shared +opengl_all: x11_all +opengl_debug: x11_debug +opengl_smart: x11_smart +opengl_release: x11_release +opengl_shared: x11_shared diff --git a/packages/Makefile.fpc b/packages/Makefile.fpc index f86da4333b..da9703666f 100644 --- a/packages/Makefile.fpc +++ b/packages/Makefile.fpc @@ -6,21 +6,21 @@ dirs=base fv hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json extra fcl-process unzip regexpr dirs_linux_i386=libc unixutil dirs_freebsd=fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 gdbm tcl syslog libcurl + gdbint libpng x11 gdbm tcl syslog libcurl opengl dirs_darwin=fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 gdbm tcl syslog libcurl + gdbint libpng x11 gdbm tcl syslog libcurl opengl dirs_solaris=fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 gdbm tcl syslog libcurl + gdbint libpng x11 gdbm tcl syslog libcurl opengl dirs_netbsd=fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 gdbm tcl syslog libcurl + gdbint libpng x11 gdbm tcl syslog libcurl opengl dirs_openbsd=fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 gdbm tcl syslog libcurl + gdbint libpng x11 gdbm tcl syslog libcurl opengl dirs_linux=fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick \ - gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl + gdbint libpng x11 uuid ldap modplug dts mad gdbm tcl syslog libcurl opengl dirs_win32=winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick \ - gdbint libpng mad tcl + gdbint libpng mad tcl opengl dirs_win64=winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick \ - gdbint tcl + gdbint tcl opengl dirs_wince=fcl-web ibase mysql tcl dirs_os2=zlib libpng x11 tcl dirs_emx=zlib libpng x11 tcl @@ -135,3 +135,10 @@ libpng_debug: zlib_debug libpng_smart: zlib_smart libpng_release: zlib_release libpng_shared: zlib_shared + +opengl_all: x11_all +opengl_debug: x11_debug +opengl_smart: x11_smart +opengl_release: x11_release +opengl_shared: x11_shared + diff --git a/packages/extra/Makefile b/packages/extra/Makefile index 587cc33b4b..b373a75998 100644 --- a/packages/extra/Makefile +++ b/packages/extra/Makefile @@ -241,28 +241,28 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) ifeq ($(FULL_TARGET),i386-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell lua sdl graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell lua sdl graph endif ifeq ($(FULL_TARGET),i386-go32v2) override TARGET_DIRS+=chm graph endif ifeq ($(FULL_TARGET),i386-win32) -override TARGET_DIRS+=chm opengl gtk gtk2 cdrom fpgtk fftw openal oggvorbis a52 openssl pcap sdl lua graph +override TARGET_DIRS+=chm gtk gtk2 cdrom fpgtk fftw openal oggvorbis a52 openssl pcap sdl lua graph endif ifeq ($(FULL_TARGET),i386-os2) override TARGET_DIRS+=chm os2units rexx gtk imlib fpgtk endif ifeq ($(FULL_TARGET),i386-freebsd) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell endif ifeq ($(FULL_TARGET),i386-beos) override TARGET_DIRS+=chm graph endif ifeq ($(FULL_TARGET),i386-netbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),i386-solaris) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo endif ifeq ($(FULL_TARGET),i386-qnx) override TARGET_DIRS+=chm @@ -271,13 +271,13 @@ ifeq ($(FULL_TARGET),i386-netware) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),i386-openbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),i386-wdosx) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),i386-darwin) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell univint sdl graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell univint sdl graph endif ifeq ($(FULL_TARGET),i386-emx) override TARGET_DIRS+=chm os2units rexx gtk imlib fpgtk @@ -298,13 +298,13 @@ ifeq ($(FULL_TARGET),i386-symbian) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),m68k-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph endif ifeq ($(FULL_TARGET),m68k-freebsd) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell endif ifeq ($(FULL_TARGET),m68k-netbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),m68k-amiga) override TARGET_DIRS+=chm amunits @@ -313,7 +313,7 @@ ifeq ($(FULL_TARGET),m68k-atari) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),m68k-openbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),m68k-palmos) override TARGET_DIRS+=chm palmunits @@ -322,10 +322,10 @@ ifeq ($(FULL_TARGET),m68k-embedded) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),powerpc-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell sdl graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell sdl graph endif ifeq ($(FULL_TARGET),powerpc-netbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),powerpc-amiga) override TARGET_DIRS+=chm amunits @@ -334,7 +334,7 @@ ifeq ($(FULL_TARGET),powerpc-macos) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),powerpc-darwin) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell univint sdl graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell univint sdl graph endif ifeq ($(FULL_TARGET),powerpc-morphos) override TARGET_DIRS+=chm @@ -343,34 +343,34 @@ ifeq ($(FULL_TARGET),powerpc-embedded) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),sparc-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph endif ifeq ($(FULL_TARGET),sparc-netbsd) -override TARGET_DIRS+=chm opengl gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell +override TARGET_DIRS+=chm gtk forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo aspell endif ifeq ($(FULL_TARGET),sparc-solaris) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo endif ifeq ($(FULL_TARGET),sparc-embedded) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),x86_64-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell sdl graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell sdl graph endif ifeq ($(FULL_TARGET),x86_64-freebsd) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd fpgtk imlib gnome1 openssl pcap cairo sdl graph aspell endif ifeq ($(FULL_TARGET),x86_64-darwin) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell +override TARGET_DIRS+=chm fftw gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell endif ifeq ($(FULL_TARGET),x86_64-win64) -override TARGET_DIRS+=chm opengl gtk gtk2 cdrom fpgtk fftw openssl sdl +override TARGET_DIRS+=chm gtk gtk2 cdrom fpgtk fftw openssl sdl endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),arm-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph endif ifeq ($(FULL_TARGET),arm-palmos) override TARGET_DIRS+=chm palmunits @@ -391,10 +391,10 @@ ifeq ($(FULL_TARGET),arm-symbian) override TARGET_DIRS+=chm endif ifeq ($(FULL_TARGET),powerpc64-linux) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph +override TARGET_DIRS+=chm fftw gtk gtk2 forms svgalib ggi libgd utmp bfd cdrom imlib gnome1 fpgtk newt openal oggvorbis a52 openssl pcap cairo aspell graph endif ifeq ($(FULL_TARGET),powerpc64-darwin) -override TARGET_DIRS+=chm fftw opengl gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell +override TARGET_DIRS+=chm fftw gtk gtk2 forms libgd utmp bfd fpgtk imlib gnome1 openssl cairo aspell endif ifeq ($(FULL_TARGET),powerpc64-embedded) override TARGET_DIRS+=chm @@ -1481,7 +1481,6 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs ifeq ($(FULL_TARGET),i386-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1512,7 +1511,6 @@ TARGET_DIRS_GRAPH=1 endif ifeq ($(FULL_TARGET),i386-win32) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_CDROM=1 @@ -1538,7 +1536,6 @@ endif ifeq ($(FULL_TARGET),i386-freebsd) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1563,7 +1560,6 @@ TARGET_DIRS_GRAPH=1 endif ifeq ($(FULL_TARGET),i386-netbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1582,7 +1578,6 @@ endif ifeq ($(FULL_TARGET),i386-solaris) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1606,7 +1601,6 @@ TARGET_DIRS_CHM=1 endif ifeq ($(FULL_TARGET),i386-openbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1628,7 +1622,6 @@ endif ifeq ($(FULL_TARGET),i386-darwin) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1672,7 +1665,6 @@ endif ifeq ($(FULL_TARGET),m68k-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1698,7 +1690,6 @@ endif ifeq ($(FULL_TARGET),m68k-freebsd) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1719,7 +1710,6 @@ TARGET_DIRS_ASPELL=1 endif ifeq ($(FULL_TARGET),m68k-netbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1744,7 +1734,6 @@ TARGET_DIRS_CHM=1 endif ifeq ($(FULL_TARGET),m68k-openbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1770,7 +1759,6 @@ endif ifeq ($(FULL_TARGET),powerpc-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1796,7 +1784,6 @@ TARGET_DIRS_GRAPH=1 endif ifeq ($(FULL_TARGET),powerpc-netbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1822,7 +1809,6 @@ endif ifeq ($(FULL_TARGET),powerpc-darwin) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1848,7 +1834,6 @@ endif ifeq ($(FULL_TARGET),sparc-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1873,7 +1858,6 @@ TARGET_DIRS_GRAPH=1 endif ifeq ($(FULL_TARGET),sparc-netbsd) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_FORMS=1 TARGET_DIRS_SVGALIB=1 @@ -1892,7 +1876,6 @@ endif ifeq ($(FULL_TARGET),sparc-solaris) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1914,7 +1897,6 @@ endif ifeq ($(FULL_TARGET),x86_64-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1941,7 +1923,6 @@ endif ifeq ($(FULL_TARGET),x86_64-freebsd) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1963,7 +1944,6 @@ endif ifeq ($(FULL_TARGET),x86_64-darwin) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -1979,7 +1959,6 @@ TARGET_DIRS_ASPELL=1 endif ifeq ($(FULL_TARGET),x86_64-win64) TARGET_DIRS_CHM=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_CDROM=1 @@ -1994,7 +1973,6 @@ endif ifeq ($(FULL_TARGET),arm-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -2040,7 +2018,6 @@ endif ifeq ($(FULL_TARGET),powerpc64-linux) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -2066,7 +2043,6 @@ endif ifeq ($(FULL_TARGET),powerpc64-darwin) TARGET_DIRS_CHM=1 TARGET_DIRS_FFTW=1 -TARGET_DIRS_OPENGL=1 TARGET_DIRS_GTK=1 TARGET_DIRS_GTK2=1 TARGET_DIRS_FORMS=1 @@ -2173,51 +2149,6 @@ fftw: $(MAKE) -C fftw all .PHONY: fftw_all fftw_debug fftw_smart fftw_release fftw_units fftw_examples fftw_shared fftw_install fftw_sourceinstall fftw_exampleinstall fftw_distinstall fftw_zipinstall fftw_zipsourceinstall fftw_zipexampleinstall fftw_zipdistinstall fftw_clean fftw_distclean fftw_cleanall fftw_info fftw_makefiles fftw endif -ifdef TARGET_DIRS_OPENGL -opengl_all: - $(MAKE) -C opengl all -opengl_debug: - $(MAKE) -C opengl debug -opengl_smart: - $(MAKE) -C opengl smart -opengl_release: - $(MAKE) -C opengl release -opengl_units: - $(MAKE) -C opengl units -opengl_examples: - $(MAKE) -C opengl examples -opengl_shared: - $(MAKE) -C opengl shared -opengl_install: - $(MAKE) -C opengl install -opengl_sourceinstall: - $(MAKE) -C opengl sourceinstall -opengl_exampleinstall: - $(MAKE) -C opengl exampleinstall -opengl_distinstall: - $(MAKE) -C opengl distinstall -opengl_zipinstall: - $(MAKE) -C opengl zipinstall -opengl_zipsourceinstall: - $(MAKE) -C opengl zipsourceinstall -opengl_zipexampleinstall: - $(MAKE) -C opengl zipexampleinstall -opengl_zipdistinstall: - $(MAKE) -C opengl zipdistinstall -opengl_clean: - $(MAKE) -C opengl clean -opengl_distclean: - $(MAKE) -C opengl distclean -opengl_cleanall: - $(MAKE) -C opengl cleanall -opengl_info: - $(MAKE) -C opengl info -opengl_makefiles: - $(MAKE) -C opengl makefiles -opengl: - $(MAKE) -C opengl all -.PHONY: opengl_all opengl_debug opengl_smart opengl_release opengl_units opengl_examples opengl_shared opengl_install opengl_sourceinstall opengl_exampleinstall opengl_distinstall opengl_zipinstall opengl_zipsourceinstall opengl_zipexampleinstall opengl_zipdistinstall opengl_clean opengl_distclean opengl_cleanall opengl_info opengl_makefiles opengl -endif ifdef TARGET_DIRS_GTK gtk_all: $(MAKE) -C gtk all diff --git a/packages/extra/Makefile.fpc b/packages/extra/Makefile.fpc index 2a8b8e52a0..1179d56e11 100644 --- a/packages/extra/Makefile.fpc +++ b/packages/extra/Makefile.fpc @@ -4,7 +4,7 @@ [target] dirs=chm dirs_linux= fftw \ - opengl gtk gtk2 \ + gtk gtk2 \ forms svgalib ggi libgd \ utmp bfd cdrom \ imlib gnome1 fpgtk newt \ @@ -18,24 +18,24 @@ dirs_sparc_linux=graph dirs_arm_linux=graph dirs_m68k_linux=graph dirs_netbsd= \ - opengl gtk \ + gtk \ forms svgalib ggi libgd \ utmp bfd fpgtk \ imlib gnome1 openssl pcap cairo aspell dirs_freebsd= fftw \ - opengl gtk gtk2 \ + gtk gtk2 \ forms svgalib ggi libgd \ utmp bfd fpgtk \ imlib gnome1 openssl pcap cairo sdl graph aspell dirs_openbsd= \ - opengl gtk \ + gtk \ forms svgalib ggi libgd \ utmp bfd fpgtk \ imlib gnome1 openssl pcap cairo aspell # libcurl should work on Win32 too, but I haven't tested this. Skip it for now. MVC. -dirs_win32= opengl gtk gtk2 cdrom fpgtk fftw \ +dirs_win32= gtk gtk2 cdrom fpgtk fftw \ openal oggvorbis a52 openssl pcap sdl lua graph -dirs_win64= opengl gtk gtk2 cdrom fpgtk fftw openssl sdl +dirs_win64= gtk gtk2 cdrom fpgtk fftw openssl sdl dirs_wince= fftw dirs_os2=os2units \ rexx \ @@ -49,14 +49,14 @@ dirs_go32v2= graph dirs_amiga=amunits dirs_palmos=palmunits dirs_darwin= fftw \ - opengl gtk gtk2 \ + gtk gtk2 \ forms libgd \ utmp bfd fpgtk imlib gnome1 \ openssl cairo aspell dirs_powerpc_darwin=univint sdl graph dirs_i386_darwin=univint sdl graph dirs_solaris= fftw \ - opengl gtk gtk2 \ + gtk gtk2 \ forms svgalib ggi libgd \ utmp bfd fpgtk imlib gnome1 \ openssl pcap cairo diff --git a/packages/opengl/Makefile b/packages/opengl/Makefile new file mode 100644 index 0000000000..00b2f29a68 --- /dev/null +++ b/packages/opengl/Makefile @@ -0,0 +1,2713 @@ +# +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26] +# +default: all +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded +BSDs = freebsd netbsd openbsd darwin +UNIXs = linux $(BSDs) solaris qnx +LIMIT83fs = go32v2 os2 emx watcom +OSNeedsComspecToRunBatch = go32v2 watcom +FORCE: +.PHONY: FORCE +override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH))) +ifneq ($(findstring darwin,$(OSTYPE)),) +inUnix=1 #darwin +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +ifeq ($(findstring ;,$(PATH)),) +inUnix=1 +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +SEARCHPATH:=$(subst ;, ,$(PATH)) +endif +endif +SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE)))) +PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH)))) +ifeq ($(PWD),) +PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH)))) +ifeq ($(PWD),) +$(error You need the GNU utils package to use this Makefile) +else +PWD:=$(firstword $(PWD)) +SRCEXEEXT= +endif +else +PWD:=$(firstword $(PWD)) +SRCEXEEXT=.exe +endif +ifndef inUnix +ifeq ($(OS),Windows_NT) +inWinNT=1 +else +ifdef OS2_SHELL +inOS2=1 +endif +endif +else +ifneq ($(findstring cygdrive,$(PATH)),) +inCygWin=1 +endif +endif +ifdef inUnix +SRCBATCHEXT=.sh +else +ifdef inOS2 +SRCBATCHEXT=.cmd +else +SRCBATCHEXT=.bat +endif +endif +ifdef COMSPEC +ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),) +RUNBATCH=$(COMSPEC) /C +endif +endif +ifdef inUnix +PATHSEP=/ +else +PATHSEP:=$(subst /,\,/) +ifdef inCygWin +PATHSEP=/ +endif +endif +ifdef PWD +BASEDIR:=$(subst \,/,$(shell $(PWD))) +ifdef inCygWin +ifneq ($(findstring /cygdrive/,$(BASEDIR)),) +BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR)) +BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR))) +BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR)) +endif +endif +else +BASEDIR=. +endif +ifdef inOS2 +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO=echo +else +ECHO:=$(firstword $(ECHO)) +endif +else +ECHO:=$(firstword $(ECHO)) +endif +endif +export ECHO +endif +override DEFAULT_FPCDIR=../.. +ifndef FPC +ifdef PP +FPC=$(PP) +endif +endif +ifndef FPC +FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(FPCPROG),) +FPCPROG:=$(firstword $(FPCPROG)) +ifneq ($(CPU_TARGET),) +FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB) +else +FPC:=$(shell $(FPCPROG) -PB) +endif +ifneq ($(findstring Error,$(FPC)),) +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +else +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +endif +override FPC:=$(subst $(SRCEXEEXT),,$(FPC)) +override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT) +FOUNDFPC:=$(strip $(wildcard $(FPC))) +ifeq ($(FOUNDFPC),) +FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH)))) +ifeq ($(FOUNDFPC),) +$(error Compiler $(FPC) not found) +endif +endif +ifndef FPC_COMPILERINFO +FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO) +endif +ifndef FPC_VERSION +FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO)) +endif +export FPC FPC_VERSION FPC_COMPILERINFO +unexport CHECKDEPEND ALLDEPENDENCIES +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif +ifneq ($(words $(FPC_COMPILERINFO)),5) +FPC_COMPILERINFO+=$(shell $(FPC) -iSP) +FPC_COMPILERINFO+=$(shell $(FPC) -iTP) +FPC_COMPILERINFO+=$(shell $(FPC) -iSO) +FPC_COMPILERINFO+=$(shell $(FPC) -iTO) +endif +ifndef CPU_SOURCE +CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO)) +endif +ifndef CPU_TARGET +CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO)) +endif +ifndef OS_SOURCE +OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO)) +endif +ifndef OS_TARGET +OS_TARGET:=$(word 5,$(FPC_COMPILERINFO)) +endif +FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +TARGETSUFFIX=$(OS_TARGET) +SOURCESUFFIX=$(OS_SOURCE) +else +TARGETSUFFIX=$(FULL_TARGET) +SOURCESUFFIX=$(FULL_SOURCE) +endif +ifneq ($(FULL_TARGET),$(FULL_SOURCE)) +CROSSCOMPILE=1 +endif +ifeq ($(findstring makefile,$(MAKECMDGOALS)),) +ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),) +$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first) +endif +endif +ifneq ($(findstring $(OS_TARGET),$(BSDs)),) +BSDhier=1 +endif +ifeq ($(OS_TARGET),linux) +linuxHier=1 +endif +export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE +ifdef FPCDIR +override FPCDIR:=$(subst \,/,$(FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=wrong +endif +else +override FPCDIR=wrong +endif +ifdef DEFAULT_FPCDIR +ifeq ($(FPCDIR),wrong) +override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=wrong +endif +endif +endif +ifeq ($(FPCDIR),wrong) +ifdef inUnix +override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION) +ifeq ($(wildcard $(FPCDIR)/units),) +override FPCDIR=/usr/lib/fpc/$(FPC_VERSION) +endif +else +override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH)))))) +override FPCDIR:=$(FPCDIR)/.. +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR:=$(FPCDIR)/.. +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR:=$(BASEDIR) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=c:/pp +endif +endif +endif +endif +endif +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX)) +endif +ifndef BINUTILSPREFIX +ifndef CROSSBINDIR +ifdef CROSSCOMPILE +BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)- +endif +endif +endif +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX)) +ifeq ($(UNITSDIR),) +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) +endif +PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) +override PACKAGE_NAME=opengl +override PACKAGE_VERSION=2.0.0 +ifeq ($(FULL_TARGET),i386-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-win32) +override TARGET_UNITS+=gl glu glut glext +endif +ifeq ($(FULL_TARGET),i386-os2) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),i386-beos) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),i386-solaris) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-qnx) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-netware) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-darwin) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),i386-emx) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-watcom) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-wince) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-symbian) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),m68k-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),m68k-atari) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),sparc-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),arm-palmos) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-wince) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-gba) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-nds) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),arm-symbian) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override TARGET_UNITS+=gl glu glut glx glext +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override TARGET_UNITS+=gl glu glut +endif +ifeq ($(FULL_TARGET),i386-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-win32) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-os2) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-beos) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-solaris) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-qnx) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-netware) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-darwin) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-emx) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-watcom) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-wince) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),i386-symbian) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-atari) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),sparc-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-palmos) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-wince) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-gba) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-nds) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),arm-symbian) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override TARGET_EXAMPLEDIRS+=examples +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override TARGET_EXAMPLEDIRS+=examples +endif +override INSTALL_FPCPACKAGE=y +ifeq ($(FULL_TARGET),i386-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-win32) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-os2) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-beos) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-solaris) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-qnx) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-netware) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-darwin) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-emx) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-watcom) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-wince) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-symbian) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-atari) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),sparc-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-palmos) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-wince) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-gba) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-nds) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),arm-symbian) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override COMPILER_INCLUDEDIR+=src +endif +ifeq ($(FULL_TARGET),i386-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-win32) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-os2) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-beos) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-solaris) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-qnx) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-netware) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-darwin) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-emx) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-watcom) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-wince) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),i386-symbian) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-atari) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),sparc-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-palmos) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-wince) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-gba) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-nds) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),arm-symbian) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override COMPILER_SOURCEDIR+=src tests examples +endif +ifdef REQUIRE_UNITSDIR +override UNITSDIR+=$(REQUIRE_UNITSDIR) +endif +ifdef REQUIRE_PACKAGESDIR +override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR) +endif +ifdef ZIPINSTALL +ifneq ($(findstring $(OS_TARGET),$(UNIXs)),) +UNIXHier=1 +endif +else +ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),) +UNIXHier=1 +endif +endif +ifndef INSTALL_PREFIX +ifdef PREFIX +INSTALL_PREFIX=$(PREFIX) +endif +endif +ifndef INSTALL_PREFIX +ifdef UNIXHier +INSTALL_PREFIX=/usr/local +else +ifdef INSTALL_FPCPACKAGE +INSTALL_BASEDIR:=/pp +else +INSTALL_BASEDIR:=/$(PACKAGE_NAME) +endif +endif +endif +export INSTALL_PREFIX +ifdef INSTALL_FPCSUBDIR +export INSTALL_FPCSUBDIR +endif +ifndef DIST_DESTDIR +DIST_DESTDIR:=$(BASEDIR) +endif +export DIST_DESTDIR +ifndef COMPILER_UNITTARGETDIR +ifdef PACKAGEDIR_MAIN +COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX) +else +COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX) +endif +endif +ifndef COMPILER_TARGETDIR +COMPILER_TARGETDIR=. +endif +ifndef INSTALL_BASEDIR +ifdef UNIXHier +ifdef INSTALL_FPCPACKAGE +INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION) +else +INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME) +endif +else +INSTALL_BASEDIR:=$(INSTALL_PREFIX) +endif +endif +ifndef INSTALL_BINDIR +ifdef UNIXHier +INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin +else +INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin +ifdef INSTALL_FPCPACKAGE +ifdef CROSSCOMPILE +ifdef CROSSINSTALL +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX) +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +endif +endif +endif +ifndef INSTALL_UNITDIR +INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX) +ifdef INSTALL_FPCPACKAGE +ifdef PACKAGE_NAME +INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME) +endif +endif +endif +ifndef INSTALL_LIBDIR +ifdef UNIXHier +INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib +else +INSTALL_LIBDIR:=$(INSTALL_UNITDIR) +endif +endif +ifndef INSTALL_SOURCEDIR +ifdef UNIXHier +ifdef BSDhier +SRCPREFIXDIR=share/src +else +ifdef linuxHier +SRCPREFIXDIR=share/src +else +SRCPREFIXDIR=src +endif +endif +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +else +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source +endif +endif +endif +ifndef INSTALL_DOCDIR +ifdef UNIXHier +ifdef BSDhier +DOCPREFIXDIR=share/doc +else +ifdef linuxHier +DOCPREFIXDIR=share/doc +else +DOCPREFIXDIR=doc +endif +endif +ifdef INSTALL_FPCPACKAGE +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +else +ifdef INSTALL_FPCPACKAGE +INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME) +else +INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc +endif +endif +endif +ifndef INSTALL_EXAMPLEDIR +ifdef UNIXHier +ifdef INSTALL_FPCPACKAGE +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME) +endif +endif +else +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +endif +endif +else +ifdef INSTALL_FPCPACKAGE +INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME) +else +INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples +endif +endif +endif +ifndef INSTALL_DATADIR +INSTALL_DATADIR=$(INSTALL_BASEDIR) +endif +ifndef INSTALL_SHAREDDIR +INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib +endif +ifdef CROSSCOMPILE +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX)) +ifeq ($(CROSSBINDIR),) +CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE)) +endif +endif +else +CROSSBINDIR= +endif +ifeq ($(OS_SOURCE),linux) +ifndef GCCLIBDIR +ifeq ($(CPU_TARGET),i386) +ifneq ($(findstring x86_64,$(shell uname -a)),) +ifeq ($(BINUTILSPREFIX),) +GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) +endif +endif +endif +ifeq ($(CPU_TARGET),powerpc64) +ifeq ($(BINUTILSPREFIX),) +GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`) +endif +endif +endif +ifndef GCCLIBDIR +CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(CROSSGCC),) +GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`) +endif +endif +ifndef OTHERLIBDIR +OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }') +endif +endif +ifdef inUnix +ifeq ($(OS_SOURCE),netbsd) +OTHERLIBDIR+=/usr/pkg/lib +endif +export GCCLIBDIR OTHERLIB +endif +BATCHEXT=.bat +LOADEREXT=.as +EXEEXT=.exe +PPLEXT=.ppl +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.so +SHAREDLIBPREFIX=libfp +STATICLIBPREFIX=libp +IMPORTLIBPREFIX=libimp +RSTEXT=.rst +ifeq ($(findstring 1.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),go32v1) +STATICLIBPREFIX= +SHORTSUFFIX=v1 +endif +ifeq ($(OS_TARGET),go32v2) +STATICLIBPREFIX= +SHORTSUFFIX=dos +endif +ifeq ($(OS_TARGET),watcom) +STATICLIBPREFIX= +OEXT=.obj +ASMEXT=.asm +SHAREDLIBEXT=.dll +SHORTSUFFIX=wat +endif +ifeq ($(OS_TARGET),linux) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +ifeq ($(OS_TARGET),freebsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=fbs +endif +ifeq ($(OS_TARGET),netbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=nbs +endif +ifeq ($(OS_TARGET),openbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=obs +endif +ifeq ($(OS_TARGET),win32) +SHAREDLIBEXT=.dll +SHORTSUFFIX=w32 +endif +ifeq ($(OS_TARGET),os2) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=os2 +ECHO=echo +endif +ifeq ($(OS_TARGET),emx) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=emx +ECHO=echo +endif +ifeq ($(OS_TARGET),amiga) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=amg +endif +ifeq ($(OS_TARGET),morphos) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=mos +endif +ifeq ($(OS_TARGET),atari) +EXEEXT=.ttp +SHORTSUFFIX=ata +endif +ifeq ($(OS_TARGET),beos) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=be +endif +ifeq ($(OS_TARGET),solaris) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=sun +endif +ifeq ($(OS_TARGET),qnx) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=qnx +endif +ifeq ($(OS_TARGET),netware) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nw +endif +ifeq ($(OS_TARGET),netwlibc) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nwl +endif +ifeq ($(OS_TARGET),macos) +BATCHEXT= +EXEEXT= +DEBUGSYMEXT=.xcoff +SHORTSUFFIX=mac +endif +ifeq ($(OS_TARGET),darwin) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=dwn +endif +ifeq ($(OS_TARGET),gba) +EXEEXT=.gba +SHAREDLIBEXT=.so +SHORTSUFFIX=gba +endif +ifeq ($(OS_TARGET),symbian) +SHAREDLIBEXT=.dll +SHORTSUFFIX=symbian +endif +else +ifeq ($(OS_TARGET),go32v1) +PPUEXT=.pp1 +OEXT=.o1 +ASMEXT=.s1 +SMARTEXT=.sl1 +STATICLIBEXT=.a1 +SHAREDLIBEXT=.so1 +STATICLIBPREFIX= +SHORTSUFFIX=v1 +endif +ifeq ($(OS_TARGET),go32v2) +STATICLIBPREFIX= +SHORTSUFFIX=dos +endif +ifeq ($(OS_TARGET),watcom) +STATICLIBPREFIX= +SHORTSUFFIX=wat +endif +ifeq ($(OS_TARGET),linux) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +ifeq ($(OS_TARGET),freebsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=fbs +endif +ifeq ($(OS_TARGET),netbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=nbs +endif +ifeq ($(OS_TARGET),openbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=obs +endif +ifeq ($(OS_TARGET),win32) +PPUEXT=.ppw +OEXT=.ow +ASMEXT=.sw +SMARTEXT=.slw +STATICLIBEXT=.aw +SHAREDLIBEXT=.dll +SHORTSUFFIX=w32 +endif +ifeq ($(OS_TARGET),os2) +BATCHEXT=.cmd +PPUEXT=.ppo +ASMEXT=.so2 +OEXT=.oo2 +AOUTEXT=.out +SMARTEXT=.sl2 +STATICLIBPREFIX= +STATICLIBEXT=.ao2 +SHAREDLIBEXT=.dll +SHORTSUFFIX=os2 +ECHO=echo +endif +ifeq ($(OS_TARGET),amiga) +EXEEXT= +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.library +SHORTSUFFIX=amg +endif +ifeq ($(OS_TARGET),atari) +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT=.ttp +SHORTSUFFIX=ata +endif +ifeq ($(OS_TARGET),beos) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=be +endif +ifeq ($(OS_TARGET),solaris) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=sun +endif +ifeq ($(OS_TARGET),qnx) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=qnx +endif +ifeq ($(OS_TARGET),netware) +STATICLIBPREFIX= +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.nlm +EXEEXT=.nlm +SHORTSUFFIX=nw +endif +ifeq ($(OS_TARGET),netwlibc) +STATICLIBPREFIX= +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.nlm +EXEEXT=.nlm +SHORTSUFFIX=nwl +endif +ifeq ($(OS_TARGET),macos) +BATCHEXT= +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +DEBUGSYMEXT=.xcoff +SHORTSUFFIX=mac +endif +endif +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +FPCMADE=fpcmade.$(SHORTSUFFIX) +ZIPSUFFIX=$(SHORTSUFFIX) +ZIPCROSSPREFIX= +ZIPSOURCESUFFIX=src +ZIPEXAMPLESUFFIX=exm +else +FPCMADE=fpcmade.$(TARGETSUFFIX) +ZIPSOURCESUFFIX=.source +ZIPEXAMPLESUFFIX=.examples +ifdef CROSSCOMPILE +ZIPSUFFIX=.$(SOURCESUFFIX) +ZIPCROSSPREFIX=$(TARGETSUFFIX)- +else +ZIPSUFFIX=.$(TARGETSUFFIX) +ZIPCROSSPREFIX= +endif +endif +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO= __missing_command_ECHO +else +ECHO:=$(firstword $(ECHO)) +endif +else +ECHO:=$(firstword $(ECHO)) +endif +endif +export ECHO +ifndef DATE +DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(DATE),) +DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(DATE),) +DATE= __missing_command_DATE +else +DATE:=$(firstword $(DATE)) +endif +else +DATE:=$(firstword $(DATE)) +endif +endif +export DATE +ifndef GINSTALL +GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(GINSTALL),) +GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(GINSTALL),) +GINSTALL= __missing_command_GINSTALL +else +GINSTALL:=$(firstword $(GINSTALL)) +endif +else +GINSTALL:=$(firstword $(GINSTALL)) +endif +endif +export GINSTALL +ifndef CPPROG +CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(CPPROG),) +CPPROG= __missing_command_CPPROG +else +CPPROG:=$(firstword $(CPPROG)) +endif +endif +export CPPROG +ifndef RMPROG +RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(RMPROG),) +RMPROG= __missing_command_RMPROG +else +RMPROG:=$(firstword $(RMPROG)) +endif +endif +export RMPROG +ifndef MVPROG +MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MVPROG),) +MVPROG= __missing_command_MVPROG +else +MVPROG:=$(firstword $(MVPROG)) +endif +endif +export MVPROG +ifndef MKDIRPROG +MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG= __missing_command_MKDIRPROG +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +endif +export MKDIRPROG +ifndef ECHOREDIR +ifndef inUnix +ECHOREDIR=echo +else +ECHOREDIR=$(ECHO) +endif +endif +ifndef COPY +COPY:=$(CPPROG) -fp +endif +ifndef COPYTREE +COPYTREE:=$(CPPROG) -Rfp +endif +ifndef MKDIRTREE +MKDIRTREE:=$(MKDIRPROG) -p +endif +ifndef MOVE +MOVE:=$(MVPROG) -f +endif +ifndef DEL +DEL:=$(RMPROG) -f +endif +ifndef DELTREE +DELTREE:=$(RMPROG) -rf +endif +ifndef INSTALL +ifdef inUnix +INSTALL:=$(GINSTALL) -c -m 644 +else +INSTALL:=$(COPY) +endif +endif +ifndef INSTALLEXE +ifdef inUnix +INSTALLEXE:=$(GINSTALL) -c -m 755 +else +INSTALLEXE:=$(COPY) +endif +endif +ifndef MKDIR +MKDIR:=$(GINSTALL) -m 755 -d +endif +export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR +ifndef PPUMOVE +PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(PPUMOVE),) +PPUMOVE= __missing_command_PPUMOVE +else +PPUMOVE:=$(firstword $(PPUMOVE)) +endif +endif +export PPUMOVE +ifndef FPCMAKE +FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(FPCMAKE),) +FPCMAKE= __missing_command_FPCMAKE +else +FPCMAKE:=$(firstword $(FPCMAKE)) +endif +endif +export FPCMAKE +ifndef ZIPPROG +ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ZIPPROG),) +ZIPPROG= __missing_command_ZIPPROG +else +ZIPPROG:=$(firstword $(ZIPPROG)) +endif +endif +export ZIPPROG +ifndef TARPROG +TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG= __missing_command_TARPROG +else +TARPROG:=$(firstword $(TARPROG)) +endif +else +TARPROG:=$(firstword $(TARPROG)) +endif +endif +export TARPROG +ASNAME=$(BINUTILSPREFIX)as +LDNAME=$(BINUTILSPREFIX)ld +ARNAME=$(BINUTILSPREFIX)ar +RCNAME=$(BINUTILSPREFIX)rc +ifneq ($(findstring 1.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),win32) +ifeq ($(CROSSBINDIR),) +ASNAME=asw +LDNAME=ldw +ARNAME=arw +endif +endif +endif +ifndef ASPROG +ifdef CROSSBINDIR +ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT) +else +ASPROG=$(ASNAME) +endif +endif +ifndef LDPROG +ifdef CROSSBINDIR +LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT) +else +LDPROG=$(LDNAME) +endif +endif +ifndef RCPROG +ifdef CROSSBINDIR +RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT) +else +RCPROG=$(RCNAME) +endif +endif +ifndef ARPROG +ifdef CROSSBINDIR +ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT) +else +ARPROG=$(ARNAME) +endif +endif +AS=$(ASPROG) +LD=$(LDPROG) +RC=$(RCPROG) +AR=$(ARPROG) +PPAS=ppas$(SRCBATCHEXT) +ifdef inUnix +LDCONFIG=ldconfig +else +LDCONFIG= +endif +ifdef DATE +DATESTR:=$(shell $(DATE) +%Y%m%d) +else +DATESTR= +endif +ifndef UPXPROG +ifeq ($(OS_TARGET),go32v2) +UPXPROG:=1 +endif +ifeq ($(OS_TARGET),win32) +UPXPROG:=1 +endif +ifdef UPXPROG +UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(UPXPROG),) +UPXPROG= +else +UPXPROG:=$(firstword $(UPXPROG)) +endif +else +UPXPROG= +endif +endif +export UPXPROG +ZIPOPT=-9 +ZIPEXT=.zip +ifeq ($(USETAR),bz2) +TAROPT=vj +TAREXT=.tar.bz2 +else +TAROPT=vz +TAREXT=.tar.gz +endif +override REQUIRE_PACKAGES=rtl +ifeq ($(FULL_TARGET),i386-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),i386-go32v2) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-win32) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-os2) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),i386-beos) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),i386-solaris) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-qnx) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-netware) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),i386-wdosx) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),i386-emx) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-watcom) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-wince) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),i386-symbian) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),m68k-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),m68k-amiga) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),m68k-atari) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),m68k-palmos) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),m68k-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),powerpc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),powerpc-macos) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),sparc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),sparc-solaris) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),sparc-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),x86_64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),x86_64-win64) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),arm-palmos) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-wince) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-gba) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-nds) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),arm-symbian) +REQUIRE_PACKAGES_RTL=1 +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +REQUIRE_PACKAGES_RTL=1 +endif +ifdef REQUIRE_PACKAGES_RTL +PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_RTL),) +ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),) +UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX) +else +UNITDIR_RTL=$(PACKAGEDIR_RTL) +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_RTL)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE) +endif +else +PACKAGEDIR_RTL= +UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_RTL),) +UNITDIR_RTL:=$(firstword $(UNITDIR_RTL)) +else +UNITDIR_RTL= +endif +endif +ifdef UNITDIR_RTL +override COMPILER_UNITDIR+=$(UNITDIR_RTL) +endif +endif +ifdef REQUIRE_PACKAGES_X11 +PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_X11),) +ifneq ($(wildcard $(PACKAGEDIR_X11)/units/$(TARGETSUFFIX)),) +UNITDIR_X11=$(PACKAGEDIR_X11)/units/$(TARGETSUFFIX) +else +UNITDIR_X11=$(PACKAGEDIR_X11) +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_X11)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_X11) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_X11)/$(FPCMADE) +endif +else +PACKAGEDIR_X11= +UNITDIR_X11:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /x11/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_X11),) +UNITDIR_X11:=$(firstword $(UNITDIR_X11)) +else +UNITDIR_X11= +endif +endif +ifdef UNITDIR_X11 +override COMPILER_UNITDIR+=$(UNITDIR_X11) +endif +endif +ifndef NOCPUDEF +override FPCOPTDEF=$(CPU_TARGET) +endif +ifneq ($(OS_TARGET),$(OS_SOURCE)) +override FPCOPT+=-T$(OS_TARGET) +endif +ifneq ($(CPU_TARGET),$(CPU_SOURCE)) +override FPCOPT+=-P$(CPU_TARGET) +endif +ifeq ($(OS_SOURCE),openbsd) +override FPCOPT+=-FD$(NEW_BINUTILS_PATH) +endif +ifndef CROSSBOOTSTRAP +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-XP$(BINUTILSPREFIX) +endif +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-Xr$(RLINKPATH) +endif +endif +ifdef UNITDIR +override FPCOPT+=$(addprefix -Fu,$(UNITDIR)) +endif +ifdef LIBDIR +override FPCOPT+=$(addprefix -Fl,$(LIBDIR)) +endif +ifdef OBJDIR +override FPCOPT+=$(addprefix -Fo,$(OBJDIR)) +endif +ifdef INCDIR +override FPCOPT+=$(addprefix -Fi,$(INCDIR)) +endif +ifdef LINKSMART +override FPCOPT+=-XX +endif +ifdef CREATESMART +override FPCOPT+=-CX +endif +ifdef DEBUG +override FPCOPT+=-gl +override FPCOPTDEF+=DEBUG +endif +ifdef RELEASE +ifneq ($(findstring 2.0.,$(FPC_VERSION)),) +ifeq ($(CPU_TARGET),i386) +FPCCPUOPT:=-OG2p3 +endif +ifeq ($(CPU_TARGET),powerpc) +FPCCPUOPT:=-O1r +endif +else +FPCCPUOPT:=-O2 +endif +override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n +override FPCOPTDEF+=RELEASE +endif +ifdef STRIP +override FPCOPT+=-Xs +endif +ifdef OPTIMIZE +override FPCOPT+=-O2 +endif +ifdef VERBOSE +override FPCOPT+=-vwni +endif +ifdef COMPILER_OPTIONS +override FPCOPT+=$(COMPILER_OPTIONS) +endif +ifdef COMPILER_UNITDIR +override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR)) +endif +ifdef COMPILER_LIBRARYDIR +override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR)) +endif +ifdef COMPILER_OBJECTDIR +override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR)) +endif +ifdef COMPILER_INCLUDEDIR +override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR)) +endif +ifdef CROSSBINDIR +override FPCOPT+=-FD$(CROSSBINDIR) +endif +ifdef COMPILER_TARGETDIR +override FPCOPT+=-FE$(COMPILER_TARGETDIR) +ifeq ($(COMPILER_TARGETDIR),.) +override TARGETDIRPREFIX= +else +override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/ +endif +endif +ifdef COMPILER_UNITTARGETDIR +override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR) +ifeq ($(COMPILER_UNITTARGETDIR),.) +override UNITTARGETDIRPREFIX= +else +override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/ +endif +else +ifdef COMPILER_TARGETDIR +override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR) +override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX) +endif +endif +ifdef CREATESHARED +override FPCOPT+=-Cg +ifeq ($(CPU_TARGET),i386) +override FPCOPT+=-Aas +endif +endif +ifeq ($(findstring 2.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),linux) +ifeq ($(CPU_TARGET),x86_64) +override FPCOPT+=-Cg +endif +endif +endif +ifdef LINKSHARED +endif +ifdef GCCLIBDIR +override FPCOPT+=-Fl$(GCCLIBDIR) +endif +ifdef OTHERLIBDIR +override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR)) +endif +ifdef OPT +override FPCOPT+=$(OPT) +endif +ifdef FPCOPTDEF +override FPCOPT+=$(addprefix -d,$(FPCOPTDEF)) +endif +ifdef CFGFILE +override FPCOPT+=@$(CFGFILE) +endif +ifdef USEENV +override FPCEXTCMD:=$(FPCOPT) +override FPCOPT:=!FPCEXTCMD +export FPCEXTCMD +endif +override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifneq ($(AFULL_TARGET),$(AFULL_SOURCE)) +override ACROSSCOMPILE=1 +endif +ifdef ACROSSCOMPILE +override FPCOPT+=$(CROSSOPT) +endif +override COMPILER:=$(FPC) $(FPCOPT) +ifeq (,$(findstring -s ,$(COMPILER))) +EXECPPAS= +else +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +ifdef RUNBATCH +EXECPPAS:=@$(RUNBATCH) $(PPAS) +else +EXECPPAS:=@$(PPAS) +endif +endif +endif +.PHONY: fpc_units +ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),) +override ALLTARGET+=fpc_units +override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS)) +override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS)) +override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES) +override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES) +endif +fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES) +ifdef TARGET_RSTS +override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) +override CLEANRSTFILES+=$(RSTFILES) +endif +.PHONY: fpc_examples +ifneq ($(TARGET_EXAMPLES),) +HASEXAMPLES=1 +override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES))) +override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES)) +override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) +override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES) +ifeq ($(OS_TARGET),os2) +override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES)) +endif +ifeq ($(OS_TARGET),emx) +override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES)) +endif +endif +ifneq ($(TARGET_EXAMPLEDIRS),) +HASEXAMPLES=1 +endif +fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS)) +.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared +$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) + @$(ECHOREDIR) Compiled > $(FPCMADE) +fpc_all: $(FPCMADE) +fpc_smart: + $(MAKE) all LINKSMART=1 CREATESMART=1 +fpc_debug: + $(MAKE) all DEBUG=1 +fpc_release: + $(MAKE) all RELEASE=1 +.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res +$(COMPILER_UNITTARGETDIR): + $(MKDIRTREE) $(COMPILER_UNITTARGETDIR) +$(COMPILER_TARGETDIR): + $(MKDIRTREE) $(COMPILER_TARGETDIR) +%$(PPUEXT): %.pp + $(COMPILER) $< + $(EXECPPAS) +%$(PPUEXT): %.pas + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.pp + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.pas + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.lpr + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.dpr + $(COMPILER) $< + $(EXECPPAS) +%.res: %.rc + windres -i $< -o $@ +vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.inc $(COMPILER_INCLUDEDIR) +vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) +vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) +.PHONY: fpc_shared +override INSTALLTARGET+=fpc_shared_install +ifndef SHARED_LIBVERSION +SHARED_LIBVERSION=$(FPC_VERSION) +endif +ifndef SHARED_LIBNAME +SHARED_LIBNAME=$(PACKAGE_NAME) +endif +ifndef SHARED_FULLNAME +SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT) +endif +ifndef SHARED_LIBUNITS +SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS) +override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS)) +endif +fpc_shared: +ifdef HASSHAREDLIB + $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1 +ifneq ($(SHARED_BUILD),n) + $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR) +endif +else + @$(ECHO) Shared Libraries not supported +endif +fpc_shared_install: +ifneq ($(SHARED_BUILD),n) +ifneq ($(SHARED_LIBUNITS),) +ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),) + $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR) +endif +endif +endif +.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall +ifdef INSTALL_UNITS +override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) +endif +ifdef INSTALL_BUILDUNIT +override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) +endif +ifdef INSTALLPPUFILES +override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) +ifneq ($(UNITTARGETDIRPREFIX),) +override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) +override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) +endif +override INSTALL_CREATEPACKAGEFPC=1 +endif +ifdef INSTALLEXEFILES +ifneq ($(TARGETDIRPREFIX),) +override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) +endif +endif +fpc_install: all $(INSTALLTARGET) +ifdef INSTALLEXEFILES + $(MKDIR) $(INSTALL_BINDIR) +ifdef UPXPROG + -$(UPXPROG) $(INSTALLEXEFILES) +endif + $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) +endif +ifdef INSTALL_CREATEPACKAGEFPC +ifdef FPCMAKE +ifdef PACKAGE_VERSION +ifneq ($(wildcard Makefile.fpc),) + $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc + $(MKDIR) $(INSTALL_UNITDIR) + $(INSTALL) Package.fpc $(INSTALL_UNITDIR) +endif +endif +endif +endif +ifdef INSTALLPPUFILES + $(MKDIR) $(INSTALL_UNITDIR) + $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR) +ifneq ($(INSTALLPPULINKFILES),) + $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR) +endif +ifneq ($(wildcard $(LIB_FULLNAME)),) + $(MKDIR) $(INSTALL_LIBDIR) + $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR) +ifdef inUnix + ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME) +endif +endif +endif +ifdef INSTALL_FILES + $(MKDIR) $(INSTALL_DATADIR) + $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR) +endif +fpc_sourceinstall: distclean + $(MKDIR) $(INSTALL_SOURCEDIR) + $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR) +fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS)) +ifdef HASEXAMPLES + $(MKDIR) $(INSTALL_EXAMPLEDIR) +endif +ifdef EXAMPLESOURCEFILES + $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR) +endif +ifdef TARGET_EXAMPLEDIRS + $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR) +endif +.PHONY: fpc_distinstall +fpc_distinstall: install exampleinstall +.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall +ifndef PACKDIR +ifndef inUnix +PACKDIR=$(BASEDIR)/../fpc-pack +else +PACKDIR=/tmp/fpc-pack +endif +endif +ifndef ZIPNAME +ifdef DIST_ZIPNAME +ZIPNAME=$(DIST_ZIPNAME) +else +ZIPNAME=$(PACKAGE_NAME) +endif +endif +ifndef FULLZIPNAME +FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX) +endif +ifndef ZIPTARGET +ifdef DIST_ZIPTARGET +ZIPTARGET=DIST_ZIPTARGET +else +ZIPTARGET=install +endif +endif +ifndef USEZIP +ifdef inUnix +USETAR=1 +endif +endif +ifndef inUnix +USEZIPWRAPPER=1 +endif +ifdef USEZIPWRAPPER +ZIPPATHSEP=$(PATHSEP) +ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT)) +else +ZIPPATHSEP=/ +endif +ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR)) +ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR)) +ifdef USETAR +ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT) +ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) * +else +ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT) +ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) * +endif +fpc_zipinstall: + $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1 + $(MKDIR) $(DIST_DESTDIR) + $(DEL) $(ZIPDESTFILE) +ifdef USEZIPWRAPPER +ifneq ($(ECHOREDIR),echo) + $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER) + $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER) + $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER) +else + echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER) + echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER) + echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER) +endif +ifdef inUnix + /bin/sh $(ZIPWRAPPER) +else +ifdef RUNBATCH + $(RUNBATCH) (ZIPWRAPPER) +else + $(ZIPWRAPPER) +endif +endif + $(DEL) $(ZIPWRAPPER) +else + $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE) +endif + $(DELTREE) $(PACKDIR) +fpc_zipsourceinstall: + $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX) +fpc_zipexampleinstall: +ifdef HASEXAMPLES + $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX) +endif +fpc_zipdistinstall: + $(MAKE) fpc_zipinstall ZIPTARGET=distinstall +.PHONY: fpc_clean fpc_cleanall fpc_distclean +ifdef EXEFILES +override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) +endif +ifdef CLEAN_UNITS +override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS)) +endif +ifdef CLEANPPUFILES +override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) +ifdef DEBUGSYMEXT +override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES)) +endif +override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES)) +override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES))) +endif +fpc_clean: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +endif +ifneq ($(CLEANPPULINKFILES),) + -$(DEL) $(CLEANPPULINKFILES) +endif +ifdef CLEANRSTFILES + -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) +endif +ifdef CLEAN_FILES + -$(DEL) $(CLEAN_FILES) +endif +ifdef LIB_NAME + -$(DEL) $(LIB_NAME) $(LIB_FULLNAME) +endif + -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT) +fpc_cleanall: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef COMPILER_UNITTARGETDIR +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +endif +ifneq ($(CLEANPPULINKFILES),) + -$(DEL) $(CLEANPPULINKFILES) +endif +ifdef CLEANRSTFILES + -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) +endif +endif + -$(DELTREE) units + -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) +ifneq ($(PPUEXT),.ppu) + -$(DEL) *.o *.ppu *.a +endif + -$(DELTREE) *$(SMARTEXT) + -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *_ppas$(BATCHEXT) +ifdef AOUTEXT + -$(DEL) *$(AOUTEXT) +endif +ifdef DEBUGSYMEXT + -$(DEL) *$(DEBUGSYMEXT) +endif +fpc_distclean: cleanall +.PHONY: fpc_baseinfo +override INFORULES+=fpc_baseinfo +fpc_baseinfo: + @$(ECHO) + @$(ECHO) == Package info == + @$(ECHO) Package Name..... $(PACKAGE_NAME) + @$(ECHO) Package Version.. $(PACKAGE_VERSION) + @$(ECHO) + @$(ECHO) == Configuration info == + @$(ECHO) + @$(ECHO) FPC.......... $(FPC) + @$(ECHO) FPC Version.. $(FPC_VERSION) + @$(ECHO) Source CPU... $(CPU_SOURCE) + @$(ECHO) Target CPU... $(CPU_TARGET) + @$(ECHO) Source OS.... $(OS_SOURCE) + @$(ECHO) Target OS.... $(OS_TARGET) + @$(ECHO) Full Source.. $(FULL_SOURCE) + @$(ECHO) Full Target.. $(FULL_TARGET) + @$(ECHO) SourceSuffix. $(SOURCESUFFIX) + @$(ECHO) TargetSuffix. $(TARGETSUFFIX) + @$(ECHO) + @$(ECHO) == Directory info == + @$(ECHO) + @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES) + @$(ECHO) + @$(ECHO) Basedir......... $(BASEDIR) + @$(ECHO) FPCDir.......... $(FPCDIR) + @$(ECHO) CrossBinDir..... $(CROSSBINDIR) + @$(ECHO) UnitsDir........ $(UNITSDIR) + @$(ECHO) PackagesDir..... $(PACKAGESDIR) + @$(ECHO) + @$(ECHO) GCC library..... $(GCCLIBDIR) + @$(ECHO) Other library... $(OTHERLIBDIR) + @$(ECHO) + @$(ECHO) == Tools info == + @$(ECHO) + @$(ECHO) As........ $(AS) + @$(ECHO) Ld........ $(LD) + @$(ECHO) Ar........ $(AR) + @$(ECHO) Rc........ $(RC) + @$(ECHO) + @$(ECHO) Mv........ $(MVPROG) + @$(ECHO) Cp........ $(CPPROG) + @$(ECHO) Rm........ $(RMPROG) + @$(ECHO) GInstall.. $(GINSTALL) + @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) + @$(ECHO) Date...... $(DATE) + @$(ECHO) FPCMake... $(FPCMAKE) + @$(ECHO) PPUMove... $(PPUMOVE) + @$(ECHO) Upx....... $(UPXPROG) + @$(ECHO) Zip....... $(ZIPPROG) + @$(ECHO) + @$(ECHO) == Object info == + @$(ECHO) + @$(ECHO) Target Loaders........ $(TARGET_LOADERS) + @$(ECHO) Target Units.......... $(TARGET_UNITS) + @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS) + @$(ECHO) Target Programs....... $(TARGET_PROGRAMS) + @$(ECHO) Target Dirs........... $(TARGET_DIRS) + @$(ECHO) Target Examples....... $(TARGET_EXAMPLES) + @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS) + @$(ECHO) + @$(ECHO) Clean Units......... $(CLEAN_UNITS) + @$(ECHO) Clean Files......... $(CLEAN_FILES) + @$(ECHO) + @$(ECHO) Install Units....... $(INSTALL_UNITS) + @$(ECHO) Install Files....... $(INSTALL_FILES) + @$(ECHO) + @$(ECHO) == Install info == + @$(ECHO) + @$(ECHO) DateStr.............. $(DATESTR) + @$(ECHO) ZipName.............. $(ZIPNAME) + @$(ECHO) ZipPrefix............ $(ZIPPREFIX) + @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX) + @$(ECHO) ZipSuffix............ $(ZIPSUFFIX) + @$(ECHO) FullZipName.......... $(FULLZIPNAME) + @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE) + @$(ECHO) + @$(ECHO) Install base dir..... $(INSTALL_BASEDIR) + @$(ECHO) Install binary dir... $(INSTALL_BINDIR) + @$(ECHO) Install library dir.. $(INSTALL_LIBDIR) + @$(ECHO) Install units dir.... $(INSTALL_UNITDIR) + @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR) + @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR) + @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR) + @$(ECHO) Install data dir..... $(INSTALL_DATADIR) + @$(ECHO) + @$(ECHO) Dist destination dir. $(DIST_DESTDIR) + @$(ECHO) Dist zip name........ $(DIST_ZIPNAME) + @$(ECHO) +.PHONY: fpc_info +fpc_info: $(INFORULES) +.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \ + fpc_makefile_dirs +fpc_makefile: + $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc +fpc_makefile_sub1: +ifdef TARGET_DIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS)) +endif +ifdef TARGET_EXAMPLEDIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS)) +endif +fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) +fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 +fpc_makefiles: fpc_makefile fpc_makefile_dirs +ifeq ($(FULL_TARGET),i386-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-go32v2) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-win32) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-os2) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-freebsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-beos) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-netbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-solaris) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-qnx) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-netware) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-openbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-wdosx) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-darwin) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-emx) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-watcom) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-wince) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),i386-symbian) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-amiga) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-atari) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-palmos) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),m68k-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-macos) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),sparc-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),sparc-solaris) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),sparc-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),x86_64-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),x86_64-win64) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-palmos) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-wince) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-gba) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-nds) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),arm-symbian) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif +ifdef TARGET_EXAMPLEDIRS_EXAMPLES +examples_all: + $(MAKE) -C examples all +examples_debug: + $(MAKE) -C examples debug +examples_smart: + $(MAKE) -C examples smart +examples_release: + $(MAKE) -C examples release +examples_units: + $(MAKE) -C examples units +examples_examples: + $(MAKE) -C examples examples +examples_shared: + $(MAKE) -C examples shared +examples_install: + $(MAKE) -C examples install +examples_sourceinstall: + $(MAKE) -C examples sourceinstall +examples_exampleinstall: + $(MAKE) -C examples exampleinstall +examples_distinstall: + $(MAKE) -C examples distinstall +examples_zipinstall: + $(MAKE) -C examples zipinstall +examples_zipsourceinstall: + $(MAKE) -C examples zipsourceinstall +examples_zipexampleinstall: + $(MAKE) -C examples zipexampleinstall +examples_zipdistinstall: + $(MAKE) -C examples zipdistinstall +examples_clean: + $(MAKE) -C examples clean +examples_distclean: + $(MAKE) -C examples distclean +examples_cleanall: + $(MAKE) -C examples cleanall +examples_info: + $(MAKE) -C examples info +examples_makefiles: + $(MAKE) -C examples makefiles +examples: + $(MAKE) -C examples all +.PHONY: examples_all examples_debug examples_smart examples_release examples_units examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefiles examples +endif +all: fpc_all +debug: fpc_debug +smart: fpc_smart +release: fpc_release +units: fpc_units +examples: fpc_examples +shared: fpc_shared +install: fpc_install +sourceinstall: fpc_sourceinstall +exampleinstall: fpc_exampleinstall +distinstall: fpc_distinstall +zipinstall: fpc_zipinstall +zipsourceinstall: fpc_zipsourceinstall +zipexampleinstall: fpc_zipexampleinstall +zipdistinstall: fpc_zipdistinstall +clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS)) +distclean: fpc_distclean +cleanall: fpc_cleanall +info: fpc_info +makefiles: fpc_makefiles +.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles +ifneq ($(wildcard fpcmake.loc),) +include fpcmake.loc +endif +.NOTPARALLEL: diff --git a/packages/opengl/Makefile.fpc b/packages/opengl/Makefile.fpc new file mode 100644 index 0000000000..e7fa93537b --- /dev/null +++ b/packages/opengl/Makefile.fpc @@ -0,0 +1,37 @@ +# +# Makefile.fpc for OpenGL for FPC +# + +[package] +name=opengl +version=2.0.0 + +[require] +packages_linux=x11 +packages_freebsd=x11 +packages_netbsd=x11 +packages_openbsd=x11 +packages_darwin=x11 + +[target] +units=gl glu glut +units_win32=glext +units_linux=glx glext +units_freebsd=glx glext +units_netbsd=glx glext +units_openbsd=glx glext +units_darwin=glx glext +exampledirs=examples + +[install] +fpcpackage=y + +[compiler] +includedir=src +sourcedir=src tests examples + +[default] +fpcdir=../.. + +[rules] +.NOTPARALLEL: diff --git a/packages/opengl/examples/Makefile b/packages/opengl/examples/Makefile new file mode 100644 index 0000000000..d05be07060 --- /dev/null +++ b/packages/opengl/examples/Makefile @@ -0,0 +1,2172 @@ +# +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26] +# +default: all +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded +BSDs = freebsd netbsd openbsd darwin +UNIXs = linux $(BSDs) solaris qnx +LIMIT83fs = go32v2 os2 emx watcom +OSNeedsComspecToRunBatch = go32v2 watcom +FORCE: +.PHONY: FORCE +override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH))) +ifneq ($(findstring darwin,$(OSTYPE)),) +inUnix=1 #darwin +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +ifeq ($(findstring ;,$(PATH)),) +inUnix=1 +SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH))) +else +SEARCHPATH:=$(subst ;, ,$(PATH)) +endif +endif +SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE)))) +PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH)))) +ifeq ($(PWD),) +PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH)))) +ifeq ($(PWD),) +$(error You need the GNU utils package to use this Makefile) +else +PWD:=$(firstword $(PWD)) +SRCEXEEXT= +endif +else +PWD:=$(firstword $(PWD)) +SRCEXEEXT=.exe +endif +ifndef inUnix +ifeq ($(OS),Windows_NT) +inWinNT=1 +else +ifdef OS2_SHELL +inOS2=1 +endif +endif +else +ifneq ($(findstring cygdrive,$(PATH)),) +inCygWin=1 +endif +endif +ifdef inUnix +SRCBATCHEXT=.sh +else +ifdef inOS2 +SRCBATCHEXT=.cmd +else +SRCBATCHEXT=.bat +endif +endif +ifdef COMSPEC +ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),) +RUNBATCH=$(COMSPEC) /C +endif +endif +ifdef inUnix +PATHSEP=/ +else +PATHSEP:=$(subst /,\,/) +ifdef inCygWin +PATHSEP=/ +endif +endif +ifdef PWD +BASEDIR:=$(subst \,/,$(shell $(PWD))) +ifdef inCygWin +ifneq ($(findstring /cygdrive/,$(BASEDIR)),) +BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR)) +BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR))) +BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR)) +endif +endif +else +BASEDIR=. +endif +ifdef inOS2 +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO=echo +else +ECHO:=$(firstword $(ECHO)) +endif +else +ECHO:=$(firstword $(ECHO)) +endif +endif +export ECHO +endif +override DEFAULT_FPCDIR=../../.. +ifndef FPC +ifdef PP +FPC=$(PP) +endif +endif +ifndef FPC +FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(FPCPROG),) +FPCPROG:=$(firstword $(FPCPROG)) +ifneq ($(CPU_TARGET),) +FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB) +else +FPC:=$(shell $(FPCPROG) -PB) +endif +ifneq ($(findstring Error,$(FPC)),) +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +else +override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH))))) +endif +endif +override FPC:=$(subst $(SRCEXEEXT),,$(FPC)) +override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT) +FOUNDFPC:=$(strip $(wildcard $(FPC))) +ifeq ($(FOUNDFPC),) +FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH)))) +ifeq ($(FOUNDFPC),) +$(error Compiler $(FPC) not found) +endif +endif +ifndef FPC_COMPILERINFO +FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO) +endif +ifndef FPC_VERSION +FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO)) +endif +export FPC FPC_VERSION FPC_COMPILERINFO +unexport CHECKDEPEND ALLDEPENDENCIES +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif +ifneq ($(words $(FPC_COMPILERINFO)),5) +FPC_COMPILERINFO+=$(shell $(FPC) -iSP) +FPC_COMPILERINFO+=$(shell $(FPC) -iTP) +FPC_COMPILERINFO+=$(shell $(FPC) -iSO) +FPC_COMPILERINFO+=$(shell $(FPC) -iTO) +endif +ifndef CPU_SOURCE +CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO)) +endif +ifndef CPU_TARGET +CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO)) +endif +ifndef OS_SOURCE +OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO)) +endif +ifndef OS_TARGET +OS_TARGET:=$(word 5,$(FPC_COMPILERINFO)) +endif +FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +TARGETSUFFIX=$(OS_TARGET) +SOURCESUFFIX=$(OS_SOURCE) +else +TARGETSUFFIX=$(FULL_TARGET) +SOURCESUFFIX=$(FULL_SOURCE) +endif +ifneq ($(FULL_TARGET),$(FULL_SOURCE)) +CROSSCOMPILE=1 +endif +ifeq ($(findstring makefile,$(MAKECMDGOALS)),) +ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),) +$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first) +endif +endif +ifneq ($(findstring $(OS_TARGET),$(BSDs)),) +BSDhier=1 +endif +ifeq ($(OS_TARGET),linux) +linuxHier=1 +endif +export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE +ifdef FPCDIR +override FPCDIR:=$(subst \,/,$(FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=wrong +endif +else +override FPCDIR=wrong +endif +ifdef DEFAULT_FPCDIR +ifeq ($(FPCDIR),wrong) +override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR)) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=wrong +endif +endif +endif +ifeq ($(FPCDIR),wrong) +ifdef inUnix +override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION) +ifeq ($(wildcard $(FPCDIR)/units),) +override FPCDIR=/usr/lib/fpc/$(FPC_VERSION) +endif +else +override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH)))))) +override FPCDIR:=$(FPCDIR)/.. +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR:=$(FPCDIR)/.. +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR:=$(BASEDIR) +ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),) +override FPCDIR=c:/pp +endif +endif +endif +endif +endif +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX)) +endif +ifndef BINUTILSPREFIX +ifndef CROSSBINDIR +ifdef CROSSCOMPILE +BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)- +endif +endif +endif +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX)) +ifeq ($(UNITSDIR),) +UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET)) +endif +PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) +ifeq ($(FULL_TARGET),i386-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-win32) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-os2) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),i386-beos) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),i386-solaris) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-qnx) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-netware) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-darwin) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),i386-emx) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-watcom) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-wince) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),i386-symbian) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),m68k-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),m68k-atari) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),sparc-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),arm-palmos) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-wince) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-gba) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-nds) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),arm-symbian) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur glxtest +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override TARGET_PROGRAMS+=glutdemo morph3d bounce radblur +endif +override INSTALL_FPCPACKAGE=y +ifeq ($(FULL_TARGET),i386-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-go32v2) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-win32) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-os2) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-freebsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-beos) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-netbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-solaris) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-qnx) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-netware) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-openbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-wdosx) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-darwin) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-emx) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-watcom) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-wince) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),i386-symbian) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-amiga) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-atari) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-palmos) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),m68k-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-macos) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),sparc-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),sparc-solaris) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),sparc-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),x86_64-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),x86_64-win64) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-palmos) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-wince) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-gba) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-nds) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),arm-symbian) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +override COMPILER_OPTIONS+=-S2h +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +override COMPILER_OPTIONS+=-S2h +endif +ifdef REQUIRE_UNITSDIR +override UNITSDIR+=$(REQUIRE_UNITSDIR) +endif +ifdef REQUIRE_PACKAGESDIR +override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR) +endif +ifdef ZIPINSTALL +ifneq ($(findstring $(OS_TARGET),$(UNIXs)),) +UNIXHier=1 +endif +else +ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),) +UNIXHier=1 +endif +endif +ifndef INSTALL_PREFIX +ifdef PREFIX +INSTALL_PREFIX=$(PREFIX) +endif +endif +ifndef INSTALL_PREFIX +ifdef UNIXHier +INSTALL_PREFIX=/usr/local +else +ifdef INSTALL_FPCPACKAGE +INSTALL_BASEDIR:=/pp +else +INSTALL_BASEDIR:=/$(PACKAGE_NAME) +endif +endif +endif +export INSTALL_PREFIX +ifdef INSTALL_FPCSUBDIR +export INSTALL_FPCSUBDIR +endif +ifndef DIST_DESTDIR +DIST_DESTDIR:=$(BASEDIR) +endif +export DIST_DESTDIR +ifndef COMPILER_UNITTARGETDIR +ifdef PACKAGEDIR_MAIN +COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX) +else +COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX) +endif +endif +ifndef COMPILER_TARGETDIR +COMPILER_TARGETDIR=. +endif +ifndef INSTALL_BASEDIR +ifdef UNIXHier +ifdef INSTALL_FPCPACKAGE +INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION) +else +INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME) +endif +else +INSTALL_BASEDIR:=$(INSTALL_PREFIX) +endif +endif +ifndef INSTALL_BINDIR +ifdef UNIXHier +INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin +else +INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin +ifdef INSTALL_FPCPACKAGE +ifdef CROSSCOMPILE +ifdef CROSSINSTALL +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX) +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +else +INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX) +endif +endif +endif +endif +ifndef INSTALL_UNITDIR +INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX) +ifdef INSTALL_FPCPACKAGE +ifdef PACKAGE_NAME +INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME) +endif +endif +endif +ifndef INSTALL_LIBDIR +ifdef UNIXHier +INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib +else +INSTALL_LIBDIR:=$(INSTALL_UNITDIR) +endif +endif +ifndef INSTALL_SOURCEDIR +ifdef UNIXHier +ifdef BSDhier +SRCPREFIXDIR=share/src +else +ifdef linuxHier +SRCPREFIXDIR=share/src +else +SRCPREFIXDIR=src +endif +endif +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +else +ifdef INSTALL_FPCPACKAGE +ifdef INSTALL_FPCSUBDIR +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME) +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME) +endif +else +INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source +endif +endif +endif +ifndef INSTALL_DOCDIR +ifdef UNIXHier +ifdef BSDhier +DOCPREFIXDIR=share/doc +else +ifdef linuxHier +DOCPREFIXDIR=share/doc +else +DOCPREFIXDIR=doc +endif +endif +ifdef INSTALL_FPCPACKAGE +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +else +ifdef INSTALL_FPCPACKAGE +INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME) +else +INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc +endif +endif +endif +ifndef INSTALL_EXAMPLEDIR +ifdef UNIXHier +ifdef INSTALL_FPCPACKAGE +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME) +endif +endif +else +ifdef BSDhier +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +ifdef linuxHier +INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +else +INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION) +endif +endif +endif +else +ifdef INSTALL_FPCPACKAGE +INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME) +else +INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples +endif +endif +endif +ifndef INSTALL_DATADIR +INSTALL_DATADIR=$(INSTALL_BASEDIR) +endif +ifndef INSTALL_SHAREDDIR +INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib +endif +ifdef CROSSCOMPILE +ifndef CROSSBINDIR +CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX)) +ifeq ($(CROSSBINDIR),) +CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE)) +endif +endif +else +CROSSBINDIR= +endif +ifeq ($(OS_SOURCE),linux) +ifndef GCCLIBDIR +ifeq ($(CPU_TARGET),i386) +ifneq ($(findstring x86_64,$(shell uname -a)),) +ifeq ($(BINUTILSPREFIX),) +GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) +endif +endif +endif +ifeq ($(CPU_TARGET),powerpc64) +ifeq ($(BINUTILSPREFIX),) +GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`) +endif +endif +endif +ifndef GCCLIBDIR +CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(CROSSGCC),) +GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`) +endif +endif +ifndef OTHERLIBDIR +OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }') +endif +endif +ifdef inUnix +ifeq ($(OS_SOURCE),netbsd) +OTHERLIBDIR+=/usr/pkg/lib +endif +export GCCLIBDIR OTHERLIB +endif +BATCHEXT=.bat +LOADEREXT=.as +EXEEXT=.exe +PPLEXT=.ppl +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.so +SHAREDLIBPREFIX=libfp +STATICLIBPREFIX=libp +IMPORTLIBPREFIX=libimp +RSTEXT=.rst +ifeq ($(findstring 1.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),go32v1) +STATICLIBPREFIX= +SHORTSUFFIX=v1 +endif +ifeq ($(OS_TARGET),go32v2) +STATICLIBPREFIX= +SHORTSUFFIX=dos +endif +ifeq ($(OS_TARGET),watcom) +STATICLIBPREFIX= +OEXT=.obj +ASMEXT=.asm +SHAREDLIBEXT=.dll +SHORTSUFFIX=wat +endif +ifeq ($(OS_TARGET),linux) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +ifeq ($(OS_TARGET),freebsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=fbs +endif +ifeq ($(OS_TARGET),netbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=nbs +endif +ifeq ($(OS_TARGET),openbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=obs +endif +ifeq ($(OS_TARGET),win32) +SHAREDLIBEXT=.dll +SHORTSUFFIX=w32 +endif +ifeq ($(OS_TARGET),os2) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=os2 +ECHO=echo +endif +ifeq ($(OS_TARGET),emx) +BATCHEXT=.cmd +AOUTEXT=.out +STATICLIBPREFIX= +SHAREDLIBEXT=.dll +SHORTSUFFIX=emx +ECHO=echo +endif +ifeq ($(OS_TARGET),amiga) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=amg +endif +ifeq ($(OS_TARGET),morphos) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=mos +endif +ifeq ($(OS_TARGET),atari) +EXEEXT=.ttp +SHORTSUFFIX=ata +endif +ifeq ($(OS_TARGET),beos) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=be +endif +ifeq ($(OS_TARGET),solaris) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=sun +endif +ifeq ($(OS_TARGET),qnx) +BATCHEXT=.sh +EXEEXT= +SHORTSUFFIX=qnx +endif +ifeq ($(OS_TARGET),netware) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nw +endif +ifeq ($(OS_TARGET),netwlibc) +EXEEXT=.nlm +STATICLIBPREFIX= +SHORTSUFFIX=nwl +endif +ifeq ($(OS_TARGET),macos) +BATCHEXT= +EXEEXT= +DEBUGSYMEXT=.xcoff +SHORTSUFFIX=mac +endif +ifeq ($(OS_TARGET),darwin) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=dwn +endif +ifeq ($(OS_TARGET),gba) +EXEEXT=.gba +SHAREDLIBEXT=.so +SHORTSUFFIX=gba +endif +ifeq ($(OS_TARGET),symbian) +SHAREDLIBEXT=.dll +SHORTSUFFIX=symbian +endif +else +ifeq ($(OS_TARGET),go32v1) +PPUEXT=.pp1 +OEXT=.o1 +ASMEXT=.s1 +SMARTEXT=.sl1 +STATICLIBEXT=.a1 +SHAREDLIBEXT=.so1 +STATICLIBPREFIX= +SHORTSUFFIX=v1 +endif +ifeq ($(OS_TARGET),go32v2) +STATICLIBPREFIX= +SHORTSUFFIX=dos +endif +ifeq ($(OS_TARGET),watcom) +STATICLIBPREFIX= +SHORTSUFFIX=wat +endif +ifeq ($(OS_TARGET),linux) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=lnx +endif +ifeq ($(OS_TARGET),freebsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=fbs +endif +ifeq ($(OS_TARGET),netbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=nbs +endif +ifeq ($(OS_TARGET),openbsd) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=obs +endif +ifeq ($(OS_TARGET),win32) +PPUEXT=.ppw +OEXT=.ow +ASMEXT=.sw +SMARTEXT=.slw +STATICLIBEXT=.aw +SHAREDLIBEXT=.dll +SHORTSUFFIX=w32 +endif +ifeq ($(OS_TARGET),os2) +BATCHEXT=.cmd +PPUEXT=.ppo +ASMEXT=.so2 +OEXT=.oo2 +AOUTEXT=.out +SMARTEXT=.sl2 +STATICLIBPREFIX= +STATICLIBEXT=.ao2 +SHAREDLIBEXT=.dll +SHORTSUFFIX=os2 +ECHO=echo +endif +ifeq ($(OS_TARGET),amiga) +EXEEXT= +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.library +SHORTSUFFIX=amg +endif +ifeq ($(OS_TARGET),atari) +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT=.ttp +SHORTSUFFIX=ata +endif +ifeq ($(OS_TARGET),beos) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=be +endif +ifeq ($(OS_TARGET),solaris) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=sun +endif +ifeq ($(OS_TARGET),qnx) +BATCHEXT=.sh +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +SHORTSUFFIX=qnx +endif +ifeq ($(OS_TARGET),netware) +STATICLIBPREFIX= +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.nlm +EXEEXT=.nlm +SHORTSUFFIX=nw +endif +ifeq ($(OS_TARGET),netwlibc) +STATICLIBPREFIX= +PPUEXT=.ppu +OEXT=.o +ASMEXT=.s +SMARTEXT=.sl +STATICLIBEXT=.a +SHAREDLIBEXT=.nlm +EXEEXT=.nlm +SHORTSUFFIX=nwl +endif +ifeq ($(OS_TARGET),macos) +BATCHEXT= +PPUEXT=.ppu +ASMEXT=.s +OEXT=.o +SMARTEXT=.sl +STATICLIBEXT=.a +EXEEXT= +DEBUGSYMEXT=.xcoff +SHORTSUFFIX=mac +endif +endif +ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) +FPCMADE=fpcmade.$(SHORTSUFFIX) +ZIPSUFFIX=$(SHORTSUFFIX) +ZIPCROSSPREFIX= +ZIPSOURCESUFFIX=src +ZIPEXAMPLESUFFIX=exm +else +FPCMADE=fpcmade.$(TARGETSUFFIX) +ZIPSOURCESUFFIX=.source +ZIPEXAMPLESUFFIX=.examples +ifdef CROSSCOMPILE +ZIPSUFFIX=.$(SOURCESUFFIX) +ZIPCROSSPREFIX=$(TARGETSUFFIX)- +else +ZIPSUFFIX=.$(TARGETSUFFIX) +ZIPCROSSPREFIX= +endif +endif +ifndef ECHO +ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ECHO),) +ECHO= __missing_command_ECHO +else +ECHO:=$(firstword $(ECHO)) +endif +else +ECHO:=$(firstword $(ECHO)) +endif +endif +export ECHO +ifndef DATE +DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(DATE),) +DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(DATE),) +DATE= __missing_command_DATE +else +DATE:=$(firstword $(DATE)) +endif +else +DATE:=$(firstword $(DATE)) +endif +endif +export DATE +ifndef GINSTALL +GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(GINSTALL),) +GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(GINSTALL),) +GINSTALL= __missing_command_GINSTALL +else +GINSTALL:=$(firstword $(GINSTALL)) +endif +else +GINSTALL:=$(firstword $(GINSTALL)) +endif +endif +export GINSTALL +ifndef CPPROG +CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(CPPROG),) +CPPROG= __missing_command_CPPROG +else +CPPROG:=$(firstword $(CPPROG)) +endif +endif +export CPPROG +ifndef RMPROG +RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(RMPROG),) +RMPROG= __missing_command_RMPROG +else +RMPROG:=$(firstword $(RMPROG)) +endif +endif +export RMPROG +ifndef MVPROG +MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MVPROG),) +MVPROG= __missing_command_MVPROG +else +MVPROG:=$(firstword $(MVPROG)) +endif +endif +export MVPROG +ifndef MKDIRPROG +MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(MKDIRPROG),) +MKDIRPROG= __missing_command_MKDIRPROG +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +else +MKDIRPROG:=$(firstword $(MKDIRPROG)) +endif +endif +export MKDIRPROG +ifndef ECHOREDIR +ifndef inUnix +ECHOREDIR=echo +else +ECHOREDIR=$(ECHO) +endif +endif +ifndef COPY +COPY:=$(CPPROG) -fp +endif +ifndef COPYTREE +COPYTREE:=$(CPPROG) -Rfp +endif +ifndef MKDIRTREE +MKDIRTREE:=$(MKDIRPROG) -p +endif +ifndef MOVE +MOVE:=$(MVPROG) -f +endif +ifndef DEL +DEL:=$(RMPROG) -f +endif +ifndef DELTREE +DELTREE:=$(RMPROG) -rf +endif +ifndef INSTALL +ifdef inUnix +INSTALL:=$(GINSTALL) -c -m 644 +else +INSTALL:=$(COPY) +endif +endif +ifndef INSTALLEXE +ifdef inUnix +INSTALLEXE:=$(GINSTALL) -c -m 755 +else +INSTALLEXE:=$(COPY) +endif +endif +ifndef MKDIR +MKDIR:=$(GINSTALL) -m 755 -d +endif +export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR +ifndef PPUMOVE +PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(PPUMOVE),) +PPUMOVE= __missing_command_PPUMOVE +else +PPUMOVE:=$(firstword $(PPUMOVE)) +endif +endif +export PPUMOVE +ifndef FPCMAKE +FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(FPCMAKE),) +FPCMAKE= __missing_command_FPCMAKE +else +FPCMAKE:=$(firstword $(FPCMAKE)) +endif +endif +export FPCMAKE +ifndef ZIPPROG +ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(ZIPPROG),) +ZIPPROG= __missing_command_ZIPPROG +else +ZIPPROG:=$(firstword $(ZIPPROG)) +endif +endif +export ZIPPROG +ifndef TARPROG +TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(TARPROG),) +TARPROG= __missing_command_TARPROG +else +TARPROG:=$(firstword $(TARPROG)) +endif +else +TARPROG:=$(firstword $(TARPROG)) +endif +endif +export TARPROG +ASNAME=$(BINUTILSPREFIX)as +LDNAME=$(BINUTILSPREFIX)ld +ARNAME=$(BINUTILSPREFIX)ar +RCNAME=$(BINUTILSPREFIX)rc +ifneq ($(findstring 1.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),win32) +ifeq ($(CROSSBINDIR),) +ASNAME=asw +LDNAME=ldw +ARNAME=arw +endif +endif +endif +ifndef ASPROG +ifdef CROSSBINDIR +ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT) +else +ASPROG=$(ASNAME) +endif +endif +ifndef LDPROG +ifdef CROSSBINDIR +LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT) +else +LDPROG=$(LDNAME) +endif +endif +ifndef RCPROG +ifdef CROSSBINDIR +RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT) +else +RCPROG=$(RCNAME) +endif +endif +ifndef ARPROG +ifdef CROSSBINDIR +ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT) +else +ARPROG=$(ARNAME) +endif +endif +AS=$(ASPROG) +LD=$(LDPROG) +RC=$(RCPROG) +AR=$(ARPROG) +PPAS=ppas$(SRCBATCHEXT) +ifdef inUnix +LDCONFIG=ldconfig +else +LDCONFIG= +endif +ifdef DATE +DATESTR:=$(shell $(DATE) +%Y%m%d) +else +DATESTR= +endif +ifndef UPXPROG +ifeq ($(OS_TARGET),go32v2) +UPXPROG:=1 +endif +ifeq ($(OS_TARGET),win32) +UPXPROG:=1 +endif +ifdef UPXPROG +UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH)))) +ifeq ($(UPXPROG),) +UPXPROG= +else +UPXPROG:=$(firstword $(UPXPROG)) +endif +else +UPXPROG= +endif +endif +export UPXPROG +ZIPOPT=-9 +ZIPEXT=.zip +ifeq ($(USETAR),bz2) +TAROPT=vj +TAREXT=.tar.bz2 +else +TAROPT=vz +TAREXT=.tar.gz +endif +override REQUIRE_PACKAGES=rtl opengl +ifeq ($(FULL_TARGET),i386-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-go32v2) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-win32) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-os2) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-beos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-solaris) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-qnx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-netware) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-wdosx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-emx) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-watcom) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-netwlibc) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-wince) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),i386-symbian) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-amiga) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-atari) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-openbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-palmos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),m68k-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-amiga) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-macos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-morphos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),sparc-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),sparc-netbsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),sparc-solaris) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),sparc-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),x86_64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),x86_64-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),x86_64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),x86_64-win64) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),x86_64-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-palmos) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-wince) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-gba) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-nds) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),arm-symbian) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc64-linux) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc64-darwin) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifeq ($(FULL_TARGET),powerpc64-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_OPENGL=1 +endif +ifdef REQUIRE_PACKAGES_RTL +PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_RTL),) +ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),) +UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX) +else +UNITDIR_RTL=$(PACKAGEDIR_RTL) +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_RTL)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE) +endif +else +PACKAGEDIR_RTL= +UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_RTL),) +UNITDIR_RTL:=$(firstword $(UNITDIR_RTL)) +else +UNITDIR_RTL= +endif +endif +ifdef UNITDIR_RTL +override COMPILER_UNITDIR+=$(UNITDIR_RTL) +endif +endif +ifdef REQUIRE_PACKAGES_X11 +PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_X11),) +ifneq ($(wildcard $(PACKAGEDIR_X11)/units/$(TARGETSUFFIX)),) +UNITDIR_X11=$(PACKAGEDIR_X11)/units/$(TARGETSUFFIX) +else +UNITDIR_X11=$(PACKAGEDIR_X11) +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_X11)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_X11) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_X11)/$(FPCMADE) +endif +else +PACKAGEDIR_X11= +UNITDIR_X11:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /x11/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_X11),) +UNITDIR_X11:=$(firstword $(UNITDIR_X11)) +else +UNITDIR_X11= +endif +endif +ifdef UNITDIR_X11 +override COMPILER_UNITDIR+=$(UNITDIR_X11) +endif +endif +ifdef REQUIRE_PACKAGES_OPENGL +PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR)))))) +ifneq ($(PACKAGEDIR_OPENGL),) +ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/units/$(TARGETSUFFIX)),) +UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/units/$(TARGETSUFFIX) +else +UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL) +endif +ifdef CHECKDEPEND +$(PACKAGEDIR_OPENGL)/$(FPCMADE): + $(MAKE) -C $(PACKAGEDIR_OPENGL) $(FPCMADE) +override ALLDEPENDENCIES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE) +endif +else +PACKAGEDIR_OPENGL= +UNITDIR_OPENGL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /opengl/Package.fpc,$(UNITSDIR))))) +ifneq ($(UNITDIR_OPENGL),) +UNITDIR_OPENGL:=$(firstword $(UNITDIR_OPENGL)) +else +UNITDIR_OPENGL= +endif +endif +ifdef UNITDIR_OPENGL +override COMPILER_UNITDIR+=$(UNITDIR_OPENGL) +endif +endif +ifndef NOCPUDEF +override FPCOPTDEF=$(CPU_TARGET) +endif +ifneq ($(OS_TARGET),$(OS_SOURCE)) +override FPCOPT+=-T$(OS_TARGET) +endif +ifneq ($(CPU_TARGET),$(CPU_SOURCE)) +override FPCOPT+=-P$(CPU_TARGET) +endif +ifeq ($(OS_SOURCE),openbsd) +override FPCOPT+=-FD$(NEW_BINUTILS_PATH) +endif +ifndef CROSSBOOTSTRAP +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-XP$(BINUTILSPREFIX) +endif +ifneq ($(BINUTILSPREFIX),) +override FPCOPT+=-Xr$(RLINKPATH) +endif +endif +ifdef UNITDIR +override FPCOPT+=$(addprefix -Fu,$(UNITDIR)) +endif +ifdef LIBDIR +override FPCOPT+=$(addprefix -Fl,$(LIBDIR)) +endif +ifdef OBJDIR +override FPCOPT+=$(addprefix -Fo,$(OBJDIR)) +endif +ifdef INCDIR +override FPCOPT+=$(addprefix -Fi,$(INCDIR)) +endif +ifdef LINKSMART +override FPCOPT+=-XX +endif +ifdef CREATESMART +override FPCOPT+=-CX +endif +ifdef DEBUG +override FPCOPT+=-gl +override FPCOPTDEF+=DEBUG +endif +ifdef RELEASE +ifneq ($(findstring 2.0.,$(FPC_VERSION)),) +ifeq ($(CPU_TARGET),i386) +FPCCPUOPT:=-OG2p3 +endif +ifeq ($(CPU_TARGET),powerpc) +FPCCPUOPT:=-O1r +endif +else +FPCCPUOPT:=-O2 +endif +override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n +override FPCOPTDEF+=RELEASE +endif +ifdef STRIP +override FPCOPT+=-Xs +endif +ifdef OPTIMIZE +override FPCOPT+=-O2 +endif +ifdef VERBOSE +override FPCOPT+=-vwni +endif +ifdef COMPILER_OPTIONS +override FPCOPT+=$(COMPILER_OPTIONS) +endif +ifdef COMPILER_UNITDIR +override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR)) +endif +ifdef COMPILER_LIBRARYDIR +override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR)) +endif +ifdef COMPILER_OBJECTDIR +override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR)) +endif +ifdef COMPILER_INCLUDEDIR +override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR)) +endif +ifdef CROSSBINDIR +override FPCOPT+=-FD$(CROSSBINDIR) +endif +ifdef COMPILER_TARGETDIR +override FPCOPT+=-FE$(COMPILER_TARGETDIR) +ifeq ($(COMPILER_TARGETDIR),.) +override TARGETDIRPREFIX= +else +override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/ +endif +endif +ifdef COMPILER_UNITTARGETDIR +override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR) +ifeq ($(COMPILER_UNITTARGETDIR),.) +override UNITTARGETDIRPREFIX= +else +override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/ +endif +else +ifdef COMPILER_TARGETDIR +override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR) +override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX) +endif +endif +ifdef CREATESHARED +override FPCOPT+=-Cg +ifeq ($(CPU_TARGET),i386) +override FPCOPT+=-Aas +endif +endif +ifeq ($(findstring 2.0.,$(FPC_VERSION)),) +ifeq ($(OS_TARGET),linux) +ifeq ($(CPU_TARGET),x86_64) +override FPCOPT+=-Cg +endif +endif +endif +ifdef LINKSHARED +endif +ifdef GCCLIBDIR +override FPCOPT+=-Fl$(GCCLIBDIR) +endif +ifdef OTHERLIBDIR +override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR)) +endif +ifdef OPT +override FPCOPT+=$(OPT) +endif +ifdef FPCOPTDEF +override FPCOPT+=$(addprefix -d,$(FPCOPTDEF)) +endif +ifdef CFGFILE +override FPCOPT+=@$(CFGFILE) +endif +ifdef USEENV +override FPCEXTCMD:=$(FPCOPT) +override FPCOPT:=!FPCEXTCMD +export FPCEXTCMD +endif +override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) +override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) +ifneq ($(AFULL_TARGET),$(AFULL_SOURCE)) +override ACROSSCOMPILE=1 +endif +ifdef ACROSSCOMPILE +override FPCOPT+=$(CROSSOPT) +endif +override COMPILER:=$(FPC) $(FPCOPT) +ifeq (,$(findstring -s ,$(COMPILER))) +EXECPPAS= +else +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +ifdef RUNBATCH +EXECPPAS:=@$(RUNBATCH) $(PPAS) +else +EXECPPAS:=@$(PPAS) +endif +endif +endif +.PHONY: fpc_exes +ifndef CROSSINSTALL +ifneq ($(TARGET_PROGRAMS),) +override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS)) +override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) +override ALLTARGET+=fpc_exes +override INSTALLEXEFILES+=$(EXEFILES) +override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES) +ifeq ($(OS_TARGET),os2) +override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) +endif +ifeq ($(OS_TARGET),emx) +override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS)) +endif +endif +endif +fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES) +ifdef TARGET_RSTS +override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) +override CLEANRSTFILES+=$(RSTFILES) +endif +.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared +$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET) + @$(ECHOREDIR) Compiled > $(FPCMADE) +fpc_all: $(FPCMADE) +fpc_smart: + $(MAKE) all LINKSMART=1 CREATESMART=1 +fpc_debug: + $(MAKE) all DEBUG=1 +fpc_release: + $(MAKE) all RELEASE=1 +.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res +$(COMPILER_UNITTARGETDIR): + $(MKDIRTREE) $(COMPILER_UNITTARGETDIR) +$(COMPILER_TARGETDIR): + $(MKDIRTREE) $(COMPILER_TARGETDIR) +%$(PPUEXT): %.pp + $(COMPILER) $< + $(EXECPPAS) +%$(PPUEXT): %.pas + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.pp + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.pas + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.lpr + $(COMPILER) $< + $(EXECPPAS) +%$(EXEEXT): %.dpr + $(COMPILER) $< + $(EXECPPAS) +%.res: %.rc + windres -i $< -o $@ +vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR) +vpath %.inc $(COMPILER_INCLUDEDIR) +vpath %$(OEXT) $(COMPILER_UNITTARGETDIR) +vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR) +.PHONY: fpc_shared +override INSTALLTARGET+=fpc_shared_install +ifndef SHARED_LIBVERSION +SHARED_LIBVERSION=$(FPC_VERSION) +endif +ifndef SHARED_LIBNAME +SHARED_LIBNAME=$(PACKAGE_NAME) +endif +ifndef SHARED_FULLNAME +SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT) +endif +ifndef SHARED_LIBUNITS +SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS) +override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS)) +endif +fpc_shared: +ifdef HASSHAREDLIB + $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1 +ifneq ($(SHARED_BUILD),n) + $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR) +endif +else + @$(ECHO) Shared Libraries not supported +endif +fpc_shared_install: +ifneq ($(SHARED_BUILD),n) +ifneq ($(SHARED_LIBUNITS),) +ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),) + $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR) +endif +endif +endif +.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall +ifdef INSTALL_UNITS +override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS)) +endif +ifdef INSTALL_BUILDUNIT +override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES)) +endif +ifdef INSTALLPPUFILES +override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) +ifneq ($(UNITTARGETDIRPREFIX),) +override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES))) +override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES)))) +endif +override INSTALL_CREATEPACKAGEFPC=1 +endif +ifdef INSTALLEXEFILES +ifneq ($(TARGETDIRPREFIX),) +override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES))) +endif +endif +fpc_install: all $(INSTALLTARGET) +ifdef INSTALLEXEFILES + $(MKDIR) $(INSTALL_BINDIR) +ifdef UPXPROG + -$(UPXPROG) $(INSTALLEXEFILES) +endif + $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR) +endif +ifdef INSTALL_CREATEPACKAGEFPC +ifdef FPCMAKE +ifdef PACKAGE_VERSION +ifneq ($(wildcard Makefile.fpc),) + $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc + $(MKDIR) $(INSTALL_UNITDIR) + $(INSTALL) Package.fpc $(INSTALL_UNITDIR) +endif +endif +endif +endif +ifdef INSTALLPPUFILES + $(MKDIR) $(INSTALL_UNITDIR) + $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR) +ifneq ($(INSTALLPPULINKFILES),) + $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR) +endif +ifneq ($(wildcard $(LIB_FULLNAME)),) + $(MKDIR) $(INSTALL_LIBDIR) + $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR) +ifdef inUnix + ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME) +endif +endif +endif +ifdef INSTALL_FILES + $(MKDIR) $(INSTALL_DATADIR) + $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR) +endif +fpc_sourceinstall: distclean + $(MKDIR) $(INSTALL_SOURCEDIR) + $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR) +fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS)) +ifdef HASEXAMPLES + $(MKDIR) $(INSTALL_EXAMPLEDIR) +endif +ifdef EXAMPLESOURCEFILES + $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR) +endif +ifdef TARGET_EXAMPLEDIRS + $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR) +endif +.PHONY: fpc_clean fpc_cleanall fpc_distclean +ifdef EXEFILES +override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) +endif +ifdef CLEAN_UNITS +override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS)) +endif +ifdef CLEANPPUFILES +override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) +ifdef DEBUGSYMEXT +override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES)) +endif +override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES)) +override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES))) +endif +fpc_clean: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +endif +ifneq ($(CLEANPPULINKFILES),) + -$(DEL) $(CLEANPPULINKFILES) +endif +ifdef CLEANRSTFILES + -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) +endif +ifdef CLEAN_FILES + -$(DEL) $(CLEAN_FILES) +endif +ifdef LIB_NAME + -$(DEL) $(LIB_NAME) $(LIB_FULLNAME) +endif + -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT) +fpc_cleanall: $(CLEANTARGET) +ifdef CLEANEXEFILES + -$(DEL) $(CLEANEXEFILES) +endif +ifdef COMPILER_UNITTARGETDIR +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +endif +ifneq ($(CLEANPPULINKFILES),) + -$(DEL) $(CLEANPPULINKFILES) +endif +ifdef CLEANRSTFILES + -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) +endif +endif + -$(DELTREE) units + -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) +ifneq ($(PPUEXT),.ppu) + -$(DEL) *.o *.ppu *.a +endif + -$(DELTREE) *$(SMARTEXT) + -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE) + -$(DEL) *_ppas$(BATCHEXT) +ifdef AOUTEXT + -$(DEL) *$(AOUTEXT) +endif +ifdef DEBUGSYMEXT + -$(DEL) *$(DEBUGSYMEXT) +endif +fpc_distclean: cleanall +.PHONY: fpc_baseinfo +override INFORULES+=fpc_baseinfo +fpc_baseinfo: + @$(ECHO) + @$(ECHO) == Package info == + @$(ECHO) Package Name..... $(PACKAGE_NAME) + @$(ECHO) Package Version.. $(PACKAGE_VERSION) + @$(ECHO) + @$(ECHO) == Configuration info == + @$(ECHO) + @$(ECHO) FPC.......... $(FPC) + @$(ECHO) FPC Version.. $(FPC_VERSION) + @$(ECHO) Source CPU... $(CPU_SOURCE) + @$(ECHO) Target CPU... $(CPU_TARGET) + @$(ECHO) Source OS.... $(OS_SOURCE) + @$(ECHO) Target OS.... $(OS_TARGET) + @$(ECHO) Full Source.. $(FULL_SOURCE) + @$(ECHO) Full Target.. $(FULL_TARGET) + @$(ECHO) SourceSuffix. $(SOURCESUFFIX) + @$(ECHO) TargetSuffix. $(TARGETSUFFIX) + @$(ECHO) + @$(ECHO) == Directory info == + @$(ECHO) + @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES) + @$(ECHO) + @$(ECHO) Basedir......... $(BASEDIR) + @$(ECHO) FPCDir.......... $(FPCDIR) + @$(ECHO) CrossBinDir..... $(CROSSBINDIR) + @$(ECHO) UnitsDir........ $(UNITSDIR) + @$(ECHO) PackagesDir..... $(PACKAGESDIR) + @$(ECHO) + @$(ECHO) GCC library..... $(GCCLIBDIR) + @$(ECHO) Other library... $(OTHERLIBDIR) + @$(ECHO) + @$(ECHO) == Tools info == + @$(ECHO) + @$(ECHO) As........ $(AS) + @$(ECHO) Ld........ $(LD) + @$(ECHO) Ar........ $(AR) + @$(ECHO) Rc........ $(RC) + @$(ECHO) + @$(ECHO) Mv........ $(MVPROG) + @$(ECHO) Cp........ $(CPPROG) + @$(ECHO) Rm........ $(RMPROG) + @$(ECHO) GInstall.. $(GINSTALL) + @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) + @$(ECHO) Date...... $(DATE) + @$(ECHO) FPCMake... $(FPCMAKE) + @$(ECHO) PPUMove... $(PPUMOVE) + @$(ECHO) Upx....... $(UPXPROG) + @$(ECHO) Zip....... $(ZIPPROG) + @$(ECHO) + @$(ECHO) == Object info == + @$(ECHO) + @$(ECHO) Target Loaders........ $(TARGET_LOADERS) + @$(ECHO) Target Units.......... $(TARGET_UNITS) + @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS) + @$(ECHO) Target Programs....... $(TARGET_PROGRAMS) + @$(ECHO) Target Dirs........... $(TARGET_DIRS) + @$(ECHO) Target Examples....... $(TARGET_EXAMPLES) + @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS) + @$(ECHO) + @$(ECHO) Clean Units......... $(CLEAN_UNITS) + @$(ECHO) Clean Files......... $(CLEAN_FILES) + @$(ECHO) + @$(ECHO) Install Units....... $(INSTALL_UNITS) + @$(ECHO) Install Files....... $(INSTALL_FILES) + @$(ECHO) + @$(ECHO) == Install info == + @$(ECHO) + @$(ECHO) DateStr.............. $(DATESTR) + @$(ECHO) ZipName.............. $(ZIPNAME) + @$(ECHO) ZipPrefix............ $(ZIPPREFIX) + @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX) + @$(ECHO) ZipSuffix............ $(ZIPSUFFIX) + @$(ECHO) FullZipName.......... $(FULLZIPNAME) + @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE) + @$(ECHO) + @$(ECHO) Install base dir..... $(INSTALL_BASEDIR) + @$(ECHO) Install binary dir... $(INSTALL_BINDIR) + @$(ECHO) Install library dir.. $(INSTALL_LIBDIR) + @$(ECHO) Install units dir.... $(INSTALL_UNITDIR) + @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR) + @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR) + @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR) + @$(ECHO) Install data dir..... $(INSTALL_DATADIR) + @$(ECHO) + @$(ECHO) Dist destination dir. $(DIST_DESTDIR) + @$(ECHO) Dist zip name........ $(DIST_ZIPNAME) + @$(ECHO) +.PHONY: fpc_info +fpc_info: $(INFORULES) +.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \ + fpc_makefile_dirs +fpc_makefile: + $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc +fpc_makefile_sub1: +ifdef TARGET_DIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS)) +endif +ifdef TARGET_EXAMPLEDIRS + $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS)) +endif +fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS)) +fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2 +fpc_makefiles: fpc_makefile fpc_makefile_dirs +all: fpc_all +debug: fpc_debug +smart: fpc_smart +release: fpc_release +units: fpc_units +examples: +shared: fpc_shared +install: fpc_install +sourceinstall: fpc_sourceinstall +exampleinstall: fpc_exampleinstall +distinstall: +zipinstall: +zipsourceinstall: +zipexampleinstall: +zipdistinstall: +clean: fpc_clean +distclean: fpc_distclean +cleanall: fpc_cleanall +info: fpc_info +makefiles: fpc_makefiles +.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles +ifneq ($(wildcard fpcmake.loc),) +include fpcmake.loc +endif +.NOTPARALLEL: diff --git a/packages/opengl/examples/Makefile.fpc b/packages/opengl/examples/Makefile.fpc new file mode 100644 index 0000000000..1ec11d8810 --- /dev/null +++ b/packages/opengl/examples/Makefile.fpc @@ -0,0 +1,26 @@ +# +# Makefile.fpc for GL demos +# + +[target] +programs=glutdemo morph3d bounce radblur +programs_linux=glxtest +programs_freebsd=glxtest +programs_netbsd=glxtest +programs_openbsd=glxtest +programs_darwin=glxtest + +[require] +packages=opengl + +[install] +fpcpackage=y + +[compiler] +options=-S2h + +[default] +fpcdir=../../.. + +[rules] +.NOTPARALLEL: diff --git a/packages/opengl/examples/bounce.pp b/packages/opengl/examples/bounce.pp new file mode 100644 index 0000000000..b0ff677c1d --- /dev/null +++ b/packages/opengl/examples/bounce.pp @@ -0,0 +1,246 @@ +{ + Bouncing ball demo. Color index mode only! + + This program is in the public domain + Brian Paul + + Converted to Pascal by Peter Vreman +} +program bounce; + +{$mode objfpc} + +uses + gl,glut; + +const + RED=1; + WHITE=2; + CYAN=3; + +var + IndexMode : Boolean; + Ball : GLuint; + +const + Zrot : GLfloat = 0.0; + Zstep : GLfloat = 6.0; + Xpos : GLfloat = 0.0; + Ypos : GLfloat = 1.0; + Xvel : GLfloat = 0.2; + Yvel : GLfloat = 0.0; + Xmin : GLfloat = -4.0; + Xmax : GLfloat = 4.0; + Ymin : GLfloat = -3.8; + Ymax : GLfloat = 4.0; + G : GLfloat = -0.1; + + +function make_ball:GLuint; +var + list : GLuint; + a,b, + ar,br : GLFloat; + da,db, + dar : GLFloat; + radius : GLFloat; + color : boolean; + x,y,z : GLFloat; +begin + da:=18.0; + db:=18.0; + radius:=1.0; + + list := glGenLists(1); + + glNewList(list, GL_COMPILE); + + color := false; + a:=-90.0; + while (a+da<=90.0) do + begin + glBegin(GL_QUAD_STRIP); + + b:=0.0; + while (b<=360.0) do + begin + if (color) then + begin + glIndexi(RED); + glColor3f(1, 0, 0); + end + else + begin + glIndexi(WHITE); + glColor3f(1, 1, 1); + end; + + ar:=a * 3.14159/180.0; + br:=b * 3.14159/180.0; + x := COS(br) * COS(ar); + y := SIN(br) * COS(ar); + z := SIN(ar); + glVertex3f(x, y, z); + + dar:=da * 3.14159/180.0; + x := radius * COS(br) * COS(ar + dar); + y := radius * SIN(br) * COS(ar + dar); + z := radius * SIN(ar + dar); + glVertex3f(x, y, z); + + color := not color; + b:=b+db; + end; + + glEnd(); + a:=a+da; + end; + + glEndList(); + + make_ball:=list; +end; + + +procedure reshape(width,height:longint); cdecl; +var + aspect : glFloat; +begin + aspect := glfloat(width) / glfloat(height); + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-6.0 * aspect, 6.0 * aspect, -6.0, 6.0, -6.0, 6.0); + glMatrixMode(GL_MODELVIEW); +end; + + +procedure key(k:byte;x,y:longint); cdecl; +begin + case k of + 27 : + halt(0); + end; +end; + + +procedure draw; cdecl; +var + i : GLint; +begin + glClear(GL_COLOR_BUFFER_BIT); + + glIndexi(CYAN); + glColor3f(0, 1, 1); + glBegin(GL_LINES); + for i:=-5 to 5 do + begin + glVertex2i(i, -5); + glVertex2i(i, 5); + end; + for i:=-5 to 5 do + begin + glVertex2i(-5, i); + glVertex2i(5, i); + end; + for i:=-5 to 5 do + begin + glVertex2i(i, -5); + glVertex2f(i * 1.15, -5.9); + end; + glVertex2f(-5.3, -5.35); + glVertex2f(5.3, -5.35); + glVertex2f(-5.75, -5.9); + glVertex2f(5.75, -5.9); + glEnd(); + + glPushMatrix(); + glTranslatef(Xpos, Ypos, 0.0); + glScalef(2.0, 2.0, 2.0); + glRotatef(8.0, 0.0, 0.0, 1.0); + glRotatef(90.0, 1.0, 0.0, 0.0); + glRotatef(Zrot, 0.0, 0.0, 1.0); + + glCallList(Ball); + + glPopMatrix(); + + glFlush(); + glutSwapBuffers(); +end; + + +const + vel0 : glfloat = -100.0; +procedure idle; cdecl; +begin + Zrot:=Zrot+Zstep; + Xpos:=Xpos+Xvel; + if (Xpos >= Xmax) then + begin + Xpos := Xmax; + Xvel := -Xvel; + Zstep := -Zstep; + end; + if (Xpos <= Xmin) then + begin + Xpos := Xmin; + Xvel := -Xvel; + Zstep := -Zstep; + end; + Ypos:=Ypos+Yvel; + Yvel:=Yvel+G; + if (Ypos < Ymin) then + begin + Ypos := Ymin; + if (vel0 = -100.0) then + vel0 := abs(Yvel); + Yvel := vel0; + end; + glutPostRedisplay(); +end; + + +procedure visible(vis:longint); cdecl; +begin + if (vis=GLUT_VISIBLE) then + glutIdleFunc(@idle) + else + glutIdleFunc(nil); +end; + + +begin + glutInit(@argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(600, 450); + + if paramcount>1 then + IndexMode:=(paramstr(1)='-ci'); + + if (IndexMode) then + glutInitDisplayMode(GLUT_INDEX or GLUT_DOUBLE) + else + glutInitDisplayMode(GLUT_RGB or GLUT_DOUBLE); + + glutCreateWindow('Bounce'); + Ball := make_ball(); + glCullFace(GL_BACK); + glEnable(GL_CULL_FACE); + glDisable(GL_DITHER); + glShadeModel(GL_FLAT); + + glutDisplayFunc(@draw); + glutReshapeFunc(@reshape); + glutVisibilityFunc(@visible); + glutKeyboardFunc(@key); + + if (IndexMode) then + begin + glutSetColor(RED, 1.0, 0.0, 0.0); + glutSetColor(WHITE, 1.0, 1.0, 1.0); + glutSetColor(CYAN, 0.0, 1.0, 1.0); + end; + + glutMainLoop(); +end. diff --git a/packages/opengl/examples/glutdemo.pp b/packages/opengl/examples/glutdemo.pp new file mode 100644 index 0000000000..f59df1feb9 --- /dev/null +++ b/packages/opengl/examples/glutdemo.pp @@ -0,0 +1,134 @@ +{ + GL units for Free Pascal - GLUT demo + 1999 Sebastian Guenther, sguenther@gmx.de + + You may use this source as starting point for your own programs; consider it + as Public Domain. +} + +{$mode objfpc} + +program GLUTDemo; +uses + GL, GLU, GLUT; + +const + + FPCImg: array[0..4, 0..10] of Byte = + ((1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1), + (1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0), + (1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0), + (1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0), + (1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1)); + +var + counter: Integer; + + +const + colors: array[0..7, 0..2] of Single = + ((0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), + (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)); + corners: array[0..7, 0..2] of Single = + ((-1, -1, -1), (+1, -1, -1), (+1, +1, -1), (-1, +1, -1), + (-1, -1, +1), (+1, -1, +1), (+1, +1, +1), (-1, +1, +1)); + + +procedure DrawCube; + procedure DrawSide(i1, i2, i3, i4: Integer); + begin + glColor4f (colors [i1, 0], colors [i1, 1], colors [i1, 2], 0.5); + glVertex3f(corners[i1, 0], corners[i1, 1], corners[i1, 2]); + glColor4f (colors [i2, 0], colors [i2, 1], colors [i2, 2], 0.5); + glVertex3f(corners[i2, 0], corners[i2, 1], corners[i2, 2]); + glColor4f (colors [i3, 0], colors [i3, 1], colors [i3, 2], 0.5); + glVertex3f(corners[i3, 0], corners[i3, 1], corners[i3, 2]); + + glVertex3f(corners[i4, 0], corners[i4, 1], corners[i4, 2]); + end; +begin + glBegin(GL_QUADS); + DrawSide(4, 5, 6, 7); // Front + DrawSide(3, 2, 1, 0); // Back + DrawSide(2, 3, 7, 6); // Top + DrawSide(0, 1, 5, 4); // Bottom + DrawSide(4, 7, 3, 0); // Left + DrawSide(1, 2, 6, 5); // Right + glEnd; +end; + + +procedure DisplayWindow; cdecl; +var + x, y: Integer; +begin + Inc(counter); + + glClearColor(0, 0, 0.2, 1); + glClear(GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT); + + glPushMatrix; + glTranslatef(0, 0, Sin(Single(counter) / 20.0) * 5.0 - 5.0); + glRotatef(Sin(Single(counter) / 200.0) * 720.0, 0, 1, 0); + glRotatef(counter, 0, 0, 1); + + for y := 0 to 4 do + for x := 0 to 10 do + if FPCImg[y, x] > 0 then begin + glPushMatrix; + glRotatef(x * Sin(Single(counter) / 5.0), 0, 1, 0); + glRotatef(y * Sin(Single(counter) / 12.0) * 4.0, 0, 0, 1); + glTranslatef((x - 5) * 1, (2 - y) * 1, 0); + glScalef(0.4, 0.4, 0.4); + glRotatef(counter, 0.5, 1, 0); + DrawCube; + glPopMatrix; + end; + + glPopMatrix; + + Inc(counter); + + glutSwapBuffers; +end; + +procedure OnTimer(value: Integer); cdecl; +begin + glutPostRedisplay; + glutTimerFunc(20, @OnTimer, 0); +end; + +begin + glutInit(@argc, argv); + + glutInitDisplayMode(GLUT_RGB or GLUT_DOUBLE or GLUT_DEPTH); + glutCreateWindow('Free Pascal GLUT demo'); + glutDisplayFunc(@DisplayWindow); + glutTimerFunc(20, @OnTimer, 0); + + WriteLn; + WriteLn('GL info:'); + WriteLn(' Vendor: ', PChar(glGetString(GL_VENDOR))); + WriteLn(' Renderer: ', PChar(glGetString(GL_RENDERER))); + WriteLn(' Version: ', PChar(glGetString(GL_VERSION))); + WriteLn(' Extensions: ', PChar(glGetString(GL_EXTENSIONS))); + + // Enable backface culling + glEnable(GL_CULL_FACE); + + // Set up depth buffer + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + // Set up projection matrix + glMatrixMode(GL_PROJECTION); + glLoadIdentity; + gluPerspective(90, 1.3, 0.1, 100); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity; + glTranslatef(0, 0, -5.5); + + WriteLn('Starting...'); + glutMainLoop; + +end. diff --git a/packages/opengl/examples/glxtest.pp b/packages/opengl/examples/glxtest.pp new file mode 100644 index 0000000000..1bb52f95be --- /dev/null +++ b/packages/opengl/examples/glxtest.pp @@ -0,0 +1,110 @@ +{ + GLX demo for FreePascal + 2005 Bart Tierens, BTierens@netscape.net + + This program is in the public domain + + Warning: This demo works only with FreePascal 2.1 and better, due to changes to the glx header +} +program glxTest; + +{$MODE delphi} + +uses glx,unix,x,xlib,xutil,gl,glu; + +var + attr: Array[0..8] of integer = (GLX_RGBA,GLX_RED_SIZE,1,GLX_GREEN_SIZE,1,GLX_BLUE_SIZE,1,GLX_DOUBLEBUFFER,none); + visinfo: PXVisualInfo; + cm: TColormap; + winAttr: TXSetWindowAttributes; + glXCont: GLXContext; + dpy: PDisplay; + win: TWindow; + +procedure redraw(); +begin + glClear(GL_COLOR_BUFFER_BIT); + + glTranslatef(-0.5,-0.5,-2); + glBegin(GL_QUADS); + glColor3f(1,0,0); + glVertex3f(0,0,0); + glColor3f(0,1,0); + glVertex3f(1,0,0); + glColor3f(0,0,1); + glVertex3f(1,1,0); + glColor3f(1,1,1); + glVertex3f(0,1,0); + glEnd(); + + glXSwapBuffers(dpy, win); //Swap the buffers +end; + +procedure resize(width,height: integer); +begin + glViewport(0,0,width,height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45,width/height,0.1,200); + glMatrixMode(GL_MODELVIEW); +end; + +procedure loop(); +var + event: TXEvent; +begin + while true do + begin + XNextEvent(dpy,@event); + case event._type of + Expose: redraw(); + ConfigureNotify: resize(event.xconfigure.width,event.xconfigure.height); + KeyPress: halt(1); + end; + end; +end; + +var + errorBase,eventBase: integer; + window_title_property: TXTextProperty; + title: String; +begin + initGlx(); + dpy := XOpenDisplay(nil); + if(dpy = nil) then + writeLn('Error: Could not connect to X server'); + + if not (glXQueryExtension(dpy,errorBase,eventBase)) then + writeLn('Error: GLX extension not supported'); + + visinfo := glXChooseVisual(dpy,DefaultScreen(dpy), Attr); + if(visinfo = nil) then + writeLn('Error: Could not find visual'); + + //Create a new colormap + cm := XCreateColormap(dpy,RootWindow(dpy,visinfo.screen),visinfo.visual,AllocNone); + winAttr.colormap := cm; + winAttr.border_pixel := 0; + winAttr.background_pixel := 0; + winAttr.event_mask := ExposureMask or ButtonPressMask or StructureNotifyMask or KeyPressMask; + + //Create a window + win := XCreateWindow(dpy,RootWindow(dpy,visinfo.screen),0,0,640,480,0,visinfo.depth,InputOutput,visinfo.visual,CWBorderPixel or CWColormap or CWEventMask,@winAttr); + + title := 'FreePascal GLX demo --------- Press any key to exit'; + XStringListToTextProperty(@title,1,@window_title_property); + XSetWMName(dpy,win,@window_title_property); + + //Create an OpenGL rendering context + glXCont := glXCreateContext(dpy,visinfo,none,true); + if(glXCont = nil) then + writeLn('Error: Could not create an OpenGL rendering context'); + + //Make it current + glXMakeCurrent(dpy,win,glXCont); + + //Map the window on the display + XMapWindow(dpy,win); + + loop(); +end.
\ No newline at end of file diff --git a/packages/opengl/examples/morph3d.pp b/packages/opengl/examples/morph3d.pp new file mode 100644 index 0000000000..3896a24688 --- /dev/null +++ b/packages/opengl/examples/morph3d.pp @@ -0,0 +1,915 @@ +{ + *- + * morph3d.c - Shows 3D morphing objects + * + * Converted to GLUT by brianp on 1/1/98 + * Converted to FreePascal by Peter Vreman on 9/3/2000 + * + * This program was inspired on a WindowsNT(R)'s screen saver. It was written + * from scratch and it was not based on any other source code. + * + * Porting it to xlock (the final objective of this code since the moment I + * decided to create it) was possible by comparing the original Mesa's gear + * demo with it's ported version, so thanks for Danny Sung for his indirect + * help (look at gear.c in xlock source tree). NOTE: At the moment this code + * was sent to Brian Paul for package inclusion, the XLock Version was not + * available. In fact, I'll wait it to appear on the next Mesa release (If you + * are reading this, it means THIS release) to send it for xlock package + * inclusion). It will probably there be a GLUT version too. + * + * Thanks goes also to Brian Paul for making it possible and inexpensive + * to use OpenGL at home. * + * Since I'm not a native english speaker, my apologies for any gramatical + * mistake. + * + * My e-mail addresses are + * + * vianna@cat.cbpf.br + * and + * marcelo@venus.rdc.puc-rio.br + * + * Marcelo F. Vianna (Feb-13-1997) + */ +} +program morph3d; + +{$mode objfpc} + +{ +This document is VERY incomplete, but tries to describe the mathematics used +in the program. At this moment it just describes how the polyhedra are +generated. On futhurer versions, this document will be probabbly improved. + +Since I'm not a native english speaker, my apologies for any gramatical +mistake. + +Marcelo Fernandes Vianna +- Undergraduate in Computer Engeneering at Catholic Pontifical University +- of Rio de Janeiro (PUC-Rio) Brasil. +- e-mail: vianna@cat.cbpf.br or marcelo@venus.rdc.puc-rio.br +- Feb-13-1997 + +POLYHEDRA GENERATION + +For the purpose of this program it's not sufficient to know the polyhedra +vertexes coordinates. Since the morphing algorithm applies a nonlinear +transformation over the surfaces (faces) of the polyhedron, each face has +to be divided into smaller ones. The morphing algorithm needs to transform +each vertex of these smaller faces individually. It's a very time consoming +task. + +In order to reduce calculation overload, and since all the macro faces of +the polyhedron are transformed by the same way, the generation is made by +creating only one face of the polyhedron, morphing it and then rotating it +around the polyhedron center. + +What we need to know is the face radius of the polyhedron (the radius of +the inscribed sphere) and the angle between the center of two adjacent +faces using the center of the sphere as the angle's vertex. + +The face radius of the regular polyhedra are known values which I decided +to not waste my time calculating. Following is a table of face radius for +the regular polyhedra with edge length = 1: + + TETRAHEDRON : 1/(2*sqrt(2))/sqrt(3) + CUBE : 1/2 + OCTAHEDRON : 1/sqrt(6) + DODECAHEDRON : T^2 * sqrt((T+2)/5) / 2 -> where T=(sqrt(5)+1)/2 + ICOSAHEDRON : (3*sqrt(3)+sqrt(15))/12 + +I've not found any reference about the mentioned angles, so I needed to +calculate them, not a trivial task until I figured out how :) +Curiously these angles are the same for the tetrahedron and octahedron. +A way to obtain this value is inscribing the tetrahedron inside the cube +by matching their vertexes. So you'll notice that the remaining unmatched +vertexes are in the same straight line starting in the cube/tetrahedron +center and crossing the center of each tetrahedron's face. At this point +it's easy to obtain the bigger angle of the isosceles triangle formed by +the center of the cube and two opposite vertexes on the same cube face. +The edges of this triangle have the following lenghts: sqrt(2) for the base +and sqrt(3)/2 for the other two other edges. So the angle we want is: + +-----------------------------------------------------------+ + | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees | + +-----------------------------------------------------------+ +For the cube this angle is obvious, but just for formality it can be +easily obtained because we also know it's isosceles edge lenghts: +sqrt(2)/2 for the base and 1/2 for the other two edges. So the angle we +want is: + +-----------------------------------------------------------+ + | 2*ARCSIN((sqrt(2)/2)/1) = 90.000000000000000000 degrees | + +-----------------------------------------------------------+ +For the octahedron we use the same idea used for the tetrahedron, but now +we inscribe the cube inside the octahedron so that all cubes's vertexes +matches excatly the center of each octahedron's face. It's now clear that +this angle is the same of the thetrahedron one: + +-----------------------------------------------------------+ + | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees | + +-----------------------------------------------------------+ +For the dodecahedron it's a little bit harder because it's only relationship +with the cube is useless to us. So we need to solve the problem by another +way. The concept of Face radius also exists on 2D polygons with the name +Edge radius: + Edge Radius For Pentagon (ERp) + ERp = (1/2)/TAN(36 degrees) * VRp = 0.6881909602355867905 + (VRp is the pentagon's vertex radio). + Face Radius For Dodecahedron + FRd = T^2 * sqrt((T+2)/5) / 2 = 1.1135163644116068404 +Why we need ERp? Well, ERp and FRd segments forms a 90 degrees angle, +completing this triangle, the lesser angle is a half of the angle we are +looking for, so this angle is: + +-----------------------------------------------------------+ + | 2*ARCTAN(ERp/FRd) = 63.434948822922009981 degrees | + +-----------------------------------------------------------+ +For the icosahedron we can use the same method used for dodecahedron (well +the method used for dodecahedron may be used for all regular polyhedra) + Edge Radius For Triangle (this one is well known: 1/3 of the triangle height) + ERt = sin(60)/3 = sqrt(3)/6 = 0.2886751345948128655 + Face Radius For Icosahedron + FRi= (3*sqrt(3)+sqrt(15))/12 = 0.7557613140761707538 +So the angle is: + +-----------------------------------------------------------+ + | 2*ARCTAN(ERt/FRi) = 41.810314895778596167 degrees | + +-----------------------------------------------------------+ +} + +uses + GL,GLUT; + +type + float = single; + +const + Scale = 0.3; + +// #define sqr(A) ((A)*(A)) + +// Increasing this values produces better image quality, the price is speed. +// Very low values produces erroneous/incorrect plotting + tetradivisions = 23; + cubedivisions = 20; + octadivisions = 21; + dodecadivisions = 10; + icodivisions = 15; + + tetraangle = 109.47122063449069174; + cubeangle = 90.000000000000000000; + octaangle = 109.47122063449069174; + dodecaangle = 63.434948822922009981; + icoangle = 41.810314895778596167; + +//#define Pi 3.1415926535897932385 + SQRT2 = 1.4142135623730951455; + SQRT3 = 1.7320508075688771932; + SQRT5 = 2.2360679774997898051; + SQRT6 = 2.4494897427831778813; + SQRT15 = 3.8729833462074170214; + cossec36_2 = 0.8506508083520399322; + cos72 = 0.3090169943749474241; + sin72 = 0.9510565162951535721; + cos36 = 0.8090169943749474241; + sin36 = 0.5877852522924731292; + +{*************************************************************************} + +const + mono : boolean=false; + smooth : boolean=true; +var + WindH,WindW : GLint; + step,seno : GLFloat; + _object : glint; + edgedivisions : glint; + draw_object : procedure; + Magnitude : glfloat; + MaterialColor : array[0..19] of pglfloat; + +const + front_shininess : array[0..0] of glfloat = (60.0); + front_specular : array[0..3] of glfloat = ( 0.7, 0.7, 0.7, 1.0 ); + ambient : array[0..3] of glfloat = ( 0.0, 0.0, 0.0, 1.0 ); + diffuse : array[0..3] of glfloat = ( 1.0, 1.0, 1.0, 1.0 ); + position0 : array[0..3] of glfloat = ( 1.0, 1.0, 1.0, 0.0 ); + position1 : array[0..3] of glfloat = (-1.0,-1.0, 1.0, 0.0 ); + lmodel_ambient : array[0..3] of glfloat = ( 0.5, 0.5, 0.5, 1.0 ); + lmodel_twoside : array[0..0] of glfloat = (GL_TRUE); + + MaterialRed : array[0..3] of glfloat = ( 0.7, 0.0, 0.0, 1.0 ); + MaterialGreen : array[0..3] of glfloat = ( 0.1, 0.5, 0.2, 1.0 ); + MaterialBlue : array[0..3] of glfloat = ( 0.0, 0.0, 0.7, 1.0 ); + MaterialCyan : array[0..3] of glfloat = ( 0.2, 0.5, 0.7, 1.0 ); + MaterialYellow : array[0..3] of glfloat = ( 0.7, 0.7, 0.0, 1.0 ); + MaterialMagenta : array[0..3] of glfloat = ( 0.6, 0.2, 0.5, 1.0 ); + MaterialWhite : array[0..3] of glfloat = ( 0.7, 0.7, 0.7, 1.0 ); + MaterialGray : array[0..3] of glfloat = ( 0.2, 0.2, 0.2, 1.0 ); + + +procedure TRIANGLE(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat); +var + Xf,Yf,Xa,Yb,Xf2,Yf2 : Extended; + Factor,Factor1,Factor2 : GLfloat; + VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat; + Ax,Ay,Bx : GLfloat; + Ri,Ti : longint; + Vr : GLfloat; + AmpVr2 : GLfloat; + Zf : GLfloat; +begin + Vr:=(Edge)*SQRT3/3; + AmpVr2:=(Amp)/sqr(Vr); + Zf:=(Edge)*(Z); + + Ax:=(Edge)*(+0.5/(Divisions)); + Ay:=(Edge)*(-SQRT3/(2*Divisions)); + Bx:=(Edge)*(-0.5/(Divisions)); + + for Ri:=1 to Divisions do + begin + glBegin(GL_TRIANGLE_STRIP); + for Ti:=0 to Ri-1 do + begin + Xf:=(Ri-Ti)*Ax + Ti*Bx; + Yf:=Vr+(Ri-Ti)*Ay + Ti*Ay; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-(((Xf2)+(Yf2))*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + + Xf:=(Ri-Ti-1)*Ax + Ti*Bx; + Yf:=Vr+(Ri-Ti-1)*Ay + Ti*Ay; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-(((Xf2)+(Yf2))*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + end; + Xf:=Ri*Bx; + Yf:=Vr+Ri*Ay; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-((Xf2+Yf2)*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + glEnd(); + end; +end; + + +procedure SQUARE(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat); +var + Xi,Yi : longint; + Xf,Yf,Y,Y2,Xf2,Yf2,Xa,Yb : GLfloat; + Factor,Factor1,Factor2 : GLfloat; + VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat; + AmpVr2 : GLfloat; + Zf : GLfloat; +begin + AmpVr2:=(Amp)/sqr((Edge)*SQRT2/2); + Zf:=(Edge)*(Z); + + for Yi:=0 to Divisions-1 do + begin + Yf:=-((Edge)/2.0) + (Yi)/(Divisions)*(Edge); + Yf2:=sqr(Yf); + Y:=Yf+1.0/(Divisions)*(Edge); + Y2:=sqr(Y); + glBegin(GL_QUAD_STRIP); + for Xi:=0 to Divisions do + begin + Xf:=-((Edge)/2.0) + (Xi)/(Divisions)*(Edge); + Xf2:=sqr(Xf); + + Xa:=Xf+0.001; Yb:=Y+0.001; + Factor:=1-((Xf2+Y2)*AmpVr2); + Factor1:=1-((sqr(Xa)+Y2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Y; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Y-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + + Xa:=Xf+0.001; Yb:=Yf+0.001; + Factor:=1-((Xf2+Yf2)*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + end; + glEnd(); + end; +end; + +procedure PENTAGON(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat); +var + Ri,Ti,Fi : longint; + Xf,Yf,Xf2,Yf2,Xa,Yb : GLfloat; + X,Y : array[0..5] of GLFloat; + Factor,Factor1,Factor2 : GLfloat; + VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat; + AmpVr2 : GLfloat; + Zf : GLfloat; +begin + AmpVr2:=(Amp)/sqr((Edge)*cossec36_2); + Zf:=(Edge)*(Z); + + for Fi:=0 to 5 do + begin + x[Fi]:=-cos( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge); + y[Fi]:=sin( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge); + end; + + for Ri:=1 to Divisions do + begin + for Fi:=0 to 4 do + begin + glBegin(GL_TRIANGLE_STRIP); + for Ti:=0 to Ri-1 do + begin + Xf:=(Ri-Ti)*x[Fi] + Ti*x[Fi+1]; + Yf:=(Ri-Ti)*y[Fi] + Ti*y[Fi+1]; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-(((Xf2)+(Yf2))*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + + Xf:=(Ri-Ti-1)*x[Fi] + Ti*x[Fi+1]; + Yf:=(Ri-Ti-1)*y[Fi] + Ti*y[Fi+1]; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-(((Xf2)+(Yf2))*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + end; + Xf:=Ri*x[Fi+1]; + Yf:=Ri*y[Fi+1]; + Xa:=Xf+0.001; Yb:=Yf+0.001; + Xf2:=sqr(Xf); + Yf2:=sqr(Yf); + Factor:=1-(((Xf2)+(Yf2))*AmpVr2); + Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2); + Factor2:=1-((Xf2+sqr(Yb))*AmpVr2); + VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf; + NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ; + NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ; + glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX); + glVertex3f(VertX, VertY, VertZ); + glEnd(); + end; + end; +end; + + +procedure draw_tetra; +var + list : GLuint; +begin + list := glGenLists( 1 ); + glNewList( list, GL_COMPILE ); + TRIANGLE(2,seno,edgedivisions,0.5/SQRT6); + glEndList(); + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,0,1); + glRotatef(-tetraangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+tetraangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+tetraangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]); + glCallList(list); + + glDeleteLists(list,1); +end; + + +procedure draw_cube; +var + list : GLuint; +begin + list := glGenLists( 1 ); + glNewList( list, GL_COMPILE ); + SQUARE(2, seno, edgedivisions, 0.5); + glEndList(); + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]); + glCallList(list); + glRotatef(cubeangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]); + glCallList(list); + glRotatef(cubeangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]); + glCallList(list); + glRotatef(cubeangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]); + glCallList(list); + glRotatef(cubeangle,0,1,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]); + glCallList(list); + glRotatef(2*cubeangle,0,1,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]); + glCallList(list); + + glDeleteLists(list,1); +end; + + +procedure draw_octa; +var + list : GLuint; +begin + list := glGenLists( 1 ); + glNewList( list, GL_COMPILE ); + TRIANGLE(2,seno,edgedivisions,1/SQRT6); + glEndList(); + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,0,1); + glRotatef(-180+octaangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-octaangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-octaangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]); + glCallList(list); + glPopMatrix(); + glRotatef(180,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,0,1); + glRotatef(-180+octaangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-octaangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-octaangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]); + glCallList(list); + + glDeleteLists(list,1); +end; + + +procedure draw_dodeca; +const + TAU = ((SQRT5+1)/2); +var + list : GLuint; +begin + list := glGenLists( 1 ); + glNewList( list, GL_COMPILE ); + PENTAGON(1,seno,edgedivisions,sqr(TAU) * sqrt((TAU+2)/5) / 2); + glEndList(); + + glPushMatrix(); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]); + glCallList(list); + glRotatef(180,0,0,1); + glPushMatrix(); + glRotatef(-dodecaangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(-dodecaangle,cos72,sin72,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(-dodecaangle,cos72,-sin72,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(dodecaangle,cos36,-sin36,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]); + glCallList(list); + glPopMatrix(); + glRotatef(dodecaangle,cos36,sin36,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]); + glCallList(list); + glPopMatrix(); + glRotatef(180,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]); + glCallList(list); + glRotatef(180,0,0,1); + glPushMatrix(); + glRotatef(-dodecaangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(-dodecaangle,cos72,sin72,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(-dodecaangle,cos72,-sin72,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(dodecaangle,cos36,-sin36,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]); + glCallList(list); + glPopMatrix(); + glRotatef(dodecaangle,cos36,sin36,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]); + glCallList(list); + + glDeleteLists(list,1); +end; + + +procedure draw_ico; +var + list : GLuint; +begin + list := glGenLists( 1 ); + glNewList( list, GL_COMPILE ); + TRIANGLE(1.5,seno,edgedivisions,(3*SQRT3+SQRT15)/12); + glEndList(); + + glPushMatrix(); + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]); + glCallList(list); + glPopMatrix(); + glRotatef(180,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[12]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[13]); + glCallList(list); + glPopMatrix(); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[14]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[15]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[16]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[17]); + glCallList(list); + glPushMatrix(); + glRotatef(180,0,1,0); + glRotatef(-180+icoangle,0.5,-SQRT3/2,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[18]); + glCallList(list); + glPopMatrix(); + glRotatef(180,0,0,1); + glRotatef(-icoangle,1,0,0); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[19]); + glCallList(list); + + glDeleteLists(list,1); +end; + + +procedure do_draw; cdecl; +begin + glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + + glTranslatef( 0.0, 0.0, -10.0 ); + glScalef( Scale*WindH/WindW, Scale, Scale ); + glTranslatef(2.5*WindW/WindH*sin(step*1.11),2.5*cos(step*1.25*1.11),0); + glRotatef(step*100,1,0,0); + glRotatef(step*95,0,1,0); + glRotatef(step*90,0,0,1); + + seno:=(sin(step)+1.0/3.0)*(4.0/5.0)*Magnitude; + + draw_object(); + + glPopMatrix(); + + glFlush(); + + glutSwapBuffers(); + + step:=step+0.05; +end; + + +procedure do_idle; cdecl; +begin + glutPostRedisplay(); +end; + + +procedure do_reshape(width,height:longint); cdecl; +begin + WindW:=width; + WindH:=height; + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 ); + glMatrixMode(GL_MODELVIEW); +end; + + +procedure pinit; +var + loop : longint; +begin + case _object of + 1 : + begin + draw_object:=@draw_tetra; + MaterialColor[0]:=@MaterialRed; + MaterialColor[1]:=@MaterialGreen; + MaterialColor[2]:=@MaterialBlue; + MaterialColor[3]:=@MaterialWhite; + edgedivisions:=tetradivisions; + Magnitude:=2.5; + end; + 2: + begin + draw_object:=@draw_cube; + MaterialColor[0]:=@MaterialRed; + MaterialColor[1]:=@MaterialGreen; + MaterialColor[2]:=@MaterialCyan; + MaterialColor[3]:=@MaterialMagenta; + MaterialColor[4]:=@MaterialYellow; + MaterialColor[5]:=@MaterialBlue; + edgedivisions:=cubedivisions; + Magnitude:=2.0; + end; + 3: + begin + draw_object:=@draw_octa; + MaterialColor[0]:=MaterialRed; + MaterialColor[1]:=MaterialGreen; + MaterialColor[2]:=MaterialBlue; + MaterialColor[3]:=MaterialWhite; + MaterialColor[4]:=MaterialCyan; + MaterialColor[5]:=MaterialMagenta; + MaterialColor[6]:=MaterialGray; + MaterialColor[7]:=MaterialYellow; + edgedivisions:=octadivisions; + Magnitude:=2.5; + end; + 4: + begin + draw_object:=@draw_dodeca; + MaterialColor[ 0]:=MaterialRed; + MaterialColor[ 1]:=MaterialGreen; + MaterialColor[ 2]:=MaterialCyan; + MaterialColor[ 3]:=MaterialBlue; + MaterialColor[ 4]:=MaterialMagenta; + MaterialColor[ 5]:=MaterialYellow; + MaterialColor[ 6]:=MaterialGreen; + MaterialColor[ 7]:=MaterialCyan; + MaterialColor[ 8]:=MaterialRed; + MaterialColor[ 9]:=MaterialMagenta; + MaterialColor[10]:=MaterialBlue; + MaterialColor[11]:=MaterialYellow; + edgedivisions:=dodecadivisions; + Magnitude:=2.0; + end; + 5: + begin + draw_object:=@draw_ico; + MaterialColor[ 0]:=MaterialRed; + MaterialColor[ 1]:=MaterialGreen; + MaterialColor[ 2]:=MaterialBlue; + MaterialColor[ 3]:=MaterialCyan; + MaterialColor[ 4]:=MaterialYellow; + MaterialColor[ 5]:=MaterialMagenta; + MaterialColor[ 6]:=MaterialRed; + MaterialColor[ 7]:=MaterialGreen; + MaterialColor[ 8]:=MaterialBlue; + MaterialColor[ 9]:=MaterialWhite; + MaterialColor[10]:=MaterialCyan; + MaterialColor[11]:=MaterialYellow; + MaterialColor[12]:=MaterialMagenta; + MaterialColor[13]:=MaterialRed; + MaterialColor[14]:=MaterialGreen; + MaterialColor[15]:=MaterialBlue; + MaterialColor[16]:=MaterialCyan; + MaterialColor[17]:=MaterialYellow; + MaterialColor[18]:=MaterialMagenta; + MaterialColor[19]:=MaterialGray; + edgedivisions:=icodivisions; + Magnitude:=2.5; + end; + end; + if (mono) then + begin + for loop:=0 to 19 do + MaterialColor[loop]:=MaterialGray; + end; + if (smooth) then + glShadeModel( GL_SMOOTH ) + else + glShadeModel( GL_FLAT ); +end; + + +procedure do_key(k:byte;x,y:integer); cdecl; +begin + case Char(k) of + '1' : _object:=1; + '2' : _object:=2; + '3' : _object:=3; + '4' : _object:=4; + '5' : _object:=5; + ' ' : mono:=not mono; + #13 : smooth:=not smooth; + #27 : halt(0); + end; + pinit; +end; + + +begin + writeln('Morph 3D - Shows morphing platonic polyhedra'); + writeln('Author: Marcelo Fernandes Vianna (vianna@cat.cbpf.br)'); + writeln(' [1] - Tetrahedron'); + writeln(' [2] - Hexahedron (Cube)'); + writeln(' [3] - Octahedron'); + writeln(' [4] - Dodecahedron'); + writeln(' [5] - Icosahedron'); + writeln('[SPACE] - Toggle colored faces'); + writeln('[RETURN] - Toggle smooth/flat shading'); + writeln(' [ESC] - Quit'); + _object:=3; + + glutInit(@argc, argv); + glutInitWindowPosition(0,0); + glutInitWindowSize(640,480); + + glutInitDisplayMode( GLUT_DEPTH + GLUT_DOUBLE + GLUT_RGB ); + + if (glutCreateWindow('Morph 3D - Shows morphing platonic polyhedra') <= 0) then + halt(1); + + glClearDepth(1.0); + glClearColor( 0.0, 0.0, 0.0, 1.0 ); + glColor3f( 1.0, 1.0, 1.0 ); + + glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT ); + glFlush(); + glutSwapBuffers(); + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position0); + glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT1, GL_POSITION, position1); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glEnable(GL_DEPTH_TEST); + glEnable(GL_NORMALIZE); + + glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular); + + glHint(GL_FOG_HINT, GL_FASTEST); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST); + + pinit(); + + glutReshapeFunc( @do_reshape ); + glutKeyboardFunc( @do_key ); + glutIdleFunc( @do_idle ); + glutDisplayFunc( @do_draw ); + glutMainLoop(); +end. diff --git a/packages/opengl/examples/radblur.pp b/packages/opengl/examples/radblur.pp new file mode 100644 index 0000000000..60d4fb4ba9 --- /dev/null +++ b/packages/opengl/examples/radblur.pp @@ -0,0 +1,375 @@ +//------------------------------------------------------------------------ +// +// Author : Dario Corno (rIo) / Jeff Molofee (NeHe) +// Converted to Delphi : Jan Horn +// Email : jhorn@global.co.za +// Website : http://www.sulaco.co.za +// Authors Web Site : http://www.spinningkids.org/rio +// Date : 14 October 2001 +// Version : 1.0 +// Description : Radial Blur +// +// Adapted to FPC : Sebastian Guenther (sg@freepascal.org) 2001-11-21 +// +//------------------------------------------------------------------------ +program RadialBlur; + +{$mode objfpc} + +uses GL, GLU, GLUT; + +const + WND_TITLE = 'Radial Blur'; + +type TVector = Array[0..2] of glFloat; +var + ElapsedTime : Integer; // Elapsed time between frames + + // Textures + BlurTexture : glUint; // An Unsigned Int To Store The Texture Number + + // User vaiables + Angle : glFloat; + Vertexes : Array[0..3] of TVector; + normal : TVector; + +const + FPSCount : Integer = 0; // Counter for FPS + // Lights and Materials + globalAmbient : Array[0..3] of glFloat = (0.2, 0.2, 0.2, 1.0); // Set Ambient Lighting To Fairly Dark Light (No Color) + Light0Pos : Array[0..3] of glFloat = (0.0, 5.0, 10.0, 1.0); // Set The Light Position + Light0Ambient : Array[0..3] of glFloat = (0.2, 0.2, 0.2, 1.0); // More Ambient Light + Light0Diffuse : Array[0..3] of glFloat = (0.3, 0.3, 0.3, 1.0); // Set The Diffuse Light A Bit Brighter + Light0Specular : Array[0..3] of glFloat = (0.8, 0.8, 0.8, 1.0); // Fairly Bright Specular Lighting + + LmodelAmbient : Array[0..3] of glFloat = (0.2, 0.2, 0.2, 1.0); // And More Ambient Light + + +function EmptyTexture : glUint; +var txtnumber : glUint; + pData : Pointer; +begin + // Create Storage Space For Texture Data (128x128x4) + GetMem(pData, 128*128*4); + + glGenTextures(1, @txtnumber); // Create 1 Texture + glBindTexture(GL_TEXTURE_2D, txtnumber); // Bind The Texture + glTexImage2D(GL_TEXTURE_2D, 0, 4, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, pData); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); + + result :=txtNumber; +end; + + +procedure ReduceToUnit(var vector : Array of glFloat); +var length : glFLoat; +begin + // Calculates The Length Of The Vector + length := sqrt((vector[0]*vector[0]) + (vector[1]*vector[1]) + (vector[2]*vector[2])); + if Length = 0 then + Length :=1; + + vector[0] :=vector[0] / length; + vector[1] :=vector[1] / length; + vector[2] :=vector[2] / length; +end; + + +procedure calcNormal(const v : Array of TVector; var cross : Array of glFloat); +var v1, v2 : Array[0..2] of glFloat; +begin + // Finds The Vector Between 2 Points By Subtracting + // The x,y,z Coordinates From One Point To Another. + + // Calculate The Vector From Point 1 To Point 0 + v1[0] := v[0][0] - v[1][0]; // Vector 1.x=Vertex[0].x-Vertex[1].x + v1[1] := v[0][1] - v[1][1]; // Vector 1.y=Vertex[0].y-Vertex[1].y + v1[2] := v[0][2] - v[1][2]; // Vector 1.z=Vertex[0].y-Vertex[1].z + // Calculate The Vector From Point 2 To Point 1 + v2[0] := v[1][0] - v[2][0]; // Vector 2.x=Vertex[0].x-Vertex[1].x + v2[1] := v[1][1] - v[2][1]; // Vector 2.y=Vertex[0].y-Vertex[1].y + v2[2] := v[1][2] - v[2][2]; // Vector 2.z=Vertex[0].z-Vertex[1].z + // Compute The Cross Product To Give Us A Surface Normal + cross[0] := v1[1]*v2[2] - v1[2]*v2[1]; // Cross Product For Y - Z + cross[1] := v1[2]*v2[0] - v1[0]*v2[2]; // Cross Product For X - Z + cross[2] := v1[0]*v2[1] - v1[1]*v2[0]; // Cross Product For X - Y + + ReduceToUnit(cross); // Normalize The Vectors +end; + + +// Draws A Helix +procedure ProcessHelix; +const Twists = 5; + MaterialColor : Array[1..4] of glFloat = (0.4, 0.2, 0.8, 1.0); + Specular : Array[1..4] of glFloat = (1, 1, 1, 1); +var x, y, z : glFLoat; + phi, theta : Integer; + r, u, v : glFLoat; +begin + glLoadIdentity(); // Reset The Modelview Matrix + gluLookAt(0, 5, 50, 0, 0, 0, 0, 1, 0); // Eye Position (0,5,50) Center Of Scene (0,0,0), Up On Y Axis + + glPushMatrix(); // Push The Modelview Matrix + glTranslatef(0,0,-50); // Translate 50 Units Into The Screen + glRotatef(angle/2.0, 1, 0, 0); // Rotate By angle/2 On The X-Axis + glRotatef(angle/3.0, 0, 1, 0); // Rotate By angle/3 On The Y-Axis + + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, @MaterialColor); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, @specular); + + r :=1.5; // Radius + + glBegin(GL_QUADS); // Begin Drawing Quads + phi :=0; + while phi < 360 do + begin + theta :=0; + while theta < 360*twists do + begin + v := phi / 180.0 * pi; // Calculate Angle Of First Point ( 0 ) + u := theta / 180.0 * pi; // Calculate Angle Of First Point ( 0 ) + + x :=cos(u)*(2 + cos(v))*r; // Calculate x Position (1st Point) + y :=sin(u)*(2 + cos(v))*r; // Calculate y Position (1st Point) + z :=(u-(2*pi) + sin(v))*r; // Calculate z Position (1st Point) + + vertexes[0][0] :=x; // Set x Value Of First Vertex + vertexes[0][1] :=y; // Set y Value Of First Vertex + vertexes[0][2] :=z; // Set z Value Of First Vertex + + v :=(phi/180.0 * pi); // Calculate Angle Of Second Point ( 0 ) + u :=((theta+20)/180.0 * pi); // Calculate Angle Of Second Point ( 20 ) + + x :=cos(u)*(2 + cos(v))*r; // Calculate x Position (2nd Point) + y :=sin(u)*(2 + cos(v))*r; // Calculate y Position (2nd Point) + z :=(u-(2*pi) + sin(v))*r; // Calculate z Position (2nd Point) + + vertexes[1][0] :=x; // Set x Value Of Second Vertex + vertexes[1][1] :=y; // Set y Value Of Second Vertex + vertexes[1][2] :=z; // Set z Value Of Second Vertex + + v :=(phi+20)/180.0*pi; // Calculate Angle Of Third Point ( 20 ) + u :=(theta+20)/180.0*pi; // Calculate Angle Of Third Point ( 20 ) + + x :=cos(u)*(2 + cos(v))*r; // Calculate x Position (3rd Point) + y :=sin(u)*(2 + cos(v))*r; // Calculate y Position (3rd Point) + z :=(u-(2*pi) + sin(v))*r; // Calculate z Position (3rd Point) + + vertexes[2][0] :=x; // Set x Value Of Third Vertex + vertexes[2][1] :=y; // Set y Value Of Third Vertex + vertexes[2][2] :=z; // Set z Value Of Third Vertex + + v :=(phi+20)/180.0*pi; // Calculate Angle Of Fourth Point ( 20 ) + u :=theta / 180.0*pi; // Calculate Angle Of Fourth Point ( 0 ) + + x :=cos(u)*(2 + cos(v))*r; // Calculate x Position (4th Point) + y :=sin(u)*(2 + cos(v))*r; // Calculate y Position (4th Point) + z :=(u-(2*pi) + sin(v))*r; // Calculate z Position (4th Point) + + vertexes[3][0] :=x; // Set x Value Of Fourth Vertex + vertexes[3][1] :=y; // Set y Value Of Fourth Vertex + vertexes[3][2] :=z; // Set z Value Of Fourth Vertex + + calcNormal(vertexes, normal); // Calculate The Quad Normal + + glNormal3f(normal[0],normal[1],normal[2]); // Set The Normal + + // Render The Quad + glVertex3f(vertexes[0][0],vertexes[0][1],vertexes[0][2]); + glVertex3f(vertexes[1][0],vertexes[1][1],vertexes[1][2]); + glVertex3f(vertexes[2][0],vertexes[2][1],vertexes[2][2]); + glVertex3f(vertexes[3][0],vertexes[3][1],vertexes[3][2]); + theta := theta + 20; + end; + phi :=phi + 20; + end; + glEnd(); // Done Rendering Quads + glPopMatrix(); // Pop The Matrix +end; + + +// Set Up An Ortho View +procedure ViewOrtho; +begin + glMatrixMode(GL_PROJECTION); // Select Projection + glPushMatrix(); // Push The Matrix + glLoadIdentity(); // Reset The Matrix + glOrtho( 0, 640 , 480 , 0, -1, 1 ); // Select Ortho Mode (640x480) + glMatrixMode(GL_MODELVIEW); // Select Modelview Matrix + glPushMatrix(); // Push The Matrix + glLoadIdentity(); // Reset The Matrix +end; + + +// Set Up A Perspective View +procedure ViewPerspective; +begin + glMatrixMode( GL_PROJECTION ); // Select Projection + glPopMatrix(); // Pop The Matrix + glMatrixMode( GL_MODELVIEW ); // Select Modelview + glPopMatrix(); // Pop The Matrix +end; + + +// Renders To A Texture +procedure RenderToTexture; +begin + glViewport(0, 0, 128, 128); // Set Our Viewport (Match Texture Size) + ProcessHelix(); // Render The Helix + glBindTexture(GL_TEXTURE_2D,BlurTexture); // Bind To The Blur Texture + + // Copy Our ViewPort To The Blur Texture (From 0,0 To 128,128... No Border) + glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 0, 0, 128, 128, 0); + glClearColor(0.0, 0.0, 0.5, 0.5); // Set The Clear Color To Medium Blue + glClear(GL_COLOR_BUFFER_BIT OR GL_DEPTH_BUFFER_BIT); // Clear The Screen And Depth Buffer + glViewport(0, 0, 640 ,480); // Set Viewport (0,0 to 640x480) +end; + + +// Draw The Blurred Image +procedure DrawBlur(const times : Integer; const inc : glFloat); +var spost, alpha, alphainc : glFloat; + I : Integer; +begin + alpha := 0.2; + spost := 0.0; + glEnable(GL_TEXTURE_2D); // Enable 2D Texture Mapping + glDisable(GL_DEPTH_TEST); // Disable Depth Testing + glBlendFunc(GL_SRC_ALPHA,GL_ONE); // Set Blending Mode + glEnable(GL_BLEND); // Enable Blending + glBindTexture(GL_TEXTURE_2D,BlurTexture); // Bind To The Blur Texture + ViewOrtho(); // Switch To An Ortho View + + alphainc := alpha / times; // alphainc=0.2f / Times To Render Blur + + glBegin(GL_QUADS); // Begin Drawing Quads + // Number Of Times To Render Blur + For I :=0 to times-1 do + begin + glColor4f(1.0, 1.0, 1.0, alpha); // Set The Alpha Value (Starts At 0.2) + glTexCoord2f(0+spost,1-spost); // Texture Coordinate ( 0, 1 ) + glVertex2f(0,0); // First Vertex ( 0, 0 ) + + glTexCoord2f(0+spost,0+spost); // Texture Coordinate ( 0, 0 ) + glVertex2f(0,480); // Second Vertex ( 0, 480 ) + + glTexCoord2f(1-spost,0+spost); // Texture Coordinate ( 1, 0 ) + glVertex2f(640,480); // Third Vertex ( 640, 480 ) + + glTexCoord2f(1-spost,1-spost); // Texture Coordinate ( 1, 1 ) + glVertex2f(640,0); // Fourth Vertex ( 640, 0 ) + + spost := spost + inc; // Gradually Increase spost (Zooming Closer To Texture Center) + alpha := alpha - alphainc; // Gradually Decrease alpha (Gradually Fading Image Out) + end; + glEnd(); // Done Drawing Quads + + ViewPerspective(); // Switch To A Perspective View + + glEnable(GL_DEPTH_TEST); // Enable Depth Testing + glDisable(GL_TEXTURE_2D); // Disable 2D Texture Mapping + glDisable(GL_BLEND); // Disable Blending + glBindTexture(GL_TEXTURE_2D,0); // Unbind The Blur Texture +end; + +{------------------------------------------------------------------} +{ Function to draw the actual scene } +{------------------------------------------------------------------} +procedure glDraw; +begin + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer + glLoadIdentity(); // Reset The View + RenderToTexture; // Render To A Texture + ProcessHelix; // Draw Our Helix + DrawBlur(25, 0.02); // Draw The Blur Effect + + angle :=ElapsedTime / 5.0; // Update angle Based On The Clock +end; + + +{------------------------------------------------------------------} +{ Initialise OpenGL } +{------------------------------------------------------------------} +procedure glInit; +begin + glClearColor(0.0, 0.0, 0.0, 0.5); // Black Background + glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading + glClearDepth(1.0); // Depth Buffer Setup + glDepthFunc(GL_LESS); // The Type Of Depth Test To Do + + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Realy Nice perspective calculations + + glEnable(GL_DEPTH_TEST); // Enable Depth Buffer + glEnable(GL_TEXTURE_2D); // Enable Texture Mapping + + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @LmodelAmbient); // Set The Ambient Light Model + + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @GlobalAmbient); // Set The Global Ambient Light Model + glLightfv(GL_LIGHT0, GL_POSITION, @light0Pos); // Set The Lights Position + glLightfv(GL_LIGHT0, GL_AMBIENT, @light0Ambient); // Set The Ambient Light + glLightfv(GL_LIGHT0, GL_DIFFUSE, @light0Diffuse); // Set The Diffuse Light + glLightfv(GL_LIGHT0, GL_SPECULAR, @light0Specular); // Set Up Specular Lighting + glEnable(GL_LIGHTING); // Enable Lighting + glEnable(GL_LIGHT0); // Enable Light0 + + BlurTexture := EmptyTexture(); // Create Our Empty Texture + glShadeModel(GL_SMOOTH); // Select Smooth Shading + glMateriali(GL_FRONT, GL_SHININESS, 128); +end; + + +{------------------------------------------------------------------} +{ Handle window resize } +{------------------------------------------------------------------} +procedure glResizeWnd(Width, Height : Integer); +begin + if (Height = 0) then // prevent divide by zero exception + Height := 1; + glViewport(0, 0, Width, Height); // Set the viewport for the OpenGL window + glMatrixMode(GL_PROJECTION); // Change Matrix Mode to Projection + glLoadIdentity(); // Reset View + gluPerspective(45.0, Width/glFloat(Height), 2.0, 200.0); // Do the perspective calculations. Last value = max clipping depth + + glMatrixMode(GL_MODELVIEW); // Return to the modelview matrix + glLoadIdentity(); // Reset View +end; + + +var + DemoStart, LastTime : LongWord; + + +procedure DisplayWindow; cdecl; +begin + Inc(FPSCount); // Increment FPS Counter + + LastTime :=ElapsedTime; + ElapsedTime := glutGet(GLUT_ELAPSED_TIME) - DemoStart; // Calculate Elapsed Time + ElapsedTime :=(LastTime + ElapsedTime) DIV 2; // Average it out for smoother movement + glDraw; + glutSwapBuffers; + Inc(ElapsedTime, 10); + glutPostRedisplay; +end; + +procedure OnReshape(width, height: Integer); cdecl; +begin + glResizeWnd(width, height); +end; + + +begin + glutInit(@argc, argv); + glutInitDisplayMode(GLUT_RGB or GLUT_DOUBLE or GLUT_DEPTH); + glutCreateWindow(WND_TITLE); + glutDisplayFunc(@DisplayWindow); + glutReshapeFunc(@OnReshape); + glutInitWindowSize(640, 480); + + glInit; + + DemoStart := glutGet(GLUT_ELAPSED_TIME); + glutMainLoop; +end. diff --git a/packages/opengl/fpmake.pp b/packages/opengl/fpmake.pp new file mode 100644 index 0000000000..713538ca9f --- /dev/null +++ b/packages/opengl/fpmake.pp @@ -0,0 +1,37 @@ +{$ifndef ALLPACKAGES} +{$mode objfpc}{$H+} +program fpmake; + +uses fpmkunit; + +Var + P : TPackage; + T : TTarget; +begin + With Installer do + begin +{$endif ALLPACKAGES} + + P:=AddPackage('opengl'); +{$ifdef ALLPACKAGES} + P.Directory:='opengl'; +{$endif ALLPACKAGES} + P.Version:='2.0.0'; + P.SourcePath.Add('src'); + + T:=P.Targets.AddUnit('glext.pp'); + T:=P.Targets.AddUnit('gl.pp'); + T:=P.Targets.AddUnit('glu.pp'); + T:=P.Targets.AddUnit('glut.pp'); + T:=P.Targets.AddUnit('glx.pp'); + with T.Dependencies do + begin + AddUnit('xlib'); + end; + + +{$ifndef ALLPACKAGES} + Run; + end; +end. +{$endif ALLPACKAGES} diff --git a/packages/opengl/glunits.txt b/packages/opengl/glunits.txt new file mode 100644 index 0000000000..51c921ee25 --- /dev/null +++ b/packages/opengl/glunits.txt @@ -0,0 +1,46 @@ + glunits.zip +*************** + +These are the Delphi conversions of gl.h, glu.h, glut.h and +glext.h. Copy them to your Delphi\Lib directory or somewhere else +in your compiler's search path and you're all set! + +To use these units with OpenGL drivers other than Microsoft's, +you need to manually initialize three DLL libraries. For example: + + LoadOpenGL('opengl.dll'); + LoadGLu('glu.dll'); + LoadGlut('glut.dll'); // Optional + +If you do this, make sure to free the previously loaded library +first: + + FreeOpenGL; + FreeGLu; + FreeGlut; + +If the DLLs the application is trying to load cannot be found, an +exception will be raised. By default, the units will try to load +OpenGL32.dll, GLu32.dll and Glut32.dll. No exception will be +thrown if they are not found, so if you want to support multiple +OpenGL implementations in your app, it's probably best to +explicitly load the DLLs explicitly as shown above. This way, you +can properly trap errors. + +A final note: if you have a 3D card with an OpenGL ICD, you do NOT +need to load the driver yourself. Microsoft's OpenGL32.dll will +automatically detect and use your 3D card's drivers, so the +default settings in these units will work perfectly. + +The fourth file in this archive, glext.pas, contains declarations +of constants and function prototypes of most OpenGL extensions. +To use an extension, you just need to check if it's supported, and +load it's functions with wglGetProcAddress() if it is. You can +check the presence of an extension with the included function +glext_ExtensionSupported(). By using glext.pas, you no longer have +to copy/paste/translate declarations from the extension specs. If +you should come across an extension that isn't yet included in +glext.pas, I'd appreciate it if you could drop me a line so I can +add it ASAP. + + Tom Nuydens (tom@delphi3d.net) diff --git a/packages/opengl/readme b/packages/opengl/readme new file mode 100644 index 0000000000..9c03c5b1b0 --- /dev/null +++ b/packages/opengl/readme @@ -0,0 +1,22 @@ +New Free Pascal OpenGL (GL, GLU, GLUT, GLX) Units +GLX unit (c) 1999-2002 Sebastian Guenther, sg@freepascal.org +other units adapted to Free Pascal from the delphi3d.net units +by Tom Nuydens (tom@delphi3d.net), see http://www.delphi3d.net/ + +You might have a look at the original readme, glunits.txt, as well + + +Some remarks: +* The new OpenGL units are not 100% compatible to the old ones; the new units + use exactly the same function declarations as their C counterpart. +* Platform compatiblity: You can work on all targets exactly as on Win32; + for example, you can use wglGetProcAddress for loading OpenGL extensions even + on Unix based systems. A future release of the glext unit might have helper + functions for loading specific extensions. (There is a small problem with + Free Pascal: In FPC mode, you cannot assign a pointer, as returned by + wglGetProcAddress, to a variable which holds a function pointer. Currently + you have to compile your programs in Delphi mode, if they are using OpenGL + extensions) +* GLUT on Win32: Get the glut32.dll from here: + http://www.xmission.com/~nate/glut.html +* GTKGLArea: The GL Area widget for GTK is available in the GTK package diff --git a/packages/opengl/src/gl.pp b/packages/opengl/src/gl.pp new file mode 100644 index 0000000000..edcc998b2d --- /dev/null +++ b/packages/opengl/src/gl.pp @@ -0,0 +1,2346 @@ +{ + + Adaption of the delphi3d.net OpenGL units to FreePascal + Sebastian Guenther (sg@freepascal.org) in 2002 + These units are free to use +} + +(*++ BUILD Version: 0004 // Increment this if a change has global effects + +Copyright (c) 1985-96, Microsoft Corporation + +Module Name: + + gl.h + +Abstract: + + Procedure declarations, constant definitions and macros for the OpenGL + component. + +--*) + +{* +** Copyright 1996 Silicon Graphics, Inc. +** All Rights Reserved. +** +** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; +** the contents of this file may not be disclosed to third parties, copied or +** duplicated in any form, in whole or in part, without the prior written +** permission of Silicon Graphics, Inc. +** +** RESTRICTED RIGHTS LEGEND: +** Use, duplication or disclosure by the Government is subject to restrictions +** as set forth in subdivision (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, DOD or NASA FAR Supplement. Unpublished - +** rights reserved under the Copyright Laws of the United States. +*} + +{******************************************************************************} +{ Converted to Delphi by Tom Nuydens (tom@delphi3d.net) } +{ For the latest updates, visit Delphi3D: http://www.delphi3d.net } +{******************************************************************************} + +{$MODE Delphi} +{$MACRO ON} +{$IFDEF Windows} + {$DEFINE extdecl := stdcall} +{$ELSE} + {$DEFINE extdecl := cdecl} + {$IFDEF MorphOS} + {$INLINE ON} + {$DEFINE GL_UNIT} + {$ELSE} + {$LINKLIB c} + {$ENDIF} +{$ENDIF} + +unit GL; + +interface + +uses + SysUtils, + {$IFDEF Windows} + Windows, dynlibs + {$ELSE Windows} + {$IFDEF MorphOS} + TinyGL + {$ELSE MorphOS} + dynlibs + {$ENDIF MorphOS} + {$ENDIF Windows}; + +{$IFNDEF MORPHOS} +var + LibGL: TLibHandle; +{$ENDIF MORPHOS} + +type + GLenum = Cardinal; PGLenum = ^GLenum; + GLboolean = Byte; PGLboolean = ^GLboolean; + GLbitfield = Cardinal; PGLbitfield = ^GLbitfield; + GLbyte = ShortInt; PGLbyte = ^GLbyte; + GLshort = SmallInt; PGLshort = ^GLshort; + GLint = Integer; PGLint = ^GLint; + GLsizei = Integer; PGLsizei = ^GLsizei; + GLubyte = Byte; PGLubyte = ^GLubyte; + GLushort = Word; PGLushort = ^GLushort; + GLuint = Cardinal; PGLuint = ^GLuint; + GLfloat = Single; PGLfloat = ^GLfloat; + GLclampf = Single; PGLclampf = ^GLclampf; + GLdouble = Double; PGLdouble = ^GLdouble; + GLclampd = Double; PGLclampd = ^GLclampd; +{ GLvoid = void; } PGLvoid = Pointer; + PPGLvoid = ^PGLvoid; + + TGLenum = GLenum; + TGLboolean = GLboolean; + TGLbitfield = GLbitfield; + TGLbyte = GLbyte; + TGLshort = GLshort; + TGLint = GLint; + TGLsizei = GLsizei; + TGLubyte = GLubyte; + TGLushort = GLushort; + TGLuint = GLuint; + TGLfloat = GLfloat; + TGLclampf = GLclampf; + TGLdouble = GLdouble; + TGLclampd = GLclampd; + +{******************************************************************************} + +const + // Version + GL_VERSION_1_1 = 1; + + // AccumOp + GL_ACCUM = $0100; + GL_LOAD = $0101; + GL_RETURN = $0102; + GL_MULT = $0103; + GL_ADD = $0104; + + // AlphaFunction + GL_NEVER = $0200; + GL_LESS = $0201; + GL_EQUAL = $0202; + GL_LEQUAL = $0203; + GL_GREATER = $0204; + GL_NOTEQUAL = $0205; + GL_GEQUAL = $0206; + GL_ALWAYS = $0207; + + // AttribMask + GL_CURRENT_BIT = $00000001; + GL_POINT_BIT = $00000002; + GL_LINE_BIT = $00000004; + GL_POLYGON_BIT = $00000008; + GL_POLYGON_STIPPLE_BIT = $00000010; + GL_PIXEL_MODE_BIT = $00000020; + GL_LIGHTING_BIT = $00000040; + GL_FOG_BIT = $00000080; + GL_DEPTH_BUFFER_BIT = $00000100; + GL_ACCUM_BUFFER_BIT = $00000200; + GL_STENCIL_BUFFER_BIT = $00000400; + GL_VIEWPORT_BIT = $00000800; + GL_TRANSFORM_BIT = $00001000; + GL_ENABLE_BIT = $00002000; + GL_COLOR_BUFFER_BIT = $00004000; + GL_HINT_BIT = $00008000; + GL_EVAL_BIT = $00010000; + GL_LIST_BIT = $00020000; + GL_TEXTURE_BIT = $00040000; + GL_SCISSOR_BIT = $00080000; + GL_ALL_ATTRIB_BITS = $000FFFFF; + + // BeginMode + GL_POINTS = $0000; + GL_LINES = $0001; + GL_LINE_LOOP = $0002; + GL_LINE_STRIP = $0003; + GL_TRIANGLES = $0004; + GL_TRIANGLE_STRIP = $0005; + GL_TRIANGLE_FAN = $0006; + GL_QUADS = $0007; + GL_QUAD_STRIP = $0008; + GL_POLYGON = $0009; + + // BlendingFactorDest + GL_ZERO = 0; + GL_ONE = 1; + GL_SRC_COLOR = $0300; + GL_ONE_MINUS_SRC_COLOR = $0301; + GL_SRC_ALPHA = $0302; + GL_ONE_MINUS_SRC_ALPHA = $0303; + GL_DST_ALPHA = $0304; + GL_ONE_MINUS_DST_ALPHA = $0305; + + // BlendingFactorSrc + // GL_ZERO + // GL_ONE + GL_DST_COLOR = $0306; + GL_ONE_MINUS_DST_COLOR = $0307; + GL_SRC_ALPHA_SATURATE = $0308; + // GL_SRC_ALPHA + // GL_ONE_MINUS_SRC_ALPHA + // GL_DST_ALPHA + // GL_ONE_MINUS_DST_ALPHA + + // Boolean + GL_TRUE = 1; + GL_FALSE = 0; + + // ClearBufferMask + // GL_COLOR_BUFFER_BIT + // GL_ACCUM_BUFFER_BIT + // GL_STENCIL_BUFFER_BIT + // GL_DEPTH_BUFFER_BIT + + // ClientArrayType + // GL_VERTEX_ARRAY + // GL_NORMAL_ARRAY + // GL_COLOR_ARRAY + // GL_INDEX_ARRAY + // GL_TEXTURE_COORD_ARRAY + // GL_EDGE_FLAG_ARRAY + + // ClipPlaneName + GL_CLIP_PLANE0 = $3000; + GL_CLIP_PLANE1 = $3001; + GL_CLIP_PLANE2 = $3002; + GL_CLIP_PLANE3 = $3003; + GL_CLIP_PLANE4 = $3004; + GL_CLIP_PLANE5 = $3005; + + // ColorMaterialFace + // GL_FRONT + // GL_BACK + // GL_FRONT_AND_BACK + + // ColorMaterialParameter + // GL_AMBIENT + // GL_DIFFUSE + // GL_SPECULAR + // GL_EMISSION + // GL_AMBIENT_AND_DIFFUSE + + // ColorPointerType + // GL_BYTE + // GL_UNSIGNED_BYTE + // GL_SHORT + // GL_UNSIGNED_SHORT + // GL_INT + // GL_UNSIGNED_INT + // GL_FLOAT + // GL_DOUBLE + + // CullFaceMode + // GL_FRONT + // GL_BACK + // GL_FRONT_AND_BACK + + // DataType + GL_BYTE = $1400; + GL_UNSIGNED_BYTE = $1401; + GL_SHORT = $1402; + GL_UNSIGNED_SHORT = $1403; + GL_INT = $1404; + GL_UNSIGNED_INT = $1405; + GL_FLOAT = $1406; + GL_2_BYTES = $1407; + GL_3_BYTES = $1408; + GL_4_BYTES = $1409; + GL_DOUBLE = $140A; + + // DepthFunction + // GL_NEVER + // GL_LESS + // GL_EQUAL + // GL_LEQUAL + // GL_GREATER + // GL_NOTEQUAL + // GL_GEQUAL + // GL_ALWAYS + + // DrawBufferMode + GL_NONE = 0; + GL_FRONT_LEFT = $0400; + GL_FRONT_RIGHT = $0401; + GL_BACK_LEFT = $0402; + GL_BACK_RIGHT = $0403; + GL_FRONT = $0404; + GL_BACK = $0405; + GL_LEFT = $0406; + GL_RIGHT = $0407; + GL_FRONT_AND_BACK = $0408; + GL_AUX0 = $0409; + GL_AUX1 = $040A; + GL_AUX2 = $040B; + GL_AUX3 = $040C; + + // Enable + // GL_FOG + // GL_LIGHTING + // GL_TEXTURE_1D + // GL_TEXTURE_2D + // GL_LINE_STIPPLE + // GL_POLYGON_STIPPLE + // GL_CULL_FACE + // GL_ALPHA_TEST + // GL_BLEND + // GL_INDEX_LOGIC_OP + // GL_COLOR_LOGIC_OP + // GL_DITHER + // GL_STENCIL_TEST + // GL_DEPTH_TEST + // GL_CLIP_PLANE0 + // GL_CLIP_PLANE1 + // GL_CLIP_PLANE2 + // GL_CLIP_PLANE3 + // GL_CLIP_PLANE4 + // GL_CLIP_PLANE5 + // GL_LIGHT0 + // GL_LIGHT1 + // GL_LIGHT2 + // GL_LIGHT3 + // GL_LIGHT4 + // GL_LIGHT5 + // GL_LIGHT6 + // GL_LIGHT7 + // GL_TEXTURE_GEN_S + // GL_TEXTURE_GEN_T + // GL_TEXTURE_GEN_R + // GL_TEXTURE_GEN_Q + // GL_MAP1_VERTEX_3 + // GL_MAP1_VERTEX_4 + // GL_MAP1_COLOR_4 + // GL_MAP1_INDEX + // GL_MAP1_NORMAL + // GL_MAP1_TEXTURE_COORD_1 + // GL_MAP1_TEXTURE_COORD_2 + // GL_MAP1_TEXTURE_COORD_3 + // GL_MAP1_TEXTURE_COORD_4 + // GL_MAP2_VERTEX_3 + // GL_MAP2_VERTEX_4 + // GL_MAP2_COLOR_4 + // GL_MAP2_INDEX + // GL_MAP2_NORMAL + // GL_MAP2_TEXTURE_COORD_1 + // GL_MAP2_TEXTURE_COORD_2 + // GL_MAP2_TEXTURE_COORD_3 + // GL_MAP2_TEXTURE_COORD_4 + // GL_POINT_SMOOTH + // GL_LINE_SMOOTH + // GL_POLYGON_SMOOTH + // GL_SCISSOR_TEST + // GL_COLOR_MATERIAL + // GL_NORMALIZE + // GL_AUTO_NORMAL + // GL_VERTEX_ARRAY + // GL_NORMAL_ARRAY + // GL_COLOR_ARRAY + // GL_INDEX_ARRAY + // GL_TEXTURE_COORD_ARRAY + // GL_EDGE_FLAG_ARRAY + // GL_POLYGON_OFFSET_POINT + // GL_POLYGON_OFFSET_LINE + // GL_POLYGON_OFFSET_FILL + + // ErrorCode + GL_NO_ERROR = 0; + GL_INVALID_ENUM = $0500; + GL_INVALID_VALUE = $0501; + GL_INVALID_OPERATION = $0502; + GL_STACK_OVERFLOW = $0503; + GL_STACK_UNDERFLOW = $0504; + GL_OUT_OF_MEMORY = $0505; + + // FeedBackMode + GL_2D = $0600; + GL_3D = $0601; + GL_3D_COLOR = $0602; + GL_3D_COLOR_TEXTURE = $0603; + GL_4D_COLOR_TEXTURE = $0604; + + // FeedBackToken + GL_PASS_THROUGH_TOKEN = $0700; + GL_POINT_TOKEN = $0701; + GL_LINE_TOKEN = $0702; + GL_POLYGON_TOKEN = $0703; + GL_BITMAP_TOKEN = $0704; + GL_DRAW_PIXEL_TOKEN = $0705; + GL_COPY_PIXEL_TOKEN = $0706; + GL_LINE_RESET_TOKEN = $0707; + + // FogMode + // GL_LINEAR + GL_EXP = $0800; + GL_EXP2 = $0801; + + // FogParameter + // GL_FOG_COLOR + // GL_FOG_DENSITY + // GL_FOG_END + // GL_FOG_INDEX + // GL_FOG_MODE + // GL_FOG_START + + // FrontFaceDirection + GL_CW = $0900; + GL_CCW = $0901; + + // GetMapTarget + GL_COEFF = $0A00; + GL_ORDER = $0A01; + GL_DOMAIN = $0A02; + + // GetPixelMap + // GL_PIXEL_MAP_I_TO_I + // GL_PIXEL_MAP_S_TO_S + // GL_PIXEL_MAP_I_TO_R + // GL_PIXEL_MAP_I_TO_G + // GL_PIXEL_MAP_I_TO_B + // GL_PIXEL_MAP_I_TO_A + // GL_PIXEL_MAP_R_TO_R + // GL_PIXEL_MAP_G_TO_G + // GL_PIXEL_MAP_B_TO_B + // GL_PIXEL_MAP_A_TO_A + + // GetPointerTarget + // GL_VERTEX_ARRAY_POINTER + // GL_NORMAL_ARRAY_POINTER + // GL_COLOR_ARRAY_POINTER + // GL_INDEX_ARRAY_POINTER + // GL_TEXTURE_COORD_ARRAY_POINTER + // GL_EDGE_FLAG_ARRAY_POINTER + + // GetTarget + GL_CURRENT_COLOR = $0B00; + GL_CURRENT_INDEX = $0B01; + GL_CURRENT_NORMAL = $0B02; + GL_CURRENT_TEXTURE_COORDS = $0B03; + GL_CURRENT_RASTER_COLOR = $0B04; + GL_CURRENT_RASTER_INDEX = $0B05; + GL_CURRENT_RASTER_TEXTURE_COORDS = $0B06; + GL_CURRENT_RASTER_POSITION = $0B07; + GL_CURRENT_RASTER_POSITION_VALID = $0B08; + GL_CURRENT_RASTER_DISTANCE = $0B09; + GL_POINT_SMOOTH = $0B10; + GL_POINT_SIZE = $0B11; + GL_POINT_SIZE_RANGE = $0B12; + GL_POINT_SIZE_GRANULARITY = $0B13; + GL_LINE_SMOOTH = $0B20; + GL_LINE_WIDTH = $0B21; + GL_LINE_WIDTH_RANGE = $0B22; + GL_LINE_WIDTH_GRANULARITY = $0B23; + GL_LINE_STIPPLE = $0B24; + GL_LINE_STIPPLE_PATTERN = $0B25; + GL_LINE_STIPPLE_REPEAT = $0B26; + GL_LIST_MODE = $0B30; + GL_MAX_LIST_NESTING = $0B31; + GL_LIST_BASE = $0B32; + GL_LIST_INDEX = $0B33; + GL_POLYGON_MODE = $0B40; + GL_POLYGON_SMOOTH = $0B41; + GL_POLYGON_STIPPLE = $0B42; + GL_EDGE_FLAG = $0B43; + GL_CULL_FACE = $0B44; + GL_CULL_FACE_MODE = $0B45; + GL_FRONT_FACE = $0B46; + GL_LIGHTING = $0B50; + GL_LIGHT_MODEL_LOCAL_VIEWER = $0B51; + GL_LIGHT_MODEL_TWO_SIDE = $0B52; + GL_LIGHT_MODEL_AMBIENT = $0B53; + GL_SHADE_MODEL = $0B54; + GL_COLOR_MATERIAL_FACE = $0B55; + GL_COLOR_MATERIAL_PARAMETER = $0B56; + GL_COLOR_MATERIAL = $0B57; + GL_FOG = $0B60; + GL_FOG_INDEX = $0B61; + GL_FOG_DENSITY = $0B62; + GL_FOG_START = $0B63; + GL_FOG_END = $0B64; + GL_FOG_MODE = $0B65; + GL_FOG_COLOR = $0B66; + GL_DEPTH_RANGE = $0B70; + GL_DEPTH_TEST = $0B71; + GL_DEPTH_WRITEMASK = $0B72; + GL_DEPTH_CLEAR_VALUE = $0B73; + GL_DEPTH_FUNC = $0B74; + GL_ACCUM_CLEAR_VALUE = $0B80; + GL_STENCIL_TEST = $0B90; + GL_STENCIL_CLEAR_VALUE = $0B91; + GL_STENCIL_FUNC = $0B92; + GL_STENCIL_VALUE_MASK = $0B93; + GL_STENCIL_FAIL = $0B94; + GL_STENCIL_PASS_DEPTH_FAIL = $0B95; + GL_STENCIL_PASS_DEPTH_PASS = $0B96; + GL_STENCIL_REF = $0B97; + GL_STENCIL_WRITEMASK = $0B98; + GL_MATRIX_MODE = $0BA0; + GL_NORMALIZE = $0BA1; + GL_VIEWPORT = $0BA2; + GL_MODELVIEW_STACK_DEPTH = $0BA3; + GL_PROJECTION_STACK_DEPTH = $0BA4; + GL_TEXTURE_STACK_DEPTH = $0BA5; + GL_MODELVIEW_MATRIX = $0BA6; + GL_PROJECTION_MATRIX = $0BA7; + GL_TEXTURE_MATRIX = $0BA8; + GL_ATTRIB_STACK_DEPTH = $0BB0; + GL_CLIENT_ATTRIB_STACK_DEPTH = $0BB1; + GL_ALPHA_TEST = $0BC0; + GL_ALPHA_TEST_FUNC = $0BC1; + GL_ALPHA_TEST_REF = $0BC2; + GL_DITHER = $0BD0; + GL_BLEND_DST = $0BE0; + GL_BLEND_SRC = $0BE1; + GL_BLEND = $0BE2; + GL_LOGIC_OP_MODE = $0BF0; + GL_INDEX_LOGIC_OP = $0BF1; + GL_COLOR_LOGIC_OP = $0BF2; + GL_AUX_BUFFERS = $0C00; + GL_DRAW_BUFFER = $0C01; + GL_READ_BUFFER = $0C02; + GL_SCISSOR_BOX = $0C10; + GL_SCISSOR_TEST = $0C11; + GL_INDEX_CLEAR_VALUE = $0C20; + GL_INDEX_WRITEMASK = $0C21; + GL_COLOR_CLEAR_VALUE = $0C22; + GL_COLOR_WRITEMASK = $0C23; + GL_INDEX_MODE = $0C30; + GL_RGBA_MODE = $0C31; + GL_DOUBLEBUFFER = $0C32; + GL_STEREO = $0C33; + GL_RENDER_MODE = $0C40; + GL_PERSPECTIVE_CORRECTION_HINT = $0C50; + GL_POINT_SMOOTH_HINT = $0C51; + GL_LINE_SMOOTH_HINT = $0C52; + GL_POLYGON_SMOOTH_HINT = $0C53; + GL_FOG_HINT = $0C54; + GL_TEXTURE_GEN_S = $0C60; + GL_TEXTURE_GEN_T = $0C61; + GL_TEXTURE_GEN_R = $0C62; + GL_TEXTURE_GEN_Q = $0C63; + GL_PIXEL_MAP_I_TO_I = $0C70; + GL_PIXEL_MAP_S_TO_S = $0C71; + GL_PIXEL_MAP_I_TO_R = $0C72; + GL_PIXEL_MAP_I_TO_G = $0C73; + GL_PIXEL_MAP_I_TO_B = $0C74; + GL_PIXEL_MAP_I_TO_A = $0C75; + GL_PIXEL_MAP_R_TO_R = $0C76; + GL_PIXEL_MAP_G_TO_G = $0C77; + GL_PIXEL_MAP_B_TO_B = $0C78; + GL_PIXEL_MAP_A_TO_A = $0C79; + GL_PIXEL_MAP_I_TO_I_SIZE = $0CB0; + GL_PIXEL_MAP_S_TO_S_SIZE = $0CB1; + GL_PIXEL_MAP_I_TO_R_SIZE = $0CB2; + GL_PIXEL_MAP_I_TO_G_SIZE = $0CB3; + GL_PIXEL_MAP_I_TO_B_SIZE = $0CB4; + GL_PIXEL_MAP_I_TO_A_SIZE = $0CB5; + GL_PIXEL_MAP_R_TO_R_SIZE = $0CB6; + GL_PIXEL_MAP_G_TO_G_SIZE = $0CB7; + GL_PIXEL_MAP_B_TO_B_SIZE = $0CB8; + GL_PIXEL_MAP_A_TO_A_SIZE = $0CB9; + GL_UNPACK_SWAP_BYTES = $0CF0; + GL_UNPACK_LSB_FIRST = $0CF1; + GL_UNPACK_ROW_LENGTH = $0CF2; + GL_UNPACK_SKIP_ROWS = $0CF3; + GL_UNPACK_SKIP_PIXELS = $0CF4; + GL_UNPACK_ALIGNMENT = $0CF5; + GL_PACK_SWAP_BYTES = $0D00; + GL_PACK_LSB_FIRST = $0D01; + GL_PACK_ROW_LENGTH = $0D02; + GL_PACK_SKIP_ROWS = $0D03; + GL_PACK_SKIP_PIXELS = $0D04; + GL_PACK_ALIGNMENT = $0D05; + GL_MAP_COLOR = $0D10; + GL_MAP_STENCIL = $0D11; + GL_INDEX_SHIFT = $0D12; + GL_INDEX_OFFSET = $0D13; + GL_RED_SCALE = $0D14; + GL_RED_BIAS = $0D15; + GL_ZOOM_X = $0D16; + GL_ZOOM_Y = $0D17; + GL_GREEN_SCALE = $0D18; + GL_GREEN_BIAS = $0D19; + GL_BLUE_SCALE = $0D1A; + GL_BLUE_BIAS = $0D1B; + GL_ALPHA_SCALE = $0D1C; + GL_ALPHA_BIAS = $0D1D; + GL_DEPTH_SCALE = $0D1E; + GL_DEPTH_BIAS = $0D1F; + GL_MAX_EVAL_ORDER = $0D30; + GL_MAX_LIGHTS = $0D31; + GL_MAX_CLIP_PLANES = $0D32; + GL_MAX_TEXTURE_SIZE = $0D33; + GL_MAX_PIXEL_MAP_TABLE = $0D34; + GL_MAX_ATTRIB_STACK_DEPTH = $0D35; + GL_MAX_MODELVIEW_STACK_DEPTH = $0D36; + GL_MAX_NAME_STACK_DEPTH = $0D37; + GL_MAX_PROJECTION_STACK_DEPTH = $0D38; + GL_MAX_TEXTURE_STACK_DEPTH = $0D39; + GL_MAX_VIEWPORT_DIMS = $0D3A; + GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = $0D3B; + GL_SUBPIXEL_BITS = $0D50; + GL_INDEX_BITS = $0D51; + GL_RED_BITS = $0D52; + GL_GREEN_BITS = $0D53; + GL_BLUE_BITS = $0D54; + GL_ALPHA_BITS = $0D55; + GL_DEPTH_BITS = $0D56; + GL_STENCIL_BITS = $0D57; + GL_ACCUM_RED_BITS = $0D58; + GL_ACCUM_GREEN_BITS = $0D59; + GL_ACCUM_BLUE_BITS = $0D5A; + GL_ACCUM_ALPHA_BITS = $0D5B; + GL_NAME_STACK_DEPTH = $0D70; + GL_AUTO_NORMAL = $0D80; + GL_MAP1_COLOR_4 = $0D90; + GL_MAP1_INDEX = $0D91; + GL_MAP1_NORMAL = $0D92; + GL_MAP1_TEXTURE_COORD_1 = $0D93; + GL_MAP1_TEXTURE_COORD_2 = $0D94; + GL_MAP1_TEXTURE_COORD_3 = $0D95; + GL_MAP1_TEXTURE_COORD_4 = $0D96; + GL_MAP1_VERTEX_3 = $0D97; + GL_MAP1_VERTEX_4 = $0D98; + GL_MAP2_COLOR_4 = $0DB0; + GL_MAP2_INDEX = $0DB1; + GL_MAP2_NORMAL = $0DB2; + GL_MAP2_TEXTURE_COORD_1 = $0DB3; + GL_MAP2_TEXTURE_COORD_2 = $0DB4; + GL_MAP2_TEXTURE_COORD_3 = $0DB5; + GL_MAP2_TEXTURE_COORD_4 = $0DB6; + GL_MAP2_VERTEX_3 = $0DB7; + GL_MAP2_VERTEX_4 = $0DB8; + GL_MAP1_GRID_DOMAIN = $0DD0; + GL_MAP1_GRID_SEGMENTS = $0DD1; + GL_MAP2_GRID_DOMAIN = $0DD2; + GL_MAP2_GRID_SEGMENTS = $0DD3; + GL_TEXTURE_1D = $0DE0; + GL_TEXTURE_2D = $0DE1; + GL_FEEDBACK_BUFFER_POINTER = $0DF0; + GL_FEEDBACK_BUFFER_SIZE = $0DF1; + GL_FEEDBACK_BUFFER_TYPE = $0DF2; + GL_SELECTION_BUFFER_POINTER = $0DF3; + GL_SELECTION_BUFFER_SIZE = $0DF4; + // GL_TEXTURE_BINDING_1D + // GL_TEXTURE_BINDING_2D + // GL_VERTEX_ARRAY + // GL_NORMAL_ARRAY + // GL_COLOR_ARRAY + // GL_INDEX_ARRAY + // GL_TEXTURE_COORD_ARRAY + // GL_EDGE_FLAG_ARRAY + // GL_VERTEX_ARRAY_SIZE + // GL_VERTEX_ARRAY_TYPE + // GL_VERTEX_ARRAY_STRIDE + // GL_NORMAL_ARRAY_TYPE + // GL_NORMAL_ARRAY_STRIDE + // GL_COLOR_ARRAY_SIZE + // GL_COLOR_ARRAY_TYPE + // GL_COLOR_ARRAY_STRIDE + // GL_INDEX_ARRAY_TYPE + // GL_INDEX_ARRAY_STRIDE + // GL_TEXTURE_COORD_ARRAY_SIZE + // GL_TEXTURE_COORD_ARRAY_TYPE + // GL_TEXTURE_COORD_ARRAY_STRIDE + // GL_EDGE_FLAG_ARRAY_STRIDE + // GL_POLYGON_OFFSET_FACTOR + // GL_POLYGON_OFFSET_UNITS + + // GetTextureParameter + // GL_TEXTURE_MAG_FILTER + // GL_TEXTURE_MIN_FILTER + // GL_TEXTURE_WRAP_S + // GL_TEXTURE_WRAP_T + GL_TEXTURE_WIDTH = $1000; + GL_TEXTURE_HEIGHT = $1001; + GL_TEXTURE_INTERNAL_FORMAT = $1003; + GL_TEXTURE_BORDER_COLOR = $1004; + GL_TEXTURE_BORDER = $1005; + // GL_TEXTURE_RED_SIZE + // GL_TEXTURE_GREEN_SIZE + // GL_TEXTURE_BLUE_SIZE + // GL_TEXTURE_ALPHA_SIZE + // GL_TEXTURE_LUMINANCE_SIZE + // GL_TEXTURE_INTENSITY_SIZE + // GL_TEXTURE_PRIORITY + // GL_TEXTURE_RESIDENT + + // HintMode + GL_DONT_CARE = $1100; + GL_FASTEST = $1101; + GL_NICEST = $1102; + + // HintTarget + // GL_PERSPECTIVE_CORRECTION_HINT + // GL_POINT_SMOOTH_HINT + // GL_LINE_SMOOTH_HINT + // GL_POLYGON_SMOOTH_HINT + // GL_FOG_HINT + + // IndexPointerType + // GL_SHORT + // GL_INT + // GL_FLOAT + // GL_DOUBLE + + // LightModelParameter + // GL_LIGHT_MODEL_AMBIENT + // GL_LIGHT_MODEL_LOCAL_VIEWER + // GL_LIGHT_MODEL_TWO_SIDE + + // LightName + GL_LIGHT0 = $4000; + GL_LIGHT1 = $4001; + GL_LIGHT2 = $4002; + GL_LIGHT3 = $4003; + GL_LIGHT4 = $4004; + GL_LIGHT5 = $4005; + GL_LIGHT6 = $4006; + GL_LIGHT7 = $4007; + + // LightParameter + GL_AMBIENT = $1200; + GL_DIFFUSE = $1201; + GL_SPECULAR = $1202; + GL_POSITION = $1203; + GL_SPOT_DIRECTION = $1204; + GL_SPOT_EXPONENT = $1205; + GL_SPOT_CUTOFF = $1206; + GL_CONSTANT_ATTENUATION = $1207; + GL_LINEAR_ATTENUATION = $1208; + GL_QUADRATIC_ATTENUATION = $1209; + + // InterleavedArrays + // GL_V2F + // GL_V3F + // GL_C4UB_V2F + // GL_C4UB_V3F + // GL_C3F_V3F + // GL_N3F_V3F + // GL_C4F_N3F_V3F + // GL_T2F_V3F + // GL_T4F_V4F + // GL_T2F_C4UB_V3F + // GL_T2F_C3F_V3F + // GL_T2F_N3F_V3F + // GL_T2F_C4F_N3F_V3F + // GL_T4F_C4F_N3F_V4F + + // ListMode + GL_COMPILE = $1300; + GL_COMPILE_AND_EXECUTE = $1301; + + // ListNameType + // GL_BYTE + // GL_UNSIGNED_BYTE + // GL_SHORT + // GL_UNSIGNED_SHORT + // GL_INT + // GL_UNSIGNED_INT + // GL_FLOAT + // GL_2_BYTES + // GL_3_BYTES + // GL_4_BYTES + + // LogicOp + GL_CLEAR = $1500; + GL_AND = $1501; + GL_AND_REVERSE = $1502; + GL_COPY = $1503; + GL_AND_INVERTED = $1504; + GL_NOOP = $1505; + GL_XOR = $1506; + GL_OR = $1507; + GL_NOR = $1508; + GL_EQUIV = $1509; + GL_INVERT = $150A; + GL_OR_REVERSE = $150B; + GL_COPY_INVERTED = $150C; + GL_OR_INVERTED = $150D; + GL_NAND = $150E; + GL_SET = $150F; + + // MapTarget + // GL_MAP1_COLOR_4 + // GL_MAP1_INDEX + // GL_MAP1_NORMAL + // GL_MAP1_TEXTURE_COORD_1 + // GL_MAP1_TEXTURE_COORD_2 + // GL_MAP1_TEXTURE_COORD_3 + // GL_MAP1_TEXTURE_COORD_4 + // GL_MAP1_VERTEX_3 + // GL_MAP1_VERTEX_4 + // GL_MAP2_COLOR_4 + // GL_MAP2_INDEX + // GL_MAP2_NORMAL + // GL_MAP2_TEXTURE_COORD_1 + // GL_MAP2_TEXTURE_COORD_2 + // GL_MAP2_TEXTURE_COORD_3 + // GL_MAP2_TEXTURE_COORD_4 + // GL_MAP2_VERTEX_3 + // GL_MAP2_VERTEX_4 + + // MaterialFace + // GL_FRONT + // GL_BACK + // GL_FRONT_AND_BACK + + // MaterialParameter + GL_EMISSION = $1600; + GL_SHININESS = $1601; + GL_AMBIENT_AND_DIFFUSE = $1602; + GL_COLOR_INDEXES = $1603; + // GL_AMBIENT + // GL_DIFFUSE + // GL_SPECULAR + + // MatrixMode + GL_MODELVIEW = $1700; + GL_PROJECTION = $1701; + GL_TEXTURE = $1702; + + // MeshMode1 + // GL_POINT + // GL_LINE + + // MeshMode2 + // GL_POINT + // GL_LINE + // GL_FILL + + // NormalPointerType + // GL_BYTE + // GL_SHORT + // GL_INT + // GL_FLOAT + // GL_DOUBLE + + // PixelCopyType + GL_COLOR = $1800; + GL_DEPTH = $1801; + GL_STENCIL = $1802; + + // PixelFormat + GL_COLOR_INDEX = $1900; + GL_STENCIL_INDEX = $1901; + GL_DEPTH_COMPONENT = $1902; + GL_RED = $1903; + GL_GREEN = $1904; + GL_BLUE = $1905; + GL_ALPHA = $1906; + GL_RGB = $1907; + GL_RGBA = $1908; + GL_LUMINANCE = $1909; + GL_LUMINANCE_ALPHA = $190A; + + // PixelMap + // GL_PIXEL_MAP_I_TO_I + // GL_PIXEL_MAP_S_TO_S + // GL_PIXEL_MAP_I_TO_R + // GL_PIXEL_MAP_I_TO_G + // GL_PIXEL_MAP_I_TO_B + // GL_PIXEL_MAP_I_TO_A + // GL_PIXEL_MAP_R_TO_R + // GL_PIXEL_MAP_G_TO_G + // GL_PIXEL_MAP_B_TO_B + // GL_PIXEL_MAP_A_TO_A + + // PixelStore + // GL_UNPACK_SWAP_BYTES + // GL_UNPACK_LSB_FIRST + // GL_UNPACK_ROW_LENGTH + // GL_UNPACK_SKIP_ROWS + // GL_UNPACK_SKIP_PIXELS + // GL_UNPACK_ALIGNMENT + // GL_PACK_SWAP_BYTES + // GL_PACK_LSB_FIRST + // GL_PACK_ROW_LENGTH + // GL_PACK_SKIP_ROWS + // GL_PACK_SKIP_PIXELS + // GL_PACK_ALIGNMENT + + // PixelTransfer + // GL_MAP_COLOR + // GL_MAP_STENCIL + // GL_INDEX_SHIFT + // GL_INDEX_OFFSET + // GL_RED_SCALE + // GL_RED_BIAS + // GL_GREEN_SCALE + // GL_GREEN_BIAS + // GL_BLUE_SCALE + // GL_BLUE_BIAS + // GL_ALPHA_SCALE + // GL_ALPHA_BIAS + // GL_DEPTH_SCALE + // GL_DEPTH_BIAS + + // PixelType + GL_BITMAP = $1A00; + // GL_BYTE + // GL_UNSIGNED_BYTE + // GL_SHORT + // GL_UNSIGNED_SHORT + // GL_INT + // GL_UNSIGNED_INT + // GL_FLOAT + + // PolygonMode + GL_POINT = $1B00; + GL_LINE = $1B01; + GL_FILL = $1B02; + + // ReadBufferMode + // GL_FRONT_LEFT + // GL_FRONT_RIGHT + // GL_BACK_LEFT + // GL_BACK_RIGHT + // GL_FRONT + // GL_BACK + // GL_LEFT + // GL_RIGHT + // GL_AUX0 + // GL_AUX1 + // GL_AUX2 + // GL_AUX3 + + // RenderingMode + GL_RENDER = $1C00; + GL_FEEDBACK = $1C01; + GL_SELECT = $1C02; + + // ShadingModel + GL_FLAT = $1D00; + GL_SMOOTH = $1D01; + + // StencilFunction + // GL_NEVER + // GL_LESS + // GL_EQUAL + // GL_LEQUAL + // GL_GREATER + // GL_NOTEQUAL + // GL_GEQUAL + // GL_ALWAYS + + // StencilOp + // GL_ZERO + GL_KEEP = $1E00; + GL_REPLACE = $1E01; + GL_INCR = $1E02; + GL_DECR = $1E03; + // GL_INVERT + + // StringName + GL_VENDOR = $1F00; + GL_RENDERER = $1F01; + GL_VERSION = $1F02; + GL_EXTENSIONS = $1F03; + + // TextureCoordName + GL_S = $2000; + GL_T = $2001; + GL_R = $2002; + GL_Q = $2003; + + // TexCoordPointerType + // GL_SHORT + // GL_INT + // GL_FLOAT + // GL_DOUBLE + + // TextureEnvMode + GL_MODULATE = $2100; + GL_DECAL = $2101; + // GL_BLEND + // GL_REPLACE + + // TextureEnvParameter + GL_TEXTURE_ENV_MODE = $2200; + GL_TEXTURE_ENV_COLOR = $2201; + + // TextureEnvTarget + GL_TEXTURE_ENV = $2300; + + // TextureGenMode + GL_EYE_LINEAR = $2400; + GL_OBJECT_LINEAR = $2401; + GL_SPHERE_MAP = $2402; + + // TextureGenParameter + GL_TEXTURE_GEN_MODE = $2500; + GL_OBJECT_PLANE = $2501; + GL_EYE_PLANE = $2502; + + // TextureMagFilter + GL_NEAREST = $2600; + GL_LINEAR = $2601; + + // TextureMinFilter + // GL_NEAREST + // GL_LINEAR + GL_NEAREST_MIPMAP_NEAREST = $2700; + GL_LINEAR_MIPMAP_NEAREST = $2701; + GL_NEAREST_MIPMAP_LINEAR = $2702; + GL_LINEAR_MIPMAP_LINEAR = $2703; + + // TextureParameterName + GL_TEXTURE_MAG_FILTER = $2800; + GL_TEXTURE_MIN_FILTER = $2801; + GL_TEXTURE_WRAP_S = $2802; + GL_TEXTURE_WRAP_T = $2803; + // GL_TEXTURE_BORDER_COLOR + // GL_TEXTURE_PRIORITY + + // TextureTarget + // GL_TEXTURE_1D + // GL_TEXTURE_2D + // GL_PROXY_TEXTURE_1D + // GL_PROXY_TEXTURE_2D + + // TextureWrapMode + GL_CLAMP = $2900; + GL_REPEAT = $2901; + + // VertexPointerType + // GL_SHORT + // GL_INT + // GL_FLOAT + // GL_DOUBLE + + // ClientAttribMask + GL_CLIENT_PIXEL_STORE_BIT = $00000001; + GL_CLIENT_VERTEX_ARRAY_BIT = $00000002; + GL_CLIENT_ALL_ATTRIB_BITS = $FFFFFFFF; + + // polygon_offset + GL_POLYGON_OFFSET_FACTOR = $8038; + GL_POLYGON_OFFSET_UNITS = $2A00; + GL_POLYGON_OFFSET_POINT = $2A01; + GL_POLYGON_OFFSET_LINE = $2A02; + GL_POLYGON_OFFSET_FILL = $8037; + + // texture + GL_ALPHA4 = $803B; + GL_ALPHA8 = $803C; + GL_ALPHA12 = $803D; + GL_ALPHA16 = $803E; + GL_LUMINANCE4 = $803F; + GL_LUMINANCE8 = $8040; + GL_LUMINANCE12 = $8041; + GL_LUMINANCE16 = $8042; + GL_LUMINANCE4_ALPHA4 = $8043; + GL_LUMINANCE6_ALPHA2 = $8044; + GL_LUMINANCE8_ALPHA8 = $8045; + GL_LUMINANCE12_ALPHA4 = $8046; + GL_LUMINANCE12_ALPHA12 = $8047; + GL_LUMINANCE16_ALPHA16 = $8048; + GL_INTENSITY = $8049; + GL_INTENSITY4 = $804A; + GL_INTENSITY8 = $804B; + GL_INTENSITY12 = $804C; + GL_INTENSITY16 = $804D; + GL_R3_G3_B2 = $2A10; + GL_RGB4 = $804F; + GL_RGB5 = $8050; + GL_RGB8 = $8051; + GL_RGB10 = $8052; + GL_RGB12 = $8053; + GL_RGB16 = $8054; + GL_RGBA2 = $8055; + GL_RGBA4 = $8056; + GL_RGB5_A1 = $8057; + GL_RGBA8 = $8058; + GL_RGB10_A2 = $8059; + GL_RGBA12 = $805A; + GL_RGBA16 = $805B; + GL_TEXTURE_RED_SIZE = $805C; + GL_TEXTURE_GREEN_SIZE = $805D; + GL_TEXTURE_BLUE_SIZE = $805E; + GL_TEXTURE_ALPHA_SIZE = $805F; + GL_TEXTURE_LUMINANCE_SIZE = $8060; + GL_TEXTURE_INTENSITY_SIZE = $8061; + GL_PROXY_TEXTURE_1D = $8063; + GL_PROXY_TEXTURE_2D = $8064; + + // texture_object + GL_TEXTURE_PRIORITY = $8066; + GL_TEXTURE_RESIDENT = $8067; + GL_TEXTURE_BINDING_1D = $8068; + GL_TEXTURE_BINDING_2D = $8069; + + // vertex_array + GL_VERTEX_ARRAY = $8074; + GL_NORMAL_ARRAY = $8075; + GL_COLOR_ARRAY = $8076; + GL_INDEX_ARRAY = $8077; + GL_TEXTURE_COORD_ARRAY = $8078; + GL_EDGE_FLAG_ARRAY = $8079; + GL_VERTEX_ARRAY_SIZE = $807A; + GL_VERTEX_ARRAY_TYPE = $807B; + GL_VERTEX_ARRAY_STRIDE = $807C; + GL_NORMAL_ARRAY_TYPE = $807E; + GL_NORMAL_ARRAY_STRIDE = $807F; + GL_COLOR_ARRAY_SIZE = $8081; + GL_COLOR_ARRAY_TYPE = $8082; + GL_COLOR_ARRAY_STRIDE = $8083; + GL_INDEX_ARRAY_TYPE = $8085; + GL_INDEX_ARRAY_STRIDE = $8086; + GL_TEXTURE_COORD_ARRAY_SIZE = $8088; + GL_TEXTURE_COORD_ARRAY_TYPE = $8089; + GL_TEXTURE_COORD_ARRAY_STRIDE = $808A; + GL_EDGE_FLAG_ARRAY_STRIDE = $808C; + GL_VERTEX_ARRAY_POINTER = $808E; + GL_NORMAL_ARRAY_POINTER = $808F; + GL_COLOR_ARRAY_POINTER = $8090; + GL_INDEX_ARRAY_POINTER = $8091; + GL_TEXTURE_COORD_ARRAY_POINTER = $8092; + GL_EDGE_FLAG_ARRAY_POINTER = $8093; + GL_V2F = $2A20; + GL_V3F = $2A21; + GL_C4UB_V2F = $2A22; + GL_C4UB_V3F = $2A23; + GL_C3F_V3F = $2A24; + GL_N3F_V3F = $2A25; + GL_C4F_N3F_V3F = $2A26; + GL_T2F_V3F = $2A27; + GL_T4F_V4F = $2A28; + GL_T2F_C4UB_V3F = $2A29; + GL_T2F_C3F_V3F = $2A2A; + GL_T2F_N3F_V3F = $2A2B; + GL_T2F_C4F_N3F_V3F = $2A2C; + GL_T4F_C4F_N3F_V4F = $2A2D; + + // Extensions + GL_EXT_vertex_array = 1; + GL_WIN_swap_hint = 1; + GL_EXT_bgra = 1; + GL_EXT_paletted_texture = 1; + + // EXT_vertex_array + GL_VERTEX_ARRAY_EXT = $8074; + GL_NORMAL_ARRAY_EXT = $8075; + GL_COLOR_ARRAY_EXT = $8076; + GL_INDEX_ARRAY_EXT = $8077; + GL_TEXTURE_COORD_ARRAY_EXT = $8078; + GL_EDGE_FLAG_ARRAY_EXT = $8079; + GL_VERTEX_ARRAY_SIZE_EXT = $807A; + GL_VERTEX_ARRAY_TYPE_EXT = $807B; + GL_VERTEX_ARRAY_STRIDE_EXT = $807C; + GL_VERTEX_ARRAY_COUNT_EXT = $807D; + GL_NORMAL_ARRAY_TYPE_EXT = $807E; + GL_NORMAL_ARRAY_STRIDE_EXT = $807F; + GL_NORMAL_ARRAY_COUNT_EXT = $8080; + GL_COLOR_ARRAY_SIZE_EXT = $8081; + GL_COLOR_ARRAY_TYPE_EXT = $8082; + GL_COLOR_ARRAY_STRIDE_EXT = $8083; + GL_COLOR_ARRAY_COUNT_EXT = $8084; + GL_INDEX_ARRAY_TYPE_EXT = $8085; + GL_INDEX_ARRAY_STRIDE_EXT = $8086; + GL_INDEX_ARRAY_COUNT_EXT = $8087; + GL_TEXTURE_COORD_ARRAY_SIZE_EXT = $8088; + GL_TEXTURE_COORD_ARRAY_TYPE_EXT = $8089; + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = $808A; + GL_TEXTURE_COORD_ARRAY_COUNT_EXT = $808B; + GL_EDGE_FLAG_ARRAY_STRIDE_EXT = $808C; + GL_EDGE_FLAG_ARRAY_COUNT_EXT = $808D; + GL_VERTEX_ARRAY_POINTER_EXT = $808E; + GL_NORMAL_ARRAY_POINTER_EXT = $808F; + GL_COLOR_ARRAY_POINTER_EXT = $8090; + GL_INDEX_ARRAY_POINTER_EXT = $8091; + GL_TEXTURE_COORD_ARRAY_POINTER_EXT = $8092; + GL_EDGE_FLAG_ARRAY_POINTER_EXT = $8093; + GL_DOUBLE_EXT = GL_DOUBLE; + + // EXT_bgra + GL_BGR_EXT = $80E0; + GL_BGRA_EXT = $80E1; + + // EXT_paletted_texture + + // These must match the GL_COLOR_TABLE_*_SGI enumerants + GL_COLOR_TABLE_FORMAT_EXT = $80D8; + GL_COLOR_TABLE_WIDTH_EXT = $80D9; + GL_COLOR_TABLE_RED_SIZE_EXT = $80DA; + GL_COLOR_TABLE_GREEN_SIZE_EXT = $80DB; + GL_COLOR_TABLE_BLUE_SIZE_EXT = $80DC; + GL_COLOR_TABLE_ALPHA_SIZE_EXT = $80DD; + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = $80DE; + GL_COLOR_TABLE_INTENSITY_SIZE_EXT = $80DF; + + GL_COLOR_INDEX1_EXT = $80E2; + GL_COLOR_INDEX2_EXT = $80E3; + GL_COLOR_INDEX4_EXT = $80E4; + GL_COLOR_INDEX8_EXT = $80E5; + GL_COLOR_INDEX12_EXT = $80E6; + GL_COLOR_INDEX16_EXT = $80E7; + + // For compatibility with OpenGL v1.0 + GL_LOGIC_OP = GL_INDEX_LOGIC_OP; + GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT; + +{******************************************************************************} + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its headers are included here. } +{$INCLUDE tinyglh.inc} + +{$ELSE MORPHOS} +var + glAccum: procedure(op: GLenum; value: GLfloat); extdecl; + glAlphaFunc: procedure(func: GLenum; ref: GLclampf); extdecl; + glAreTexturesResident: function (n: GLsizei; const textures: PGLuint; residences: PGLboolean): GLboolean; extdecl; + glArrayElement: procedure(i: GLint); extdecl; + glBegin: procedure(mode: GLenum); extdecl; + glBindTexture: procedure(target: GLenum; texture: GLuint); extdecl; + glBitmap: procedure (width, height: GLsizei; xorig, yorig: GLfloat; xmove, ymove: GLfloat; const bitmap: PGLubyte); extdecl; + glBlendFunc: procedure(sfactor, dfactor: GLenum); extdecl; + glCallList: procedure(list: GLuint); extdecl; + glCallLists: procedure(n: GLsizei; atype: GLenum; const lists: Pointer); extdecl; + glClear: procedure(mask: GLbitfield); extdecl; + glClearAccum: procedure(red, green, blue, alpha: GLfloat); extdecl; + glClearColor: procedure(red, green, blue, alpha: GLclampf); extdecl; + glClearDepth: procedure(depth: GLclampd); extdecl; + glClearIndex: procedure(c: GLfloat); extdecl; + glClearStencil: procedure(s: GLint); extdecl; + glClipPlane: procedure(plane: GLenum; const equation: PGLdouble); extdecl; + glColor3b: procedure(red, green, blue: GLbyte); extdecl; + glColor3bv: procedure(const v: PGLbyte); extdecl; + glColor3d: procedure(red, green, blue: GLdouble); extdecl; + glColor3dv: procedure(const v: PGLdouble); extdecl; + glColor3f: procedure(red, green, blue: GLfloat); extdecl; + glColor3fv: procedure(const v: PGLfloat); extdecl; + glColor3i: procedure(red, green, blue: GLint); extdecl; + glColor3iv: procedure(const v: PGLint); extdecl; + glColor3s: procedure(red, green, blue: GLshort); extdecl; + glColor3sv: procedure(const v: PGLshort); extdecl; + glColor3ub: procedure(red, green, blue: GLubyte); extdecl; + glColor3ubv: procedure(const v: PGLubyte); extdecl; + glColor3ui: procedure(red, green, blue: GLuint); extdecl; + glColor3uiv: procedure(const v: PGLuint); extdecl; + glColor3us: procedure(red, green, blue: GLushort); extdecl; + glColor3usv: procedure(const v: PGLushort); extdecl; + glColor4b: procedure(red, green, blue, alpha: GLbyte); extdecl; + glColor4bv: procedure(const v: PGLbyte); extdecl; + glColor4d: procedure(red, green, blue, alpha: GLdouble); extdecl; + glColor4dv: procedure(const v: PGLdouble); extdecl; + glColor4f: procedure(red, green, blue, alpha: GLfloat); extdecl; + glColor4fv: procedure(const v: PGLfloat); extdecl; + glColor4i: procedure(red, green, blue, alpha: GLint); extdecl; + glColor4iv: procedure(const v: PGLint); extdecl; + glColor4s: procedure(red, green, blue, alpha: GLshort); extdecl; + glColor4sv: procedure(const v: PGLshort); extdecl; + glColor4ub: procedure(red, green, blue, alpha: GLubyte); extdecl; + glColor4ubv: procedure(const v: PGLubyte); extdecl; + glColor4ui: procedure(red, green, blue, alpha: GLuint); extdecl; + glColor4uiv: procedure(const v: PGLuint); extdecl; + glColor4us: procedure(red, green, blue, alpha: GLushort); extdecl; + glColor4usv: procedure(const v: PGLushort); extdecl; + glColorMask: procedure(red, green, blue, alpha: GLboolean); extdecl; + glColorMaterial: procedure(face, mode: GLenum); extdecl; + glColorPointer: procedure(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glCopyPixels: procedure(x, y: GLint; width, height: GLsizei; atype: GLenum); extdecl; + glCopyTexImage1D: procedure (target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width: GLsizei; border: GLint); extdecl; + glCopyTexImage2D: procedure(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); extdecl; + glCopyTexSubImage1D: procedure(target: GLenum; level, xoffset, x, y: GLint; width: GLsizei); extdecl; + glCopyTexSubImage2D: procedure(target: GLenum; level, xoffset, yoffset, x, y: GLint; width, height: GLsizei); extdecl; + glCullFace: procedure(mode: GLenum); extdecl; + glDeleteLists: procedure(list: GLuint; range: GLsizei); extdecl; + glDeleteTextures: procedure(n: GLsizei; const textures: PGLuint); extdecl; + glDepthFunc: procedure(func: GLenum); extdecl; + glDepthMask: procedure(flag: GLboolean); extdecl; + glDepthRange: procedure(zNear, zFar: GLclampd); extdecl; + glDisable: procedure(cap: GLenum); extdecl; + glDisableClientState: procedure(aarray: GLenum); extdecl; + glDrawArrays: procedure(mode: GLenum; first: GLint; count: GLsizei); extdecl; + glDrawBuffer: procedure(mode: GLenum); extdecl; + glDrawElements: procedure(mode: GLenum; count: GLsizei; atype: GLenum; const indices: Pointer); extdecl; + glDrawPixels: procedure(width, height: GLsizei; format, atype: GLenum; const pixels: Pointer); extdecl; + glEdgeFlag: procedure(flag: GLboolean); extdecl; + glEdgeFlagPointer: procedure(stride: GLsizei; const pointer: Pointer); extdecl; + glEdgeFlagv: procedure(const flag: PGLboolean); extdecl; + glEnable: procedure(cap: GLenum); extdecl; + glEnableClientState: procedure(aarray: GLenum); extdecl; + glEnd: procedure; extdecl; + glEndList: procedure; extdecl; + glEvalCoord1d: procedure(u: GLdouble); extdecl; + glEvalCoord1dv: procedure(const u: PGLdouble); extdecl; + glEvalCoord1f: procedure(u: GLfloat); extdecl; + glEvalCoord1fv: procedure(const u: PGLfloat); extdecl; + glEvalCoord2d: procedure(u, v: GLdouble); extdecl; + glEvalCoord2dv: procedure(const u: PGLdouble); extdecl; + glEvalCoord2f: procedure(u, v: GLfloat); extdecl; + glEvalCoord2fv: procedure(const u: PGLfloat); extdecl; + glEvalMesh1: procedure(mode: GLenum; i1, i2: GLint); extdecl; + glEvalMesh2: procedure(mode: GLenum; i1, i2, j1, j2: GLint); extdecl; + glEvalPoint1: procedure(i: GLint); extdecl; + glEvalPoint2: procedure(i, j: GLint); extdecl; + glFeedbackBuffer: procedure(size: GLsizei; atype: GLenum; buffer: PGLfloat); extdecl; + glFinish: procedure; extdecl; + glFlush: procedure; extdecl; + glFogf: procedure(pname: GLenum; param: GLfloat); extdecl; + glFogfv: procedure(pname: GLenum; const params: PGLfloat); extdecl; + glFogi: procedure(pname: GLenum; param: GLint); extdecl; + glFogiv: procedure(pname: GLenum; const params: PGLint); extdecl; + glFrontFace: procedure(mode: GLenum); extdecl; + glFrustum: procedure(left, right, bottom, top, zNear, zFar: GLdouble); extdecl; + glGenLists: function(range: GLsizei): GLuint; extdecl; + glGenTextures: procedure(n: GLsizei; textures: PGLuint); extdecl; + glGetBooleanv: procedure(pname: GLenum; params: PGLboolean); extdecl; + glGetClipPlane: procedure(plane: GLenum; equation: PGLdouble); extdecl; + glGetDoublev: procedure(pname: GLenum; params: PGLdouble); extdecl; + glGetError: function: GLenum; extdecl; + glGetFloatv: procedure(pname: GLenum; params: PGLfloat); extdecl; + glGetIntegerv: procedure(pname: GLenum; params: PGLint); extdecl; + glGetLightfv: procedure(light, pname: GLenum; params: PGLfloat); extdecl; + glGetLightiv: procedure(light, pname: GLenum; params: PGLint); extdecl; + glGetMapdv: procedure(target, query: GLenum; v: PGLdouble); extdecl; + glGetMapfv: procedure(target, query: GLenum; v: PGLfloat); extdecl; + glGetMapiv: procedure(target, query: GLenum; v: PGLint); extdecl; + glGetMaterialfv: procedure(face, pname: GLenum; params: PGLfloat); extdecl; + glGetMaterialiv: procedure(face, pname: GLenum; params: PGLint); extdecl; + glGetPixelMapfv: procedure(map: GLenum; values: PGLfloat); extdecl; + glGetPixelMapuiv: procedure(map: GLenum; values: PGLuint); extdecl; + glGetPixelMapusv: procedure(map: GLenum; values: PGLushort); extdecl; + glGetPointerv: procedure(pname: GLenum; params: Pointer); extdecl; + glGetPolygonStipple: procedure(mask: PGLubyte); extdecl; + glGetString: function(name: GLenum): PChar; extdecl; + glGetTexEnvfv: procedure(target, pname: GLenum; params: PGLfloat); extdecl; + glGetTexEnviv: procedure(target, pname: GLenum; params: PGLint); extdecl; + glGetTexGendv: procedure(coord, pname: GLenum; params: PGLdouble); extdecl; + glGetTexGenfv: procedure(coord, pname: GLenum; params: PGLfloat); extdecl; + glGetTexGeniv: procedure(coord, pname: GLenum; params: PGLint); extdecl; + glGetTexImage: procedure(target: GLenum; level: GLint; format: GLenum; atype: GLenum; pixels: Pointer); extdecl; + glGetTexLevelParameterfv: procedure(target: GLenum; level: GLint; pname: GLenum; params: Pointer); extdecl; + glGetTexLevelParameteriv: procedure(target: GLenum; level: GLint; pname: GLenum; params: PGLint); extdecl; + glGetTexParameterfv: procedure(target, pname: GLenum; params: PGLfloat); extdecl; + glGetTexParameteriv: procedure(target, pname: GLenum; params: PGLint); extdecl; + glHint: procedure(target, mode: GLenum); extdecl; + glIndexMask: procedure(mask: GLuint); extdecl; + glIndexPointer: procedure(atype: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glIndexd: procedure(c: GLdouble); extdecl; + glIndexdv: procedure(const c: PGLdouble); extdecl; + glIndexf: procedure(c: GLfloat); extdecl; + glIndexfv: procedure(const c: PGLfloat); extdecl; + glIndexi: procedure(c: GLint); extdecl; + glIndexiv: procedure(const c: PGLint); extdecl; + glIndexs: procedure(c: GLshort); extdecl; + glIndexsv: procedure(const c: PGLshort); extdecl; + glIndexub: procedure(c: GLubyte); extdecl; + glIndexubv: procedure(const c: PGLubyte); extdecl; + glInitNames: procedure; extdecl; + glInterleavedArrays: procedure(format: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glIsEnabled: function(cap: GLenum): GLboolean; extdecl; + glIsList: function(list: GLuint): GLboolean; extdecl; + glIsTexture: function(texture: GLuint): GLboolean; extdecl; + glLightModelf: procedure(pname: GLenum; param: GLfloat); extdecl; + glLightModelfv: procedure(pname: GLenum; const params: PGLfloat); extdecl; + glLightModeli: procedure(pname: GLenum; param: GLint); extdecl; + glLightModeliv: procedure(pname: GLenum; const params: PGLint); extdecl; + glLightf: procedure(light, pname: GLenum; param: GLfloat); extdecl; + glLightfv: procedure(light, pname: GLenum; const params: PGLfloat); extdecl; + glLighti: procedure(light, pname: GLenum; param: GLint); extdecl; + glLightiv: procedure(light, pname: GLenum; const params: PGLint); extdecl; + glLineStipple: procedure(factor: GLint; pattern: GLushort); extdecl; + glLineWidth: procedure(width: GLfloat); extdecl; + glListBase: procedure(base: GLuint); extdecl; + glLoadIdentity: procedure; extdecl; + glLoadMatrixd: procedure(const m: PGLdouble); extdecl; + glLoadMatrixf: procedure(const m: PGLfloat); extdecl; + glLoadName: procedure(name: GLuint); extdecl; + glLogicOp: procedure(opcode: GLenum); extdecl; + glMap1d: procedure(target: GLenum; u1, u2: GLdouble; stride, order: GLint; const points: PGLdouble); extdecl; + glMap1f: procedure(target: GLenum; u1, u2: GLfloat; stride, order: GLint; const points: PGLfloat); extdecl; + glMap2d: procedure(target: GLenum; u1, u2: GLdouble; ustride, uorder: GLint; v1, v2: GLdouble; vstride, vorder: GLint; const points: PGLdouble); extdecl; + glMap2f: procedure(target: GLenum; u1, u2: GLfloat; ustride, uorder: GLint; v1, v2: GLfloat; vstride, vorder: GLint; const points: PGLfloat); extdecl; + glMapGrid1d: procedure(un: GLint; u1, u2: GLdouble); extdecl; + glMapGrid1f: procedure(un: GLint; u1, u2: GLfloat); extdecl; + glMapGrid2d: procedure(un: GLint; u1, u2: GLdouble; vn: GLint; v1, v2: GLdouble); extdecl; + glMapGrid2f: procedure(un: GLint; u1, u2: GLfloat; vn: GLint; v1, v2: GLfloat); extdecl; + glMaterialf: procedure(face, pname: GLenum; param: GLfloat); extdecl; + glMaterialfv: procedure(face, pname: GLenum; const params: PGLfloat); extdecl; + glMateriali: procedure(face, pname: GLenum; param: GLint); extdecl; + glMaterialiv: procedure(face, pname: GLenum; const params: PGLint); extdecl; + glMatrixMode: procedure(mode: GLenum); extdecl; + glMultMatrixd: procedure(const m: PGLdouble); extdecl; + glMultMatrixf: procedure(const m: PGLfloat); extdecl; + glNewList: procedure(list: GLuint; mode: GLenum); extdecl; + glNormal3b: procedure(nx, ny, nz: GLbyte); extdecl; + glNormal3bv: procedure(const v: PGLbyte); extdecl; + glNormal3d: procedure(nx, ny, nz: GLdouble); extdecl; + glNormal3dv: procedure(const v: PGLdouble); extdecl; + glNormal3f: procedure(nx, ny, nz: GLfloat); extdecl; + glNormal3fv: procedure(const v: PGLfloat); extdecl; + glNormal3i: procedure(nx, ny, nz: GLint); extdecl; + glNormal3iv: procedure(const v: PGLint); extdecl; + glNormal3s: procedure(nx, ny, nz: GLshort); extdecl; + glNormal3sv: procedure(const v: PGLshort); extdecl; + glNormalPointer: procedure(atype: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glOrtho: procedure(left, right, bottom, top, zNear, zFar: GLdouble); extdecl; + glPassThrough: procedure(token: GLfloat); extdecl; + glPixelMapfv: procedure(map: GLenum; mapsize: GLsizei; const values: PGLfloat); extdecl; + glPixelMapuiv: procedure(map: GLenum; mapsize: GLsizei; const values: PGLuint); extdecl; + glPixelMapusv: procedure(map: GLenum; mapsize: GLsizei; const values: PGLushort); extdecl; + glPixelStoref: procedure(pname: GLenum; param: GLfloat); extdecl; + glPixelStorei: procedure(pname: GLenum; param: GLint); extdecl; + glPixelTransferf: procedure(pname: GLenum; param: GLfloat); extdecl; + glPixelTransferi: procedure(pname: GLenum; param: GLint); extdecl; + glPixelZoom: procedure(xfactor, yfactor: GLfloat); extdecl; + glPointSize: procedure(size: GLfloat); extdecl; + glPolygonMode: procedure(face, mode: GLenum); extdecl; + glPolygonOffset: procedure(factor, units: GLfloat); extdecl; + glPolygonStipple: procedure(const mask: PGLubyte); extdecl; + glPopAttrib: procedure; extdecl; + glPopClientAttrib: procedure; extdecl; + glPopMatrix: procedure; extdecl; + glPopName: procedure; extdecl; + glPrioritizeTextures: procedure(n: GLsizei; const textures: PGLuint; const priorities: PGLclampf); extdecl; + glPushAttrib: procedure(mask: GLbitfield); extdecl; + glPushClientAttrib: procedure(mask: GLbitfield); extdecl; + glPushMatrix: procedure; extdecl; + glPushName: procedure(name: GLuint); extdecl; + glRasterPos2d: procedure(x, y: GLdouble); extdecl; + glRasterPos2dv: procedure(const v: PGLdouble); extdecl; + glRasterPos2f: procedure(x, y: GLfloat); extdecl; + glRasterPos2fv: procedure(const v: PGLfloat); extdecl; + glRasterPos2i: procedure(x, y: GLint); extdecl; + glRasterPos2iv: procedure(const v: PGLint); extdecl; + glRasterPos2s: procedure(x, y: GLshort); extdecl; + glRasterPos2sv: procedure(const v: PGLshort); extdecl; + glRasterPos3d: procedure(x, y, z: GLdouble); extdecl; + glRasterPos3dv: procedure(const v: PGLdouble); extdecl; + glRasterPos3f: procedure(x, y, z: GLfloat); extdecl; + glRasterPos3fv: procedure(const v: PGLfloat); extdecl; + glRasterPos3i: procedure(x, y, z: GLint); extdecl; + glRasterPos3iv: procedure(const v: PGLint); extdecl; + glRasterPos3s: procedure(x, y, z: GLshort); extdecl; + glRasterPos3sv: procedure(const v: PGLshort); extdecl; + glRasterPos4d: procedure(x, y, z, w: GLdouble); extdecl; + glRasterPos4dv: procedure(const v: PGLdouble); extdecl; + glRasterPos4f: procedure(x, y, z, w: GLfloat); extdecl; + glRasterPos4fv: procedure(const v: PGLfloat); extdecl; + glRasterPos4i: procedure(x, y, z, w: GLint); extdecl; + glRasterPos4iv: procedure(const v: PGLint); extdecl; + glRasterPos4s: procedure(x, y, z, w: GLshort); extdecl; + glRasterPos4sv: procedure(const v: PGLshort); extdecl; + glReadBuffer: procedure(mode: GLenum); extdecl; + glReadPixels: procedure(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); extdecl; + glRectd: procedure(x1, y1, x2, y2: GLdouble); extdecl; + glRectdv: procedure(const v1: PGLdouble; const v2: PGLdouble); extdecl; + glRectf: procedure(x1, y1, x2, y2: GLfloat); extdecl; + glRectfv: procedure(const v1: PGLfloat; const v2: PGLfloat); extdecl; + glRecti: procedure(x1, y1, x2, y2: GLint); extdecl; + glRectiv: procedure(const v1: PGLint; const v2: PGLint); extdecl; + glRects: procedure(x1, y1, x2, y2: GLshort); extdecl; + glRectsv: procedure(const v1: PGLshort; const v2: PGLshort); extdecl; + glRenderMode: function(mode: GLint): GLint; extdecl; + glRotated: procedure(angle, x, y, z: GLdouble); extdecl; + glRotatef: procedure(angle, x, y, z: GLfloat); extdecl; + glScaled: procedure(x, y, z: GLdouble); extdecl; + glScalef: procedure(x, y, z: GLfloat); extdecl; + glScissor: procedure(x, y: GLint; width, height: GLsizei); extdecl; + glSelectBuffer: procedure(size: GLsizei; buffer: PGLuint); extdecl; + glShadeModel: procedure(mode: GLenum); extdecl; + glStencilFunc: procedure(func: GLenum; ref: GLint; mask: GLuint); extdecl; + glStencilMask: procedure(mask: GLuint); extdecl; + glStencilOp: procedure(fail, zfail, zpass: GLenum); extdecl; + glTexCoord1d: procedure(s: GLdouble); extdecl; + glTexCoord1dv: procedure(const v: PGLdouble); extdecl; + glTexCoord1f: procedure(s: GLfloat); extdecl; + glTexCoord1fv: procedure(const v: PGLfloat); extdecl; + glTexCoord1i: procedure(s: GLint); extdecl; + glTexCoord1iv: procedure(const v: PGLint); extdecl; + glTexCoord1s: procedure(s: GLshort); extdecl; + glTexCoord1sv: procedure(const v: PGLshort); extdecl; + glTexCoord2d: procedure(s, t: GLdouble); extdecl; + glTexCoord2dv: procedure(const v: PGLdouble); extdecl; + glTexCoord2f: procedure(s, t: GLfloat); extdecl; + glTexCoord2fv: procedure(const v: PGLfloat); extdecl; + glTexCoord2i: procedure(s, t: GLint); extdecl; + glTexCoord2iv: procedure(const v: PGLint); extdecl; + glTexCoord2s: procedure(s, t: GLshort); extdecl; + glTexCoord2sv: procedure(const v: PGLshort); extdecl; + glTexCoord3d: procedure(s, t, r: GLdouble); extdecl; + glTexCoord3dv: procedure(const v: PGLdouble); extdecl; + glTexCoord3f: procedure(s, t, r: GLfloat); extdecl; + glTexCoord3fv: procedure(const v: PGLfloat); extdecl; + glTexCoord3i: procedure(s, t, r: GLint); extdecl; + glTexCoord3iv: procedure(const v: PGLint); extdecl; + glTexCoord3s: procedure(s, t, r: GLshort); extdecl; + glTexCoord3sv: procedure(const v: PGLshort); extdecl; + glTexCoord4d: procedure(s, t, r, q: GLdouble); extdecl; + glTexCoord4dv: procedure(const v: PGLdouble); extdecl; + glTexCoord4f: procedure(s, t, r, q: GLfloat); extdecl; + glTexCoord4fv: procedure(const v: PGLfloat); extdecl; + glTexCoord4i: procedure(s, t, r, q: GLint); extdecl; + glTexCoord4iv: procedure(const v: PGLint); extdecl; + glTexCoord4s: procedure(s, t, r, q: GLshort); extdecl; + glTexCoord4sv: procedure(const v: PGLshort); extdecl; + glTexCoordPointer: procedure(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glTexEnvf: procedure(target: GLenum; pname: GLenum; param: GLfloat); extdecl; + glTexEnvfv: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glTexEnvi: procedure(target: GLenum; pname: GLenum; param: GLint); extdecl; + glTexEnviv: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glTexGend: procedure(coord: GLenum; pname: GLenum; param: GLdouble); extdecl; + glTexGendv: procedure(coord: GLenum; pname: GLenum; const params: PGLdouble); extdecl; + glTexGenf: procedure(coord: GLenum; pname: GLenum; param: GLfloat); extdecl; + glTexGenfv: procedure(coord: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glTexGeni: procedure(coord: GLenum; pname: GLenum; param: GLint); extdecl; + glTexGeniv: procedure(coord: GLenum; pname: GLenum; const params: PGLint); extdecl; + glTexImage1D: procedure(target: GLenum; level, internalformat: GLint; width: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer); extdecl; + glTexImage2D: procedure(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer); extdecl; + glTexParameterf: procedure(target: GLenum; pname: GLenum; param: GLfloat); extdecl; + glTexParameterfv: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glTexParameteri: procedure(target: GLenum; pname: GLenum; param: GLint); extdecl; + glTexParameteriv: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glTexSubImage1D: procedure(target: GLenum; level, xoffset: GLint; width: GLsizei; format, atype: GLenum; const pixels: Pointer); extdecl; + glTexSubImage2D: procedure(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; const pixels: Pointer); extdecl; + glTranslated: procedure(x, y, z: GLdouble); extdecl; + glTranslatef: procedure(x, y, z: GLfloat); extdecl; + glVertex2d: procedure(x, y: GLdouble); extdecl; + glVertex2dv: procedure(const v: PGLdouble); extdecl; + glVertex2f: procedure(x, y: GLfloat); extdecl; + glVertex2fv: procedure(const v: PGLfloat); extdecl; + glVertex2i: procedure(x, y: GLint); extdecl; + glVertex2iv: procedure(const v: PGLint); extdecl; + glVertex2s: procedure(x, y: GLshort); extdecl; + glVertex2sv: procedure(const v: PGLshort); extdecl; + glVertex3d: procedure(x, y, z: GLdouble); extdecl; + glVertex3dv: procedure(const v: PGLdouble); extdecl; + glVertex3f: procedure(x, y, z: GLfloat); extdecl; + glVertex3fv: procedure(const v: PGLfloat); extdecl; + glVertex3i: procedure(x, y, z: GLint); extdecl; + glVertex3iv: procedure(const v: PGLint); extdecl; + glVertex3s: procedure(x, y, z: GLshort); extdecl; + glVertex3sv: procedure(const v: PGLshort); extdecl; + glVertex4d: procedure(x, y, z, w: GLdouble); extdecl; + glVertex4dv: procedure(const v: PGLdouble); extdecl; + glVertex4f: procedure(x, y, z, w: GLfloat); extdecl; + glVertex4fv: procedure(const v: PGLfloat); extdecl; + glVertex4i: procedure(x, y, z, w: GLint); extdecl; + glVertex4iv: procedure(const v: PGLint); extdecl; + glVertex4s: procedure(x, y, z, w: GLshort); extdecl; + glVertex4sv: procedure(const v: PGLshort); extdecl; + glVertexPointer: procedure(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); extdecl; + glViewport: procedure(x, y: GLint; width, height: GLsizei); extdecl; + {$IFDEF Windows} + ChoosePixelFormat: function(DC: HDC; p2: PPixelFormatDescriptor): Integer; extdecl; + {$ENDIF} +{$ENDIF MORPHOS} + +type + // EXT_vertex_array + PFNGLARRAYELEMENTEXTPROC = procedure(i: GLint); extdecl; + PFNGLDRAWARRAYSEXTPROC = procedure(mode: GLenum; first: GLint; count: GLsizei); extdecl; + PFNGLVERTEXPOINTEREXTPROC = procedure(size: GLint; atype: GLenum; + stride, count: GLsizei; const pointer: Pointer); extdecl; + PFNGLNORMALPOINTEREXTPROC = procedure(atype: GLenum; stride, count: GLsizei; + const pointer: Pointer); extdecl; + PFNGLCOLORPOINTEREXTPROC = procedure(size: GLint; atype: GLenum; stride, count: GLsizei; + const pointer: Pointer); extdecl; + PFNGLINDEXPOINTEREXTPROC = procedure(atype: GLenum; stride, count: GLsizei; + const pointer: Pointer); extdecl; + PFNGLTEXCOORDPOINTEREXTPROC = procedure(size: GLint; atype: GLenum; + stride, count: GLsizei; const pointer: Pointer); extdecl; + PFNGLEDGEFLAGPOINTEREXTPROC = procedure(stride, count: GLsizei; + const pointer: PGLboolean); extdecl; + PFNGLGETPOINTERVEXTPROC = procedure(pname: GLenum; params: Pointer); extdecl; + PFNGLARRAYELEMENTARRAYEXTPROC = procedure(mode: GLenum; count: GLsizei; + const pi: Pointer); extdecl; + + // WIN_swap_hint + PFNGLADDSWAPHINTRECTWINPROC = procedure(x, y: GLint; width, height: GLsizei); extdecl; + + // EXT_paletted_texture + PFNGLCOLORTABLEEXTPROC = procedure(target, internalFormat: GLenum; width: GLsizei; + format, atype: GLenum; const data: Pointer); extdecl; + PFNGLCOLORSUBTABLEEXTPROC = procedure(target: GLenum; start, count: GLsizei; + format, atype: GLenum; const data: Pointer); extdecl; + PFNGLGETCOLORTABLEEXTPROC = procedure(target, format, atype: GLenum; data: Pointer); extdecl; + PFNGLGETCOLORTABLEPARAMETERIVEXTPROC = procedure(target, pname: GLenum; params: PGLint); extdecl; + PFNGLGETCOLORTABLEPARAMETERFVEXTPROC = procedure(target, pname: GLenum; params: PGLfloat); extdecl; + +procedure LoadOpenGL(const dll: String); +procedure FreeOpenGL; + +implementation + +{$if defined(cpui386) or defined(cpux86_64)} +uses + math; +{$endif} + +{$ifdef windows} +function WinChoosePixelFormat(DC: HDC; p2: PPixelFormatDescriptor): Integer; extdecl; external 'gdi32' name 'ChoosePixelFormat'; +{$endif} + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its functions are included here. } +{$INCLUDE tinygl.inc} + +{$ENDIF MORPHOS} + +procedure FreeOpenGL; +begin +{$IFDEF MORPHOS} + + // MorphOS's GL will closed down by TinyGL unit, nothing is needed here. + +{$ELSE MORPHOS} + @glAccum := nil; + @glAlphaFunc := nil; + @glAreTexturesResident := nil; + @glArrayElement := nil; + @glBegin := nil; + @glBindTexture := nil; + @glBitmap := nil; + @glBlendFunc := nil; + @glCallList := nil; + @glCallLists := nil; + @glClear := nil; + @glClearAccum := nil; + @glClearColor := nil; + @glClearDepth := nil; + @glClearIndex := nil; + @glClearStencil := nil; + @glClipPlane := nil; + @glColor3b := nil; + @glColor3bv := nil; + @glColor3d := nil; + @glColor3dv := nil; + @glColor3f := nil; + @glColor3fv := nil; + @glColor3i := nil; + @glColor3iv := nil; + @glColor3s := nil; + @glColor3sv := nil; + @glColor3ub := nil; + @glColor3ubv := nil; + @glColor3ui := nil; + @glColor3uiv := nil; + @glColor3us := nil; + @glColor3usv := nil; + @glColor4b := nil; + @glColor4bv := nil; + @glColor4d := nil; + @glColor4dv := nil; + @glColor4f := nil; + @glColor4fv := nil; + @glColor4i := nil; + @glColor4iv := nil; + @glColor4s := nil; + @glColor4sv := nil; + @glColor4ub := nil; + @glColor4ubv := nil; + @glColor4ui := nil; + @glColor4uiv := nil; + @glColor4us := nil; + @glColor4usv := nil; + @glColorMask := nil; + @glColorMaterial := nil; + @glColorPointer := nil; + @glCopyPixels := nil; + @glCopyTexImage1D := nil; + @glCopyTexImage2D := nil; + @glCopyTexSubImage1D := nil; + @glCopyTexSubImage2D := nil; + @glCullFace := nil; + @glDeleteLists := nil; + @glDeleteTextures := nil; + @glDepthFunc := nil; + @glDepthMask := nil; + @glDepthRange := nil; + @glDisable := nil; + @glDisableClientState := nil; + @glDrawArrays := nil; + @glDrawBuffer := nil; + @glDrawElements := nil; + @glDrawPixels := nil; + @glEdgeFlag := nil; + @glEdgeFlagPointer := nil; + @glEdgeFlagv := nil; + @glEnable := nil; + @glEnableClientState := nil; + @glEnd := nil; + @glEndList := nil; + @glEvalCoord1d := nil; + @glEvalCoord1dv := nil; + @glEvalCoord1f := nil; + @glEvalCoord1fv := nil; + @glEvalCoord2d := nil; + @glEvalCoord2dv := nil; + @glEvalCoord2f := nil; + @glEvalCoord2fv := nil; + @glEvalMesh1 := nil; + @glEvalMesh2 := nil; + @glEvalPoint1 := nil; + @glEvalPoint2 := nil; + @glFeedbackBuffer := nil; + @glFinish := nil; + @glFlush := nil; + @glFogf := nil; + @glFogfv := nil; + @glFogi := nil; + @glFogiv := nil; + @glFrontFace := nil; + @glFrustum := nil; + @glGenLists := nil; + @glGenTextures := nil; + @glGetBooleanv := nil; + @glGetClipPlane := nil; + @glGetDoublev := nil; + @glGetError := nil; + @glGetFloatv := nil; + @glGetIntegerv := nil; + @glGetLightfv := nil; + @glGetLightiv := nil; + @glGetMapdv := nil; + @glGetMapfv := nil; + @glGetMapiv := nil; + @glGetMaterialfv := nil; + @glGetMaterialiv := nil; + @glGetPixelMapfv := nil; + @glGetPixelMapuiv := nil; + @glGetPixelMapusv := nil; + @glGetPointerv := nil; + @glGetPolygonStipple := nil; + @glGetString := nil; + @glGetTexEnvfv := nil; + @glGetTexEnviv := nil; + @glGetTexGendv := nil; + @glGetTexGenfv := nil; + @glGetTexGeniv := nil; + @glGetTexImage := nil; + @glGetTexLevelParameterfv := nil; + @glGetTexLevelParameteriv := nil; + @glGetTexParameterfv := nil; + @glGetTexParameteriv := nil; + @glHint := nil; + @glIndexMask := nil; + @glIndexPointer := nil; + @glIndexd := nil; + @glIndexdv := nil; + @glIndexf := nil; + @glIndexfv := nil; + @glIndexi := nil; + @glIndexiv := nil; + @glIndexs := nil; + @glIndexsv := nil; + @glIndexub := nil; + @glIndexubv := nil; + @glInitNames := nil; + @glInterleavedArrays := nil; + @glIsEnabled := nil; + @glIsList := nil; + @glIsTexture := nil; + @glLightModelf := nil; + @glLightModelfv := nil; + @glLightModeli := nil; + @glLightModeliv := nil; + @glLightf := nil; + @glLightfv := nil; + @glLighti := nil; + @glLightiv := nil; + @glLineStipple := nil; + @glLineWidth := nil; + @glListBase := nil; + @glLoadIdentity := nil; + @glLoadMatrixd := nil; + @glLoadMatrixf := nil; + @glLoadName := nil; + @glLogicOp := nil; + @glMap1d := nil; + @glMap1f := nil; + @glMap2d := nil; + @glMap2f := nil; + @glMapGrid1d := nil; + @glMapGrid1f := nil; + @glMapGrid2d := nil; + @glMapGrid2f := nil; + @glMaterialf := nil; + @glMaterialfv := nil; + @glMateriali := nil; + @glMaterialiv := nil; + @glMatrixMode := nil; + @glMultMatrixd := nil; + @glMultMatrixf := nil; + @glNewList := nil; + @glNormal3b := nil; + @glNormal3bv := nil; + @glNormal3d := nil; + @glNormal3dv := nil; + @glNormal3f := nil; + @glNormal3fv := nil; + @glNormal3i := nil; + @glNormal3iv := nil; + @glNormal3s := nil; + @glNormal3sv := nil; + @glNormalPointer := nil; + @glOrtho := nil; + @glPassThrough := nil; + @glPixelMapfv := nil; + @glPixelMapuiv := nil; + @glPixelMapusv := nil; + @glPixelStoref := nil; + @glPixelStorei := nil; + @glPixelTransferf := nil; + @glPixelTransferi := nil; + @glPixelZoom := nil; + @glPointSize := nil; + @glPolygonMode := nil; + @glPolygonOffset := nil; + @glPolygonStipple := nil; + @glPopAttrib := nil; + @glPopClientAttrib := nil; + @glPopMatrix := nil; + @glPopName := nil; + @glPrioritizeTextures := nil; + @glPushAttrib := nil; + @glPushClientAttrib := nil; + @glPushMatrix := nil; + @glPushName := nil; + @glRasterPos2d := nil; + @glRasterPos2dv := nil; + @glRasterPos2f := nil; + @glRasterPos2fv := nil; + @glRasterPos2i := nil; + @glRasterPos2iv := nil; + @glRasterPos2s := nil; + @glRasterPos2sv := nil; + @glRasterPos3d := nil; + @glRasterPos3dv := nil; + @glRasterPos3f := nil; + @glRasterPos3fv := nil; + @glRasterPos3i := nil; + @glRasterPos3iv := nil; + @glRasterPos3s := nil; + @glRasterPos3sv := nil; + @glRasterPos4d := nil; + @glRasterPos4dv := nil; + @glRasterPos4f := nil; + @glRasterPos4fv := nil; + @glRasterPos4i := nil; + @glRasterPos4iv := nil; + @glRasterPos4s := nil; + @glRasterPos4sv := nil; + @glReadBuffer := nil; + @glReadPixels := nil; + @glRectd := nil; + @glRectdv := nil; + @glRectf := nil; + @glRectfv := nil; + @glRecti := nil; + @glRectiv := nil; + @glRects := nil; + @glRectsv := nil; + @glRenderMode := nil; + @glRotated := nil; + @glRotatef := nil; + @glScaled := nil; + @glScalef := nil; + @glScissor := nil; + @glSelectBuffer := nil; + @glShadeModel := nil; + @glStencilFunc := nil; + @glStencilMask := nil; + @glStencilOp := nil; + @glTexCoord1d := nil; + @glTexCoord1dv := nil; + @glTexCoord1f := nil; + @glTexCoord1fv := nil; + @glTexCoord1i := nil; + @glTexCoord1iv := nil; + @glTexCoord1s := nil; + @glTexCoord1sv := nil; + @glTexCoord2d := nil; + @glTexCoord2dv := nil; + @glTexCoord2f := nil; + @glTexCoord2fv := nil; + @glTexCoord2i := nil; + @glTexCoord2iv := nil; + @glTexCoord2s := nil; + @glTexCoord2sv := nil; + @glTexCoord3d := nil; + @glTexCoord3dv := nil; + @glTexCoord3f := nil; + @glTexCoord3fv := nil; + @glTexCoord3i := nil; + @glTexCoord3iv := nil; + @glTexCoord3s := nil; + @glTexCoord3sv := nil; + @glTexCoord4d := nil; + @glTexCoord4dv := nil; + @glTexCoord4f := nil; + @glTexCoord4fv := nil; + @glTexCoord4i := nil; + @glTexCoord4iv := nil; + @glTexCoord4s := nil; + @glTexCoord4sv := nil; + @glTexCoordPointer := nil; + @glTexEnvf := nil; + @glTexEnvfv := nil; + @glTexEnvi := nil; + @glTexEnviv := nil; + @glTexGend := nil; + @glTexGendv := nil; + @glTexGenf := nil; + @glTexGenfv := nil; + @glTexGeni := nil; + @glTexGeniv := nil; + @glTexImage1D := nil; + @glTexImage2D := nil; + @glTexParameterf := nil; + @glTexParameterfv := nil; + @glTexParameteri := nil; + @glTexParameteriv := nil; + @glTexSubImage1D := nil; + @glTexSubImage2D := nil; + @glTranslated := nil; + @glTranslatef := nil; + @glVertex2d := nil; + @glVertex2dv := nil; + @glVertex2f := nil; + @glVertex2fv := nil; + @glVertex2i := nil; + @glVertex2iv := nil; + @glVertex2s := nil; + @glVertex2sv := nil; + @glVertex3d := nil; + @glVertex3dv := nil; + @glVertex3f := nil; + @glVertex3fv := nil; + @glVertex3i := nil; + @glVertex3iv := nil; + @glVertex3s := nil; + @glVertex3sv := nil; + @glVertex4d := nil; + @glVertex4dv := nil; + @glVertex4f := nil; + @glVertex4fv := nil; + @glVertex4i := nil; + @glVertex4iv := nil; + @glVertex4s := nil; + @glVertex4sv := nil; + @glVertexPointer := nil; + @glViewport := nil; + {$IFDEF Windows} + @ChoosePixelFormat := nil; + {$ENDIF} + + if (LibGL <> 0) then + FreeLibrary(LibGL); +{$ENDIF MORPHOS} +end; + +procedure LoadOpenGL(const dll: String); +{$IFDEF MORPHOS} +begin + // MorphOS's GL has own initialization in TinyGL unit, nothing is needed here. +end; +{$ELSE MORPHOS} +var + MethodName: string = ''; + + function GetGLProcAddress(Lib: PtrInt; ProcName: PChar): Pointer; + begin + MethodName:=ProcName; + Result:=GetProcAddress(Lib, ProcName); + end; + +begin + + FreeOpenGL; + + LibGL := LoadLibrary(PChar(dll)); + if LibGL = 0 then raise Exception.Create('Could not load OpenGL from ' + dll); + try + @glAccum := GetGLProcAddress(LibGL, 'glAccum'); + @glAlphaFunc := GetGLProcAddress(LibGL, 'glAlphaFunc'); + @glAreTexturesResident := GetGLProcAddress(LibGL, 'glAreTexturesResident'); + @glArrayElement := GetGLProcAddress(LibGL, 'glArrayElement'); + @glBegin := GetGLProcAddress(LibGL, 'glBegin'); + @glBindTexture := GetGLProcAddress(LibGL, 'glBindTexture'); + @glBitmap := GetGLProcAddress(LibGL, 'glBitmap'); + @glBlendFunc := GetGLProcAddress(LibGL, 'glBlendFunc'); + @glCallList := GetGLProcAddress(LibGL, 'glCallList'); + @glCallLists := GetGLProcAddress(LibGL, 'glCallLists'); + @glClear := GetGLProcAddress(LibGL, 'glClear'); + @glClearAccum := GetGLProcAddress(LibGL, 'glClearAccum'); + @glClearColor := GetGLProcAddress(LibGL, 'glClearColor'); + @glClearDepth := GetGLProcAddress(LibGL, 'glClearDepth'); + @glClearIndex := GetGLProcAddress(LibGL, 'glClearIndex'); + @glClearStencil := GetGLProcAddress(LibGL, 'glClearStencil'); + @glClipPlane := GetGLProcAddress(LibGL, 'glClipPlane'); + @glColor3b := GetGLProcAddress(LibGL, 'glColor3b'); + @glColor3bv := GetGLProcAddress(LibGL, 'glColor3bv'); + @glColor3d := GetGLProcAddress(LibGL, 'glColor3d'); + @glColor3dv := GetGLProcAddress(LibGL, 'glColor3dv'); + @glColor3f := GetGLProcAddress(LibGL, 'glColor3f'); + @glColor3fv := GetGLProcAddress(LibGL, 'glColor3fv'); + @glColor3i := GetGLProcAddress(LibGL, 'glColor3i'); + @glColor3iv := GetGLProcAddress(LibGL, 'glColor3iv'); + @glColor3s := GetGLProcAddress(LibGL, 'glColor3s'); + @glColor3sv := GetGLProcAddress(LibGL, 'glColor3sv'); + @glColor3ub := GetGLProcAddress(LibGL, 'glColor3ub'); + @glColor3ubv := GetGLProcAddress(LibGL, 'glColor3ubv'); + @glColor3ui := GetGLProcAddress(LibGL, 'glColor3ui'); + @glColor3uiv := GetGLProcAddress(LibGL, 'glColor3uiv'); + @glColor3us := GetGLProcAddress(LibGL, 'glColor3us'); + @glColor3usv := GetGLProcAddress(LibGL, 'glColor3usv'); + @glColor4b := GetGLProcAddress(LibGL, 'glColor4b'); + @glColor4bv := GetGLProcAddress(LibGL, 'glColor4bv'); + @glColor4d := GetGLProcAddress(LibGL, 'glColor4d'); + @glColor4dv := GetGLProcAddress(LibGL, 'glColor4dv'); + @glColor4f := GetGLProcAddress(LibGL, 'glColor4f'); + @glColor4fv := GetGLProcAddress(LibGL, 'glColor4fv'); + @glColor4i := GetGLProcAddress(LibGL, 'glColor4i'); + @glColor4iv := GetGLProcAddress(LibGL, 'glColor4iv'); + @glColor4s := GetGLProcAddress(LibGL, 'glColor4s'); + @glColor4sv := GetGLProcAddress(LibGL, 'glColor4sv'); + @glColor4ub := GetGLProcAddress(LibGL, 'glColor4ub'); + @glColor4ubv := GetGLProcAddress(LibGL, 'glColor4ubv'); + @glColor4ui := GetGLProcAddress(LibGL, 'glColor4ui'); + @glColor4uiv := GetGLProcAddress(LibGL, 'glColor4uiv'); + @glColor4us := GetGLProcAddress(LibGL, 'glColor4us'); + @glColor4usv := GetGLProcAddress(LibGL, 'glColor4usv'); + @glColorMask := GetGLProcAddress(LibGL, 'glColorMask'); + @glColorMaterial := GetGLProcAddress(LibGL, 'glColorMaterial'); + @glColorPointer := GetGLProcAddress(LibGL, 'glColorPointer'); + @glCopyPixels := GetGLProcAddress(LibGL, 'glCopyPixels'); + @glCopyTexImage1D := GetGLProcAddress(LibGL, 'glCopyTexImage1D'); + @glCopyTexImage2D := GetGLProcAddress(LibGL, 'glCopyTexImage2D'); + @glCopyTexSubImage1D := GetGLProcAddress(LibGL, 'glCopyTexSubImage1D'); + @glCopyTexSubImage2D := GetGLProcAddress(LibGL, 'glCopyTexSubImage2D'); + @glCullFace := GetGLProcAddress(LibGL, 'glCullFace'); + @glDeleteLists := GetGLProcAddress(LibGL, 'glDeleteLists'); + @glDeleteTextures := GetGLProcAddress(LibGL, 'glDeleteTextures'); + @glDepthFunc := GetGLProcAddress(LibGL, 'glDepthFunc'); + @glDepthMask := GetGLProcAddress(LibGL, 'glDepthMask'); + @glDepthRange := GetGLProcAddress(LibGL, 'glDepthRange'); + @glDisable := GetGLProcAddress(LibGL, 'glDisable'); + @glDisableClientState := GetGLProcAddress(LibGL, 'glDisableClientState'); + @glDrawArrays := GetGLProcAddress(LibGL, 'glDrawArrays'); + @glDrawBuffer := GetGLProcAddress(LibGL, 'glDrawBuffer'); + @glDrawElements := GetGLProcAddress(LibGL, 'glDrawElements'); + @glDrawPixels := GetGLProcAddress(LibGL, 'glDrawPixels'); + @glEdgeFlag := GetGLProcAddress(LibGL, 'glEdgeFlag'); + @glEdgeFlagPointer := GetGLProcAddress(LibGL, 'glEdgeFlagPointer'); + @glEdgeFlagv := GetGLProcAddress(LibGL, 'glEdgeFlagv'); + @glEnable := GetGLProcAddress(LibGL, 'glEnable'); + @glEnableClientState := GetGLProcAddress(LibGL, 'glEnableClientState'); + @glEnd := GetGLProcAddress(LibGL, 'glEnd'); + @glEndList := GetGLProcAddress(LibGL, 'glEndList'); + @glEvalCoord1d := GetGLProcAddress(LibGL, 'glEvalCoord1d'); + @glEvalCoord1dv := GetGLProcAddress(LibGL, 'glEvalCoord1dv'); + @glEvalCoord1f := GetGLProcAddress(LibGL, 'glEvalCoord1f'); + @glEvalCoord1fv := GetGLProcAddress(LibGL, 'glEvalCoord1fv'); + @glEvalCoord2d := GetGLProcAddress(LibGL, 'glEvalCoord2d'); + @glEvalCoord2dv := GetGLProcAddress(LibGL, 'glEvalCoord2dv'); + @glEvalCoord2f := GetGLProcAddress(LibGL, 'glEvalCoord2f'); + @glEvalCoord2fv := GetGLProcAddress(LibGL, 'glEvalCoord2fv'); + @glEvalMesh1 := GetGLProcAddress(LibGL, 'glEvalMesh1'); + @glEvalMesh2 := GetGLProcAddress(LibGL, 'glEvalMesh2'); + @glEvalPoint1 := GetGLProcAddress(LibGL, 'glEvalPoint1'); + @glEvalPoint2 := GetGLProcAddress(LibGL, 'glEvalPoint2'); + @glFeedbackBuffer := GetGLProcAddress(LibGL, 'glFeedbackBuffer'); + @glFinish := GetGLProcAddress(LibGL, 'glFinish'); + @glFlush := GetGLProcAddress(LibGL, 'glFlush'); + @glFogf := GetGLProcAddress(LibGL, 'glFogf'); + @glFogfv := GetGLProcAddress(LibGL, 'glFogfv'); + @glFogi := GetGLProcAddress(LibGL, 'glFogi'); + @glFogiv := GetGLProcAddress(LibGL, 'glFogiv'); + @glFrontFace := GetGLProcAddress(LibGL, 'glFrontFace'); + @glFrustum := GetGLProcAddress(LibGL, 'glFrustum'); + @glGenLists := GetGLProcAddress(LibGL, 'glGenLists'); + @glGenTextures := GetGLProcAddress(LibGL, 'glGenTextures'); + @glGetBooleanv := GetGLProcAddress(LibGL, 'glGetBooleanv'); + @glGetClipPlane := GetGLProcAddress(LibGL, 'glGetClipPlane'); + @glGetDoublev := GetGLProcAddress(LibGL, 'glGetDoublev'); + @glGetError := GetGLProcAddress(LibGL, 'glGetError'); + @glGetFloatv := GetGLProcAddress(LibGL, 'glGetFloatv'); + @glGetIntegerv := GetGLProcAddress(LibGL, 'glGetIntegerv'); + @glGetLightfv := GetGLProcAddress(LibGL, 'glGetLightfv'); + @glGetLightiv := GetGLProcAddress(LibGL, 'glGetLightiv'); + @glGetMapdv := GetGLProcAddress(LibGL, 'glGetMapdv'); + @glGetMapfv := GetGLProcAddress(LibGL, 'glGetMapfv'); + @glGetMapiv := GetGLProcAddress(LibGL, 'glGetMapiv'); + @glGetMaterialfv := GetGLProcAddress(LibGL, 'glGetMaterialfv'); + @glGetMaterialiv := GetGLProcAddress(LibGL, 'glGetMaterialiv'); + @glGetPixelMapfv := GetGLProcAddress(LibGL, 'glGetPixelMapfv'); + @glGetPixelMapuiv := GetGLProcAddress(LibGL, 'glGetPixelMapuiv'); + @glGetPixelMapusv := GetGLProcAddress(LibGL, 'glGetPixelMapusv'); + @glGetPointerv := GetGLProcAddress(LibGL, 'glGetPointerv'); + @glGetPolygonStipple := GetGLProcAddress(LibGL, 'glGetPolygonStipple'); + @glGetString := GetGLProcAddress(LibGL, 'glGetString'); + @glGetTexEnvfv := GetGLProcAddress(LibGL, 'glGetTexEnvfv'); + @glGetTexEnviv := GetGLProcAddress(LibGL, 'glGetTexEnviv'); + @glGetTexGendv := GetGLProcAddress(LibGL, 'glGetTexGendv'); + @glGetTexGenfv := GetGLProcAddress(LibGL, 'glGetTexGenfv'); + @glGetTexGeniv := GetGLProcAddress(LibGL, 'glGetTexGeniv'); + @glGetTexImage := GetGLProcAddress(LibGL, 'glGetTexImage'); + @glGetTexLevelParameterfv := GetGLProcAddress(LibGL, 'glGetTexLevelParameterfv'); + @glGetTexLevelParameteriv := GetGLProcAddress(LibGL, 'glGetTexLevelParameteriv'); + @glGetTexParameterfv := GetGLProcAddress(LibGL, 'glGetTexParameterfv'); + @glGetTexParameteriv := GetGLProcAddress(LibGL, 'glGetTexParameteriv'); + @glHint := GetGLProcAddress(LibGL, 'glHint'); + @glIndexMask := GetGLProcAddress(LibGL, 'glIndexMask'); + @glIndexPointer := GetGLProcAddress(LibGL, 'glIndexPointer'); + @glIndexd := GetGLProcAddress(LibGL, 'glIndexd'); + @glIndexdv := GetGLProcAddress(LibGL, 'glIndexdv'); + @glIndexf := GetGLProcAddress(LibGL, 'glIndexf'); + @glIndexfv := GetGLProcAddress(LibGL, 'glIndexfv'); + @glIndexi := GetGLProcAddress(LibGL, 'glIndexi'); + @glIndexiv := GetGLProcAddress(LibGL, 'glIndexiv'); + @glIndexs := GetGLProcAddress(LibGL, 'glIndexs'); + @glIndexsv := GetGLProcAddress(LibGL, 'glIndexsv'); + @glIndexub := GetGLProcAddress(LibGL, 'glIndexub'); + @glIndexubv := GetGLProcAddress(LibGL, 'glIndexubv'); + @glInitNames := GetGLProcAddress(LibGL, 'glInitNames'); + @glInterleavedArrays := GetGLProcAddress(LibGL, 'glInterleavedArrays'); + @glIsEnabled := GetGLProcAddress(LibGL, 'glIsEnabled'); + @glIsList := GetGLProcAddress(LibGL, 'glIsList'); + @glIsTexture := GetGLProcAddress(LibGL, 'glIsTexture'); + @glLightModelf := GetGLProcAddress(LibGL, 'glLightModelf'); + @glLightModelfv := GetGLProcAddress(LibGL, 'glLightModelfv'); + @glLightModeli := GetGLProcAddress(LibGL, 'glLightModeli'); + @glLightModeliv := GetGLProcAddress(LibGL, 'glLightModeliv'); + @glLightf := GetGLProcAddress(LibGL, 'glLightf'); + @glLightfv := GetGLProcAddress(LibGL, 'glLightfv'); + @glLighti := GetGLProcAddress(LibGL, 'glLighti'); + @glLightiv := GetGLProcAddress(LibGL, 'glLightiv'); + @glLineStipple := GetGLProcAddress(LibGL, 'glLineStipple'); + @glLineWidth := GetGLProcAddress(LibGL, 'glLineWidth'); + @glListBase := GetGLProcAddress(LibGL, 'glListBase'); + @glLoadIdentity := GetGLProcAddress(LibGL, 'glLoadIdentity'); + @glLoadMatrixd := GetGLProcAddress(LibGL, 'glLoadMatrixd'); + @glLoadMatrixf := GetGLProcAddress(LibGL, 'glLoadMatrixf'); + @glLoadName := GetGLProcAddress(LibGL, 'glLoadName'); + @glLogicOp := GetGLProcAddress(LibGL, 'glLogicOp'); + @glMap1d := GetGLProcAddress(LibGL, 'glMap1d'); + @glMap1f := GetGLProcAddress(LibGL, 'glMap1f'); + @glMap2d := GetGLProcAddress(LibGL, 'glMap2d'); + @glMap2f := GetGLProcAddress(LibGL, 'glMap2f'); + @glMapGrid1d := GetGLProcAddress(LibGL, 'glMapGrid1d'); + @glMapGrid1f := GetGLProcAddress(LibGL, 'glMapGrid1f'); + @glMapGrid2d := GetGLProcAddress(LibGL, 'glMapGrid2d'); + @glMapGrid2f := GetGLProcAddress(LibGL, 'glMapGrid2f'); + @glMaterialf := GetGLProcAddress(LibGL, 'glMaterialf'); + @glMaterialfv := GetGLProcAddress(LibGL, 'glMaterialfv'); + @glMateriali := GetGLProcAddress(LibGL, 'glMateriali'); + @glMaterialiv := GetGLProcAddress(LibGL, 'glMaterialiv'); + @glMatrixMode := GetGLProcAddress(LibGL, 'glMatrixMode'); + @glMultMatrixd := GetGLProcAddress(LibGL, 'glMultMatrixd'); + @glMultMatrixf := GetGLProcAddress(LibGL, 'glMultMatrixf'); + @glNewList := GetGLProcAddress(LibGL, 'glNewList'); + @glNormal3b := GetGLProcAddress(LibGL, 'glNormal3b'); + @glNormal3bv := GetGLProcAddress(LibGL, 'glNormal3bv'); + @glNormal3d := GetGLProcAddress(LibGL, 'glNormal3d'); + @glNormal3dv := GetGLProcAddress(LibGL, 'glNormal3dv'); + @glNormal3f := GetGLProcAddress(LibGL, 'glNormal3f'); + @glNormal3fv := GetGLProcAddress(LibGL, 'glNormal3fv'); + @glNormal3i := GetGLProcAddress(LibGL, 'glNormal3i'); + @glNormal3iv := GetGLProcAddress(LibGL, 'glNormal3iv'); + @glNormal3s := GetGLProcAddress(LibGL, 'glNormal3s'); + @glNormal3sv := GetGLProcAddress(LibGL, 'glNormal3sv'); + @glNormalPointer := GetGLProcAddress(LibGL, 'glNormalPointer'); + @glOrtho := GetGLProcAddress(LibGL, 'glOrtho'); + @glPassThrough := GetGLProcAddress(LibGL, 'glPassThrough'); + @glPixelMapfv := GetGLProcAddress(LibGL, 'glPixelMapfv'); + @glPixelMapuiv := GetGLProcAddress(LibGL, 'glPixelMapuiv'); + @glPixelMapusv := GetGLProcAddress(LibGL, 'glPixelMapusv'); + @glPixelStoref := GetGLProcAddress(LibGL, 'glPixelStoref'); + @glPixelStorei := GetGLProcAddress(LibGL, 'glPixelStorei'); + @glPixelTransferf := GetGLProcAddress(LibGL, 'glPixelTransferf'); + @glPixelTransferi := GetGLProcAddress(LibGL, 'glPixelTransferi'); + @glPixelZoom := GetGLProcAddress(LibGL, 'glPixelZoom'); + @glPointSize := GetGLProcAddress(LibGL, 'glPointSize'); + @glPolygonMode := GetGLProcAddress(LibGL, 'glPolygonMode'); + @glPolygonOffset := GetGLProcAddress(LibGL, 'glPolygonOffset'); + @glPolygonStipple := GetGLProcAddress(LibGL, 'glPolygonStipple'); + @glPopAttrib := GetGLProcAddress(LibGL, 'glPopAttrib'); + @glPopClientAttrib := GetGLProcAddress(LibGL, 'glPopClientAttrib'); + @glPopMatrix := GetGLProcAddress(LibGL, 'glPopMatrix'); + @glPopName := GetGLProcAddress(LibGL, 'glPopName'); + @glPrioritizeTextures := GetGLProcAddress(LibGL, 'glPrioritizeTextures'); + @glPushAttrib := GetGLProcAddress(LibGL, 'glPushAttrib'); + @glPushClientAttrib := GetGLProcAddress(LibGL, 'glPushClientAttrib'); + @glPushMatrix := GetGLProcAddress(LibGL, 'glPushMatrix'); + @glPushName := GetGLProcAddress(LibGL, 'glPushName'); + @glRasterPos2d := GetGLProcAddress(LibGL, 'glRasterPos2d'); + @glRasterPos2dv := GetGLProcAddress(LibGL, 'glRasterPos2dv'); + @glRasterPos2f := GetGLProcAddress(LibGL, 'glRasterPos2f'); + @glRasterPos2fv := GetGLProcAddress(LibGL, 'glRasterPos2fv'); + @glRasterPos2i := GetGLProcAddress(LibGL, 'glRasterPos2i'); + @glRasterPos2iv := GetGLProcAddress(LibGL, 'glRasterPos2iv'); + @glRasterPos2s := GetGLProcAddress(LibGL, 'glRasterPos2s'); + @glRasterPos2sv := GetGLProcAddress(LibGL, 'glRasterPos2sv'); + @glRasterPos3d := GetGLProcAddress(LibGL, 'glRasterPos3d'); + @glRasterPos3dv := GetGLProcAddress(LibGL, 'glRasterPos3dv'); + @glRasterPos3f := GetGLProcAddress(LibGL, 'glRasterPos3f'); + @glRasterPos3fv := GetGLProcAddress(LibGL, 'glRasterPos3fv'); + @glRasterPos3i := GetGLProcAddress(LibGL, 'glRasterPos3i'); + @glRasterPos3iv := GetGLProcAddress(LibGL, 'glRasterPos3iv'); + @glRasterPos3s := GetGLProcAddress(LibGL, 'glRasterPos3s'); + @glRasterPos3sv := GetGLProcAddress(LibGL, 'glRasterPos3sv'); + @glRasterPos4d := GetGLProcAddress(LibGL, 'glRasterPos4d'); + @glRasterPos4dv := GetGLProcAddress(LibGL, 'glRasterPos4dv'); + @glRasterPos4f := GetGLProcAddress(LibGL, 'glRasterPos4f'); + @glRasterPos4fv := GetGLProcAddress(LibGL, 'glRasterPos4fv'); + @glRasterPos4i := GetGLProcAddress(LibGL, 'glRasterPos4i'); + @glRasterPos4iv := GetGLProcAddress(LibGL, 'glRasterPos4iv'); + @glRasterPos4s := GetGLProcAddress(LibGL, 'glRasterPos4s'); + @glRasterPos4sv := GetGLProcAddress(LibGL, 'glRasterPos4sv'); + @glReadBuffer := GetGLProcAddress(LibGL, 'glReadBuffer'); + @glReadPixels := GetGLProcAddress(LibGL, 'glReadPixels'); + @glRectd := GetGLProcAddress(LibGL, 'glRectd'); + @glRectdv := GetGLProcAddress(LibGL, 'glRectdv'); + @glRectf := GetGLProcAddress(LibGL, 'glRectf'); + @glRectfv := GetGLProcAddress(LibGL, 'glRectfv'); + @glRecti := GetGLProcAddress(LibGL, 'glRecti'); + @glRectiv := GetGLProcAddress(LibGL, 'glRectiv'); + @glRects := GetGLProcAddress(LibGL, 'glRects'); + @glRectsv := GetGLProcAddress(LibGL, 'glRectsv'); + @glRenderMode := GetGLProcAddress(LibGL, 'glRenderMode'); + @glRotated := GetGLProcAddress(LibGL, 'glRotated'); + @glRotatef := GetGLProcAddress(LibGL, 'glRotatef'); + @glScaled := GetGLProcAddress(LibGL, 'glScaled'); + @glScalef := GetGLProcAddress(LibGL, 'glScalef'); + @glScissor := GetGLProcAddress(LibGL, 'glScissor'); + @glSelectBuffer := GetGLProcAddress(LibGL, 'glSelectBuffer'); + @glShadeModel := GetGLProcAddress(LibGL, 'glShadeModel'); + @glStencilFunc := GetGLProcAddress(LibGL, 'glStencilFunc'); + @glStencilMask := GetGLProcAddress(LibGL, 'glStencilMask'); + @glStencilOp := GetGLProcAddress(LibGL, 'glStencilOp'); + @glTexCoord1d := GetGLProcAddress(LibGL, 'glTexCoord1d'); + @glTexCoord1dv := GetGLProcAddress(LibGL, 'glTexCoord1dv'); + @glTexCoord1f := GetGLProcAddress(LibGL, 'glTexCoord1f'); + @glTexCoord1fv := GetGLProcAddress(LibGL, 'glTexCoord1fv'); + @glTexCoord1i := GetGLProcAddress(LibGL, 'glTexCoord1i'); + @glTexCoord1iv := GetGLProcAddress(LibGL, 'glTexCoord1iv'); + @glTexCoord1s := GetGLProcAddress(LibGL, 'glTexCoord1s'); + @glTexCoord1sv := GetGLProcAddress(LibGL, 'glTexCoord1sv'); + @glTexCoord2d := GetGLProcAddress(LibGL, 'glTexCoord2d'); + @glTexCoord2dv := GetGLProcAddress(LibGL, 'glTexCoord2dv'); + @glTexCoord2f := GetGLProcAddress(LibGL, 'glTexCoord2f'); + @glTexCoord2fv := GetGLProcAddress(LibGL, 'glTexCoord2fv'); + @glTexCoord2i := GetGLProcAddress(LibGL, 'glTexCoord2i'); + @glTexCoord2iv := GetGLProcAddress(LibGL, 'glTexCoord2iv'); + @glTexCoord2s := GetGLProcAddress(LibGL, 'glTexCoord2s'); + @glTexCoord2sv := GetGLProcAddress(LibGL, 'glTexCoord2sv'); + @glTexCoord3d := GetGLProcAddress(LibGL, 'glTexCoord3d'); + @glTexCoord3dv := GetGLProcAddress(LibGL, 'glTexCoord3dv'); + @glTexCoord3f := GetGLProcAddress(LibGL, 'glTexCoord3f'); + @glTexCoord3fv := GetGLProcAddress(LibGL, 'glTexCoord3fv'); + @glTexCoord3i := GetGLProcAddress(LibGL, 'glTexCoord3i'); + @glTexCoord3iv := GetGLProcAddress(LibGL, 'glTexCoord3iv'); + @glTexCoord3s := GetGLProcAddress(LibGL, 'glTexCoord3s'); + @glTexCoord3sv := GetGLProcAddress(LibGL, 'glTexCoord3sv'); + @glTexCoord4d := GetGLProcAddress(LibGL, 'glTexCoord4d'); + @glTexCoord4dv := GetGLProcAddress(LibGL, 'glTexCoord4dv'); + @glTexCoord4f := GetGLProcAddress(LibGL, 'glTexCoord4f'); + @glTexCoord4fv := GetGLProcAddress(LibGL, 'glTexCoord4fv'); + @glTexCoord4i := GetGLProcAddress(LibGL, 'glTexCoord4i'); + @glTexCoord4iv := GetGLProcAddress(LibGL, 'glTexCoord4iv'); + @glTexCoord4s := GetGLProcAddress(LibGL, 'glTexCoord4s'); + @glTexCoord4sv := GetGLProcAddress(LibGL, 'glTexCoord4sv'); + @glTexCoordPointer := GetGLProcAddress(LibGL, 'glTexCoordPointer'); + @glTexEnvf := GetGLProcAddress(LibGL, 'glTexEnvf'); + @glTexEnvfv := GetGLProcAddress(LibGL, 'glTexEnvfv'); + @glTexEnvi := GetGLProcAddress(LibGL, 'glTexEnvi'); + @glTexEnviv := GetGLProcAddress(LibGL, 'glTexEnviv'); + @glTexGend := GetGLProcAddress(LibGL, 'glTexGend'); + @glTexGendv := GetGLProcAddress(LibGL, 'glTexGendv'); + @glTexGenf := GetGLProcAddress(LibGL, 'glTexGenf'); + @glTexGenfv := GetGLProcAddress(LibGL, 'glTexGenfv'); + @glTexGeni := GetGLProcAddress(LibGL, 'glTexGeni'); + @glTexGeniv := GetGLProcAddress(LibGL, 'glTexGeniv'); + @glTexImage1D := GetGLProcAddress(LibGL, 'glTexImage1D'); + @glTexImage2D := GetGLProcAddress(LibGL, 'glTexImage2D'); + @glTexParameterf := GetGLProcAddress(LibGL, 'glTexParameterf'); + @glTexParameterfv := GetGLProcAddress(LibGL, 'glTexParameterfv'); + @glTexParameteri := GetGLProcAddress(LibGL, 'glTexParameteri'); + @glTexParameteriv := GetGLProcAddress(LibGL, 'glTexParameteriv'); + @glTexSubImage1D := GetGLProcAddress(LibGL, 'glTexSubImage1D'); + @glTexSubImage2D := GetGLProcAddress(LibGL, 'glTexSubImage2D'); + @glTranslated := GetGLProcAddress(LibGL, 'glTranslated'); + @glTranslatef := GetGLProcAddress(LibGL, 'glTranslatef'); + @glVertex2d := GetGLProcAddress(LibGL, 'glVertex2d'); + @glVertex2dv := GetGLProcAddress(LibGL, 'glVertex2dv'); + @glVertex2f := GetGLProcAddress(LibGL, 'glVertex2f'); + @glVertex2fv := GetGLProcAddress(LibGL, 'glVertex2fv'); + @glVertex2i := GetGLProcAddress(LibGL, 'glVertex2i'); + @glVertex2iv := GetGLProcAddress(LibGL, 'glVertex2iv'); + @glVertex2s := GetGLProcAddress(LibGL, 'glVertex2s'); + @glVertex2sv := GetGLProcAddress(LibGL, 'glVertex2sv'); + @glVertex3d := GetGLProcAddress(LibGL, 'glVertex3d'); + @glVertex3dv := GetGLProcAddress(LibGL, 'glVertex3dv'); + @glVertex3f := GetGLProcAddress(LibGL, 'glVertex3f'); + @glVertex3fv := GetGLProcAddress(LibGL, 'glVertex3fv'); + @glVertex3i := GetGLProcAddress(LibGL, 'glVertex3i'); + @glVertex3iv := GetGLProcAddress(LibGL, 'glVertex3iv'); + @glVertex3s := GetGLProcAddress(LibGL, 'glVertex3s'); + @glVertex3sv := GetGLProcAddress(LibGL, 'glVertex3sv'); + @glVertex4d := GetGLProcAddress(LibGL, 'glVertex4d'); + @glVertex4dv := GetGLProcAddress(LibGL, 'glVertex4dv'); + @glVertex4f := GetGLProcAddress(LibGL, 'glVertex4f'); + @glVertex4fv := GetGLProcAddress(LibGL, 'glVertex4fv'); + @glVertex4i := GetGLProcAddress(LibGL, 'glVertex4i'); + @glVertex4iv := GetGLProcAddress(LibGL, 'glVertex4iv'); + @glVertex4s := GetGLProcAddress(LibGL, 'glVertex4s'); + @glVertex4sv := GetGLProcAddress(LibGL, 'glVertex4sv'); + @glVertexPointer := GetGLProcAddress(LibGL, 'glVertexPointer'); + @glViewport := GetGLProcAddress(LibGL, 'glViewport'); + except + raise Exception.Create('Failed loading ' + MethodName +' from ' + dll); + end; + + {$IFDEF Windows} + try + @ChoosePixelFormat := GetGLProcAddress(LibGL, 'ChoosePixelFormat'); + if not Assigned(ChoosePixelFormat) then + @ChoosePixelFormat := @WinChoosePixelFormat; + except + raise Exception.Create('Unable to select pixel format'); + end; + {$ENDIF} +end; +{$ENDIF MORPHOS} + +initialization + + { according to bug 7570, this is necessary on all x86 platforms, + maybe we've to fix the sse control word as well } + { Yes, at least for darwin/x86_64 (JM) } + {$if defined(cpui386) or defined(cpux86_64)} + SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,exOverflow, exUnderflow, exPrecision]); + {$endif} + + {$IFDEF Windows} + LoadOpenGL('opengl32.dll'); + {$ELSE} + {$ifdef darwin} + LoadOpenGL('/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib'); + {$ELSE} + {$IFDEF MorphOS} + InitTinyGLLibrary; + {$ELSE} + LoadOpenGL('libGL.so.1'); + {$ENDIF} + {$endif} + {$ENDIF} + +finalization + + FreeOpenGL; + +end. diff --git a/packages/opengl/src/glext.pp b/packages/opengl/src/glext.pp new file mode 100644 index 0000000000..d8cee3be4c --- /dev/null +++ b/packages/opengl/src/glext.pp @@ -0,0 +1,9547 @@ +{ + + Adaption of the delphi3d.net OpenGL units to FreePascal + Sebastian Guenther (sg@freepascal.org) in 2002 + These units are free to use +} + +{$MACRO ON} +{$MODE Delphi} +{$IFDEF Windows} + {$DEFINE extdecl:=stdcall } +{$ELSE} + {$DEFINE extdecl:=cdecl } +{$ENDIF} + +unit GLext; + +(************************************************** + * OpenGL extension loading library * + * Generated by MetaGLext, written by Tom Nuydens * + * (tom@delphi3d.net -- http://www.delphi3d.net * + **************************************************) + +//*** Generated on 10/11/2002 + +interface + +uses + SysUtils, + {$IFDEF Windows} + Windows, + {$ELSE} + dynlibs, + {$ENDIF} + GL; + +{$IFDEF Windows} +{ Declared in Windows unit as well in FPC; but declared here as well, to be + fully compatible to upstream version - sg } +function wglGetProcAddress(proc: PChar): Pointer; extdecl; external 'OpenGL32.dll'; +{$ELSE} +function wglGetProcAddress(proc: PChar): Pointer; +{$ENDIF} + +// Test if the given extension name is present in the given extension string. +function glext_ExtensionSupported(const extension: String; const searchIn: String): Boolean; + +// Load the extension with the given name. +function glext_LoadExtension(ext: String): Boolean; + +type + GLcharARB = Char; + TGLcharARB = GLcharARB; + PGLcharARB = ^GLcharARB; + + GLhandleARB = Cardinal; + TGLhandleARB = GLhandleARB; + PGLhandleARB = ^GLhandleARB; + + GLintptr = PtrInt; + TGLintptr = GLintptr; + PGLintptr = ^GLintptr; + + GLsizeiptr = PtrInt; + TGLsizeiptr = GLsizeiptr; + PGLsizeiptr = ^GLsizeiptr; + + GLchar = Char; + TGLchar = GLchar; + PGLchar = Pchar; + +//***** GL_version_1_2 *****// +const + GL_UNSIGNED_BYTE_3_3_2 = $8032; + GL_UNSIGNED_SHORT_4_4_4_4 = $8033; + GL_UNSIGNED_SHORT_5_5_5_1 = $8034; + GL_UNSIGNED_INT_8_8_8_8 = $8035; + GL_UNSIGNED_INT_10_10_10_2 = $8036; + GL_RESCALE_NORMAL = $803A; + GL_UNSIGNED_BYTE_2_3_3_REV = $8362; + GL_UNSIGNED_SHORT_5_6_5 = $8363; + GL_UNSIGNED_SHORT_5_6_5_REV = $8364; + GL_UNSIGNED_SHORT_4_4_4_4_REV = $8365; + GL_UNSIGNED_SHORT_1_5_5_5_REV = $8366; + GL_UNSIGNED_INT_8_8_8_8_REV = $8367; + GL_UNSIGNED_INT_2_10_10_10_REV = $8368; + GL_BGR = $80E0; + GL_BGRA = $80E1; + GL_MAX_ELEMENTS_VERTICES = $80E8; + GL_MAX_ELEMENTS_INDICES = $80E9; + GL_CLAMP_TO_EDGE = $812F; + GL_TEXTURE_MIN_LOD = $813A; + GL_TEXTURE_MAX_LOD = $813B; + GL_TEXTURE_BASE_LEVEL = $813C; + GL_TEXTURE_MAX_LEVEL = $813D; + GL_LIGHT_MODEL_COLOR_CONTROL = $81F8; + GL_SINGLE_COLOR = $81F9; + GL_SEPARATE_SPECULAR_COLOR = $81FA; + GL_SMOOTH_POINT_SIZE_RANGE = $0B12; + GL_SMOOTH_POINT_SIZE_GRANULARITY = $0B13; + GL_SMOOTH_LINE_WIDTH_RANGE = $0B22; + GL_SMOOTH_LINE_WIDTH_GRANULARITY = $0B23; + GL_ALIASED_POINT_SIZE_RANGE = $846D; + GL_ALIASED_LINE_WIDTH_RANGE = $846E; + GL_PACK_SKIP_IMAGES = $806B; + GL_PACK_IMAGE_HEIGHT = $806C; + GL_UNPACK_SKIP_IMAGES = $806D; + GL_UNPACK_IMAGE_HEIGHT = $806E; + GL_TEXTURE_3D = $806F; + GL_PROXY_TEXTURE_3D = $8070; + GL_TEXTURE_DEPTH = $8071; + GL_TEXTURE_WRAP_R = $8072; + GL_MAX_3D_TEXTURE_SIZE = $8073; +var + glBlendColor: procedure(red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf); extdecl; + glBlendEquation: procedure(mode: GLenum); extdecl; + glDrawRangeElements: procedure(mode: GLenum; start: GLuint; _end: GLuint; count: GLsizei; _type: GLenum; const indices: PGLvoid); extdecl; + glColorTable: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; format: GLenum; _type: GLenum; const table: PGLvoid); extdecl; + glColorTableParameterfv: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glColorTableParameteriv: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glCopyColorTable: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei); extdecl; + glGetColorTable: procedure(target: GLenum; format: GLenum; _type: GLenum; table: PGLvoid); extdecl; + glGetColorTableParameterfv: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetColorTableParameteriv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glColorSubTable: procedure(target: GLenum; start: GLsizei; count: GLsizei; format: GLenum; _type: GLenum; const data: PGLvoid); extdecl; + glCopyColorSubTable: procedure(target: GLenum; start: GLsizei; x: GLint; y: GLint; width: GLsizei); extdecl; + glConvolutionFilter1D: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; format: GLenum; _type: GLenum; const image: PGLvoid); extdecl; + glConvolutionFilter2D: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; const image: PGLvoid); extdecl; + glConvolutionParameterf: procedure(target: GLenum; pname: GLenum; params: GLfloat); extdecl; + glConvolutionParameterfv: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glConvolutionParameteri: procedure(target: GLenum; pname: GLenum; params: GLint); extdecl; + glConvolutionParameteriv: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glCopyConvolutionFilter1D: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei); extdecl; + glCopyConvolutionFilter2D: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl; + glGetConvolutionFilter: procedure(target: GLenum; format: GLenum; _type: GLenum; image: PGLvoid); extdecl; + glGetConvolutionParameterfv: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetConvolutionParameteriv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetSeparableFilter: procedure(target: GLenum; format: GLenum; _type: GLenum; row: PGLvoid; column: PGLvoid; span: PGLvoid); extdecl; + glSeparableFilter2D: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; const row: PGLvoid; const column: PGLvoid); extdecl; + glGetHistogram: procedure(target: GLenum; reset: GLboolean; format: GLenum; _type: GLenum; values: PGLvoid); extdecl; + glGetHistogramParameterfv: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetHistogramParameteriv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetMinmax: procedure(target: GLenum; reset: GLboolean; format: GLenum; _type: GLenum; values: PGLvoid); extdecl; + glGetMinmaxParameterfv: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetMinmaxParameteriv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glHistogram: procedure(target: GLenum; width: GLsizei; internalformat: GLenum; sink: GLboolean); extdecl; + glMinmax: procedure(target: GLenum; internalformat: GLenum; sink: GLboolean); extdecl; + glResetHistogram: procedure(target: GLenum); extdecl; + glResetMinmax: procedure(target: GLenum); extdecl; + glTexImage3D: procedure(target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + glTexSubImage3D: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + glCopyTexSubImage3D: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl; + +function Load_GL_version_1_2: Boolean; + +//***** GL_ARB_imaging *****// +const + GL_CONSTANT_COLOR = $8001; + GL_ONE_MINUS_CONSTANT_COLOR = $8002; + GL_CONSTANT_ALPHA = $8003; + GL_ONE_MINUS_CONSTANT_ALPHA = $8004; + GL_BLEND_COLOR = $8005; + GL_FUNC_ADD = $8006; + GL_MIN = $8007; + GL_MAX = $8008; + GL_BLEND_EQUATION = $8009; + GL_FUNC_SUBTRACT = $800A; + GL_FUNC_REVERSE_SUBTRACT = $800B; + GL_CONVOLUTION_1D = $8010; + GL_CONVOLUTION_2D = $8011; + GL_SEPARABLE_2D = $8012; + GL_CONVOLUTION_BORDER_MODE = $8013; + GL_CONVOLUTION_FILTER_SCALE = $8014; + GL_CONVOLUTION_FILTER_BIAS = $8015; + GL_REDUCE = $8016; + GL_CONVOLUTION_FORMAT = $8017; + GL_CONVOLUTION_WIDTH = $8018; + GL_CONVOLUTION_HEIGHT = $8019; + GL_MAX_CONVOLUTION_WIDTH = $801A; + GL_MAX_CONVOLUTION_HEIGHT = $801B; + GL_POST_CONVOLUTION_RED_SCALE = $801C; + GL_POST_CONVOLUTION_GREEN_SCALE = $801D; + GL_POST_CONVOLUTION_BLUE_SCALE = $801E; + GL_POST_CONVOLUTION_ALPHA_SCALE = $801F; + GL_POST_CONVOLUTION_RED_BIAS = $8020; + GL_POST_CONVOLUTION_GREEN_BIAS = $8021; + GL_POST_CONVOLUTION_BLUE_BIAS = $8022; + GL_POST_CONVOLUTION_ALPHA_BIAS = $8023; + GL_HISTOGRAM = $8024; + GL_PROXY_HISTOGRAM = $8025; + GL_HISTOGRAM_WIDTH = $8026; + GL_HISTOGRAM_FORMAT = $8027; + GL_HISTOGRAM_RED_SIZE = $8028; + GL_HISTOGRAM_GREEN_SIZE = $8029; + GL_HISTOGRAM_BLUE_SIZE = $802A; + GL_HISTOGRAM_ALPHA_SIZE = $802B; + GL_HISTOGRAM_LUMINANCE_SIZE = $802C; + GL_HISTOGRAM_SINK = $802D; + GL_MINMAX = $802E; + GL_MINMAX_FORMAT = $802F; + GL_MINMAX_SINK = $8030; + GL_TABLE_TOO_LARGE = $8031; + GL_COLOR_MATRIX = $80B1; + GL_COLOR_MATRIX_STACK_DEPTH = $80B2; + GL_MAX_COLOR_MATRIX_STACK_DEPTH = $80B3; + GL_POST_COLOR_MATRIX_RED_SCALE = $80B4; + GL_POST_COLOR_MATRIX_GREEN_SCALE = $80B5; + GL_POST_COLOR_MATRIX_BLUE_SCALE = $80B6; + GL_POST_COLOR_MATRIX_ALPHA_SCALE = $80B7; + GL_POST_COLOR_MATRIX_RED_BIAS = $80B8; + GL_POST_COLOR_MATRIX_GREEN_BIAS = $80B9; + GL_POST_COLOR_MATRIX_BLUE_BIAS = $80BA; + GL_POST_COLOR_MATIX_ALPHA_BIAS = $80BB; + GL_COLOR_TABLE = $80D0; + GL_POST_CONVOLUTION_COLOR_TABLE = $80D1; + GL_POST_COLOR_MATRIX_COLOR_TABLE = $80D2; + GL_PROXY_COLOR_TABLE = $80D3; + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = $80D4; + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = $80D5; + GL_COLOR_TABLE_SCALE = $80D6; + GL_COLOR_TABLE_BIAS = $80D7; + GL_COLOR_TABLE_FORMAT = $80D8; + GL_COLOR_TABLE_WIDTH = $80D9; + GL_COLOR_TABLE_RED_SIZE = $80DA; + GL_COLOR_TABLE_GREEN_SIZE = $80DB; + GL_COLOR_TABLE_BLUE_SIZE = $80DC; + GL_COLOR_TABLE_ALPHA_SIZE = $80DD; + GL_COLOR_TABLE_LUMINANCE_SIZE = $80DE; + GL_COLOR_TABLE_INTENSITY_SIZE = $80DF; + GL_IGNORE_BORDER = $8150; + GL_CONSTANT_BORDER = $8151; + GL_WRAP_BORDER = $8152; + GL_REPLICATE_BORDER = $8153; + GL_CONVOLUTION_BORDER_COLOR = $8154; + +function Load_GL_ARB_imaging: Boolean; + +//***** GL_version_1_3 *****// +const + GL_TEXTURE0 = $84C0; + GL_TEXTURE1 = $84C1; + GL_TEXTURE2 = $84C2; + GL_TEXTURE3 = $84C3; + GL_TEXTURE4 = $84C4; + GL_TEXTURE5 = $84C5; + GL_TEXTURE6 = $84C6; + GL_TEXTURE7 = $84C7; + GL_TEXTURE8 = $84C8; + GL_TEXTURE9 = $84C9; + GL_TEXTURE10 = $84CA; + GL_TEXTURE11 = $84CB; + GL_TEXTURE12 = $84CC; + GL_TEXTURE13 = $84CD; + GL_TEXTURE14 = $84CE; + GL_TEXTURE15 = $84CF; + GL_TEXTURE16 = $84D0; + GL_TEXTURE17 = $84D1; + GL_TEXTURE18 = $84D2; + GL_TEXTURE19 = $84D3; + GL_TEXTURE20 = $84D4; + GL_TEXTURE21 = $84D5; + GL_TEXTURE22 = $84D6; + GL_TEXTURE23 = $84D7; + GL_TEXTURE24 = $84D8; + GL_TEXTURE25 = $84D9; + GL_TEXTURE26 = $84DA; + GL_TEXTURE27 = $84DB; + GL_TEXTURE28 = $84DC; + GL_TEXTURE29 = $84DD; + GL_TEXTURE30 = $84DE; + GL_TEXTURE31 = $84DF; + GL_ACTIVE_TEXTURE = $84E0; + GL_CLIENT_ACTIVE_TEXTURE = $84E1; + GL_MAX_TEXTURE_UNITS = $84E2; + GL_TRANSPOSE_MODELVIEW_MATRIX = $84E3; + GL_TRANSPOSE_PROJECTION_MATRIX = $84E4; + GL_TRANSPOSE_TEXTURE_MATRIX = $84E5; + GL_TRANSPOSE_COLOR_MATRIX = $84E6; + GL_MULTISAMPLE = $809D; + GL_SAMPLE_ALPHA_TO_COVERAGE = $809E; + GL_SAMPLE_ALPHA_TO_ONE = $809F; + GL_SAMPLE_COVERAGE = $80A0; + GL_SAMPLE_BUFFERS = $80A8; + GL_SAMPLES = $80A9; + GL_SAMPLE_COVERAGE_VALUE = $80AA; + GL_SAMPLE_COVERAGE_INVERT = $80AB; + GL_MULTISAMPLE_BIT = $20000000; + GL_NORMAL_MAP = $8511; + GL_REFLECTION_MAP = $8512; + GL_TEXTURE_CUBE_MAP = $8513; + GL_TEXTURE_BINDING_CUBE_MAP = $8514; + GL_TEXTURE_CUBE_MAP_POSITIVE_X = $8515; + GL_TEXTURE_CUBE_MAP_NEGATIVE_X = $8516; + GL_TEXTURE_CUBE_MAP_POSITIVE_Y = $8517; + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = $8518; + GL_TEXTURE_CUBE_MAP_POSITIVE_Z = $8519; + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = $851A; + GL_PROXY_TEXTURE_CUBE_MAP = $851B; + GL_MAX_CUBE_MAP_TEXTURE_SIZE = $851C; + GL_COMPRESSED_ALPHA = $84E9; + GL_COMPRESSED_LUMINANCE = $84EA; + GL_COMPRESSED_LUMINANCE_ALPHA = $84EB; + GL_COMPRESSED_INTENSITY = $84EC; + GL_COMPRESSED_RGB = $84ED; + GL_COMPRESSED_RGBA = $84EE; + GL_TEXTURE_COMPRESSION_HINT = $84EF; + GL_TEXTURE_COMPRESSED_IMAGE_SIZE = $86A0; + GL_TEXTURE_COMPRESSED = $86A1; + GL_NUM_COMPRESSED_TEXTURE_FORMATS = $86A2; + GL_COMPRESSED_TEXTURE_FORMATS = $86A3; + GL_CLAMP_TO_BORDER = $812D; + GL_CLAMP_TO_BORDER_SGIS = $812D; + GL_COMBINE = $8570; + GL_COMBINE_RGB = $8571; + GL_COMBINE_ALPHA = $8572; + GL_SOURCE0_RGB = $8580; + GL_SOURCE1_RGB = $8581; + GL_SOURCE2_RGB = $8582; + GL_SOURCE0_ALPHA = $8588; + GL_SOURCE1_ALPHA = $8589; + GL_SOURCE2_ALPHA = $858A; + GL_OPERAND0_RGB = $8590; + GL_OPERAND1_RGB = $8591; + GL_OPERAND2_RGB = $8592; + GL_OPERAND0_ALPHA = $8598; + GL_OPERAND1_ALPHA = $8599; + GL_OPERAND2_ALPHA = $859A; + GL_RGB_SCALE = $8573; + GL_ADD_SIGNED = $8574; + GL_INTERPOLATE = $8575; + GL_SUBTRACT = $84E7; + GL_CONSTANT = $8576; + GL_PRIMARY_COLOR = $8577; + GL_PREVIOUS = $8578; + GL_DOT3_RGB = $86AE; + GL_DOT3_RGBA = $86AF; +var + glActiveTexture: procedure(texture: GLenum); extdecl; + glClientActiveTexture: procedure(texture: GLenum); extdecl; + glMultiTexCoord1d: procedure(target: GLenum; s: GLdouble); extdecl; + glMultiTexCoord1dv: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord1f: procedure(target: GLenum; s: GLfloat); extdecl; + glMultiTexCoord1fv: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord1i: procedure(target: GLenum; s: GLint); extdecl; + glMultiTexCoord1iv: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord1s: procedure(target: GLenum; s: GLshort); extdecl; + glMultiTexCoord1sv: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord2d: procedure(target: GLenum; s: GLdouble; t: GLdouble); extdecl; + glMultiTexCoord2dv: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord2f: procedure(target: GLenum; s: GLfloat; t: GLfloat); extdecl; + glMultiTexCoord2fv: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord2i: procedure(target: GLenum; s: GLint; t: GLint); extdecl; + glMultiTexCoord2iv: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord2s: procedure(target: GLenum; s: GLshort; t: GLshort); extdecl; + glMultiTexCoord2sv: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord3d: procedure(target: GLenum; s: GLdouble; t: GLdouble; r: GLdouble); extdecl; + glMultiTexCoord3dv: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord3f: procedure(target: GLenum; s: GLfloat; t: GLfloat; r: GLfloat); extdecl; + glMultiTexCoord3fv: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord3i: procedure(target: GLenum; s: GLint; t: GLint; r: GLint); extdecl; + glMultiTexCoord3iv: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord3s: procedure(target: GLenum; s: GLshort; t: GLshort; r: GLshort); extdecl; + glMultiTexCoord3sv: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord4d: procedure(target: GLenum; s: GLdouble; t: GLdouble; r: GLdouble; q: GLdouble); extdecl; + glMultiTexCoord4dv: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord4f: procedure(target: GLenum; s: GLfloat; t: GLfloat; r: GLfloat; q: GLfloat); extdecl; + glMultiTexCoord4fv: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord4i: procedure(target: GLenum; s: GLint; t: GLint; r: GLint; q: GLint); extdecl; + glMultiTexCoord4iv: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord4s: procedure(target: GLenum; s: GLshort; t: GLshort; r: GLshort; q: GLshort); extdecl; + glMultiTexCoord4sv: procedure(target: GLenum; const v: PGLshort); extdecl; + glLoadTransposeMatrixf: procedure(const m: PGLfloat); extdecl; + glLoadTransposeMatrixd: procedure(const m: PGLdouble); extdecl; + glMultTransposeMatrixf: procedure(const m: PGLfloat); extdecl; + glMultTransposeMatrixd: procedure(const m: PGLdouble); extdecl; + glSampleCoverage: procedure(value: GLclampf; invert: GLboolean); extdecl; + glCompressedTexImage3D: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; depth: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexImage2D: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexImage1D: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage3D: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage2D: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage1D: procedure(target: GLenum; level: GLint; xoffset: GLint; width: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glGetCompressedTexImage: procedure(target: GLenum; level: GLint; img: PGLvoid); extdecl; + +function Load_GL_version_1_3: Boolean; + +//***** GL_ARB_multitexture *****// +const + GL_TEXTURE0_ARB = $84C0; + GL_TEXTURE1_ARB = $84C1; + GL_TEXTURE2_ARB = $84C2; + GL_TEXTURE3_ARB = $84C3; + GL_TEXTURE4_ARB = $84C4; + GL_TEXTURE5_ARB = $84C5; + GL_TEXTURE6_ARB = $84C6; + GL_TEXTURE7_ARB = $84C7; + GL_TEXTURE8_ARB = $84C8; + GL_TEXTURE9_ARB = $84C9; + GL_TEXTURE10_ARB = $84CA; + GL_TEXTURE11_ARB = $84CB; + GL_TEXTURE12_ARB = $84CC; + GL_TEXTURE13_ARB = $84CD; + GL_TEXTURE14_ARB = $84CE; + GL_TEXTURE15_ARB = $84CF; + GL_TEXTURE16_ARB = $84D0; + GL_TEXTURE17_ARB = $84D1; + GL_TEXTURE18_ARB = $84D2; + GL_TEXTURE19_ARB = $84D3; + GL_TEXTURE20_ARB = $84D4; + GL_TEXTURE21_ARB = $84D5; + GL_TEXTURE22_ARB = $84D6; + GL_TEXTURE23_ARB = $84D7; + GL_TEXTURE24_ARB = $84D8; + GL_TEXTURE25_ARB = $84D9; + GL_TEXTURE26_ARB = $84DA; + GL_TEXTURE27_ARB = $84DB; + GL_TEXTURE28_ARB = $84DC; + GL_TEXTURE29_ARB = $84DD; + GL_TEXTURE30_ARB = $84DE; + GL_TEXTURE31_ARB = $84DF; + GL_ACTIVE_TEXTURE_ARB = $84E0; + GL_CLIENT_ACTIVE_TEXTURE_ARB = $84E1; + GL_MAX_TEXTURE_UNITS_ARB = $84E2; +var + glActiveTextureARB: procedure(texture: GLenum); extdecl; + glClientActiveTextureARB: procedure(texture: GLenum); extdecl; + glMultiTexCoord1dARB: procedure(target: GLenum; s: GLdouble); extdecl; + glMultiTexCoord1dvARB: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord1fARB: procedure(target: GLenum; s: GLfloat); extdecl; + glMultiTexCoord1fvARB: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord1iARB: procedure(target: GLenum; s: GLint); extdecl; + glMultiTexCoord1ivARB: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord1sARB: procedure(target: GLenum; s: GLshort); extdecl; + glMultiTexCoord1svARB: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord2dARB: procedure(target: GLenum; s: GLdouble; t: GLdouble); extdecl; + glMultiTexCoord2dvARB: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord2fARB: procedure(target: GLenum; s: GLfloat; t: GLfloat); extdecl; + glMultiTexCoord2fvARB: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord2iARB: procedure(target: GLenum; s: GLint; t: GLint); extdecl; + glMultiTexCoord2ivARB: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord2sARB: procedure(target: GLenum; s: GLshort; t: GLshort); extdecl; + glMultiTexCoord2svARB: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord3dARB: procedure(target: GLenum; s: GLdouble; t: GLdouble; r: GLdouble); extdecl; + glMultiTexCoord3dvARB: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord3fARB: procedure(target: GLenum; s: GLfloat; t: GLfloat; r: GLfloat); extdecl; + glMultiTexCoord3fvARB: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord3iARB: procedure(target: GLenum; s: GLint; t: GLint; r: GLint); extdecl; + glMultiTexCoord3ivARB: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord3sARB: procedure(target: GLenum; s: GLshort; t: GLshort; r: GLshort); extdecl; + glMultiTexCoord3svARB: procedure(target: GLenum; const v: PGLshort); extdecl; + glMultiTexCoord4dARB: procedure(target: GLenum; s: GLdouble; t: GLdouble; r: GLdouble; q: GLdouble); extdecl; + glMultiTexCoord4dvARB: procedure(target: GLenum; const v: PGLdouble); extdecl; + glMultiTexCoord4fARB: procedure(target: GLenum; s: GLfloat; t: GLfloat; r: GLfloat; q: GLfloat); extdecl; + glMultiTexCoord4fvARB: procedure(target: GLenum; const v: PGLfloat); extdecl; + glMultiTexCoord4iARB: procedure(target: GLenum; s: GLint; t: GLint; r: GLint; q: GLint); extdecl; + glMultiTexCoord4ivARB: procedure(target: GLenum; const v: PGLint); extdecl; + glMultiTexCoord4sARB: procedure(target: GLenum; s: GLshort; t: GLshort; r: GLshort; q: GLshort); extdecl; + glMultiTexCoord4svARB: procedure(target: GLenum; const v: PGLshort); extdecl; + +function Load_GL_ARB_multitexture: Boolean; + +//***** GL_ARB_transpose_matrix *****// +const + GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = $84E3; + GL_TRANSPOSE_PROJECTION_MATRIX_ARB = $84E4; + GL_TRANSPOSE_TEXTURE_MATRIX_ARB = $84E5; + GL_TRANSPOSE_COLOR_MATRIX_ARB = $84E6; +var + glLoadTransposeMatrixfARB: procedure(m: PGLfloat); extdecl; + glLoadTransposeMatrixdARB: procedure(m: PGLdouble); extdecl; + glMultTransposeMatrixfARB: procedure(m: PGLfloat); extdecl; + glMultTransposeMatrixdARB: procedure(m: PGLdouble); extdecl; + +function Load_GL_ARB_transpose_matrix: Boolean; + +//***** GL_ARB_multisample *****// +const + WGL_SAMPLE_BUFFERS_ARB = $2041; + WGL_SAMPLES_ARB = $2042; + GL_MULTISAMPLE_ARB = $809D; + GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = $809E; + GL_SAMPLE_ALPHA_TO_ONE_ARB = $809F; + GL_SAMPLE_COVERAGE_ARB = $80A0; + GL_MULTISAMPLE_BIT_ARB = $20000000; + GL_SAMPLE_BUFFERS_ARB = $80A8; + GL_SAMPLES_ARB = $80A9; + GL_SAMPLE_COVERAGE_VALUE_ARB = $80AA; + GL_SAMPLE_COVERAGE_INVERT_ARB = $80AB; +var + glSampleCoverageARB: procedure(value: GLclampf; invert: GLboolean); extdecl; + +function Load_GL_ARB_multisample: Boolean; + +//***** GL_ARB_texture_env_add *****// + +function Load_GL_ARB_texture_env_add: Boolean; + +{$IFDEF Windows} +//***** WGL_ARB_extensions_string *****// +var + wglGetExtensionsStringARB: function(hdc: HDC): Pchar; extdecl; + +function Load_WGL_ARB_extensions_string: Boolean; + +//***** WGL_ARB_buffer_region *****// +const + WGL_FRONT_COLOR_BUFFER_BIT_ARB = $0001; + WGL_BACK_COLOR_BUFFER_BIT_ARB = $0002; + WGL_DEPTH_BUFFER_BIT_ARB = $0004; + WGL_STENCIL_BUFFER_BIT_ARB = $0008; +var + wglCreateBufferRegionARB: function(hDC: HDC; iLayerPlane: GLint; uType: GLuint): THandle; extdecl; + wglDeleteBufferRegionARB: procedure(hRegion: THandle); extdecl; + wglSaveBufferRegionARB: function(hRegion: THandle; x: GLint; y: GLint; width: GLint; height: GLint): BOOL; extdecl; + wglRestoreBufferRegionARB: function(hRegion: THandle; x: GLint; y: GLint; width: GLint; height: GLint; xSrc: GLint; ySrc: GLint): BOOL; extdecl; + +function Load_WGL_ARB_buffer_region: Boolean; +{$ENDIF} + +//***** GL_ARB_texture_cube_map *****// +const + GL_NORMAL_MAP_ARB = $8511; + GL_REFLECTION_MAP_ARB = $8512; + GL_TEXTURE_CUBE_MAP_ARB = $8513; + GL_TEXTURE_BINDING_CUBE_MAP_ARB = $8514; + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = $8515; + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = $8516; + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = $8517; + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = $8518; + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = $8519; + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = $851A; + GL_PROXY_TEXTURE_CUBE_MAP_ARB = $851B; + GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = $851C; + +function Load_GL_ARB_texture_cube_map: Boolean; + +//***** GL_ARB_depth_texture *****// +const + GL_DEPTH_COMPONENT16_ARB = $81A5; + GL_DEPTH_COMPONENT24_ARB = $81A6; + GL_DEPTH_COMPONENT32_ARB = $81A7; + GL_TEXTURE_DEPTH_SIZE_ARB = $884A; + GL_DEPTH_TEXTURE_MODE_ARB = $884B; + +function Load_GL_ARB_depth_texture: Boolean; + +//***** GL_ARB_point_parameters *****// +const + GL_POINT_SIZE_MIN_ARB = $8126; + GL_POINT_SIZE_MAX_ARB = $8127; + GL_POINT_FADE_THRESHOLD_SIZE_ARB = $8128; + GL_POINT_DISTANCE_ATTENUATION_ARB = $8129; +var + glPointParameterfARB: procedure(pname: GLenum; param: GLfloat); extdecl; + glPointParameterfvARB: procedure(pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_ARB_point_parameters: Boolean; + +//***** GL_ARB_shadow *****// +const + GL_TEXTURE_COMPARE_MODE_ARB = $884C; + GL_TEXTURE_COMPARE_FUNC_ARB = $884D; + GL_COMPARE_R_TO_TEXTURE_ARB = $884E; + +function Load_GL_ARB_shadow: Boolean; + +//***** GL_ARB_shadow_ambient *****// +const + GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = $80BF; + +function Load_GL_ARB_shadow_ambient: Boolean; + +//***** GL_ARB_texture_border_clamp *****// +const + GL_CLAMP_TO_BORDER_ARB = $812D; + +function Load_GL_ARB_texture_border_clamp: Boolean; + +//***** GL_ARB_texture_compression *****// +const + GL_COMPRESSED_ALPHA_ARB = $84E9; + GL_COMPRESSED_LUMINANCE_ARB = $84EA; + GL_COMPRESSED_LUMINANCE_ALPHA_ARB = $84EB; + GL_COMPRESSED_INTENSITY_ARB = $84EC; + GL_COMPRESSED_RGB_ARB = $84ED; + GL_COMPRESSED_RGBA_ARB = $84EE; + GL_TEXTURE_COMPRESSION_HINT_ARB = $84EF; + GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = $86A0; + GL_TEXTURE_COMPRESSED_ARB = $86A1; + GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = $86A2; + GL_COMPRESSED_TEXTURE_FORMATS_ARB = $86A3; +var + glCompressedTexImage3DARB: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; depth: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexImage2DARB: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexImage1DARB: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage3DARB: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage2DARB: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glCompressedTexSubImage1DARB: procedure(target: GLenum; level: GLint; xoffset: GLint; width: GLsizei; format: GLenum; imageSize: GLsizei; const data: PGLvoid); extdecl; + glGetCompressedTexImageARB: procedure(target: GLenum; lod: GLint; img: PGLvoid); extdecl; + +function Load_GL_ARB_texture_compression: Boolean; + +//***** GL_ARB_texture_env_combine *****// +const + GL_COMBINE_ARB = $8570; + GL_COMBINE_RGB_ARB = $8571; + GL_COMBINE_ALPHA_ARB = $8572; + GL_SOURCE0_RGB_ARB = $8580; + GL_SOURCE1_RGB_ARB = $8581; + GL_SOURCE2_RGB_ARB = $8582; + GL_SOURCE0_ALPHA_ARB = $8588; + GL_SOURCE1_ALPHA_ARB = $8589; + GL_SOURCE2_ALPHA_ARB = $858A; + GL_OPERAND0_RGB_ARB = $8590; + GL_OPERAND1_RGB_ARB = $8591; + GL_OPERAND2_RGB_ARB = $8592; + GL_OPERAND0_ALPHA_ARB = $8598; + GL_OPERAND1_ALPHA_ARB = $8599; + GL_OPERAND2_ALPHA_ARB = $859A; + GL_RGB_SCALE_ARB = $8573; + GL_ADD_SIGNED_ARB = $8574; + GL_INTERPOLATE_ARB = $8575; + GL_SUBTRACT_ARB = $84E7; + GL_CONSTANT_ARB = $8576; + GL_PRIMARY_COLOR_ARB = $8577; + GL_PREVIOUS_ARB = $8578; + +function Load_GL_ARB_texture_env_combine: Boolean; + +//***** GL_ARB_texture_env_crossbar *****// + +function Load_GL_ARB_texture_env_crossbar: Boolean; + +//***** GL_ARB_texture_env_dot3 *****// +const + GL_DOT3_RGB_ARB = $86AE; + GL_DOT3_RGBA_ARB = $86AF; + +function Load_GL_ARB_texture_env_dot3: Boolean; + +//***** GL_ARB_texture_mirrored_repeat *****// +const + GL_MIRRORED_REPEAT_ARB = $8370; + +function Load_GL_ARB_texture_mirrored_repeat: Boolean; + +//***** GL_ARB_vertex_blend *****// +const + GL_MAX_VERTEX_UNITS_ARB = $86A4; + GL_ACTIVE_VERTEX_UNITS_ARB = $86A5; + GL_WEIGHT_SUM_UNITY_ARB = $86A6; + GL_VERTEX_BLEND_ARB = $86A7; + GL_MODELVIEW0_ARB = $1700; + GL_MODELVIEW1_ARB = $850A; + GL_MODELVIEW2_ARB = $8722; + GL_MODELVIEW3_ARB = $8723; + GL_MODELVIEW4_ARB = $8724; + GL_MODELVIEW5_ARB = $8725; + GL_MODELVIEW6_ARB = $8726; + GL_MODELVIEW7_ARB = $8727; + GL_MODELVIEW8_ARB = $8728; + GL_MODELVIEW9_ARB = $8729; + GL_MODELVIEW10_ARB = $872A; + GL_MODELVIEW11_ARB = $872B; + GL_MODELVIEW12_ARB = $872C; + GL_MODELVIEW13_ARB = $872D; + GL_MODELVIEW14_ARB = $872E; + GL_MODELVIEW15_ARB = $872F; + GL_MODELVIEW16_ARB = $8730; + GL_MODELVIEW17_ARB = $8731; + GL_MODELVIEW18_ARB = $8732; + GL_MODELVIEW19_ARB = $8733; + GL_MODELVIEW20_ARB = $8734; + GL_MODELVIEW21_ARB = $8735; + GL_MODELVIEW22_ARB = $8736; + GL_MODELVIEW23_ARB = $8737; + GL_MODELVIEW24_ARB = $8738; + GL_MODELVIEW25_ARB = $8739; + GL_MODELVIEW26_ARB = $873A; + GL_MODELVIEW27_ARB = $873B; + GL_MODELVIEW28_ARB = $873C; + GL_MODELVIEW29_ARB = $873D; + GL_MODELVIEW30_ARB = $873E; + GL_MODELVIEW31_ARB = $873F; + GL_CURRENT_WEIGHT_ARB = $86A8; + GL_WEIGHT_ARRAY_TYPE_ARB = $86A9; + GL_WEIGHT_ARRAY_STRIDE_ARB = $86AA; + GL_WEIGHT_ARRAY_SIZE_ARB = $86AB; + GL_WEIGHT_ARRAY_POINTER_ARB = $86AC; + GL_WEIGHT_ARRAY_ARB = $86AD; +var + glWeightbvARB: procedure(size: GLint; weights: PGLbyte); extdecl; + glWeightsvARB: procedure(size: GLint; weights: PGLshort); extdecl; + glWeightivARB: procedure(size: GLint; weights: PGLint); extdecl; + glWeightfvARB: procedure(size: GLint; weights: PGLfloat); extdecl; + glWeightdvARB: procedure(size: GLint; weights: PGLdouble); extdecl; + glWeightvARB: procedure(size: GLint; weights: PGLdouble); extdecl; + glWeightubvARB: procedure(size: GLint; weights: PGLubyte); extdecl; + glWeightusvARB: procedure(size: GLint; weights: PGLushort); extdecl; + glWeightuivARB: procedure(size: GLint; weights: PGLuint); extdecl; + glWeightPointerARB: procedure(size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); extdecl; + glVertexBlendARB: procedure(count: GLint); extdecl; + +function Load_GL_ARB_vertex_blend: Boolean; + +//***** GL_ARB_vertex_program *****// +const + GL_VERTEX_PROGRAM_ARB = $8620; + GL_VERTEX_PROGRAM_POINT_SIZE_ARB = $8642; + GL_VERTEX_PROGRAM_TWO_SIDE_ARB = $8643; + GL_COLOR_SUM_ARB = $8458; + GL_PROGRAM_FORMAT_ASCII_ARB = $8875; + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = $8622; + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = $8623; + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = $8624; + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = $8625; + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = $886A; + GL_CURRENT_VERTEX_ATTRIB_ARB = $8626; + GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = $8645; + GL_PROGRAM_LENGTH_ARB = $8627; + GL_PROGRAM_FORMAT_ARB = $8876; + GL_PROGRAM_BINDING_ARB = $8677; + GL_PROGRAM_INSTRUCTIONS_ARB = $88A0; + GL_MAX_PROGRAM_INSTRUCTIONS_ARB = $88A1; + GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = $88A2; + GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = $88A3; + GL_PROGRAM_TEMPORARIES_ARB = $88A4; + GL_MAX_PROGRAM_TEMPORARIES_ARB = $88A5; + GL_PROGRAM_NATIVE_TEMPORARIES_ARB = $88A6; + GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = $88A7; + GL_PROGRAM_PARAMETERS_ARB = $88A8; + GL_MAX_PROGRAM_PARAMETERS_ARB = $88A9; + GL_PROGRAM_NATIVE_PARAMETERS_ARB = $88AA; + GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = $88AB; + GL_PROGRAM_ATTRIBS_ARB = $88AC; + GL_MAX_PROGRAM_ATTRIBS_ARB = $88AD; + GL_PROGRAM_NATIVE_ATTRIBS_ARB = $88AE; + GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = $88AF; + GL_PROGRAM_ADDRESS_REGISTERS_ARB = $88B0; + GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = $88B1; + GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = $88B2; + GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = $88B3; + GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = $88B4; + GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = $88B5; + GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = $88B6; + GL_PROGRAM_STRING_ARB = $8628; + GL_PROGRAM_ERROR_POSITION_ARB = $864B; + GL_CURRENT_MATRIX_ARB = $8641; + GL_TRANSPOSE_CURRENT_MATRIX_ARB = $88B7; + GL_CURRENT_MATRIX_STACK_DEPTH_ARB = $8640; + GL_MAX_VERTEX_ATTRIBS_ARB = $8869; + GL_MAX_PROGRAM_MATRICES_ARB = $862F; + GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = $862E; + GL_PROGRAM_ERROR_STRING_ARB = $8874; + GL_MATRIX0_ARB = $88C0; + GL_MATRIX1_ARB = $88C1; + GL_MATRIX2_ARB = $88C2; + GL_MATRIX3_ARB = $88C3; + GL_MATRIX4_ARB = $88C4; + GL_MATRIX5_ARB = $88C5; + GL_MATRIX6_ARB = $88C6; + GL_MATRIX7_ARB = $88C7; + GL_MATRIX8_ARB = $88C8; + GL_MATRIX9_ARB = $88C9; + GL_MATRIX10_ARB = $88CA; + GL_MATRIX11_ARB = $88CB; + GL_MATRIX12_ARB = $88CC; + GL_MATRIX13_ARB = $88CD; + GL_MATRIX14_ARB = $88CE; + GL_MATRIX15_ARB = $88CF; + GL_MATRIX16_ARB = $88D0; + GL_MATRIX17_ARB = $88D1; + GL_MATRIX18_ARB = $88D2; + GL_MATRIX19_ARB = $88D3; + GL_MATRIX20_ARB = $88D4; + GL_MATRIX21_ARB = $88D5; + GL_MATRIX22_ARB = $88D6; + GL_MATRIX23_ARB = $88D7; + GL_MATRIX24_ARB = $88D8; + GL_MATRIX25_ARB = $88D9; + GL_MATRIX26_ARB = $88DA; + GL_MATRIX27_ARB = $88DB; + GL_MATRIX28_ARB = $88DC; + GL_MATRIX29_ARB = $88DD; + GL_MATRIX30_ARB = $88DE; + GL_MATRIX31_ARB = $88DF; +var + glVertexAttrib1sARB: procedure(index: GLuint; x: GLshort); extdecl; + glVertexAttrib1fARB: procedure(index: GLuint; x: GLfloat); extdecl; + glVertexAttrib1dARB: procedure(index: GLuint; x: GLdouble); extdecl; + glVertexAttrib2sARB: procedure(index: GLuint; x: GLshort; y: GLshort); extdecl; + glVertexAttrib2fARB: procedure(index: GLuint; x: GLfloat; y: GLfloat); extdecl; + glVertexAttrib2dARB: procedure(index: GLuint; x: GLdouble; y: GLdouble); extdecl; + glVertexAttrib3sARB: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort); extdecl; + glVertexAttrib3fARB: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glVertexAttrib3dARB: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glVertexAttrib4sARB: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort; w: GLshort); extdecl; + glVertexAttrib4fARB: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glVertexAttrib4dARB: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glVertexAttrib4NubARB: procedure(index: GLuint; x: GLubyte; y: GLubyte; z: GLubyte; w: GLubyte); extdecl; + glVertexAttrib1svARB: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib1fvARB: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib1dvARB: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib2svARB: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib2fvARB: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib2dvARB: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib3svARB: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib3fvARB: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib3dvARB: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib4bvARB: procedure(index: GLuint; const v: PGLbyte); extdecl; + glVertexAttrib4svARB: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4ivARB: procedure(index: GLuint; const v: PGLint); extdecl; + glVertexAttrib4ubvARB: procedure(index: GLuint; const v: PGLubyte); extdecl; + glVertexAttrib4usvARB: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib4uivARB: procedure(index: GLuint; const v: PGLuint); extdecl; + glVertexAttrib4fvARB: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib4dvARB: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib4NbvARB: procedure(index: GLuint; const v: PGLbyte); extdecl; + glVertexAttrib4NsvARB: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4NivARB: procedure(index: GLuint; const v: PGLint); extdecl; + glVertexAttrib4NubvARB: procedure(index: GLuint; const v: PGLubyte); extdecl; + glVertexAttrib4NusvARB: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib4NuivARB: procedure(index: GLuint; const v: PGLuint); extdecl; + glVertexAttribPointerARB: procedure(index: GLuint; size: GLint; _type: GLenum; normalized: GLboolean; stride: GLsizei; const pointer: PGLvoid); extdecl; + glEnableVertexAttribArrayARB: procedure(index: GLuint); extdecl; + glDisableVertexAttribArrayARB: procedure(index: GLuint); extdecl; + glProgramStringARB: procedure(target: GLenum; format: GLenum; len: GLsizei; const _string: PGLvoid); extdecl; + glBindProgramARB: procedure(target: GLenum; _program: GLuint); extdecl; + glDeleteProgramsARB: procedure(n: GLsizei; const programs: PGLuint); extdecl; + glGenProgramsARB: procedure(n: GLsizei; programs: PGLuint); extdecl; + glProgramEnvParameter4dARB: procedure(target: GLenum; index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glProgramEnvParameter4dvARB: procedure(target: GLenum; index: GLuint; const params: PGLdouble); extdecl; + glProgramEnvParameter4fARB: procedure(target: GLenum; index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glProgramEnvParameter4fvARB: procedure(target: GLenum; index: GLuint; const params: PGLfloat); extdecl; + glProgramLocalParameter4dARB: procedure(target: GLenum; index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glProgramLocalParameter4dvARB: procedure(target: GLenum; index: GLuint; const params: PGLdouble); extdecl; + glProgramLocalParameter4fARB: procedure(target: GLenum; index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glProgramLocalParameter4fvARB: procedure(target: GLenum; index: GLuint; const params: PGLfloat); extdecl; + glGetProgramEnvParameterdvARB: procedure(target: GLenum; index: GLuint; params: PGLdouble); extdecl; + glGetProgramEnvParameterfvARB: procedure(target: GLenum; index: GLuint; params: PGLfloat); extdecl; + glGetProgramLocalParameterdvARB: procedure(target: GLenum; index: GLuint; params: PGLdouble); extdecl; + glGetProgramLocalParameterfvARB: procedure(target: GLenum; index: GLuint; params: PGLfloat); extdecl; + glGetProgramivARB: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetProgramStringARB: procedure(target: GLenum; pname: GLenum; _string: PGLvoid); extdecl; + glGetVertexAttribdvARB: procedure(index: GLuint; pname: GLenum; params: PGLdouble); extdecl; + glGetVertexAttribfvARB: procedure(index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetVertexAttribivARB: procedure(index: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetVertexAttribPointervARB: procedure(index: GLuint; pname: GLenum; pointer: PGLvoid); extdecl; + glIsProgramARB: function(_program: GLuint): GLboolean; extdecl; + +function Load_GL_ARB_vertex_program: Boolean; + +//***** GL_ARB_window_pos *****// +var + glWindowPos2dARB: procedure(x: GLdouble; y: GLdouble); extdecl; + glWindowPos2fARB: procedure(x: GLfloat; y: GLfloat); extdecl; + glWindowPos2iARB: procedure(x: GLint; y: GLint); extdecl; + glWindowPos2sARB: procedure(x: GLshort; y: GLshort); extdecl; + glWindowPos2dvARB: procedure(const p: PGLdouble); extdecl; + glWindowPos2fvARB: procedure(const p: PGLfloat); extdecl; + glWindowPos2ivARB: procedure(const p: PGLint); extdecl; + glWindowPos2svARB: procedure(const p: PGLshort); extdecl; + glWindowPos3dARB: procedure(x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glWindowPos3fARB: procedure(x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glWindowPos3iARB: procedure(x: GLint; y: GLint; z: GLint); extdecl; + glWindowPos3sARB: procedure(x: GLshort; y: GLshort; z: GLshort); extdecl; + glWindowPos3dvARB: procedure(const p: PGLdouble); extdecl; + glWindowPos3fvARB: procedure(const p: PGLfloat); extdecl; + glWindowPos3ivARB: procedure(const p: PGLint); extdecl; + glWindowPos3svARB: procedure(const p: PGLshort); extdecl; + +function Load_GL_ARB_window_pos: Boolean; + +//***** GL_EXT_422_pixels *****// +const + GL_422_EXT = $80CC; + GL_422_REV_EXT = $80CD; + GL_422_AVERAGE_EXT = $80CE; + GL_422_REV_AVERAGE_EXT = $80CF; + +function Load_GL_EXT_422_pixels: Boolean; + +//***** GL_EXT_abgr *****// +const + GL_ABGR_EXT = $8000; + +function Load_GL_EXT_abgr: Boolean; + +//***** GL_EXT_bgra *****// +const + GL_BGR_EXT = $80E0; + GL_BGRA_EXT = $80E1; + +function Load_GL_EXT_bgra: Boolean; + +//***** GL_EXT_blend_color *****// +const + GL_CONSTANT_COLOR_EXT = $8001; + GL_ONE_MINUS_CONSTANT_COLOR_EXT = $8002; + GL_CONSTANT_ALPHA_EXT = $8003; + GL_ONE_MINUS_CONSTANT_ALPHA_EXT = $8004; + GL_BLEND_COLOR_EXT = $8005; +var + glBlendColorEXT: procedure(red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf); extdecl; + +function Load_GL_EXT_blend_color: Boolean; + +//***** GL_EXT_blend_func_separate *****// +const + GL_BLEND_DST_RGB_EXT = $80C8; + GL_BLEND_SRC_RGB_EXT = $80C9; + GL_BLEND_DST_ALPHA_EXT = $80CA; + GL_BLEND_SRC_ALPHA_EXT = $80CB; +var + glBlendFuncSeparateEXT: procedure(sfactorRGB: GLenum; dfactorRGB: GLenum; sfactorAlpha: GLenum; dfactorAlpha: GLenum); extdecl; + +function Load_GL_EXT_blend_func_separate: Boolean; + +//***** GL_EXT_blend_logic_op *****// + +function Load_GL_EXT_blend_logic_op: Boolean; + +//***** GL_EXT_blend_minmax *****// +const + GL_FUNC_ADD_EXT = $8006; + GL_MIN_EXT = $8007; + GL_MAX_EXT = $8008; + GL_BLEND_EQUATION_EXT = $8009; +var + glBlendEquationEXT: procedure(mode: GLenum); extdecl; + +function Load_GL_EXT_blend_minmax: Boolean; + +//***** GL_EXT_blend_subtract *****// +const + GL_FUNC_SUBTRACT_EXT = $800A; + GL_FUNC_REVERSE_SUBTRACT_EXT = $800B; + +function Load_GL_EXT_blend_subtract: Boolean; + +//***** GL_EXT_clip_volume_hint *****// +const + GL_CLIP_VOLUME_CLIPPING_HINT_EXT = $80F0; + +function Load_GL_EXT_clip_volume_hint: Boolean; + +//***** GL_EXT_color_subtable *****// +var + glColorSubTableEXT: procedure(target: GLenum; start: GLsizei; count: GLsizei; format: GLenum; _type: GLenum; const data: PGLvoid); extdecl; + glCopyColorSubTableEXT: procedure(target: GLenum; start: GLsizei; x: GLint; y: GLint; width: GLsizei); extdecl; + +function Load_GL_EXT_color_subtable: Boolean; + +//***** GL_EXT_compiled_vertex_array *****// +const + GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = $81A8; + GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = $81A9; +var + glLockArraysEXT: procedure(first: GLint; count: GLsizei); extdecl; + glUnlockArraysEXT: procedure(); extdecl; + +function Load_GL_EXT_compiled_vertex_array: Boolean; + +//***** GL_EXT_convolution *****// +const + GL_CONVOLUTION_1D_EXT = $8010; + GL_CONVOLUTION_2D_EXT = $8011; + GL_SEPARABLE_2D_EXT = $8012; + GL_CONVOLUTION_BORDER_MODE_EXT = $8013; + GL_CONVOLUTION_FILTER_SCALE_EXT = $8014; + GL_CONVOLUTION_FILTER_BIAS_EXT = $8015; + GL_REDUCE_EXT = $8016; + GL_CONVOLUTION_FORMAT_EXT = $8017; + GL_CONVOLUTION_WIDTH_EXT = $8018; + GL_CONVOLUTION_HEIGHT_EXT = $8019; + GL_MAX_CONVOLUTION_WIDTH_EXT = $801A; + GL_MAX_CONVOLUTION_HEIGHT_EXT = $801B; + GL_POST_CONVOLUTION_RED_SCALE_EXT = $801C; + GL_POST_CONVOLUTION_GREEN_SCALE_EXT = $801D; + GL_POST_CONVOLUTION_BLUE_SCALE_EXT = $801E; + GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = $801F; + GL_POST_CONVOLUTION_RED_BIAS_EXT = $8020; + GL_POST_CONVOLUTION_GREEN_BIAS_EXT = $8021; + GL_POST_CONVOLUTION_BLUE_BIAS_EXT = $8022; + GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = $8023; +var + glConvolutionFilter1DEXT: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; format: GLenum; _type: GLenum; const image: PGLvoid); extdecl; + glConvolutionFilter2DEXT: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; const image: PGLvoid); extdecl; + glCopyConvolutionFilter1DEXT: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei); extdecl; + glCopyConvolutionFilter2DEXT: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei; height: GLsizei); extdecl; + glGetConvolutionFilterEXT: procedure(target: GLenum; format: GLenum; _type: GLenum; image: PGLvoid); extdecl; + glSeparableFilter2DEXT: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; const row: PGLvoid; const column: PGLvoid); extdecl; + glGetSeparableFilterEXT: procedure(target: GLenum; format: GLenum; _type: GLenum; row: PGLvoid; column: PGLvoid; span: PGLvoid); extdecl; + glConvolutionParameteriEXT: procedure(target: GLenum; pname: GLenum; param: GLint); extdecl; + glConvolutionParameterivEXT: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glConvolutionParameterfEXT: procedure(target: GLenum; pname: GLenum; param: GLfloat); extdecl; + glConvolutionParameterfvEXT: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glGetConvolutionParameterivEXT: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetConvolutionParameterfvEXT: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_EXT_convolution: Boolean; + +//***** GL_EXT_fog_coord *****// +const + GL_FOG_COORDINATE_SOURCE_EXT = $8450; + GL_FOG_COORDINATE_EXT = $8451; + GL_FRAGMENT_DEPTH_EXT = $8452; + GL_CURRENT_FOG_COORDINATE_EXT = $8453; + GL_FOG_COORDINATE_ARRAY_TYPE_EXT = $8454; + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = $8455; + GL_FOG_COORDINATE_ARRAY_POINTER_EXT = $8456; + GL_FOG_COORDINATE_ARRAY_EXT = $8457; +var + glFogCoordfEXT: procedure(coord: GLfloat); extdecl; + glFogCoorddEXT: procedure(coord: GLdouble); extdecl; + glFogCoordfvEXT: procedure(coord: PGLfloat); extdecl; + glFogCoorddvEXT: procedure(coord: PGLdouble); extdecl; + glFogCoordPointerEXT: procedure(_type: GLenum; stride: GLsizei; pointer: PGLvoid); extdecl; + +function Load_GL_EXT_fog_coord: Boolean; + +//***** GL_EXT_histogram *****// +const + GL_HISTOGRAM_EXT = $8024; + GL_PROXY_HISTOGRAM_EXT = $8025; + GL_HISTOGRAM_WIDTH_EXT = $8026; + GL_HISTOGRAM_FORMAT_EXT = $8027; + GL_HISTOGRAM_RED_SIZE_EXT = $8028; + GL_HISTOGRAM_GREEN_SIZE_EXT = $8029; + GL_HISTOGRAM_BLUE_SIZE_EXT = $802A; + GL_HISTOGRAM_ALPHA_SIZE_EXT = $802B; + GL_HISTOGRAM_LUMINANCE_SIZE_EXT = $802C; + GL_HISTOGRAM_SINK_EXT = $802D; + GL_MINMAX_EXT = $802E; + GL_MINMAX_FORMAT_EXT = $802F; + GL_MINMAX_SINK_EXT = $8030; +var + glHistogramEXT: procedure(target: GLenum; width: GLsizei; internalformat: GLenum; sink: GLboolean); extdecl; + glResetHistogramEXT: procedure(target: GLenum); extdecl; + glGetHistogramEXT: procedure(target: GLenum; reset: GLboolean; format: GLenum; _type: GLenum; values: PGLvoid); extdecl; + glGetHistogramParameterivEXT: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetHistogramParameterfvEXT: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glMinmaxEXT: procedure(target: GLenum; internalformat: GLenum; sink: GLboolean); extdecl; + glResetMinmaxEXT: procedure(target: GLenum); extdecl; + glGetMinmaxEXT: procedure(target: GLenum; reset: GLboolean; format: GLenum; _type: GLenum; values: PGLvoid); extdecl; + glGetMinmaxParameterivEXT: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetMinmaxParameterfvEXT: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_EXT_histogram: Boolean; + +//***** GL_EXT_multi_draw_arrays *****// +var + glMultiDrawArraysEXT: procedure(mode: GLenum; first: PGLint; count: PGLsizei; primcount: GLsizei); extdecl; + glMultiDrawElementsEXT: procedure(mode: GLenum; count: PGLsizei; _type: GLenum; const indices: PGLvoid; primcount: GLsizei); extdecl; + +function Load_GL_EXT_multi_draw_arrays: Boolean; + +//***** GL_EXT_packed_pixels *****// +const + GL_UNSIGNED_BYTE_3_3_2_EXT = $8032; + GL_UNSIGNED_SHORT_4_4_4_4_EXT = $8033; + GL_UNSIGNED_SHORT_5_5_5_1_EXT = $8034; + GL_UNSIGNED_INT_8_8_8_8_EXT = $8035; + GL_UNSIGNED_INT_10_10_10_2_EXT = $8036; + +function Load_GL_EXT_packed_pixels: Boolean; + +//***** GL_EXT_paletted_texture *****// +const + GL_COLOR_INDEX1_EXT = $80E2; + GL_COLOR_INDEX2_EXT = $80E3; + GL_COLOR_INDEX4_EXT = $80E4; + GL_COLOR_INDEX8_EXT = $80E5; + GL_COLOR_INDEX12_EXT = $80E6; + GL_COLOR_INDEX16_EXT = $80E7; + GL_COLOR_TABLE_FORMAT_EXT = $80D8; + GL_COLOR_TABLE_WIDTH_EXT = $80D9; + GL_COLOR_TABLE_RED_SIZE_EXT = $80DA; + GL_COLOR_TABLE_GREEN_SIZE_EXT = $80DB; + GL_COLOR_TABLE_BLUE_SIZE_EXT = $80DC; + GL_COLOR_TABLE_ALPHA_SIZE_EXT = $80DD; + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = $80DE; + GL_COLOR_TABLE_INTENSITY_SIZE_EXT = $80DF; + GL_TEXTURE_INDEX_SIZE_EXT = $80ED; + GL_TEXTURE_1D = $0DE0; + GL_TEXTURE_2D = $0DE1; + GL_TEXTURE_3D_EXT = $806F; + // GL_TEXTURE_CUBE_MAP_ARB { already defined } + GL_PROXY_TEXTURE_1D = $8063; + GL_PROXY_TEXTURE_2D = $8064; + GL_PROXY_TEXTURE_3D_EXT = $8070; + // GL_PROXY_TEXTURE_CUBE_MAP_ARB { already defined } + // GL_TEXTURE_1D { already defined } + // GL_TEXTURE_2D { already defined } + // GL_TEXTURE_3D_EXT { already defined } + // GL_TEXTURE_CUBE_MAP_ARB { already defined } +var + glColorTableEXT: procedure(target: GLenum; internalFormat: GLenum; width: GLsizei; format: GLenum; _type: GLenum; const data: PGLvoid); extdecl; + // glColorSubTableEXT { already defined } + glGetColorTableEXT: procedure(target: GLenum; format: GLenum; _type: GLenum; data: PGLvoid); extdecl; + glGetColorTableParameterivEXT: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetColorTableParameterfvEXT: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_EXT_paletted_texture: Boolean; + +//***** GL_EXT_point_parameters *****// +const + GL_POINT_SIZE_MIN_EXT = $8126; + GL_POINT_SIZE_MAX_EXT = $8127; + GL_POINT_FADE_THRESHOLD_SIZE_EXT = $8128; + GL_DISTANCE_ATTENUATION_EXT = $8129; +var + glPointParameterfEXT: procedure(pname: GLenum; param: GLfloat); extdecl; + glPointParameterfvEXT: procedure(pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_EXT_point_parameters: Boolean; + +//***** GL_EXT_polygon_offset *****// +const + GL_POLYGON_OFFSET_EXT = $8037; + GL_POLYGON_OFFSET_FACTOR_EXT = $8038; + GL_POLYGON_OFFSET_BIAS_EXT = $8039; +var + glPolygonOffsetEXT: procedure(factor: GLfloat; bias: GLfloat); extdecl; + +function Load_GL_EXT_polygon_offset: Boolean; + +//***** GL_EXT_secondary_color *****// +const + GL_COLOR_SUM_EXT = $8458; + GL_CURRENT_SECONDARY_COLOR_EXT = $8459; + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = $845A; + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = $845B; + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = $845C; + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = $845D; + GL_SECONDARY_COLOR_ARRAY_EXT = $845E; +var + glSecondaryColor3bEXT: procedure(components: GLbyte); extdecl; + glSecondaryColor3sEXT: procedure(components: GLshort); extdecl; + glSecondaryColor3iEXT: procedure(components: GLint); extdecl; + glSecondaryColor3fEXT: procedure(components: GLfloat); extdecl; + glSecondaryColor3dEXT: procedure(components: GLdouble); extdecl; + glSecondaryColor3ubEXT: procedure(components: GLubyte); extdecl; + glSecondaryColor3usEXT: procedure(components: GLushort); extdecl; + glSecondaryColor3uiEXT: procedure(components: GLuint); extdecl; + glSecondaryColor3bvEXT: procedure(components: GLbyte); extdecl; + glSecondaryColor3svEXT: procedure(components: GLshort); extdecl; + glSecondaryColor3ivEXT: procedure(components: GLint); extdecl; + glSecondaryColor3fvEXT: procedure(components: GLfloat); extdecl; + glSecondaryColor3dvEXT: procedure(components: GLdouble); extdecl; + glSecondaryColor3ubvEXT: procedure(components: GLubyte); extdecl; + glSecondaryColor3usvEXT: procedure(components: GLushort); extdecl; + glSecondaryColor3uivEXT: procedure(components: GLuint); extdecl; + glSecondaryColorPointerEXT: procedure(size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); extdecl; + +function Load_GL_EXT_secondary_color: Boolean; + +//***** GL_EXT_separate_specular_color *****// +const + GL_LIGHT_MODEL_COLOR_CONTROL_EXT = $81F8; + GL_SINGLE_COLOR_EXT = $81F9; + GL_SEPARATE_SPECULAR_COLOR_EXT = $81FA; + +function Load_GL_EXT_separate_specular_color: Boolean; + +//***** GL_EXT_shadow_funcs *****// + +function Load_GL_EXT_shadow_funcs: Boolean; + +//***** GL_EXT_shared_texture_palette *****// +const + GL_SHARED_TEXTURE_PALETTE_EXT = $81FB; + +function Load_GL_EXT_shared_texture_palette: Boolean; + +//***** GL_EXT_stencil_two_side *****// +const + GL_STENCIL_TEST_TWO_SIDE_EXT = $8910; + GL_ACTIVE_STENCIL_FACE_EXT = $8911; +var + glActiveStencilFaceEXT: procedure(face: GLenum); extdecl; + +function Load_GL_EXT_stencil_two_side: Boolean; + +//***** GL_EXT_stencil_wrap *****// +const + GL_INCR_WRAP_EXT = $8507; + GL_DECR_WRAP_EXT = $8508; + +function Load_GL_EXT_stencil_wrap: Boolean; + +//***** GL_EXT_subtexture *****// +var + glTexSubImage1DEXT: procedure(target: GLenum; level: GLint; xoffset: GLint; width: GLsizei; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + glTexSubImage2DEXT: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + glTexSubImage3DEXT: procedure(target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + +function Load_GL_EXT_subtexture: Boolean; + +//***** GL_EXT_texture3D *****// +const + GL_PACK_SKIP_IMAGES_EXT = $806B; + GL_PACK_IMAGE_HEIGHT_EXT = $806C; + GL_UNPACK_SKIP_IMAGES_EXT = $806D; + GL_UNPACK_IMAGE_HEIGHT_EXT = $806E; + // GL_TEXTURE_3D_EXT { already defined } + // GL_PROXY_TEXTURE_3D_EXT { already defined } + GL_TEXTURE_DEPTH_EXT = $8071; + GL_TEXTURE_WRAP_R_EXT = $8072; + GL_MAX_3D_TEXTURE_SIZE_EXT = $8073; +var + glTexImage3DEXT: procedure(target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; height: GLsizei; depth: GLsizei; border: GLint; format: GLenum; _type: GLenum; const pixels: PGLvoid); extdecl; + +function Load_GL_EXT_texture3D: Boolean; + +//***** GL_EXT_texture_compression_s3tc *****// +const + GL_COMPRESSED_RGB_S3TC_DXT1_EXT = $83F0; + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = $83F1; + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = $83F2; + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = $83F3; + +function Load_GL_EXT_texture_compression_s3tc: Boolean; + +//***** GL_EXT_texture_env_add *****// + +function Load_GL_EXT_texture_env_add: Boolean; + +//***** GL_EXT_texture_env_combine *****// +const + GL_COMBINE_EXT = $8570; + GL_COMBINE_RGB_EXT = $8571; + GL_COMBINE_ALPHA_EXT = $8572; + GL_SOURCE0_RGB_EXT = $8580; + GL_SOURCE1_RGB_EXT = $8581; + GL_SOURCE2_RGB_EXT = $8582; + GL_SOURCE0_ALPHA_EXT = $8588; + GL_SOURCE1_ALPHA_EXT = $8589; + GL_SOURCE2_ALPHA_EXT = $858A; + GL_OPERAND0_RGB_EXT = $8590; + GL_OPERAND1_RGB_EXT = $8591; + GL_OPERAND2_RGB_EXT = $8592; + GL_OPERAND0_ALPHA_EXT = $8598; + GL_OPERAND1_ALPHA_EXT = $8599; + GL_OPERAND2_ALPHA_EXT = $859A; + GL_RGB_SCALE_EXT = $8573; + GL_ADD_SIGNED_EXT = $8574; + GL_INTERPOLATE_EXT = $8575; + GL_CONSTANT_EXT = $8576; + GL_PRIMARY_COLOR_EXT = $8577; + GL_PREVIOUS_EXT = $8578; + +function Load_GL_EXT_texture_env_combine: Boolean; + +//***** GL_EXT_texture_env_dot3 *****// +const + GL_DOT3_RGB_EXT = $8740; + GL_DOT3_RGBA_EXT = $8741; + +function Load_GL_EXT_texture_env_dot3: Boolean; + +//***** GL_EXT_texture_filter_anisotropic *****// +const + GL_TEXTURE_MAX_ANISOTROPY_EXT = $84FE; + GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = $84FF; + +function Load_GL_EXT_texture_filter_anisotropic: Boolean; + +//***** GL_EXT_texture_lod_bias *****// +const + GL_TEXTURE_FILTER_CONTROL_EXT = $8500; + GL_TEXTURE_LOD_BIAS_EXT = $8501; + GL_MAX_TEXTURE_LOD_BIAS_EXT = $84FD; + +function Load_GL_EXT_texture_lod_bias: Boolean; + +//***** GL_EXT_texture_object *****// +const + GL_TEXTURE_PRIORITY_EXT = $8066; + GL_TEXTURE_RESIDENT_EXT = $8067; + GL_TEXTURE_1D_BINDING_EXT = $8068; + GL_TEXTURE_2D_BINDING_EXT = $8069; + GL_TEXTURE_3D_BINDING_EXT = $806A; +var + glGenTexturesEXT: procedure(n: GLsizei; textures: PGLuint); extdecl; + glDeleteTexturesEXT: procedure(n: GLsizei; const textures: PGLuint); extdecl; + glBindTextureEXT: procedure(target: GLenum; texture: GLuint); extdecl; + glPrioritizeTexturesEXT: procedure(n: GLsizei; const textures: PGLuint; const priorities: PGLclampf); extdecl; + glAreTexturesResidentEXT: function(n: GLsizei; const textures: PGLuint; residences: PGLboolean): GLboolean; extdecl; + glIsTextureEXT: function(texture: GLuint): GLboolean; extdecl; + +function Load_GL_EXT_texture_object: Boolean; + +//***** GL_EXT_vertex_array *****// +const + GL_VERTEX_ARRAY_EXT = $8074; + GL_NORMAL_ARRAY_EXT = $8075; + GL_COLOR_ARRAY_EXT = $8076; + GL_INDEX_ARRAY_EXT = $8077; + GL_TEXTURE_COORD_ARRAY_EXT = $8078; + GL_EDGE_FLAG_ARRAY_EXT = $8079; + GL_DOUBLE_EXT = $140A; + GL_VERTEX_ARRAY_SIZE_EXT = $807A; + GL_VERTEX_ARRAY_TYPE_EXT = $807B; + GL_VERTEX_ARRAY_STRIDE_EXT = $807C; + GL_VERTEX_ARRAY_COUNT_EXT = $807D; + GL_NORMAL_ARRAY_TYPE_EXT = $807E; + GL_NORMAL_ARRAY_STRIDE_EXT = $807F; + GL_NORMAL_ARRAY_COUNT_EXT = $8080; + GL_COLOR_ARRAY_SIZE_EXT = $8081; + GL_COLOR_ARRAY_TYPE_EXT = $8082; + GL_COLOR_ARRAY_STRIDE_EXT = $8083; + GL_COLOR_ARRAY_COUNT_EXT = $8084; + GL_INDEX_ARRAY_TYPE_EXT = $8085; + GL_INDEX_ARRAY_STRIDE_EXT = $8086; + GL_INDEX_ARRAY_COUNT_EXT = $8087; + GL_TEXTURE_COORD_ARRAY_SIZE_EXT = $8088; + GL_TEXTURE_COORD_ARRAY_TYPE_EXT = $8089; + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = $808A; + GL_TEXTURE_COORD_ARRAY_COUNT_EXT = $808B; + GL_EDGE_FLAG_ARRAY_STRIDE_EXT = $808C; + GL_EDGE_FLAG_ARRAY_COUNT_EXT = $808D; + GL_VERTEX_ARRAY_POINTER_EXT = $808E; + GL_NORMAL_ARRAY_POINTER_EXT = $808F; + GL_COLOR_ARRAY_POINTER_EXT = $8090; + GL_INDEX_ARRAY_POINTER_EXT = $8091; + GL_TEXTURE_COORD_ARRAY_POINTER_EXT = $8092; + GL_EDGE_FLAG_ARRAY_POINTER_EXT = $8093; +var + glArrayElementEXT: procedure(i: GLint); extdecl; + glDrawArraysEXT: procedure(mode: GLenum; first: GLint; count: GLsizei); extdecl; + glVertexPointerEXT: procedure(size: GLint; _type: GLenum; stride: GLsizei; count: GLsizei; const pointer: PGLvoid); extdecl; + glNormalPointerEXT: procedure(_type: GLenum; stride: GLsizei; count: GLsizei; const pointer: PGLvoid); extdecl; + glColorPointerEXT: procedure(size: GLint; _type: GLenum; stride: GLsizei; count: GLsizei; const pointer: PGLvoid); extdecl; + glIndexPointerEXT: procedure(_type: GLenum; stride: GLsizei; count: GLsizei; const pointer: PGLvoid); extdecl; + glTexCoordPointerEXT: procedure(size: GLint; _type: GLenum; stride: GLsizei; count: GLsizei; const pointer: PGLvoid); extdecl; + glEdgeFlagPointerEXT: procedure(stride: GLsizei; count: GLsizei; const pointer: PGLboolean); extdecl; + glGetPointervEXT: procedure(pname: GLenum; params: PGLvoid); extdecl; + +function Load_GL_EXT_vertex_array: Boolean; + +//***** GL_EXT_vertex_shader *****// +const + GL_VERTEX_SHADER_EXT = $8780; + GL_VARIANT_VALUE_EXT = $87E4; + GL_VARIANT_DATATYPE_EXT = $87E5; + GL_VARIANT_ARRAY_STRIDE_EXT = $87E6; + GL_VARIANT_ARRAY_TYPE_EXT = $87E7; + GL_VARIANT_ARRAY_EXT = $87E8; + GL_VARIANT_ARRAY_POINTER_EXT = $87E9; + GL_INVARIANT_VALUE_EXT = $87EA; + GL_INVARIANT_DATATYPE_EXT = $87EB; + GL_LOCAL_CONSTANT_VALUE_EXT = $87EC; + GL_LOCAL_CONSTANT_DATATYPE_EXT = $87ED; + GL_OP_INDEX_EXT = $8782; + GL_OP_NEGATE_EXT = $8783; + GL_OP_DOT3_EXT = $8784; + GL_OP_DOT4_EXT = $8785; + GL_OP_MUL_EXT = $8786; + GL_OP_ADD_EXT = $8787; + GL_OP_MADD_EXT = $8788; + GL_OP_FRAC_EXT = $8789; + GL_OP_MAX_EXT = $878A; + GL_OP_MIN_EXT = $878B; + GL_OP_SET_GE_EXT = $878C; + GL_OP_SET_LT_EXT = $878D; + GL_OP_CLAMP_EXT = $878E; + GL_OP_FLOOR_EXT = $878F; + GL_OP_ROUND_EXT = $8790; + GL_OP_EXP_BASE_2_EXT = $8791; + GL_OP_LOG_BASE_2_EXT = $8792; + GL_OP_POWER_EXT = $8793; + GL_OP_RECIP_EXT = $8794; + GL_OP_RECIP_SQRT_EXT = $8795; + GL_OP_SUB_EXT = $8796; + GL_OP_CROSS_PRODUCT_EXT = $8797; + GL_OP_MULTIPLY_MATRIX_EXT = $8798; + GL_OP_MOV_EXT = $8799; + GL_OUTPUT_VERTEX_EXT = $879A; + GL_OUTPUT_COLOR0_EXT = $879B; + GL_OUTPUT_COLOR1_EXT = $879C; + GL_OUTPUT_TEXTURE_COORD0_EXT = $879D; + GL_OUTPUT_TEXTURE_COORD1_EXT = $879E; + GL_OUTPUT_TEXTURE_COORD2_EXT = $879F; + GL_OUTPUT_TEXTURE_COORD3_EXT = $87A0; + GL_OUTPUT_TEXTURE_COORD4_EXT = $87A1; + GL_OUTPUT_TEXTURE_COORD5_EXT = $87A2; + GL_OUTPUT_TEXTURE_COORD6_EXT = $87A3; + GL_OUTPUT_TEXTURE_COORD7_EXT = $87A4; + GL_OUTPUT_TEXTURE_COORD8_EXT = $87A5; + GL_OUTPUT_TEXTURE_COORD9_EXT = $87A6; + GL_OUTPUT_TEXTURE_COORD10_EXT = $87A7; + GL_OUTPUT_TEXTURE_COORD11_EXT = $87A8; + GL_OUTPUT_TEXTURE_COORD12_EXT = $87A9; + GL_OUTPUT_TEXTURE_COORD13_EXT = $87AA; + GL_OUTPUT_TEXTURE_COORD14_EXT = $87AB; + GL_OUTPUT_TEXTURE_COORD15_EXT = $87AC; + GL_OUTPUT_TEXTURE_COORD16_EXT = $87AD; + GL_OUTPUT_TEXTURE_COORD17_EXT = $87AE; + GL_OUTPUT_TEXTURE_COORD18_EXT = $87AF; + GL_OUTPUT_TEXTURE_COORD19_EXT = $87B0; + GL_OUTPUT_TEXTURE_COORD20_EXT = $87B1; + GL_OUTPUT_TEXTURE_COORD21_EXT = $87B2; + GL_OUTPUT_TEXTURE_COORD22_EXT = $87B3; + GL_OUTPUT_TEXTURE_COORD23_EXT = $87B4; + GL_OUTPUT_TEXTURE_COORD24_EXT = $87B5; + GL_OUTPUT_TEXTURE_COORD25_EXT = $87B6; + GL_OUTPUT_TEXTURE_COORD26_EXT = $87B7; + GL_OUTPUT_TEXTURE_COORD27_EXT = $87B8; + GL_OUTPUT_TEXTURE_COORD28_EXT = $87B9; + GL_OUTPUT_TEXTURE_COORD29_EXT = $87BA; + GL_OUTPUT_TEXTURE_COORD30_EXT = $87BB; + GL_OUTPUT_TEXTURE_COORD31_EXT = $87BC; + GL_OUTPUT_FOG_EXT = $87BD; + GL_SCALAR_EXT = $87BE; + GL_VECTOR_EXT = $87BF; + GL_MATRIX_EXT = $87C0; + GL_VARIANT_EXT = $87C1; + GL_INVARIANT_EXT = $87C2; + GL_LOCAL_CONSTANT_EXT = $87C3; + GL_LOCAL_EXT = $87C4; + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = $87C5; + GL_MAX_VERTEX_SHADER_VARIANTS_EXT = $87C6; + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = $87C7; + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = $87C8; + GL_MAX_VERTEX_SHADER_LOCALS_EXT = $87C9; + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = $87CA; + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = $87CB; + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = $87CC; + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = $87CD; + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = $87CE; + GL_VERTEX_SHADER_INSTRUCTIONS_EXT = $87CF; + GL_VERTEX_SHADER_VARIANTS_EXT = $87D0; + GL_VERTEX_SHADER_INVARIANTS_EXT = $87D1; + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = $87D2; + GL_VERTEX_SHADER_LOCALS_EXT = $87D3; + GL_VERTEX_SHADER_BINDING_EXT = $8781; + GL_VERTEX_SHADER_OPTIMIZED_EXT = $87D4; + GL_X_EXT = $87D5; + GL_Y_EXT = $87D6; + GL_Z_EXT = $87D7; + GL_W_EXT = $87D8; + GL_NEGATIVE_X_EXT = $87D9; + GL_NEGATIVE_Y_EXT = $87DA; + GL_NEGATIVE_Z_EXT = $87DB; + GL_NEGATIVE_W_EXT = $87DC; + GL_ZERO_EXT = $87DD; + GL_ONE_EXT = $87DE; + GL_NEGATIVE_ONE_EXT = $87DF; + GL_NORMALIZED_RANGE_EXT = $87E0; + GL_FULL_RANGE_EXT = $87E1; + GL_CURRENT_VERTEX_EXT = $87E2; + GL_MVP_MATRIX_EXT = $87E3; +var + glBeginVertexShaderEXT: procedure(); extdecl; + glEndVertexShaderEXT: procedure(); extdecl; + glBindVertexShaderEXT: procedure(id: GLuint); extdecl; + glGenVertexShadersEXT: function(range: GLuint): GLuint; extdecl; + glDeleteVertexShaderEXT: procedure(id: GLuint); extdecl; + glShaderOp1EXT: procedure(op: GLenum; res: GLuint; arg1: GLuint); extdecl; + glShaderOp2EXT: procedure(op: GLenum; res: GLuint; arg1: GLuint; arg2: GLuint); extdecl; + glShaderOp3EXT: procedure(op: GLenum; res: GLuint; arg1: GLuint; arg2: GLuint; arg3: GLuint); extdecl; + glSwizzleEXT: procedure(res: GLuint; _in: GLuint; outX: GLenum; outY: GLenum; outZ: GLenum; outW: GLenum); extdecl; + glWriteMaskEXT: procedure(res: GLuint; _in: GLuint; outX: GLenum; outY: GLenum; outZ: GLenum; outW: GLenum); extdecl; + glInsertComponentEXT: procedure(res: GLuint; src: GLuint; num: GLuint); extdecl; + glExtractComponentEXT: procedure(res: GLuint; src: GLuint; num: GLuint); extdecl; + glGenSymbolsEXT: function(datatype: GLenum; storagetype: GLenum; range: GLenum; components: GLuint): GLuint; extdecl; + glSetInvariantEXT: procedure(id: GLuint; _type: GLenum; addr: PGLvoid); extdecl; + glSetLocalConstantEXT: procedure(id: GLuint; _type: GLenum; addr: PGLvoid); extdecl; + glVariantbvEXT: procedure(id: GLuint; addr: PGLbyte); extdecl; + glVariantsvEXT: procedure(id: GLuint; addr: PGLshort); extdecl; + glVariantivEXT: procedure(id: GLuint; addr: PGLint); extdecl; + glVariantfvEXT: procedure(id: GLuint; addr: PGLfloat); extdecl; + glVariantdvEXT: procedure(id: GLuint; addr: PGLdouble); extdecl; + glVariantubvEXT: procedure(id: GLuint; addr: PGLubyte); extdecl; + glVariantusvEXT: procedure(id: GLuint; addr: PGLushort); extdecl; + glVariantuivEXT: procedure(id: GLuint; addr: PGLuint); extdecl; + glVariantPointerEXT: procedure(id: GLuint; _type: GLenum; stride: GLuint; addr: PGLvoid); extdecl; + glEnableVariantClientStateEXT: procedure(id: GLuint); extdecl; + glDisableVariantClientStateEXT: procedure(id: GLuint); extdecl; + glBindLightParameterEXT: function(light: GLenum; value: GLenum): GLuint; extdecl; + glBindMaterialParameterEXT: function(face: GLenum; value: GLenum): GLuint; extdecl; + glBindTexGenParameterEXT: function(_unit: GLenum; coord: GLenum; value: GLenum): GLuint; extdecl; + glBindTextureUnitParameterEXT: function(_unit: GLenum; value: GLenum): GLuint; extdecl; + glBindParameterEXT: function(value: GLenum): GLuint; extdecl; + glIsVariantEnabledEXT: function(id: GLuint; cap: GLenum): GLboolean; extdecl; + glGetVariantBooleanvEXT: procedure(id: GLuint; value: GLenum; data: PGLboolean); extdecl; + glGetVariantIntegervEXT: procedure(id: GLuint; value: GLenum; data: PGLint); extdecl; + glGetVariantFloatvEXT: procedure(id: GLuint; value: GLenum; data: PGLfloat); extdecl; + glGetVariantPointervEXT: procedure(id: GLuint; value: GLenum; data: PGLvoid); extdecl; + glGetInvariantBooleanvEXT: procedure(id: GLuint; value: GLenum; data: PGLboolean); extdecl; + glGetInvariantIntegervEXT: procedure(id: GLuint; value: GLenum; data: PGLint); extdecl; + glGetInvariantFloatvEXT: procedure(id: GLuint; value: GLenum; data: PGLfloat); extdecl; + glGetLocalConstantBooleanvEXT: procedure(id: GLuint; value: GLenum; data: PGLboolean); extdecl; + glGetLocalConstantIntegervEXT: procedure(id: GLuint; value: GLenum; data: PGLint); extdecl; + glGetLocalConstantFloatvEXT: procedure(id: GLuint; value: GLenum; data: PGLfloat); extdecl; + +function Load_GL_EXT_vertex_shader: Boolean; + +//***** GL_EXT_vertex_weighting *****// +const + GL_VERTEX_WEIGHTING_EXT = $8509; + GL_MODELVIEW0_EXT = $1700; + GL_MODELVIEW1_EXT = $850A; + GL_MODELVIEW0_MATRIX_EXT = $0BA6; + GL_MODELVIEW1_MATRIX_EXT = $8506; + GL_CURRENT_VERTEX_WEIGHT_EXT = $850B; + GL_VERTEX_WEIGHT_ARRAY_EXT = $850C; + GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = $850D; + GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = $850E; + GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = $850F; + GL_MODELVIEW0_STACK_DEPTH_EXT = $0BA3; + GL_MODELVIEW1_STACK_DEPTH_EXT = $8502; + GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = $8510; +var + glVertexWeightfEXT: procedure(weight: GLfloat); extdecl; + glVertexWeightfvEXT: procedure(weight: PGLfloat); extdecl; + glVertexWeightPointerEXT: procedure(size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); extdecl; + +function Load_GL_EXT_vertex_weighting: Boolean; + +//***** GL_HP_occlusion_test *****// +const + GL_OCCLUSION_TEST_HP = $8165; + GL_OCCLUSION_TEST_RESULT_HP = $8166; + +function Load_GL_HP_occlusion_test: Boolean; + +//***** GL_NV_blend_square *****// + +function Load_GL_NV_blend_square: Boolean; + +//***** GL_NV_copy_depth_to_color *****// +const + GL_DEPTH_STENCIL_TO_RGBA_NV = $886E; + GL_DEPTH_STENCIL_TO_BGRA_NV = $886F; + +function Load_GL_NV_copy_depth_to_color: Boolean; + +//***** GL_NV_depth_clamp *****// +const + GL_DEPTH_CLAMP_NV = $864F; + +function Load_GL_NV_depth_clamp: Boolean; + +//***** GL_NV_evaluators *****// +const + GL_EVAL_2D_NV = $86C0; + GL_EVAL_TRIANGULAR_2D_NV = $86C1; + GL_MAP_TESSELLATION_NV = $86C2; + GL_MAP_ATTRIB_U_ORDER_NV = $86C3; + GL_MAP_ATTRIB_V_ORDER_NV = $86C4; + GL_EVAL_FRACTIONAL_TESSELLATION_NV = $86C5; + GL_EVAL_VERTEX_ATTRIB0_NV = $86C6; + GL_EVAL_VERTEX_ATTRIB1_NV = $86C7; + GL_EVAL_VERTEX_ATTRIB2_NV = $86C8; + GL_EVAL_VERTEX_ATTRIB3_NV = $86C9; + GL_EVAL_VERTEX_ATTRIB4_NV = $86CA; + GL_EVAL_VERTEX_ATTRIB5_NV = $86CB; + GL_EVAL_VERTEX_ATTRIB6_NV = $86CC; + GL_EVAL_VERTEX_ATTRIB7_NV = $86CD; + GL_EVAL_VERTEX_ATTRIB8_NV = $86CE; + GL_EVAL_VERTEX_ATTRIB9_NV = $86CF; + GL_EVAL_VERTEX_ATTRIB10_NV = $86D0; + GL_EVAL_VERTEX_ATTRIB11_NV = $86D1; + GL_EVAL_VERTEX_ATTRIB12_NV = $86D2; + GL_EVAL_VERTEX_ATTRIB13_NV = $86D3; + GL_EVAL_VERTEX_ATTRIB14_NV = $86D4; + GL_EVAL_VERTEX_ATTRIB15_NV = $86D5; + GL_MAX_MAP_TESSELLATION_NV = $86D6; + GL_MAX_RATIONAL_EVAL_ORDER_NV = $86D7; +var + glMapControlPointsNV: procedure(target: GLenum; index: GLuint; _type: GLenum; ustride: GLsizei; vstride: GLsizei; uorder: GLint; vorder: GLint; _packed: GLboolean; const points: PGLvoid); extdecl; + glMapParameterivNV: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glMapParameterfvNV: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glGetMapControlPointsNV: procedure(target: GLenum; index: GLuint; _type: GLenum; ustride: GLsizei; vstride: GLsizei; _packed: GLboolean; points: PGLvoid); extdecl; + glGetMapParameterivNV: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetMapParameterfvNV: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetMapAttribParameterivNV: procedure(target: GLenum; index: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetMapAttribParameterfvNV: procedure(target: GLenum; index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glEvalMapsNV: procedure(target: GLenum; mode: GLenum); extdecl; + +function Load_GL_NV_evaluators: Boolean; + +//***** GL_NV_fence *****// +const + GL_ALL_COMPLETED_NV = $84F2; + GL_FENCE_STATUS_NV = $84F3; + GL_FENCE_CONDITION_NV = $84F4; +var + glGenFencesNV: procedure(n: GLsizei; fences: PGLuint); extdecl; + glDeleteFencesNV: procedure(n: GLsizei; const fences: PGLuint); extdecl; + glSetFenceNV: procedure(fence: GLuint; condition: GLenum); extdecl; + glTestFenceNV: function(fence: GLuint): GLboolean; extdecl; + glFinishFenceNV: procedure(fence: GLuint); extdecl; + glIsFenceNV: function(fence: GLuint): GLboolean; extdecl; + glGetFenceivNV: procedure(fence: GLuint; pname: GLenum; params: PGLint); extdecl; + +function Load_GL_NV_fence: Boolean; + +//***** GL_NV_fog_distance *****// +const + GL_FOG_DISTANCE_MODE_NV = $855A; + GL_EYE_RADIAL_NV = $855B; + GL_EYE_PLANE_ABSOLUTE_NV = $855C; + +function Load_GL_NV_fog_distance: Boolean; + +//***** GL_NV_light_max_exponent *****// +const + GL_MAX_SHININESS_NV = $8504; + GL_MAX_SPOT_EXPONENT_NV = $8505; + +function Load_GL_NV_light_max_exponent: Boolean; + +//***** GL_NV_multisample_filter_hint *****// +const + GL_MULTISAMPLE_FILTER_HINT_NV = $8534; + +function Load_GL_NV_multisample_filter_hint: Boolean; + +//***** GL_NV_occlusion_query *****// + // GL_OCCLUSION_TEST_HP { already defined } + // GL_OCCLUSION_TEST_RESULT_HP { already defined } +const + GL_PIXEL_COUNTER_BITS_NV = $8864; + GL_CURRENT_OCCLUSION_QUERY_ID_NV = $8865; + GL_PIXEL_COUNT_NV = $8866; + GL_PIXEL_COUNT_AVAILABLE_NV = $8867; +var + glGenOcclusionQueriesNV: procedure(n: GLsizei; ids: PGLuint); extdecl; + glDeleteOcclusionQueriesNV: procedure(n: GLsizei; const ids: PGLuint); extdecl; + glIsOcclusionQueryNV: function(id: GLuint): GLboolean; extdecl; + glBeginOcclusionQueryNV: procedure(id: GLuint); extdecl; + glEndOcclusionQueryNV: procedure(); extdecl; + glGetOcclusionQueryivNV: procedure(id: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetOcclusionQueryuivNV: procedure(id: GLuint; pname: GLenum; params: PGLuint); extdecl; + +function Load_GL_NV_occlusion_query: Boolean; + +//***** GL_NV_packed_depth_stencil *****// +const + GL_DEPTH_STENCIL_NV = $84F9; + GL_UNSIGNED_INT_24_8_NV = $84FA; + +function Load_GL_NV_packed_depth_stencil: Boolean; + +//***** GL_NV_point_sprite *****// +const + GL_POINT_SPRITE_NV = $8861; + GL_COORD_REPLACE_NV = $8862; + GL_POINT_SPRITE_R_MODE_NV = $8863; +var + glPointParameteriNV: procedure(pname: GLenum; param: GLint); extdecl; + glPointParameterivNV: procedure(pname: GLenum; const params: PGLint); extdecl; + +function Load_GL_NV_point_sprite: Boolean; + +//***** GL_NV_register_combiners *****// +const + GL_REGISTER_COMBINERS_NV = $8522; + GL_COMBINER0_NV = $8550; + GL_COMBINER1_NV = $8551; + GL_COMBINER2_NV = $8552; + GL_COMBINER3_NV = $8553; + GL_COMBINER4_NV = $8554; + GL_COMBINER5_NV = $8555; + GL_COMBINER6_NV = $8556; + GL_COMBINER7_NV = $8557; + GL_VARIABLE_A_NV = $8523; + GL_VARIABLE_B_NV = $8524; + GL_VARIABLE_C_NV = $8525; + GL_VARIABLE_D_NV = $8526; + GL_VARIABLE_E_NV = $8527; + GL_VARIABLE_F_NV = $8528; + GL_VARIABLE_G_NV = $8529; + GL_CONSTANT_COLOR0_NV = $852A; + GL_CONSTANT_COLOR1_NV = $852B; + GL_PRIMARY_COLOR_NV = $852C; + GL_SECONDARY_COLOR_NV = $852D; + GL_SPARE0_NV = $852E; + GL_SPARE1_NV = $852F; + GL_UNSIGNED_IDENTITY_NV = $8536; + GL_UNSIGNED_INVERT_NV = $8537; + GL_EXPAND_NORMAL_NV = $8538; + GL_EXPAND_NEGATE_NV = $8539; + GL_HALF_BIAS_NORMAL_NV = $853A; + GL_HALF_BIAS_NEGATE_NV = $853B; + GL_SIGNED_IDENTITY_NV = $853C; + GL_SIGNED_NEGATE_NV = $853D; + GL_E_TIMES_F_NV = $8531; + GL_SPARE0_PLUS_SECONDARY_COLOR_NV = $8532; + GL_SCALE_BY_TWO_NV = $853E; + GL_SCALE_BY_FOUR_NV = $853F; + GL_SCALE_BY_ONE_HALF_NV = $8540; + GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = $8541; + GL_DISCARD_NV = $8530; + GL_COMBINER_INPUT_NV = $8542; + GL_COMBINER_MAPPING_NV = $8543; + GL_COMBINER_COMPONENT_USAGE_NV = $8544; + GL_COMBINER_AB_DOT_PRODUCT_NV = $8545; + GL_COMBINER_CD_DOT_PRODUCT_NV = $8546; + GL_COMBINER_MUX_SUM_NV = $8547; + GL_COMBINER_SCALE_NV = $8548; + GL_COMBINER_BIAS_NV = $8549; + GL_COMBINER_AB_OUTPUT_NV = $854A; + GL_COMBINER_CD_OUTPUT_NV = $854B; + GL_COMBINER_SUM_OUTPUT_NV = $854C; + GL_NUM_GENERAL_COMBINERS_NV = $854E; + GL_COLOR_SUM_CLAMP_NV = $854F; + GL_MAX_GENERAL_COMBINERS_NV = $854D; +var + glCombinerParameterfvNV: procedure(pname: GLenum; const params: PGLfloat); extdecl; + glCombinerParameterivNV: procedure(pname: GLenum; const params: PGLint); extdecl; + glCombinerParameterfNV: procedure(pname: GLenum; param: GLfloat); extdecl; + glCombinerParameteriNV: procedure(pname: GLenum; param: GLint); extdecl; + glCombinerInputNV: procedure(stage: GLenum; portion: GLenum; variable: GLenum; input: GLenum; mapping: GLenum; componentUsage: GLenum); extdecl; + glCombinerOutputNV: procedure(stage: GLenum; portion: GLenum; abOutput: GLenum; cdOutput: GLenum; sumOutput: GLenum; scale: GLenum; bias: GLenum; abDotProduct: GLboolean; cdDotProduct: GLboolean; muxSum: GLboolean); extdecl; + glFinalCombinerInputNV: procedure(variable: GLenum; input: GLenum; mapping: GLenum; componentUsage: GLenum); extdecl; + glGetCombinerInputParameterfvNV: procedure(stage: GLenum; portion: GLenum; variable: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetCombinerInputParameterivNV: procedure(stage: GLenum; portion: GLenum; variable: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetCombinerOutputParameterfvNV: procedure(stage: GLenum; portion: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetCombinerOutputParameterivNV: procedure(stage: GLenum; portion: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetFinalCombinerInputParameterfvNV: procedure(variable: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetFinalCombinerInputParameterivNV: procedure(variable: GLenum; pname: GLenum; params: PGLint); extdecl; + +function Load_GL_NV_register_combiners: Boolean; + +//***** GL_NV_register_combiners2 *****// +const + GL_PER_STAGE_CONSTANTS_NV = $8535; +var + glCombinerStageParameterfvNV: procedure(stage: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glGetCombinerStageParameterfvNV: procedure(stage: GLenum; pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_NV_register_combiners2: Boolean; + +//***** GL_NV_texgen_emboss *****// +const + GL_EMBOSS_MAP_NV = $855F; + GL_EMBOSS_LIGHT_NV = $855D; + GL_EMBOSS_CONSTANT_NV = $855E; + +function Load_GL_NV_texgen_emboss: Boolean; + +//***** GL_NV_texgen_reflection *****// +const + GL_NORMAL_MAP_NV = $8511; + GL_REFLECTION_MAP_NV = $8512; + +function Load_GL_NV_texgen_reflection: Boolean; + +//***** GL_NV_texture_compression_vtc *****// + // GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } + // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } + // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT { already defined } + // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT { already defined } + +function Load_GL_NV_texture_compression_vtc: Boolean; + +//***** GL_NV_texture_env_combine4 *****// +const + GL_COMBINE4_NV = $8503; + GL_SOURCE3_RGB_NV = $8583; + GL_SOURCE3_ALPHA_NV = $858B; + GL_OPERAND3_RGB_NV = $8593; + GL_OPERAND3_ALPHA_NV = $859B; + +function Load_GL_NV_texture_env_combine4: Boolean; + +//***** GL_NV_texture_rectangle *****// +const + GL_TEXTURE_RECTANGLE_NV = $84F5; + GL_TEXTURE_BINDING_RECTANGLE_NV = $84F6; + GL_PROXY_TEXTURE_RECTANGLE_NV = $84F7; + GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = $84F8; + +function Load_GL_NV_texture_rectangle: Boolean; + +//***** GL_NV_texture_shader *****// +const + GL_TEXTURE_SHADER_NV = $86DE; + GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = $86D9; + GL_SHADER_OPERATION_NV = $86DF; + GL_CULL_MODES_NV = $86E0; + GL_OFFSET_TEXTURE_MATRIX_NV = $86E1; + GL_OFFSET_TEXTURE_SCALE_NV = $86E2; + GL_OFFSET_TEXTURE_BIAS_NV = $86E3; + GL_PREVIOUS_TEXTURE_INPUT_NV = $86E4; + GL_CONST_EYE_NV = $86E5; + GL_SHADER_CONSISTENT_NV = $86DD; + GL_PASS_THROUGH_NV = $86E6; + GL_CULL_FRAGMENT_NV = $86E7; + GL_OFFSET_TEXTURE_2D_NV = $86E8; + GL_OFFSET_TEXTURE_RECTANGLE_NV = $864C; + GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = $864D; + GL_DEPENDENT_AR_TEXTURE_2D_NV = $86E9; + GL_DEPENDENT_GB_TEXTURE_2D_NV = $86EA; + GL_DOT_PRODUCT_NV = $86EC; + GL_DOT_PRODUCT_DEPTH_REPLACE_NV = $86ED; + GL_DOT_PRODUCT_TEXTURE_2D_NV = $86EE; + GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = $864E; + GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = $86F0; + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = $86F1; + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = $86F2; + GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = $86F3; + GL_HILO_NV = $86F4; + GL_DSDT_NV = $86F5; + GL_DSDT_MAG_NV = $86F6; + GL_DSDT_MAG_VIB_NV = $86F7; + GL_UNSIGNED_INT_S8_S8_8_8_NV = $86DA; + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = $86DB; + GL_SIGNED_RGBA_NV = $86FB; + GL_SIGNED_RGBA8_NV = $86FC; + GL_SIGNED_RGB_NV = $86FE; + GL_SIGNED_RGB8_NV = $86FF; + GL_SIGNED_LUMINANCE_NV = $8701; + GL_SIGNED_LUMINANCE8_NV = $8702; + GL_SIGNED_LUMINANCE_ALPHA_NV = $8703; + GL_SIGNED_LUMINANCE8_ALPHA8_NV = $8704; + GL_SIGNED_ALPHA_NV = $8705; + GL_SIGNED_ALPHA8_NV = $8706; + GL_SIGNED_INTENSITY_NV = $8707; + GL_SIGNED_INTENSITY8_NV = $8708; + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = $870C; + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = $870D; + GL_HILO16_NV = $86F8; + GL_SIGNED_HILO_NV = $86F9; + GL_SIGNED_HILO16_NV = $86FA; + GL_DSDT8_NV = $8709; + GL_DSDT8_MAG8_NV = $870A; + GL_DSDT_MAG_INTENSITY_NV = $86DC; + GL_DSDT8_MAG8_INTENSITY8_NV = $870B; + GL_HI_SCALE_NV = $870E; + GL_LO_SCALE_NV = $870F; + GL_DS_SCALE_NV = $8710; + GL_DT_SCALE_NV = $8711; + GL_MAGNITUDE_SCALE_NV = $8712; + GL_VIBRANCE_SCALE_NV = $8713; + GL_HI_BIAS_NV = $8714; + GL_LO_BIAS_NV = $8715; + GL_DS_BIAS_NV = $8716; + GL_DT_BIAS_NV = $8717; + GL_MAGNITUDE_BIAS_NV = $8718; + GL_VIBRANCE_BIAS_NV = $8719; + GL_TEXTURE_BORDER_VALUES_NV = $871A; + GL_TEXTURE_HI_SIZE_NV = $871B; + GL_TEXTURE_LO_SIZE_NV = $871C; + GL_TEXTURE_DS_SIZE_NV = $871D; + GL_TEXTURE_DT_SIZE_NV = $871E; + GL_TEXTURE_MAG_SIZE_NV = $871F; + +function Load_GL_NV_texture_shader: Boolean; + +//***** GL_NV_texture_shader2 *****// +const + GL_DOT_PRODUCT_TEXTURE_3D_NV = $86EF; + // GL_HILO_NV { already defined } + // GL_DSDT_NV { already defined } + // GL_DSDT_MAG_NV { already defined } + // GL_DSDT_MAG_VIB_NV { already defined } + // GL_UNSIGNED_INT_S8_S8_8_8_NV { already defined } + // GL_UNSIGNED_INT_8_8_S8_S8_REV_NV { already defined } + // GL_SIGNED_RGBA_NV { already defined } + // GL_SIGNED_RGBA8_NV { already defined } + // GL_SIGNED_RGB_NV { already defined } + // GL_SIGNED_RGB8_NV { already defined } + // GL_SIGNED_LUMINANCE_NV { already defined } + // GL_SIGNED_LUMINANCE8_NV { already defined } + // GL_SIGNED_LUMINANCE_ALPHA_NV { already defined } + // GL_SIGNED_LUMINANCE8_ALPHA8_NV { already defined } + // GL_SIGNED_ALPHA_NV { already defined } + // GL_SIGNED_ALPHA8_NV { already defined } + // GL_SIGNED_INTENSITY_NV { already defined } + // GL_SIGNED_INTENSITY8_NV { already defined } + // GL_SIGNED_RGB_UNSIGNED_ALPHA_NV { already defined } + // GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV { already defined } + // GL_HILO16_NV { already defined } + // GL_SIGNED_HILO_NV { already defined } + // GL_SIGNED_HILO16_NV { already defined } + // GL_DSDT8_NV { already defined } + // GL_DSDT8_MAG8_NV { already defined } + // GL_DSDT_MAG_INTENSITY_NV { already defined } + // GL_DSDT8_MAG8_INTENSITY8_NV { already defined } + +function Load_GL_NV_texture_shader2: Boolean; + +//***** GL_NV_texture_shader3 *****// +const + GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = $8850; + GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = $8851; + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = $8852; + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = $8853; + GL_OFFSET_HILO_TEXTURE_2D_NV = $8854; + GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = $8855; + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = $8856; + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = $8857; + GL_DEPENDENT_HILO_TEXTURE_2D_NV = $8858; + GL_DEPENDENT_RGB_TEXTURE_3D_NV = $8859; + GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = $885A; + GL_DOT_PRODUCT_PASS_THROUGH_NV = $885B; + GL_DOT_PRODUCT_TEXTURE_1D_NV = $885C; + GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = $885D; + GL_HILO8_NV = $885E; + GL_SIGNED_HILO8_NV = $885F; + GL_FORCE_BLUE_TO_ONE_NV = $8860; + +function Load_GL_NV_texture_shader3: Boolean; + +//***** GL_NV_vertex_array_range *****// +const + GL_VERTEX_ARRAY_RANGE_NV = $851D; + GL_VERTEX_ARRAY_RANGE_LENGTH_NV = $851E; + GL_VERTEX_ARRAY_RANGE_VALID_NV = $851F; + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = $8520; + GL_VERTEX_ARRAY_RANGE_POINTER_NV = $8521; +var + glVertexArrayRangeNV: procedure(length: GLsizei; pointer: PGLvoid); extdecl; + glFlushVertexArrayRangeNV: procedure(); extdecl; +{$IFDEF Windows} + wglAllocateMemoryNV: function(size: GLsizei; readFrequency: GLfloat; writeFrequency: GLfloat; priority: GLfloat): PGLvoid; extdecl; + wglFreeMemoryNV: procedure(pointer: PGLvoid); extdecl; +{$ENDIF} + +function Load_GL_NV_vertex_array_range: Boolean; + +//***** GL_NV_vertex_array_range2 *****// +const + GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = $8533; + +function Load_GL_NV_vertex_array_range2: Boolean; + +//***** GL_NV_vertex_program *****// +const + GL_VERTEX_PROGRAM_NV = $8620; + GL_VERTEX_PROGRAM_POINT_SIZE_NV = $8642; + GL_VERTEX_PROGRAM_TWO_SIDE_NV = $8643; + GL_VERTEX_STATE_PROGRAM_NV = $8621; + GL_ATTRIB_ARRAY_SIZE_NV = $8623; + GL_ATTRIB_ARRAY_STRIDE_NV = $8624; + GL_ATTRIB_ARRAY_TYPE_NV = $8625; + GL_CURRENT_ATTRIB_NV = $8626; + GL_PROGRAM_PARAMETER_NV = $8644; + GL_ATTRIB_ARRAY_POINTER_NV = $8645; + GL_PROGRAM_TARGET_NV = $8646; + GL_PROGRAM_LENGTH_NV = $8627; + GL_PROGRAM_RESIDENT_NV = $8647; + GL_PROGRAM_STRING_NV = $8628; + GL_TRACK_MATRIX_NV = $8648; + GL_TRACK_MATRIX_TRANSFORM_NV = $8649; + GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = $862E; + GL_MAX_TRACK_MATRICES_NV = $862F; + GL_CURRENT_MATRIX_STACK_DEPTH_NV = $8640; + GL_CURRENT_MATRIX_NV = $8641; + GL_VERTEX_PROGRAM_BINDING_NV = $864A; + GL_PROGRAM_ERROR_POSITION_NV = $864B; + GL_MODELVIEW_PROJECTION_NV = $8629; + GL_MATRIX0_NV = $8630; + GL_MATRIX1_NV = $8631; + GL_MATRIX2_NV = $8632; + GL_MATRIX3_NV = $8633; + GL_MATRIX4_NV = $8634; + GL_MATRIX5_NV = $8635; + GL_MATRIX6_NV = $8636; + GL_MATRIX7_NV = $8637; + GL_IDENTITY_NV = $862A; + GL_INVERSE_NV = $862B; + GL_TRANSPOSE_NV = $862C; + GL_INVERSE_TRANSPOSE_NV = $862D; + GL_VERTEX_ATTRIB_ARRAY0_NV = $8650; + GL_VERTEX_ATTRIB_ARRAY1_NV = $8651; + GL_VERTEX_ATTRIB_ARRAY2_NV = $8652; + GL_VERTEX_ATTRIB_ARRAY3_NV = $8653; + GL_VERTEX_ATTRIB_ARRAY4_NV = $8654; + GL_VERTEX_ATTRIB_ARRAY5_NV = $8655; + GL_VERTEX_ATTRIB_ARRAY6_NV = $8656; + GL_VERTEX_ATTRIB_ARRAY7_NV = $8657; + GL_VERTEX_ATTRIB_ARRAY8_NV = $8658; + GL_VERTEX_ATTRIB_ARRAY9_NV = $8659; + GL_VERTEX_ATTRIB_ARRAY10_NV = $865A; + GL_VERTEX_ATTRIB_ARRAY11_NV = $865B; + GL_VERTEX_ATTRIB_ARRAY12_NV = $865C; + GL_VERTEX_ATTRIB_ARRAY13_NV = $865D; + GL_VERTEX_ATTRIB_ARRAY14_NV = $865E; + GL_VERTEX_ATTRIB_ARRAY15_NV = $865F; + GL_MAP1_VERTEX_ATTRIB0_4_NV = $8660; + GL_MAP1_VERTEX_ATTRIB1_4_NV = $8661; + GL_MAP1_VERTEX_ATTRIB2_4_NV = $8662; + GL_MAP1_VERTEX_ATTRIB3_4_NV = $8663; + GL_MAP1_VERTEX_ATTRIB4_4_NV = $8664; + GL_MAP1_VERTEX_ATTRIB5_4_NV = $8665; + GL_MAP1_VERTEX_ATTRIB6_4_NV = $8666; + GL_MAP1_VERTEX_ATTRIB7_4_NV = $8667; + GL_MAP1_VERTEX_ATTRIB8_4_NV = $8668; + GL_MAP1_VERTEX_ATTRIB9_4_NV = $8669; + GL_MAP1_VERTEX_ATTRIB10_4_NV = $866A; + GL_MAP1_VERTEX_ATTRIB11_4_NV = $866B; + GL_MAP1_VERTEX_ATTRIB12_4_NV = $866C; + GL_MAP1_VERTEX_ATTRIB13_4_NV = $866D; + GL_MAP1_VERTEX_ATTRIB14_4_NV = $866E; + GL_MAP1_VERTEX_ATTRIB15_4_NV = $866F; + GL_MAP2_VERTEX_ATTRIB0_4_NV = $8670; + GL_MAP2_VERTEX_ATTRIB1_4_NV = $8671; + GL_MAP2_VERTEX_ATTRIB2_4_NV = $8672; + GL_MAP2_VERTEX_ATTRIB3_4_NV = $8673; + GL_MAP2_VERTEX_ATTRIB4_4_NV = $8674; + GL_MAP2_VERTEX_ATTRIB5_4_NV = $8675; + GL_MAP2_VERTEX_ATTRIB6_4_NV = $8676; + GL_MAP2_VERTEX_ATTRIB7_4_NV = $8677; + GL_MAP2_VERTEX_ATTRIB8_4_NV = $8678; + GL_MAP2_VERTEX_ATTRIB9_4_NV = $8679; + GL_MAP2_VERTEX_ATTRIB10_4_NV = $867A; + GL_MAP2_VERTEX_ATTRIB11_4_NV = $867B; + GL_MAP2_VERTEX_ATTRIB12_4_NV = $867C; + GL_MAP2_VERTEX_ATTRIB13_4_NV = $867D; + GL_MAP2_VERTEX_ATTRIB14_4_NV = $867E; + GL_MAP2_VERTEX_ATTRIB15_4_NV = $867F; +var + glBindProgramNV: procedure(target: GLenum; id: GLuint); extdecl; + glDeleteProgramsNV: procedure(n: GLsizei; const ids: PGLuint); extdecl; + glExecuteProgramNV: procedure(target: GLenum; id: GLuint; const params: PGLfloat); extdecl; + glGenProgramsNV: procedure(n: GLsizei; ids: PGLuint); extdecl; + glAreProgramsResidentNV: function(n: GLsizei; const ids: PGLuint; residences: PGLboolean): GLboolean; extdecl; + glRequestResidentProgramsNV: procedure(n: GLsizei; ids: PGLuint); extdecl; + glGetProgramParameterfvNV: procedure(target: GLenum; index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetProgramParameterdvNV: procedure(target: GLenum; index: GLuint; pname: GLenum; params: PGLdouble); extdecl; + glGetProgramivNV: procedure(id: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetProgramStringNV: procedure(id: GLuint; pname: GLenum; _program: PGLubyte); extdecl; + glGetTrackMatrixivNV: procedure(target: GLenum; address: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetVertexAttribdvNV: procedure(index: GLuint; pname: GLenum; params: PGLdouble); extdecl; + glGetVertexAttribfvNV: procedure(index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetVertexAttribivNV: procedure(index: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetVertexAttribPointervNV: procedure(index: GLuint; pname: GLenum; pointer: PGLvoid); extdecl; + glIsProgramNV: function(id: GLuint): GLboolean; extdecl; + glLoadProgramNV: procedure(target: GLenum; id: GLuint; len: GLsizei; const _program: PGLubyte); extdecl; + glProgramParameter4fNV: procedure(target: GLenum; index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glProgramParameter4fvNV: procedure(target: GLenum; index: GLuint; const params: PGLfloat); extdecl; + glProgramParameters4dvNV: procedure(target: GLenum; index: GLuint; num: GLuint; const params: PGLdouble); extdecl; + glProgramParameters4fvNV: procedure(target: GLenum; index: GLuint; num: GLuint; const params: PGLfloat); extdecl; + glTrackMatrixNV: procedure(target: GLenum; address: GLuint; matrix: GLenum; transform: GLenum); extdecl; + glVertexAttribPointerNV: procedure(index: GLuint; size: GLint; _type: GLenum; stride: GLsizei; const pointer: PGLvoid); extdecl; + glVertexAttrib1sNV: procedure(index: GLuint; x: GLshort); extdecl; + glVertexAttrib1fNV: procedure(index: GLuint; x: GLfloat); extdecl; + glVertexAttrib1dNV: procedure(index: GLuint; x: GLdouble); extdecl; + glVertexAttrib2sNV: procedure(index: GLuint; x: GLshort; y: GLshort); extdecl; + glVertexAttrib2fNV: procedure(index: GLuint; x: GLfloat; y: GLfloat); extdecl; + glVertexAttrib2dNV: procedure(index: GLuint; x: GLdouble; y: GLdouble); extdecl; + glVertexAttrib3sNV: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort); extdecl; + glVertexAttrib3fNV: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glVertexAttrib3dNV: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glVertexAttrib4sNV: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort; w: GLshort); extdecl; + glVertexAttrib4fNV: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glVertexAttrib4dNV: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glVertexAttrib4ubNV: procedure(index: GLuint; x: GLubyte; y: GLubyte; z: GLubyte; w: GLubyte); extdecl; + glVertexAttrib1svNV: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib1fvNV: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib1dvNV: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib2svNV: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib2fvNV: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib2dvNV: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib3svNV: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib3fvNV: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib3dvNV: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib4svNV: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4fvNV: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib4dvNV: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib4ubvNV: procedure(index: GLuint; const v: PGLubyte); extdecl; + glVertexAttribs1svNV: procedure(index: GLuint; n: GLsizei; const v: PGLshort); extdecl; + glVertexAttribs1fvNV: procedure(index: GLuint; n: GLsizei; const v: PGLfloat); extdecl; + glVertexAttribs1dvNV: procedure(index: GLuint; n: GLsizei; const v: PGLdouble); extdecl; + glVertexAttribs2svNV: procedure(index: GLuint; n: GLsizei; const v: PGLshort); extdecl; + glVertexAttribs2fvNV: procedure(index: GLuint; n: GLsizei; const v: PGLfloat); extdecl; + glVertexAttribs2dvNV: procedure(index: GLuint; n: GLsizei; const v: PGLdouble); extdecl; + glVertexAttribs3svNV: procedure(index: GLuint; n: GLsizei; const v: PGLshort); extdecl; + glVertexAttribs3fvNV: procedure(index: GLuint; n: GLsizei; const v: PGLfloat); extdecl; + glVertexAttribs3dvNV: procedure(index: GLuint; n: GLsizei; const v: PGLdouble); extdecl; + glVertexAttribs4svNV: procedure(index: GLuint; n: GLsizei; const v: PGLshort); extdecl; + glVertexAttribs4fvNV: procedure(index: GLuint; n: GLsizei; const v: PGLfloat); extdecl; + glVertexAttribs4dvNV: procedure(index: GLuint; n: GLsizei; const v: PGLdouble); extdecl; + glVertexAttribs4ubvNV: procedure(index: GLuint; n: GLsizei; const v: PGLubyte); extdecl; + +function Load_GL_NV_vertex_program: Boolean; + +//***** GL_NV_vertex_program1_1 *****// + +function Load_GL_NV_vertex_program1_1: Boolean; + +//***** GL_ATI_element_array *****// +const + GL_ELEMENT_ARRAY_ATI = $8768; + GL_ELEMENT_ARRAY_TYPE_ATI = $8769; + GL_ELEMENT_ARRAY_POINTER_ATI = $876A; +var + glElementPointerATI: procedure(_type: GLenum; const pointer: PGLvoid); extdecl; + glDrawElementArrayATI: procedure(mode: GLenum; count: GLsizei); extdecl; + glDrawRangeElementArrayATI: procedure(mode: GLenum; start: GLuint; _end: GLuint; count: GLsizei); extdecl; + +function Load_GL_ATI_element_array: Boolean; + +//***** GL_ATI_envmap_bumpmap *****// +const + GL_BUMP_ROT_MATRIX_ATI = $8775; + GL_BUMP_ROT_MATRIX_SIZE_ATI = $8776; + GL_BUMP_NUM_TEX_UNITS_ATI = $8777; + GL_BUMP_TEX_UNITS_ATI = $8778; + GL_DUDV_ATI = $8779; + GL_DU8DV8_ATI = $877A; + GL_BUMP_ENVMAP_ATI = $877B; + GL_BUMP_TARGET_ATI = $877C; +var + glTexBumpParameterivATI: procedure(pname: GLenum; param: PGLint); extdecl; + glTexBumpParameterfvATI: procedure(pname: GLenum; param: PGLfloat); extdecl; + glGetTexBumpParameterivATI: procedure(pname: GLenum; param: PGLint); extdecl; + glGetTexBumpParameterfvATI: procedure(pname: GLenum; param: PGLfloat); extdecl; + +function Load_GL_ATI_envmap_bumpmap: Boolean; + +//***** GL_ATI_fragment_shader *****// +const + GL_FRAGMENT_SHADER_ATI = $8920; + GL_REG_0_ATI = $8921; + GL_REG_1_ATI = $8922; + GL_REG_2_ATI = $8923; + GL_REG_3_ATI = $8924; + GL_REG_4_ATI = $8925; + GL_REG_5_ATI = $8926; + GL_CON_0_ATI = $8941; + GL_CON_1_ATI = $8942; + GL_CON_2_ATI = $8943; + GL_CON_3_ATI = $8944; + GL_CON_4_ATI = $8945; + GL_CON_5_ATI = $8946; + GL_CON_6_ATI = $8947; + GL_CON_7_ATI = $8948; + GL_MOV_ATI = $8961; + GL_ADD_ATI = $8963; + GL_MUL_ATI = $8964; + GL_SUB_ATI = $8965; + GL_DOT3_ATI = $8966; + GL_DOT4_ATI = $8967; + GL_MAD_ATI = $8968; + GL_LERP_ATI = $8969; + GL_CND_ATI = $896A; + GL_CND0_ATI = $896B; + GL_DOT2_ADD_ATI = $896C; + GL_SECONDARY_INTERPOLATOR_ATI = $896D; + GL_SWIZZLE_STR_ATI = $8976; + GL_SWIZZLE_STQ_ATI = $8977; + GL_SWIZZLE_STR_DR_ATI = $8978; + GL_SWIZZLE_STQ_DQ_ATI = $8979; + GL_RED_BIT_ATI = $0001; + GL_GREEN_BIT_ATI = $0002; + GL_BLUE_BIT_ATI = $0004; + GL_2X_BIT_ATI = $0001; + GL_4X_BIT_ATI = $0002; + GL_8X_BIT_ATI = $0004; + GL_HALF_BIT_ATI = $0008; + GL_QUARTER_BIT_ATI = $0010; + GL_EIGHTH_BIT_ATI = $0020; + GL_SATURATE_BIT_ATI = $0040; + // GL_2X_BIT_ATI { already defined } + GL_COMP_BIT_ATI = $0002; + GL_NEGATE_BIT_ATI = $0004; + GL_BIAS_BIT_ATI = $0008; +var + glGenFragmentShadersATI: function(range: GLuint): GLuint; extdecl; + glBindFragmentShaderATI: procedure(id: GLuint); extdecl; + glDeleteFragmentShaderATI: procedure(id: GLuint); extdecl; + glBeginFragmentShaderATI: procedure(); extdecl; + glEndFragmentShaderATI: procedure(); extdecl; + glPassTexCoordATI: procedure(dst: GLuint; coord: GLuint; swizzle: GLenum); extdecl; + glSampleMapATI: procedure(dst: GLuint; interp: GLuint; swizzle: GLenum); extdecl; + glColorFragmentOp1ATI: procedure(op: GLenum; dst: GLuint; dstMask: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint); extdecl; + glColorFragmentOp2ATI: procedure(op: GLenum; dst: GLuint; dstMask: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint; arg2: GLuint; arg2Rep: GLuint; arg2Mod: GLuint); extdecl; + glColorFragmentOp3ATI: procedure(op: GLenum; dst: GLuint; dstMask: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint; arg2: GLuint; arg2Rep: GLuint; arg2Mod: GLuint; arg3: GLuint; arg3Rep: GLuint; arg3Mod: GLuint); extdecl; + glAlphaFragmentOp1ATI: procedure(op: GLenum; dst: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint); extdecl; + glAlphaFragmentOp2ATI: procedure(op: GLenum; dst: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint; arg2: GLuint; arg2Rep: GLuint; arg2Mod: GLuint); extdecl; + glAlphaFragmentOp3ATI: procedure(op: GLenum; dst: GLuint; dstMod: GLuint; arg1: GLuint; arg1Rep: GLuint; arg1Mod: GLuint; arg2: GLuint; arg2Rep: GLuint; arg2Mod: GLuint; arg3: GLuint; arg3Rep: GLuint; arg3Mod: GLuint); extdecl; + glSetFragmentShaderConstantATI: procedure(dst: GLuint; const value: PGLfloat); extdecl; + +function Load_GL_ATI_fragment_shader: Boolean; + +//***** GL_ATI_pn_triangles *****// +const + GL_PN_TRIANGLES_ATI = $87F0; + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = $87F1; + GL_PN_TRIANGLES_POINT_MODE_ATI = $87F2; + GL_PN_TRIANGLES_NORMAL_MODE_ATI = $87F3; + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = $87F4; + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = $87F5; + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = $87F6; + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = $87F7; + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = $87F8; +var + glPNTrianglesiATI: procedure(pname: GLenum; param: GLint); extdecl; + glPNTrianglesfATI: procedure(pname: GLenum; param: GLfloat); extdecl; + +function Load_GL_ATI_pn_triangles: Boolean; + +//***** GL_ATI_texture_mirror_once *****// +const + GL_MIRROR_CLAMP_ATI = $8742; + GL_MIRROR_CLAMP_TO_EDGE_ATI = $8743; + +function Load_GL_ATI_texture_mirror_once: Boolean; + +//***** GL_ATI_vertex_array_object *****// +const + GL_STATIC_ATI = $8760; + GL_DYNAMIC_ATI = $8761; + GL_PRESERVE_ATI = $8762; + GL_DISCARD_ATI = $8763; + GL_OBJECT_BUFFER_SIZE_ATI = $8764; + GL_OBJECT_BUFFER_USAGE_ATI = $8765; + GL_ARRAY_OBJECT_BUFFER_ATI = $8766; + GL_ARRAY_OBJECT_OFFSET_ATI = $8767; +var + glNewObjectBufferATI: function(size: GLsizei; const pointer: PGLvoid; usage: GLenum): GLuint; extdecl; + glIsObjectBufferATI: function(buffer: GLuint): GLboolean; extdecl; + glUpdateObjectBufferATI: procedure(buffer: GLuint; offset: GLuint; size: GLsizei; const pointer: PGLvoid; preserve: GLenum); extdecl; + glGetObjectBufferfvATI: procedure(buffer: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetObjectBufferivATI: procedure(buffer: GLuint; pname: GLenum; params: PGLint); extdecl; + glDeleteObjectBufferATI: procedure(buffer: GLuint); extdecl; + glArrayObjectATI: procedure(_array: GLenum; size: GLint; _type: GLenum; stride: GLsizei; buffer: GLuint; offset: GLuint); extdecl; + glGetArrayObjectfvATI: procedure(_array: GLenum; pname: GLenum; params: PGLfloat); extdecl; + glGetArrayObjectivATI: procedure(_array: GLenum; pname: GLenum; params: PGLint); extdecl; + glVariantArrayObjectATI: procedure(id: GLuint; _type: GLenum; stride: GLsizei; buffer: GLuint; offset: GLuint); extdecl; + glGetVariantArrayObjectfvATI: procedure(id: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetVariantArrayObjectivATI: procedure(id: GLuint; pname: GLenum; params: PGLint); extdecl; + +function Load_GL_ATI_vertex_array_object: Boolean; + +//***** GL_ATI_vertex_streams *****// +const + GL_MAX_VERTEX_STREAMS_ATI = $876B; + GL_VERTEX_STREAM0_ATI = $876C; + GL_VERTEX_STREAM1_ATI = $876D; + GL_VERTEX_STREAM2_ATI = $876E; + GL_VERTEX_STREAM3_ATI = $876F; + GL_VERTEX_STREAM4_ATI = $8770; + GL_VERTEX_STREAM5_ATI = $8771; + GL_VERTEX_STREAM6_ATI = $8772; + GL_VERTEX_STREAM7_ATI = $8773; + GL_VERTEX_SOURCE_ATI = $8774; +var + glVertexStream1s: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream1i: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream1f: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream1d: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream1sv: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream1iv: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream1fv: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream1dv: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream2s: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream2i: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream2f: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream2d: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream2sv: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream2iv: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream2fv: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream2dv: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream3s: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream3i: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream3f: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream3d: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream3sv: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream3iv: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream3fv: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream3dv: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream4s: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream4i: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream4f: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream4d: procedure(stream: GLenum; coords: GLdouble); extdecl; + glVertexStream4sv: procedure(stream: GLenum; coords: GLshort); extdecl; + glVertexStream4iv: procedure(stream: GLenum; coords: GLint); extdecl; + glVertexStream4fv: procedure(stream: GLenum; coords: GLfloat); extdecl; + glVertexStream4dv: procedure(stream: GLenum; coords: GLdouble); extdecl; + glNormalStream3b: procedure(stream: GLenum; coords: GLbyte); extdecl; + glNormalStream3s: procedure(stream: GLenum; coords: GLshort); extdecl; + glNormalStream3i: procedure(stream: GLenum; coords: GLint); extdecl; + glNormalStream3f: procedure(stream: GLenum; coords: GLfloat); extdecl; + glNormalStream3d: procedure(stream: GLenum; coords: GLdouble); extdecl; + glNormalStream3bv: procedure(stream: GLenum; coords: GLbyte); extdecl; + glNormalStream3sv: procedure(stream: GLenum; coords: GLshort); extdecl; + glNormalStream3iv: procedure(stream: GLenum; coords: GLint); extdecl; + glNormalStream3fv: procedure(stream: GLenum; coords: GLfloat); extdecl; + glNormalStream3dv: procedure(stream: GLenum; coords: GLdouble); extdecl; + glClientActiveVertexStream: procedure(stream: GLenum); extdecl; + glVertexBlendEnvi: procedure(pname: GLenum; param: GLint); extdecl; + glVertexBlendEnvf: procedure(pname: GLenum; param: GLfloat); extdecl; + +function Load_GL_ATI_vertex_streams: Boolean; + +{$IFDEF Windows} +//***** WGL_I3D_image_buffer *****// +const + WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = $0001; + WGL_IMAGE_BUFFER_LOCK_I3D = $0002; +var + wglCreateImageBufferI3D: function(hDC: HDC; dwSize: DWORD; uFlags: UINT): PGLvoid; extdecl; + wglDestroyImageBufferI3D: function(hDC: HDC; pAddress: PGLvoid): BOOL; extdecl; + wglAssociateImageBufferEventsI3D: function(hdc: HDC; pEvent: PHandle; pAddress: PGLvoid; pSize: PDWORD; count: UINT): BOOL; extdecl; + wglReleaseImageBufferEventsI3D: function(hdc: HDC; pAddress: PGLvoid; count: UINT): BOOL; extdecl; + +function Load_WGL_I3D_image_buffer: Boolean; + +//***** WGL_I3D_swap_frame_lock *****// +var + wglEnableFrameLockI3D: function(): BOOL; extdecl; + wglDisableFrameLockI3D: function(): BOOL; extdecl; + wglIsEnabledFrameLockI3D: function(pFlag: PBOOL): BOOL; extdecl; + wglQueryFrameLockMasterI3D: function(pFlag: PBOOL): BOOL; extdecl; + +function Load_WGL_I3D_swap_frame_lock: Boolean; + +//***** WGL_I3D_swap_frame_usage *****// +var + wglGetFrameUsageI3D: function(pUsage: PGLfloat): BOOL; extdecl; + wglBeginFrameTrackingI3D: function(): BOOL; extdecl; + wglEndFrameTrackingI3D: function(): BOOL; extdecl; + wglQueryFrameTrackingI3D: function(pFrameCount: PDWORD; pMissedFrames: PDWORD; pLastMissedUsage: PGLfloat): BOOL; extdecl; + +function Load_WGL_I3D_swap_frame_usage: Boolean; +{$ENDIF} + +//***** GL_3DFX_texture_compression_FXT1 *****// +const + GL_COMPRESSED_RGB_FXT1_3DFX = $86B0; + GL_COMPRESSED_RGBA_FXT1_3DFX = $86B1; + +function Load_GL_3DFX_texture_compression_FXT1: Boolean; + +//***** GL_IBM_cull_vertex *****// +const + GL_CULL_VERTEX_IBM = $1928A; + +function Load_GL_IBM_cull_vertex: Boolean; + +//***** GL_IBM_multimode_draw_arrays *****// +var + glMultiModeDrawArraysIBM: procedure(mode: PGLenum; first: PGLint; count: PGLsizei; primcount: GLsizei; modestride: GLint); extdecl; + glMultiModeDrawElementsIBM: procedure(mode: PGLenum; count: PGLsizei; _type: GLenum; const indices: PGLvoid; primcount: GLsizei; modestride: GLint); extdecl; + +function Load_GL_IBM_multimode_draw_arrays: Boolean; + +//***** GL_IBM_raster_pos_clip *****// +const + GL_RASTER_POSITION_UNCLIPPED_IBM = $19262; + +function Load_GL_IBM_raster_pos_clip: Boolean; + +//***** GL_IBM_texture_mirrored_repeat *****// +const + GL_MIRRORED_REPEAT_IBM = $8370; + +function Load_GL_IBM_texture_mirrored_repeat: Boolean; + +//***** GL_IBM_vertex_array_lists *****// +const + GL_VERTEX_ARRAY_LIST_IBM = $1929E; + GL_NORMAL_ARRAY_LIST_IBM = $1929F; + GL_COLOR_ARRAY_LIST_IBM = $192A0; + GL_INDEX_ARRAY_LIST_IBM = $192A1; + GL_TEXTURE_COORD_ARRAY_LIST_IBM = $192A2; + GL_EDGE_FLAG_ARRAY_LIST_IBM = $192A3; + GL_FOG_COORDINATE_ARRAY_LIST_IBM = $192A4; + GL_SECONDARY_COLOR_ARRAY_LIST_IBM = $192A5; + GL_VERTEX_ARRAY_LIST_STRIDE_IBM = $192A8; + GL_NORMAL_ARRAY_LIST_STRIDE_IBM = $192A9; + GL_COLOR_ARRAY_LIST_STRIDE_IBM = $192AA; + GL_INDEX_ARRAY_LIST_STRIDE_IBM = $192AB; + GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = $192AC; + GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = $192AD; + GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = $192AE; + GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = $192AF; +var + glColorPointerListIBM: procedure(size: GLint; _type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + glSecondaryColorPointerListIBM: procedure(size: GLint; _type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + glEdgeFlagPointerListIBM: procedure(stride: GLint; const pointer: PGLboolean; ptrstride: GLint); extdecl; + glFogCoordPointerListIBM: procedure(_type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + glNormalPointerListIBM: procedure(_type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + glTexCoordPointerListIBM: procedure(size: GLint; _type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + glVertexPointerListIBM: procedure(size: GLint; _type: GLenum; stride: GLint; const pointer: PGLvoid; ptrstride: GLint); extdecl; + +function Load_GL_IBM_vertex_array_lists: Boolean; + +//***** GL_MESA_resize_buffers *****// +var + glResizeBuffersMESA: procedure(); extdecl; + +function Load_GL_MESA_resize_buffers: Boolean; + +//***** GL_MESA_window_pos *****// +var + glWindowPos2dMESA: procedure(x: GLdouble; y: GLdouble); extdecl; + glWindowPos2fMESA: procedure(x: GLfloat; y: GLfloat); extdecl; + glWindowPos2iMESA: procedure(x: GLint; y: GLint); extdecl; + glWindowPos2sMESA: procedure(x: GLshort; y: GLshort); extdecl; + glWindowPos2ivMESA: procedure(const p: PGLint); extdecl; + glWindowPos2svMESA: procedure(const p: PGLshort); extdecl; + glWindowPos2fvMESA: procedure(const p: PGLfloat); extdecl; + glWindowPos2dvMESA: procedure(const p: PGLdouble); extdecl; + glWindowPos3iMESA: procedure(x: GLint; y: GLint; z: GLint); extdecl; + glWindowPos3sMESA: procedure(x: GLshort; y: GLshort; z: GLshort); extdecl; + glWindowPos3fMESA: procedure(x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glWindowPos3dMESA: procedure(x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glWindowPos3ivMESA: procedure(const p: PGLint); extdecl; + glWindowPos3svMESA: procedure(const p: PGLshort); extdecl; + glWindowPos3fvMESA: procedure(const p: PGLfloat); extdecl; + glWindowPos3dvMESA: procedure(const p: PGLdouble); extdecl; + glWindowPos4iMESA: procedure(x: GLint; y: GLint; z: GLint; w: GLint); extdecl; + glWindowPos4sMESA: procedure(x: GLshort; y: GLshort; z: GLshort; w: GLshort); extdecl; + glWindowPos4fMESA: procedure(x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glWindowPos4dMESA: procedure(x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glWindowPos4ivMESA: procedure(const p: PGLint); extdecl; + glWindowPos4svMESA: procedure(const p: PGLshort); extdecl; + glWindowPos4fvMESA: procedure(const p: PGLfloat); extdecl; + glWindowPos4dvMESA: procedure(const p: PGLdouble); extdecl; + +function Load_GL_MESA_window_pos: Boolean; + +//***** GL_OML_interlace *****// +const + GL_INTERLACE_OML = $8980; + GL_INTERLACE_READ_OML = $8981; + +function Load_GL_OML_interlace: Boolean; + +//***** GL_OML_resample *****// +const + GL_PACK_RESAMPLE_OML = $8984; + GL_UNPACK_RESAMPLE_OML = $8985; + GL_RESAMPLE_REPLICATE_OML = $8986; + GL_RESAMPLE_ZERO_FILL_OML = $8987; + GL_RESAMPLE_AVERAGE_OML = $8988; + GL_RESAMPLE_DECIMATE_OML = $8989; + // GL_RESAMPLE_AVERAGE_OML { already defined } + +function Load_GL_OML_resample: Boolean; + +//***** GL_OML_subsample *****// +const + GL_FORMAT_SUBSAMPLE_24_24_OML = $8982; + GL_FORMAT_SUBSAMPLE_244_244_OML = $8983; + +function Load_GL_OML_subsample: Boolean; + +//***** GL_SGIS_generate_mipmap *****// +const + GL_GENERATE_MIPMAP_SGIS = $8191; + GL_GENERATE_MIPMAP_HINT_SGIS = $8192; + +function Load_GL_SGIS_generate_mipmap: Boolean; + +//***** GL_SGIS_multisample *****// +const + GLX_SAMPLE_BUFFERS_SGIS = $186A0; + GLX_SAMPLES_SGIS = $186A1; + GL_MULTISAMPLE_SGIS = $809D; + GL_SAMPLE_ALPHA_TO_MASK_SGIS = $809E; + GL_SAMPLE_ALPHA_TO_ONE_SGIS = $809F; + GL_SAMPLE_MASK_SGIS = $80A0; + GL_MULTISAMPLE_BIT_EXT = $20000000; + GL_1PASS_SGIS = $80A1; + GL_2PASS_0_SGIS = $80A2; + GL_2PASS_1_SGIS = $80A3; + GL_4PASS_0_SGIS = $80A4; + GL_4PASS_1_SGIS = $80A5; + GL_4PASS_2_SGIS = $80A6; + GL_4PASS_3_SGIS = $80A7; + GL_SAMPLE_BUFFERS_SGIS = $80A8; + GL_SAMPLES_SGIS = $80A9; + GL_SAMPLE_MASK_VALUE_SGIS = $80AA; + GL_SAMPLE_MASK_INVERT_SGIS = $80AB; + GL_SAMPLE_PATTERN_SGIS = $80AC; +var + glSampleMaskSGIS: procedure(value: GLclampf; invert: GLboolean); extdecl; + glSamplePatternSGIS: procedure(pattern: GLenum); extdecl; + +function Load_GL_SGIS_multisample: Boolean; + +//***** GL_SGIS_pixel_texture *****// +const + GL_PIXEL_TEXTURE_SGIS = $8353; + GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = $8354; + GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = $8355; + GL_PIXEL_GROUP_COLOR_SGIS = $8356; +var + glPixelTexGenParameteriSGIS: procedure(pname: GLenum; param: GLint); extdecl; + glPixelTexGenParameterfSGIS: procedure(pname: GLenum; param: GLfloat); extdecl; + glGetPixelTexGenParameterivSGIS: procedure(pname: GLenum; params: GLint); extdecl; + glGetPixelTexGenParameterfvSGIS: procedure(pname: GLenum; params: GLfloat); extdecl; + +function Load_GL_SGIS_pixel_texture: Boolean; + +//***** GL_SGIS_texture_border_clamp *****// + // GL_CLAMP_TO_BORDER_SGIS { already defined } + +function Load_GL_SGIS_texture_border_clamp: Boolean; + +//***** GL_SGIS_texture_color_mask *****// +const + GL_TEXTURE_COLOR_WRITEMASK_SGIS = $81EF; +var + glTextureColorMaskSGIS: procedure(r: GLboolean; g: GLboolean; b: GLboolean; a: GLboolean); extdecl; + +function Load_GL_SGIS_texture_color_mask: Boolean; + +//***** GL_SGIS_texture_edge_clamp *****// +const + GL_CLAMP_TO_EDGE_SGIS = $812F; + +function Load_GL_SGIS_texture_edge_clamp: Boolean; + +//***** GL_SGIS_texture_lod *****// +const + GL_TEXTURE_MIN_LOD_SGIS = $813A; + GL_TEXTURE_MAX_LOD_SGIS = $813B; + GL_TEXTURE_BASE_LEVEL_SGIS = $813C; + GL_TEXTURE_MAX_LEVEL_SGIS = $813D; + +function Load_GL_SGIS_texture_lod: Boolean; + +//***** GL_SGIS_depth_texture *****// +const + GL_DEPTH_COMPONENT16_SGIX = $81A5; + GL_DEPTH_COMPONENT24_SGIX = $81A6; + GL_DEPTH_COMPONENT32_SGIX = $81A7; + +function Load_GL_SGIS_depth_texture: Boolean; + +//***** GL_SGIX_fog_offset *****// +const + GL_FOG_OFFSET_SGIX = $8198; + GL_FOG_OFFSET_VALUE_SGIX = $8199; + +function Load_GL_SGIX_fog_offset: Boolean; + +//***** GL_SGIX_interlace *****// +const + GL_INTERLACE_SGIX = $8094; + +function Load_GL_SGIX_interlace: Boolean; + +//***** GL_SGIX_shadow_ambient *****// +const + GL_SHADOW_AMBIENT_SGIX = $80BF; + +function Load_GL_SGIX_shadow_ambient: Boolean; + +//***** GL_SGI_color_matrix *****// +const + GL_COLOR_MATRIX_SGI = $80B1; + GL_COLOR_MATRIX_STACK_DEPTH_SGI = $80B2; + GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = $80B3; + GL_POST_COLOR_MATRIX_RED_SCALE_SGI = $80B4; + GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = $80B5; + GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = $80B6; + GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = $80B7; + GL_POST_COLOR_MATRIX_RED_BIAS_SGI = $80B8; + GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = $80B9; + GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = $80BA; + GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = $80BB; + +function Load_GL_SGI_color_matrix: Boolean; + +//***** GL_SGI_color_table *****// +const + GL_COLOR_TABLE_SGI = $80D0; + GL_POST_CONVOLUTION_COLOR_TABLE_SGI = $80D1; + GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = $80D2; + GL_PROXY_COLOR_TABLE_SGI = $80D3; + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = $80D4; + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = $80D5; + GL_COLOR_TABLE_SCALE_SGI = $80D6; + GL_COLOR_TABLE_BIAS_SGI = $80D7; + GL_COLOR_TABLE_FORMAT_SGI = $80D8; + GL_COLOR_TABLE_WIDTH_SGI = $80D9; + GL_COLOR_TABLE_RED_SIZE_SGI = $80DA; + GL_COLOR_TABLE_GREEN_SIZE_SGI = $80DB; + GL_COLOR_TABLE_BLUE_SIZE_SGI = $80DC; + GL_COLOR_TABLE_ALPHA_SIZE_SGI = $80DD; + GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = $80DE; + GL_COLOR_TABLE_INTENSITY_SIZE_SGI = $80DF; +var + glColorTableSGI: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; format: GLenum; _type: GLenum; const table: PGLvoid); extdecl; + glCopyColorTableSGI: procedure(target: GLenum; internalformat: GLenum; x: GLint; y: GLint; width: GLsizei); extdecl; + glColorTableParameterivSGI: procedure(target: GLenum; pname: GLenum; const params: PGLint); extdecl; + glColorTableParameterfvSGI: procedure(target: GLenum; pname: GLenum; const params: PGLfloat); extdecl; + glGetColorTableSGI: procedure(target: GLenum; format: GLenum; _type: GLenum; table: PGLvoid); extdecl; + glGetColorTableParameterivSGI: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetColorTableParameterfvSGI: procedure(target: GLenum; pname: GLenum; params: PGLfloat); extdecl; + +function Load_GL_SGI_color_table: Boolean; + +//***** GL_SGI_texture_color_table *****// +const + GL_TEXTURE_COLOR_TABLE_SGI = $80BC; + GL_PROXY_TEXTURE_COLOR_TABLE_SGI = $80BD; + +function Load_GL_SGI_texture_color_table: Boolean; + +//***** GL_SUN_vertex *****// +var + glColor4ubVertex2fSUN: procedure(r: GLubyte; g: GLubyte; b: GLubyte; a: GLubyte; x: GLfloat; y: GLfloat); extdecl; + glColor4ubVertex2fvSUN: procedure(const c: PGLubyte; const v: PGLfloat); extdecl; + glColor4ubVertex3fSUN: procedure(r: GLubyte; g: GLubyte; b: GLubyte; a: GLubyte; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glColor4ubVertex3fvSUN: procedure(const c: PGLubyte; const v: PGLfloat); extdecl; + glColor3fVertex3fSUN: procedure(r: GLfloat; g: GLfloat; b: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glColor3fVertex3fvSUN: procedure(const c: PGLfloat; const v: PGLfloat); extdecl; + glNormal3fVertex3fSUN: procedure(nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glNormal3fVertex3fvSUN: procedure(const n: PGLfloat; const v: PGLfloat); extdecl; + glColor4fNormal3fVertex3fSUN: procedure(r: GLfloat; g: GLfloat; b: GLfloat; a: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glColor4fNormal3fVertex3fvSUN: procedure(const c: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord2fVertex3fSUN: procedure(s: GLfloat; t: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glTexCoord2fVertex3fvSUN: procedure(const tc: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord4fVertex4fSUN: procedure(s: GLfloat; t: GLfloat; p: GLfloat; q: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glTexCoord4fVertex4fvSUN: procedure(const tc: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord2fColor4ubVertex3fSUN: procedure(s: GLfloat; t: GLfloat; r: GLubyte; g: GLubyte; b: GLubyte; a: GLubyte; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glTexCoord2fColor4ubVertex3fvSUN: procedure(const tc: PGLfloat; const c: PGLubyte; const v: PGLfloat); extdecl; + glTexCoord2fColor3fVertex3fSUN: procedure(s: GLfloat; t: GLfloat; r: GLfloat; g: GLfloat; b: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glTexCoord2fColor3fVertex3fvSUN: procedure(const tc: PGLfloat; const c: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord2fNormal3fVertex3fSUN: procedure(s: GLfloat; t: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glTexCoord2fNormal3fVertex3fvSUN: procedure(const tc: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord2fColor4fNormal3fVertex3fSUN: procedure(s: GLfloat; t: GLfloat; r: GLfloat; g: GLfloat; b: GLfloat; a: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glTexCoord2fColor4fNormal3fVertex3fvSUN: procedure(const tc: PGLfloat; const c: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glTexCoord4fColor4fNormal3fVertex4fSUN: procedure(s: GLfloat; t: GLfloat; p: GLfloat; q: GLfloat; r: GLfloat; g: GLfloat; b: GLfloat; a: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glTexCoord4fColor4fNormal3fVertex4fvSUN: procedure(const tc: PGLfloat; const c: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiVertex3fSUN: procedure(rc: GLuint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiVertex3fvSUN: procedure(const rc: PGLuint; const v: PGLfloat); extdecl; + glReplacementCodeuiColor4ubVertex3fSUN: procedure(rc: GLuint; r: GLubyte; g: GLubyte; b: GLubyte; a: GLubyte; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiColor4ubVertex3fvSUN: procedure(const rc: PGLuint; const c: PGLubyte; const v: PGLfloat); extdecl; + glReplacementCodeuiColor3fVertex3fSUN: procedure(rc: GLuint; r: GLfloat; g: GLfloat; b: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiColor3fVertex3fvSUN: procedure(const rc: PGLuint; const c: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiNormal3fVertex3fSUN: procedure(rc: GLuint; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiNormal3fVertex3fvSUN: procedure(const rc: PGLuint; const n: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiColor4fNormal3fVertex3fSUN: procedure(rc: GLuint; r: GLfloat; g: GLfloat; b: GLfloat; a: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiColor4fNormal3fVertex3fvSUN: procedure(const rc: PGLuint; const c: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiTexCoord2fVertex3fSUN: procedure(rc: GLuint; s: GLfloat; t: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiTexCoord2fVertex3fvSUN: procedure(const rc: PGLuint; const tc: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN: procedure(rc: GLuint; s: GLfloat; t: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN: procedure(const rc: PGLuint; const tc: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN: procedure(rc: GLuint; s: GLfloat; t: GLfloat; r: GLfloat; g: GLfloat; b: GLfloat; a: GLfloat; nx: GLfloat; ny: GLfloat; nz: GLfloat; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN: procedure(const rc: PGLuint; const tc: PGLfloat; const c: PGLfloat; const n: PGLfloat; const v: PGLfloat); extdecl; + +function Load_GL_SUN_vertex: Boolean; + +//***** GL_ARB_fragment_program *****// +const + GL_FRAGMENT_PROGRAM_ARB = $8804; + // GL_PROGRAM_FORMAT_ASCII_ARB { already defined } + // GL_PROGRAM_LENGTH_ARB { already defined } + // GL_PROGRAM_FORMAT_ARB { already defined } + // GL_PROGRAM_BINDING_ARB { already defined } + // GL_PROGRAM_INSTRUCTIONS_ARB { already defined } + // GL_MAX_PROGRAM_INSTRUCTIONS_ARB { already defined } + // GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } + // GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } + // GL_PROGRAM_TEMPORARIES_ARB { already defined } + // GL_MAX_PROGRAM_TEMPORARIES_ARB { already defined } + // GL_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } + // GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } + // GL_PROGRAM_PARAMETERS_ARB { already defined } + // GL_MAX_PROGRAM_PARAMETERS_ARB { already defined } + // GL_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } + // GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } + // GL_PROGRAM_ATTRIBS_ARB { already defined } + // GL_MAX_PROGRAM_ATTRIBS_ARB { already defined } + // GL_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } + // GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } + // GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB { already defined } + // GL_MAX_PROGRAM_ENV_PARAMETERS_ARB { already defined } + // GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB { already defined } + GL_PROGRAM_ALU_INSTRUCTIONS_ARB = $8805; + GL_PROGRAM_TEX_INSTRUCTIONS_ARB = $8806; + GL_PROGRAM_TEX_INDIRECTIONS_ARB = $8807; + GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = $8808; + GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = $8809; + GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = $880A; + GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = $880B; + GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = $880C; + GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = $880D; + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = $880E; + GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = $880F; + GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = $8810; + // GL_PROGRAM_STRING_ARB { already defined } + // GL_PROGRAM_ERROR_POSITION_ARB { already defined } + // GL_CURRENT_MATRIX_ARB { already defined } + // GL_TRANSPOSE_CURRENT_MATRIX_ARB { already defined } + // GL_CURRENT_MATRIX_STACK_DEPTH_ARB { already defined } + // GL_MAX_PROGRAM_MATRICES_ARB { already defined } + // GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB { already defined } + GL_MAX_TEXTURE_COORDS_ARB = $8871; + GL_MAX_TEXTURE_IMAGE_UNITS_ARB = $8872; + // GL_PROGRAM_ERROR_STRING_ARB { already defined } + // GL_MATRIX0_ARB { already defined } + // GL_MATRIX1_ARB { already defined } + // GL_MATRIX2_ARB { already defined } + // GL_MATRIX3_ARB { already defined } + // GL_MATRIX4_ARB { already defined } + // GL_MATRIX5_ARB { already defined } + // GL_MATRIX6_ARB { already defined } + // GL_MATRIX7_ARB { already defined } + // GL_MATRIX8_ARB { already defined } + // GL_MATRIX9_ARB { already defined } + // GL_MATRIX10_ARB { already defined } + // GL_MATRIX11_ARB { already defined } + // GL_MATRIX12_ARB { already defined } + // GL_MATRIX13_ARB { already defined } + // GL_MATRIX14_ARB { already defined } + // GL_MATRIX15_ARB { already defined } + // GL_MATRIX16_ARB { already defined } + // GL_MATRIX17_ARB { already defined } + // GL_MATRIX18_ARB { already defined } + // GL_MATRIX19_ARB { already defined } + // GL_MATRIX20_ARB { already defined } + // GL_MATRIX21_ARB { already defined } + // GL_MATRIX22_ARB { already defined } + // GL_MATRIX23_ARB { already defined } + // GL_MATRIX24_ARB { already defined } + // GL_MATRIX25_ARB { already defined } + // GL_MATRIX26_ARB { already defined } + // GL_MATRIX27_ARB { already defined } + // GL_MATRIX28_ARB { already defined } + // GL_MATRIX29_ARB { already defined } + // GL_MATRIX30_ARB { already defined } + // GL_MATRIX31_ARB { already defined } + // glProgramStringARB { already defined } + // glBindProgramARB { already defined } + // glDeleteProgramsARB { already defined } + // glGenProgramsARB { already defined } + // glProgramEnvParameter4dARB { already defined } + // glProgramEnvParameter4dvARB { already defined } + // glProgramEnvParameter4fARB { already defined } + // glProgramEnvParameter4fvARB { already defined } + // glProgramLocalParameter4dARB { already defined } + // glProgramLocalParameter4dvARB { already defined } + // glProgramLocalParameter4fARB { already defined } + // glProgramLocalParameter4fvARB { already defined } + // glGetProgramEnvParameterdvARB { already defined } + // glGetProgramEnvParameterfvARB { already defined } + // glGetProgramLocalParameterdvARB { already defined } + // glGetProgramLocalParameterfvARB { already defined } + // glGetProgramivARB { already defined } + // glGetProgramStringARB { already defined } + // glIsProgramARB { already defined } + +function Load_GL_ARB_fragment_program: Boolean; + +{***** GL_ATI_text_fragment_shader *****} +const + GL_TEXT_FRAGMENT_SHADER_ATI = $8200; + +{***** GL_ARB_vertex_buffer_object *****} +const + GL_BUFFER_SIZE_ARB = $8764; + GL_BUFFER_USAGE_ARB = $8765; + GL_ARRAY_BUFFER_ARB = $8892; + GL_ELEMENT_ARRAY_BUFFER_ARB = $8893; + GL_ARRAY_BUFFER_BINDING_ARB = $8894; + GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = $8895; + GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = $8896; + GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = $8897; + GL_COLOR_ARRAY_BUFFER_BINDING_ARB = $8898; + GL_INDEX_ARRAY_BUFFER_BINDING_ARB = $8899; + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = $889A; + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = $889B; + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = $889C; + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = $889D; + GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = $889E; + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = $889F; + GL_READ_ONLY_ARB = $88B8; + GL_WRITE_ONLY_ARB = $88B9; + GL_READ_WRITE_ARB = $88BA; + GL_BUFFER_ACCESS_ARB = $88BB; + GL_BUFFER_MAPPED_ARB = $88BC; + GL_BUFFER_MAP_POINTER_ARB = $88BD; + GL_STREAM_DRAW_ARB = $88E0; + GL_STREAM_READ_ARB = $88E1; + GL_STREAM_COPY_ARB = $88E2; + GL_STATIC_DRAW_ARB = $88E4; + GL_STATIC_READ_ARB = $88E5; + GL_STATIC_COPY_ARB = $88E6; + GL_DYNAMIC_DRAW_ARB = $88E8; + GL_DYNAMIC_READ_ARB = $88E9; + GL_DYNAMIC_COPY_ARB = $88EA; + +var + glBindBufferARB : procedure(target : GLenum; buffer: GLuint); extdecl; + glDeleteBuffersARB : procedure(n : GLsizei; buffers : PGLuint); extdecl; + glGenBuffersARB : procedure(n : GLsizei; buffers : PGLuint); extdecl; + glIsBufferARB : function (buffer : GLuint) :GLboolean; extdecl; + glBufferDataARB : procedure(target : GLenum; size:GLsizei; data:PGLvoid;usage: GLenum); extdecl; + glBufferSubDataARB : procedure(target : GLenum; offset :GLint; size : GLsizei; data: PGLvoid); extdecl; + glGetBufferSubDataARB : procedure(target : GLenum; offset :GLint; size : GLsizei; data: PGLvoid); extdecl; + glMapBufferARB : function (target :GLenum; access: GLenum) : PGLvoid; extdecl; + glUnmapBufferARB : function (target :GLenum) :GLboolean; extdecl; + glGetBufferParameterivARB:procedure(target:GLenum; pname:GLenum; params:PGLint); extdecl; + glGetBufferPointervARB : procedure(target: GLenum; pname:GLenum; params: PPGLvoid); extdecl; + function Load_GL_ARB_vertex_buffer_object : boolean; + +function Load_GL_ATI_text_fragment_shader: Boolean; + +//***** GL_APPLE_client_storage *****// +const + GL_UNPACK_CLIENT_STORAGE_APPLE = $85B2; + +function Load_GL_APPLE_client_storage: Boolean; + +//***** GL_APPLE_element_array *****// +const + GL_ELEMENT_ARRAY_APPLE = $8768; + GL_ELEMENT_ARRAY_TYPE_APPLE = $8769; + GL_ELEMENT_ARRAY_POINTER_APPLE = $876A; +var + glElementPointerAPPLE: procedure(_type: GLenum; const pointer: PGLvoid); extdecl; + glDrawElementArrayAPPLE: procedure(mode: GLenum; first: GLint; count: GLsizei); extdecl; + glDrawRangeElementArrayAPPLE: procedure(mode: GLenum; start: GLuint; _end: GLuint; first: GLint; count: GLsizei); extdecl; + glMultiDrawElementArrayAPPLE: procedure(mode: GLenum; const first: PGLint; const count: PGLsizei; primcount: GLsizei); extdecl; + glMultiDrawRangeElementArrayAPPLE: procedure(mode: GLenum; start: GLuint; _end: GLuint; const first: PGLint; const count: PGLsizei; primcount: GLsizei); extdecl; + +function Load_GL_APPLE_element_array: Boolean; + +//***** GL_APPLE_fence *****// +const + GL_DRAW_PIXELS_APPLE = $8A0A; + GL_FENCE_APPLE = $8A0B; +var + glGenFencesAPPLE: procedure(n: GLsizei; fences: PGLuint); extdecl; + glDeleteFencesAPPLE: procedure(n: GLsizei; const fences: PGLuint); extdecl; + glSetFenceAPPLE: procedure(fence: GLuint); extdecl; + glIsFenceAPPLE: function(fence: GLuint): GLboolean; extdecl; + glTestFenceAPPLE: function(fence: GLuint): GLboolean; extdecl; + glFinishFenceAPPLE: procedure(fence: GLuint); extdecl; + glTestObjectAPPLE: function(_object: GLenum; name: GLuint): GLboolean; extdecl; + glFinishObjectAPPLE: procedure(_object: GLenum; name: GLint); extdecl; + +function Load_GL_APPLE_fence: Boolean; + +//***** GL_APPLE_vertex_array_object *****// +const + GL_VERTEX_ARRAY_BINDING_APPLE = $85B5; +var + glBindVertexArrayAPPLE: procedure(_array: GLuint); extdecl; + glDeleteVertexArraysAPPLE: procedure(n: GLsizei; const arrays: PGLuint); extdecl; + glGenVertexArraysAPPLE: procedure(n: GLsizei; const arrays: PGLuint); extdecl; + glIsVertexArrayAPPLE: function(_array: GLuint): GLboolean; extdecl; + +function Load_GL_APPLE_vertex_array_object: Boolean; + +//***** GL_APPLE_vertex_array_range *****// +const + GL_VERTEX_ARRAY_RANGE_APPLE = $851D; + GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = $851E; + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE = $8520; + GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = $8521; + GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = $851F; + GL_STORAGE_CACHED_APPLE = $85BE; + GL_STORAGE_SHARED_APPLE = $85BF; +var + glVertexArrayRangeAPPLE: procedure(length: GLsizei; pointer: PGLvoid); extdecl; + glFlushVertexArrayRangeAPPLE: procedure(length: GLsizei; pointer: PGLvoid); extdecl; + glVertexArrayParameteriAPPLE: procedure(pname: GLenum; param: GLint); extdecl; + +function Load_GL_APPLE_vertex_array_range: Boolean; + +{$IFDEF Windows} +//***** WGL_ARB_pixel_format *****// +const + WGL_NUMBER_PIXEL_FORMATS_ARB = $2000; + WGL_DRAW_TO_WINDOW_ARB = $2001; + WGL_DRAW_TO_BITMAP_ARB = $2002; + WGL_ACCELERATION_ARB = $2003; + WGL_NEED_PALETTE_ARB = $2004; + WGL_NEED_SYSTEM_PALETTE_ARB = $2005; + WGL_SWAP_LAYER_BUFFERS_ARB = $2006; + WGL_SWAP_METHOD_ARB = $2007; + WGL_NUMBER_OVERLAYS_ARB = $2008; + WGL_NUMBER_UNDERLAYS_ARB = $2009; + WGL_TRANSPARENT_ARB = $200A; + WGL_TRANSPARENT_RED_VALUE_ARB = $2037; + WGL_TRANSPARENT_GREEN_VALUE_ARB = $2038; + WGL_TRANSPARENT_BLUE_VALUE_ARB = $2039; + WGL_TRANSPARENT_ALPHA_VALUE_ARB = $203A; + WGL_TRANSPARENT_INDEX_VALUE_ARB = $203B; + WGL_SHARE_DEPTH_ARB = $200C; + WGL_SHARE_STENCIL_ARB = $200D; + WGL_SHARE_ACCUM_ARB = $200E; + WGL_SUPPORT_GDI_ARB = $200F; + WGL_SUPPORT_OPENGL_ARB = $2010; + WGL_DOUBLE_BUFFER_ARB = $2011; + WGL_STEREO_ARB = $2012; + WGL_PIXEL_TYPE_ARB = $2013; + WGL_COLOR_BITS_ARB = $2014; + WGL_RED_BITS_ARB = $2015; + WGL_RED_SHIFT_ARB = $2016; + WGL_GREEN_BITS_ARB = $2017; + WGL_GREEN_SHIFT_ARB = $2018; + WGL_BLUE_BITS_ARB = $2019; + WGL_BLUE_SHIFT_ARB = $201A; + WGL_ALPHA_BITS_ARB = $201B; + WGL_ALPHA_SHIFT_ARB = $201C; + WGL_ACCUM_BITS_ARB = $201D; + WGL_ACCUM_RED_BITS_ARB = $201E; + WGL_ACCUM_GREEN_BITS_ARB = $201F; + WGL_ACCUM_BLUE_BITS_ARB = $2020; + WGL_ACCUM_ALPHA_BITS_ARB = $2021; + WGL_DEPTH_BITS_ARB = $2022; + WGL_STENCIL_BITS_ARB = $2023; + WGL_AUX_BUFFERS_ARB = $2024; + WGL_NO_ACCELERATION_ARB = $2025; + WGL_GENERIC_ACCELERATION_ARB = $2026; + WGL_FULL_ACCELERATION_ARB = $2027; + WGL_SWAP_EXCHANGE_ARB = $2028; + WGL_SWAP_COPY_ARB = $2029; + WGL_SWAP_UNDEFINED_ARB = $202A; + WGL_TYPE_RGBA_ARB = $202B; + WGL_TYPE_COLORINDEX_ARB = $202C; +var + wglGetPixelFormatAttribivARB: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; const piAttributes: PGLint; piValues: PGLint): BOOL; extdecl; + wglGetPixelFormatAttribfvARB: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; const piAttributes: PGLint; pfValues: PGLfloat): BOOL; extdecl; + wglChoosePixelFormatARB: function(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: GLuint; piFormats: PGLint; nNumFormats: PGLuint): BOOL; extdecl; + +function Load_WGL_ARB_pixel_format: Boolean; + +//***** WGL_ARB_make_current_read *****// +const + WGL_ERROR_INVALID_PIXEL_TYPE_ARB = $2043; + WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = $2054; +var + wglMakeContextCurrentARB: function(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): BOOL; extdecl; + wglGetCurrentReadDCARB: function(): HDC; extdecl; + +function Load_WGL_ARB_make_current_read: Boolean; + +//***** WGL_ARB_pbuffer *****// +const + WGL_DRAW_TO_PBUFFER_ARB = $202D; + // WGL_DRAW_TO_PBUFFER_ARB { already defined } + WGL_MAX_PBUFFER_PIXELS_ARB = $202E; + WGL_MAX_PBUFFER_WIDTH_ARB = $202F; + WGL_MAX_PBUFFER_HEIGHT_ARB = $2030; + WGL_PBUFFER_LARGEST_ARB = $2033; + WGL_PBUFFER_WIDTH_ARB = $2034; + WGL_PBUFFER_HEIGHT_ARB = $2035; + WGL_PBUFFER_LOST_ARB = $2036; +var + wglCreatePbufferARB: function(hDC: HDC; iPixelFormat: GLint; iWidth: GLint; iHeight: GLint; const piAttribList: PGLint): THandle; extdecl; + wglGetPbufferDCARB: function(hPbuffer: THandle): HDC; extdecl; + wglReleasePbufferDCARB: function(hPbuffer: THandle; hDC: HDC): GLint; extdecl; + wglDestroyPbufferARB: function(hPbuffer: THandle): BOOL; extdecl; + wglQueryPbufferARB: function(hPbuffer: THandle; iAttribute: GLint; piValue: PGLint): BOOL; extdecl; + +function Load_WGL_ARB_pbuffer: Boolean; + +//***** WGL_EXT_swap_control *****// +var + wglSwapIntervalEXT: function(interval: GLint): BOOL; extdecl; + wglGetSwapIntervalEXT: function(): GLint; extdecl; + +function Load_WGL_EXT_swap_control: Boolean; + +//***** WGL_ARB_render_texture *****// +const + WGL_BIND_TO_TEXTURE_RGB_ARB = $2070; + WGL_BIND_TO_TEXTURE_RGBA_ARB = $2071; + WGL_TEXTURE_FORMAT_ARB = $2072; + WGL_TEXTURE_TARGET_ARB = $2073; + WGL_MIPMAP_TEXTURE_ARB = $2074; + WGL_TEXTURE_RGB_ARB = $2075; + WGL_TEXTURE_RGBA_ARB = $2076; + WGL_NO_TEXTURE_ARB = $2077; + WGL_TEXTURE_CUBE_MAP_ARB = $2078; + WGL_TEXTURE_1D_ARB = $2079; + WGL_TEXTURE_2D_ARB = $207A; + // WGL_NO_TEXTURE_ARB { already defined } + WGL_MIPMAP_LEVEL_ARB = $207B; + WGL_CUBE_MAP_FACE_ARB = $207C; + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = $207D; + WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = $207E; + WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = $207F; + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = $2080; + WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = $2081; + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = $2082; + WGL_FRONT_LEFT_ARB = $2083; + WGL_FRONT_RIGHT_ARB = $2084; + WGL_BACK_LEFT_ARB = $2085; + WGL_BACK_RIGHT_ARB = $2086; + WGL_AUX0_ARB = $2087; + WGL_AUX1_ARB = $2088; + WGL_AUX2_ARB = $2089; + WGL_AUX3_ARB = $208A; + WGL_AUX4_ARB = $208B; + WGL_AUX5_ARB = $208C; + WGL_AUX6_ARB = $208D; + WGL_AUX7_ARB = $208E; + WGL_AUX8_ARB = $208F; + WGL_AUX9_ARB = $2090; +var + wglBindTexImageARB: function(hPbuffer: THandle; iBuffer: GLint): BOOL; extdecl; + wglReleaseTexImageARB: function(hPbuffer: THandle; iBuffer: GLint): BOOL; extdecl; + wglSetPbufferAttribARB: function(hPbuffer: THandle; const piAttribList: PGLint): BOOL; extdecl; + +function Load_WGL_ARB_render_texture: Boolean; + +//***** WGL_EXT_extensions_string *****// +var + wglGetExtensionsStringEXT: function(): Pchar; extdecl; + +function Load_WGL_EXT_extensions_string: Boolean; + +//***** WGL_EXT_make_current_read *****// +var + wglMakeContextCurrentEXT: function(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): BOOL; extdecl; + wglGetCurrentReadDCEXT: function(): HDC; extdecl; + +function Load_WGL_EXT_make_current_read: Boolean; + +//***** WGL_EXT_pbuffer *****// +const + WGL_DRAW_TO_PBUFFER_EXT = $202D; + WGL_MAX_PBUFFER_PIXELS_EXT = $202E; + WGL_MAX_PBUFFER_WIDTH_EXT = $202F; + WGL_MAX_PBUFFER_HEIGHT_EXT = $2030; + WGL_OPTIMAL_PBUFFER_WIDTH_EXT = $2031; + WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = $2032; + WGL_PBUFFER_LARGEST_EXT = $2033; + WGL_PBUFFER_WIDTH_EXT = $2034; + WGL_PBUFFER_HEIGHT_EXT = $2035; +var + wglCreatePbufferEXT: function(hDC: HDC; iPixelFormat: GLint; iWidth: GLint; iHeight: GLint; const piAttribList: PGLint): THandle; extdecl; + wglGetPbufferDCEXT: function(hPbuffer: THandle): HDC; extdecl; + wglReleasePbufferDCEXT: function(hPbuffer: THandle; hDC: HDC): GLint; extdecl; + wglDestroyPbufferEXT: function(hPbuffer: THandle): BOOL; extdecl; + wglQueryPbufferEXT: function(hPbuffer: THandle; iAttribute: GLint; piValue: PGLint): BOOL; extdecl; + +function Load_WGL_EXT_pbuffer: Boolean; + +//***** WGL_EXT_pixel_format *****// +const + WGL_NUMBER_PIXEL_FORMATS_EXT = $2000; + WGL_DRAW_TO_WINDOW_EXT = $2001; + WGL_DRAW_TO_BITMAP_EXT = $2002; + WGL_ACCELERATION_EXT = $2003; + WGL_NEED_PALETTE_EXT = $2004; + WGL_NEED_SYSTEM_PALETTE_EXT = $2005; + WGL_SWAP_LAYER_BUFFERS_EXT = $2006; + WGL_SWAP_METHOD_EXT = $2007; + WGL_NUMBER_OVERLAYS_EXT = $2008; + WGL_NUMBER_UNDERLAYS_EXT = $2009; + WGL_TRANSPARENT_EXT = $200A; + WGL_TRANSPARENT_VALUE_EXT = $200B; + WGL_SHARE_DEPTH_EXT = $200C; + WGL_SHARE_STENCIL_EXT = $200D; + WGL_SHARE_ACCUM_EXT = $200E; + WGL_SUPPORT_GDI_EXT = $200F; + WGL_SUPPORT_OPENGL_EXT = $2010; + WGL_DOUBLE_BUFFER_EXT = $2011; + WGL_STEREO_EXT = $2012; + WGL_PIXEL_TYPE_EXT = $2013; + WGL_COLOR_BITS_EXT = $2014; + WGL_RED_BITS_EXT = $2015; + WGL_RED_SHIFT_EXT = $2016; + WGL_GREEN_BITS_EXT = $2017; + WGL_GREEN_SHIFT_EXT = $2018; + WGL_BLUE_BITS_EXT = $2019; + WGL_BLUE_SHIFT_EXT = $201A; + WGL_ALPHA_BITS_EXT = $201B; + WGL_ALPHA_SHIFT_EXT = $201C; + WGL_ACCUM_BITS_EXT = $201D; + WGL_ACCUM_RED_BITS_EXT = $201E; + WGL_ACCUM_GREEN_BITS_EXT = $201F; + WGL_ACCUM_BLUE_BITS_EXT = $2020; + WGL_ACCUM_ALPHA_BITS_EXT = $2021; + WGL_DEPTH_BITS_EXT = $2022; + WGL_STENCIL_BITS_EXT = $2023; + WGL_AUX_BUFFERS_EXT = $2024; + WGL_NO_ACCELERATION_EXT = $2025; + WGL_GENERIC_ACCELERATION_EXT = $2026; + WGL_FULL_ACCELERATION_EXT = $2027; + WGL_SWAP_EXCHANGE_EXT = $2028; + WGL_SWAP_COPY_EXT = $2029; + WGL_SWAP_UNDEFINED_EXT = $202A; + WGL_TYPE_RGBA_EXT = $202B; + WGL_TYPE_COLORINDEX_EXT = $202C; +var + wglGetPixelFormatAttribivEXT: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; piAttributes: PGLint; piValues: PGLint): BOOL; extdecl; + wglGetPixelFormatAttribfvEXT: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; piAttributes: PGLint; pfValues: PGLfloat): BOOL; extdecl; + wglChoosePixelFormatEXT: function(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: GLuint; piFormats: PGLint; nNumFormats: PGLuint): BOOL; extdecl; + +function Load_WGL_EXT_pixel_format: Boolean; + +//***** WGL_I3D_digital_video_control *****// +const + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = $2050; + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = $2051; + WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = $2052; + WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = $2053; +var + wglGetDigitalVideoParametersI3D: function(hDC: HDC; iAttribute: GLint; piValue: PGLint): BOOL; extdecl; + wglSetDigitalVideoParametersI3D: function(hDC: HDC; iAttribute: GLint; const piValue: PGLint): BOOL; extdecl; + +function Load_WGL_I3D_digital_video_control: Boolean; + +//***** WGL_I3D_gamma *****// +const + WGL_GAMMA_TABLE_SIZE_I3D = $204E; + WGL_GAMMA_EXCLUDE_DESKTOP_I3D = $204F; + // WGL_GAMMA_EXCLUDE_DESKTOP_I3D { already defined } +var + wglGetGammaTableParametersI3D: function(hDC: HDC; iAttribute: GLint; piValue: PGLint): BOOL; extdecl; + wglSetGammaTableParametersI3D: function(hDC: HDC; iAttribute: GLint; const piValue: PGLint): BOOL; extdecl; + wglGetGammaTableI3D: function(hDC: HDC; iEntries: GLint; puRed: PGLUSHORT; puGreen: PGLUSHORT; puBlue: PGLUSHORT): BOOL; extdecl; + wglSetGammaTableI3D: function(hDC: HDC; iEntries: GLint; const puRed: PGLUSHORT; const puGreen: PGLUSHORT; const puBlue: PGLUSHORT): BOOL; extdecl; + +function Load_WGL_I3D_gamma: Boolean; + +//***** WGL_I3D_genlock *****// +const + WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = $2044; + WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D = $2045; + WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D = $2046; + WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D = $2047; + WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = $2048; + WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = $2049; + WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = $204A; + WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = $204B; + WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = $204C; +var + wglEnableGenlockI3D: function(hDC: HDC): BOOL; extdecl; + wglDisableGenlockI3D: function(hDC: HDC): BOOL; extdecl; + wglIsEnabledGenlockI3D: function(hDC: HDC; pFlag: PBOOL): BOOL; extdecl; + wglGenlockSourceI3D: function(hDC: HDC; uSource: GLUINT): BOOL; extdecl; + wglGetGenlockSourceI3D: function(hDC: HDC; uSource: PGLUINT): BOOL; extdecl; + wglGenlockSourceEdgeI3D: function(hDC: HDC; uEdge: GLUINT): BOOL; extdecl; + wglGetGenlockSourceEdgeI3D: function(hDC: HDC; uEdge: PGLUINT): BOOL; extdecl; + wglGenlockSampleRateI3D: function(hDC: HDC; uRate: GLUINT): BOOL; extdecl; + wglGetGenlockSampleRateI3D: function(hDC: HDC; uRate: PGLUINT): BOOL; extdecl; + wglGenlockSourceDelayI3D: function(hDC: HDC; uDelay: GLUINT): BOOL; extdecl; + wglGetGenlockSourceDelayI3D: function(hDC: HDC; uDelay: PGLUINT): BOOL; extdecl; + wglQueryGenlockMaxSourceDelayI3D: function(hDC: HDC; uMaxLineDelay: PGLUINT; uMaxPixelDelay: PGLUINT): BOOL; extdecl; + +function Load_WGL_I3D_genlock: Boolean; +{$ENDIF} + +//***** GL_ARB_matrix_palette *****// +const + GL_MATRIX_PALETTE_ARB = $8840; + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = $8841; + GL_MAX_PALETTE_MATRICES_ARB = $8842; + GL_CURRENT_PALETTE_MATRIX_ARB = $8843; + GL_MATRIX_INDEX_ARRAY_ARB = $8844; + GL_CURRENT_MATRIX_INDEX_ARB = $8845; + GL_MATRIX_INDEX_ARRAY_SIZE_ARB = $8846; + GL_MATRIX_INDEX_ARRAY_TYPE_ARB = $8847; + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = $8848; + GL_MATRIX_INDEX_ARRAY_POINTER_ARB = $8849; +var + glCurrentPaletteMatrixARB: procedure(index: GLint); extdecl; + glMatrixIndexubvARB: procedure(size: GLint; indices: PGLubyte); extdecl; + glMatrixIndexusvARB: procedure(size: GLint; indices: PGLushort); extdecl; + glMatrixIndexuivARB: procedure(size: GLint; indices: PGLuint); extdecl; + glMatrixIndexPointerARB: procedure(size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); extdecl; + +function Load_GL_ARB_matrix_palette: Boolean; + +//***** GL_NV_element_array *****// +const + GL_ELEMENT_ARRAY_TYPE_NV = $8769; + GL_ELEMENT_ARRAY_POINTER_NV = $876A; +var + glElementPointerNV: procedure(_type: GLenum; const pointer: PGLvoid); extdecl; + glDrawElementArrayNV: procedure(mode: GLenum; first: GLint; count: GLsizei); extdecl; + glDrawRangeElementArrayNV: procedure(mode: GLenum; start: GLuint; _end: GLuint; first: GLint; count: GLsizei); extdecl; + glMultiDrawElementArrayNV: procedure(mode: GLenum; const first: PGLint; const count: PGLsizei; primcount: GLsizei); extdecl; + glMultiDrawRangeElementArrayNV: procedure(mode: GLenum; start: GLuint; _end: GLuint; const first: PGLint; const count: PGLsizei; primcount: GLsizei); extdecl; + +function Load_GL_NV_element_array: Boolean; + +//***** GL_NV_float_buffer *****// +const + GL_FLOAT_R_NV = $8880; + GL_FLOAT_RG_NV = $8881; + GL_FLOAT_RGB_NV = $8882; + GL_FLOAT_RGBA_NV = $8883; + GL_FLOAT_R16_NV = $8884; + GL_FLOAT_R32_NV = $8885; + GL_FLOAT_RG16_NV = $8886; + GL_FLOAT_RG32_NV = $8887; + GL_FLOAT_RGB16_NV = $8888; + GL_FLOAT_RGB32_NV = $8889; + GL_FLOAT_RGBA16_NV = $888A; + GL_FLOAT_RGBA32_NV = $888B; + GL_TEXTURE_FLOAT_COMPONENTS_NV = $888C; + GL_FLOAT_CLEAR_COLOR_VALUE_NV = $888D; + GL_FLOAT_RGBA_MODE_NV = $888E; +{$IFDEF Windows} + WGL_FLOAT_COMPONENTS_NV = $20B0; + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = $20B1; + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = $20B2; + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = $20B3; + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = $20B4; + WGL_TEXTURE_FLOAT_R_NV = $20B5; + WGL_TEXTURE_FLOAT_RG_NV = $20B6; + WGL_TEXTURE_FLOAT_RGB_NV = $20B7; + WGL_TEXTURE_FLOAT_RGBA_NV = $20B8; +{$ENDIF} + +function Load_GL_NV_float_buffer: Boolean; + +//***** GL_NV_fragment_program *****// +const + GL_FRAGMENT_PROGRAM_NV = $8870; + GL_MAX_TEXTURE_COORDS_NV = $8871; + GL_MAX_TEXTURE_IMAGE_UNITS_NV = $8872; + GL_FRAGMENT_PROGRAM_BINDING_NV = $8873; + GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = $8868; + GL_PROGRAM_ERROR_STRING_NV = $8874; +var + glProgramNamedParameter4fNV: procedure(id: GLuint; len: GLsizei; const name: PGLubyte; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glProgramNamedParameter4dNV: procedure(id: GLuint; len: GLsizei; const name: PGLubyte; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glGetProgramNamedParameterfvNV: procedure(id: GLuint; len: GLsizei; const name: PGLubyte; params: PGLfloat); extdecl; + glGetProgramNamedParameterdvNV: procedure(id: GLuint; len: GLsizei; const name: PGLubyte; params: PGLdouble); extdecl; + // glProgramLocalParameter4dARB { already defined } + // glProgramLocalParameter4dvARB { already defined } + // glProgramLocalParameter4fARB { already defined } + // glProgramLocalParameter4fvARB { already defined } + // glGetProgramLocalParameterdvARB { already defined } + // glGetProgramLocalParameterfvARB { already defined } + +function Load_GL_NV_fragment_program: Boolean; + +//***** GL_NV_primitive_restart *****// +const + GL_PRIMITIVE_RESTART_NV = $8558; + GL_PRIMITIVE_RESTART_INDEX_NV = $8559; +var + glPrimitiveRestartNV: procedure(); extdecl; + glPrimitiveRestartIndexNV: procedure(index: GLuint); extdecl; + +function Load_GL_NV_primitive_restart: Boolean; + +//***** GL_NV_vertex_program2 *****// + +function Load_GL_NV_vertex_program2: Boolean; + +{$IFDEF Windows} +//***** WGL_NV_render_texture_rectangle *****// +const + WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = $20A0; + WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = $20A1; + WGL_TEXTURE_RECTANGLE_NV = $20A2; + +function Load_WGL_NV_render_texture_rectangle: Boolean; +{$ENDIF} + +//***** GL_NV_pixel_data_range *****// +const + GL_WRITE_PIXEL_DATA_RANGE_NV = $8878; + GL_READ_PIXEL_DATA_RANGE_NV = $8879; + GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = $887A; + GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = $887B; + GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = $887C; + GL_READ_PIXEL_DATA_RANGE_POINTER_NV = $887D; +var + glPixelDataRangeNV: procedure(target: GLenum; length: GLsizei; pointer: PGLvoid); extdecl; + glFlushPixelDataRangeNV: procedure(target: GLenum); extdecl; + // wglAllocateMemoryNV { already defined } + // wglFreeMemoryNV { already defined } + +function Load_GL_NV_pixel_data_range: Boolean; + +//***** GL_EXT_texture_rectangle *****// +const + GL_TEXTURE_RECTANGLE_EXT = $84F5; + GL_TEXTURE_BINDING_RECTANGLE_EXT = $84F6; + GL_PROXY_TEXTURE_RECTANGLE_EXT = $84F7; + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT = $84F8; + +function Load_GL_EXT_texture_rectangle: Boolean; + +//***** GL_S3_s3tc *****// +const + GL_RGB_S3TC = $83A0; + GL_RGB4_S3TC = $83A1; + GL_RGBA_S3TC = $83A2; + GL_RGBA4_S3TC = $83A3; + +function Load_GL_S3_s3tc: Boolean; + +//***** GL_ATI_draw_buffers *****// +const + GL_MAX_DRAW_BUFFERS_ATI = $8824; + GL_DRAW_BUFFER0_ATI = $8825; + GL_DRAW_BUFFER1_ATI = $8826; + GL_DRAW_BUFFER2_ATI = $8827; + GL_DRAW_BUFFER3_ATI = $8828; + GL_DRAW_BUFFER4_ATI = $8829; + GL_DRAW_BUFFER5_ATI = $882A; + GL_DRAW_BUFFER6_ATI = $882B; + GL_DRAW_BUFFER7_ATI = $882C; + GL_DRAW_BUFFER8_ATI = $882D; + GL_DRAW_BUFFER9_ATI = $882E; + GL_DRAW_BUFFER10_ATI = $882F; + GL_DRAW_BUFFER11_ATI = $8830; + GL_DRAW_BUFFER12_ATI = $8831; + GL_DRAW_BUFFER13_ATI = $8832; + GL_DRAW_BUFFER14_ATI = $8833; + GL_DRAW_BUFFER15_ATI = $8834; +var + glDrawBuffersATI: procedure(n: GLsizei; const bufs: PGLenum); extdecl; + +function Load_GL_ATI_draw_buffers: Boolean; + +{$IFDEF Windows} +//***** WGL_ATI_pixel_format_float *****// +const + WGL_RGBA_FLOAT_MODE_ATI = $8820; + WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = $8835; + WGL_TYPE_RGBA_FLOAT_ATI = $21A0; + +function Load_WGL_ATI_pixel_format_float: Boolean; +{$ENDIF} + +//***** GL_ATI_texture_env_combine3 *****// +const + GL_MODULATE_ADD_ATI = $8744; + GL_MODULATE_SIGNED_ADD_ATI = $8745; + GL_MODULATE_SUBTRACT_ATI = $8746; + +function Load_GL_ATI_texture_env_combine3: Boolean; + +//***** GL_ATI_texture_float *****// +const + GL_RGBA_FLOAT32_ATI = $8814; + GL_RGB_FLOAT32_ATI = $8815; + GL_ALPHA_FLOAT32_ATI = $8816; + GL_INTENSITY_FLOAT32_ATI = $8817; + GL_LUMINANCE_FLOAT32_ATI = $8818; + GL_LUMINANCE_ALPHA_FLOAT32_ATI = $8819; + GL_RGBA_FLOAT16_ATI = $881A; + GL_RGB_FLOAT16_ATI = $881B; + GL_ALPHA_FLOAT16_ATI = $881C; + GL_INTENSITY_FLOAT16_ATI = $881D; + GL_LUMINANCE_FLOAT16_ATI = $881E; + GL_LUMINANCE_ALPHA_FLOAT16_ATI = $881F; + +function Load_GL_ATI_texture_float: Boolean; + +//***** GL_NV_texture_expand_normal *****// +const + GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = $888F; + +function Load_GL_NV_texture_expand_normal: Boolean; + +//***** GL_NV_half_float *****// +const + GL_HALF_FLOAT_NV = $140B; +var + glVertex2hNV: procedure(x: GLushort; y: GLushort); extdecl; + glVertex2hvNV: procedure(const v: PGLushort); extdecl; + glVertex3hNV: procedure(x: GLushort; y: GLushort; z: GLushort); extdecl; + glVertex3hvNV: procedure(const v: PGLushort); extdecl; + glVertex4hNV: procedure(x: GLushort; y: GLushort; z: GLushort; w: GLushort); extdecl; + glVertex4hvNV: procedure(const v: PGLushort); extdecl; + glNormal3hNV: procedure(nx: GLushort; ny: GLushort; nz: GLushort); extdecl; + glNormal3hvNV: procedure(const v: PGLushort); extdecl; + glColor3hNV: procedure(red: GLushort; green: GLushort; blue: GLushort); extdecl; + glColor3hvNV: procedure(const v: PGLushort); extdecl; + glColor4hNV: procedure(red: GLushort; green: GLushort; blue: GLushort; alpha: GLushort); extdecl; + glColor4hvNV: procedure(const v: PGLushort); extdecl; + glTexCoord1hNV: procedure(s: GLushort); extdecl; + glTexCoord1hvNV: procedure(const v: PGLushort); extdecl; + glTexCoord2hNV: procedure(s: GLushort; t: GLushort); extdecl; + glTexCoord2hvNV: procedure(const v: PGLushort); extdecl; + glTexCoord3hNV: procedure(s: GLushort; t: GLushort; r: GLushort); extdecl; + glTexCoord3hvNV: procedure(const v: PGLushort); extdecl; + glTexCoord4hNV: procedure(s: GLushort; t: GLushort; r: GLushort; q: GLushort); extdecl; + glTexCoord4hvNV: procedure(const v: PGLushort); extdecl; + glMultiTexCoord1hNV: procedure(target: GLenum; s: GLushort); extdecl; + glMultiTexCoord1hvNV: procedure(target: GLenum; const v: PGLushort); extdecl; + glMultiTexCoord2hNV: procedure(target: GLenum; s: GLushort; t: GLushort); extdecl; + glMultiTexCoord2hvNV: procedure(target: GLenum; const v: PGLushort); extdecl; + glMultiTexCoord3hNV: procedure(target: GLenum; s: GLushort; t: GLushort; r: GLushort); extdecl; + glMultiTexCoord3hvNV: procedure(target: GLenum; const v: PGLushort); extdecl; + glMultiTexCoord4hNV: procedure(target: GLenum; s: GLushort; t: GLushort; r: GLushort; q: GLushort); extdecl; + glMultiTexCoord4hvNV: procedure(target: GLenum; const v: PGLushort); extdecl; + glFogCoordhNV: procedure(fog: GLushort); extdecl; + glFogCoordhvNV: procedure(const fog: PGLushort); extdecl; + glSecondaryColor3hNV: procedure(red: GLushort; green: GLushort; blue: GLushort); extdecl; + glSecondaryColor3hvNV: procedure(const v: PGLushort); extdecl; + glVertexWeighthNV: procedure(weight: GLushort); extdecl; + glVertexWeighthvNV: procedure(const weight: PGLushort); extdecl; + glVertexAttrib1hNV: procedure(index: GLuint; x: GLushort); extdecl; + glVertexAttrib1hvNV: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib2hNV: procedure(index: GLuint; x: GLushort; y: GLushort); extdecl; + glVertexAttrib2hvNV: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib3hNV: procedure(index: GLuint; x: GLushort; y: GLushort; z: GLushort); extdecl; + glVertexAttrib3hvNV: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib4hNV: procedure(index: GLuint; x: GLushort; y: GLushort; z: GLushort; w: GLushort); extdecl; + glVertexAttrib4hvNV: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttribs1hvNV: procedure(index: GLuint; n: GLsizei; const v: PGLushort); extdecl; + glVertexAttribs2hvNV: procedure(index: GLuint; n: GLsizei; const v: PGLushort); extdecl; + glVertexAttribs3hvNV: procedure(index: GLuint; n: GLsizei; const v: PGLushort); extdecl; + glVertexAttribs4hvNV: procedure(index: GLuint; n: GLsizei; const v: PGLushort); extdecl; + +function Load_GL_NV_half_float: Boolean; + +//***** GL_ATI_map_object_buffer *****// +var + glMapObjectBufferATI: function(buffer: GLuint): PGLvoid; extdecl; + glUnmapObjectBufferATI: procedure(buffer: GLuint); extdecl; + +function Load_GL_ATI_map_object_buffer: Boolean; + +//***** GL_ATI_separate_stencil *****// +const + GL_KEEP = $1E00; + GL_ZERO = $0000; + GL_REPLACE = $1E01; + GL_INCR = $1E02; + GL_DECR = $1E03; + GL_INVERT = $150A; + GL_NEVER = $0200; + GL_LESS = $0201; + GL_LEQUAL = $0203; + GL_GREATER = $0204; + GL_GEQUAL = $0206; + GL_EQUAL = $0202; + GL_NOTEQUAL = $0205; + GL_ALWAYS = $0207; + GL_FRONT = $0404; + GL_BACK = $0405; + GL_FRONT_AND_BACK = $0408; + GL_STENCIL_BACK_FUNC_ATI = $8800; + GL_STENCIL_BACK_FAIL_ATI = $8801; + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = $8802; + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = $8803; +var + glStencilOpSeparateATI: procedure(face: GLenum; sfail: GLenum; dpfail: GLenum; dppass: GLenum); extdecl; + glStencilFuncSeparateATI: procedure(frontfunc: GLenum; backfunc: GLenum; ref: GLint; mask: GLuint); extdecl; + +function Load_GL_ATI_separate_stencil: Boolean; + +//***** GL_ATI_vertex_attrib_array_object *****// +var + glVertexAttribArrayObjectATI: procedure(index: GLuint; size: GLint; _type: GLenum; normalized: GLboolean; stride: GLsizei; buffer: GLuint; offset: GLuint); extdecl; + glGetVertexAttribArrayObjectfvATI: procedure(index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetVertexAttribArrayObjectivATI: procedure(index: GLuint; pname: GLenum; params: PGLint); extdecl; + +function Load_GL_ATI_vertex_attrib_array_object: Boolean; + +//***** GL_ARB_occlusion_query *****// +const + GL_SAMPLES_PASSED_ARB = $8914; + GL_QUERY_COUNTER_BITS_ARB = $8864; + GL_CURRENT_QUERY_ARB = $8865; + GL_QUERY_RESULT_ARB = $8866; + GL_QUERY_RESULT_AVAILABLE_ARB = $8867; +var + glGenQueriesARB: procedure(n: GLsizei; ids: PGLuint); extdecl; + glDeleteQueriesARB: procedure(n: GLsizei; const ids: PGLuint); extdecl; + glIsQueryARB: function(id: GLuint): GLboolean; extdecl; + glBeginQueryARB: procedure(target: GLenum; id: GLuint); extdecl; + glEndQueryARB: procedure(target: GLenum); extdecl; + glGetQueryivARB: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetQueryObjectivARB: procedure(id: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetQueryObjectuivARB: procedure(id: GLuint; pname: GLenum; params: PGLuint); extdecl; + +function Load_GL_ARB_occlusion_query: Boolean; + +//***** GL_ARB_shader_objects *****// +const + GL_PROGRAM_OBJECT_ARB = $8B40; + GL_OBJECT_TYPE_ARB = $8B4E; + GL_OBJECT_SUBTYPE_ARB = $8B4F; + GL_OBJECT_DELETE_STATUS_ARB = $8B80; + GL_OBJECT_COMPILE_STATUS_ARB = $8B81; + GL_OBJECT_LINK_STATUS_ARB = $8B82; + GL_OBJECT_VALIDATE_STATUS_ARB = $8B83; + GL_OBJECT_INFO_LOG_LENGTH_ARB = $8B84; + GL_OBJECT_ATTACHED_OBJECTS_ARB = $8B85; + GL_OBJECT_ACTIVE_UNIFORMS_ARB = $8B86; + GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = $8B87; + GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = $8B88; + GL_SHADER_OBJECT_ARB = $8B48; + GL_FLOAT = $1406; + GL_FLOAT_VEC2_ARB = $8B50; + GL_FLOAT_VEC3_ARB = $8B51; + GL_FLOAT_VEC4_ARB = $8B52; + GL_INT = $1404; + GL_INT_VEC2_ARB = $8B53; + GL_INT_VEC3_ARB = $8B54; + GL_INT_VEC4_ARB = $8B55; + GL_BOOL_ARB = $8B56; + GL_BOOL_VEC2_ARB = $8B57; + GL_BOOL_VEC3_ARB = $8B58; + GL_BOOL_VEC4_ARB = $8B59; + GL_FLOAT_MAT2_ARB = $8B5A; + GL_FLOAT_MAT3_ARB = $8B5B; + GL_FLOAT_MAT4_ARB = $8B5C; +var + glDeleteObjectARB: procedure(obj: GLhandleARB); extdecl; + glGetHandleARB: function(pname: GLenum): GLhandleARB; extdecl; + glDetachObjectARB: procedure(containerObj: GLhandleARB; attachedObj: GLhandleARB); extdecl; + glCreateShaderObjectARB: function(shaderType: GLenum): GLhandleARB; extdecl; + glShaderSourceARB: procedure(shaderObj: GLhandleARB; count: GLsizei; const _string: PGLvoid; const length: PGLint); extdecl; + glCompileShaderARB: procedure(shaderObj: GLhandleARB); extdecl; + glCreateProgramObjectARB: function(): GLhandleARB; extdecl; + glAttachObjectARB: procedure(containerObj: GLhandleARB; obj: GLhandleARB); extdecl; + glLinkProgramARB: procedure(programObj: GLhandleARB); extdecl; + glUseProgramObjectARB: procedure(programObj: GLhandleARB); extdecl; + glValidateProgramARB: procedure(programObj: GLhandleARB); extdecl; + glUniform1fARB: procedure(location: GLint; v0: GLfloat); extdecl; + glUniform2fARB: procedure(location: GLint; v0: GLfloat; v1: GLfloat); extdecl; + glUniform3fARB: procedure(location: GLint; v0: GLfloat; v1: GLfloat; v2: GLfloat); extdecl; + glUniform4fARB: procedure(location: GLint; v0: GLfloat; v1: GLfloat; v2: GLfloat; v3: GLfloat); extdecl; + glUniform1iARB: procedure(location: GLint; v0: GLint); extdecl; + glUniform2iARB: procedure(location: GLint; v0: GLint; v1: GLint); extdecl; + glUniform3iARB: procedure(location: GLint; v0: GLint; v1: GLint; v2: GLint); extdecl; + glUniform4iARB: procedure(location: GLint; v0: GLint; v1: GLint; v2: GLint; v3: GLint); extdecl; + glUniform1fvARB: procedure(location: GLint; count: GLsizei; value: PGLfloat); extdecl; + glUniform2fvARB: procedure(location: GLint; count: GLsizei; value: PGLfloat); extdecl; + glUniform3fvARB: procedure(location: GLint; count: GLsizei; value: PGLfloat); extdecl; + glUniform4fvARB: procedure(location: GLint; count: GLsizei; value: PGLfloat); extdecl; + glUniform1ivARB: procedure(location: GLint; count: GLsizei; value: PGLint); extdecl; + glUniform2ivARB: procedure(location: GLint; count: GLsizei; value: PGLint); extdecl; + glUniform3ivARB: procedure(location: GLint; count: GLsizei; value: PGLint); extdecl; + glUniform4ivARB: procedure(location: GLint; count: GLsizei; value: PGLint); extdecl; + glUniformMatrix2fvARB: procedure(location: GLint; count: GLsizei; transpose: GLboolean; value: PGLfloat); extdecl; + glUniformMatrix3fvARB: procedure(location: GLint; count: GLsizei; transpose: GLboolean; value: PGLfloat); extdecl; + glUniformMatrix4fvARB: procedure(location: GLint; count: GLsizei; transpose: GLboolean; value: PGLfloat); extdecl; + glGetObjectParameterfvARB: procedure(obj: GLhandleARB; pname: GLenum; params: PGLfloat); extdecl; + glGetObjectParameterivARB: procedure(obj: GLhandleARB; pname: GLenum; params: PGLint); extdecl; + glGetInfoLogARB: procedure(obj: GLhandleARB; maxLength: GLsizei; length: PGLsizei; infoLog: PGLcharARB); extdecl; + glGetAttachedObjectsARB: procedure(containerObj: GLhandleARB; maxCount: GLsizei; count: PGLsizei; obj: PGLhandleARB); extdecl; + glGetUniformLocationARB: function(programObj: GLhandleARB; const name: PGLcharARB): GLint; extdecl; + glGetActiveUniformARB: procedure(programObj: GLhandleARB; index: GLuint; maxLength: GLsizei; length: PGLsizei; size: PGLint; _type: PGLenum; name: PGLcharARB); extdecl; + glGetUniformfvARB: procedure(programObj: GLhandleARB; location: GLint; params: PGLfloat); extdecl; + glGetUniformivARB: procedure(programObj: GLhandleARB; location: GLint; params: PGLint); extdecl; + glGetShaderSourceARB: procedure(obj: GLhandleARB; maxLength: GLsizei; length: PGLsizei; source: PGLcharARB); extdecl; + +function Load_GL_ARB_shader_objects: Boolean; + +//***** GL_ARB_vertex_shader *****// +const + GL_VERTEX_SHADER_ARB = $8B31; + GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = $8B4A; + GL_MAX_VARYING_FLOATS_ARB = $8B4B; + // GL_MAX_VERTEX_ATTRIBS_ARB { already defined } + // GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = $8B4C; + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = $8B4D; + // GL_MAX_TEXTURE_COORDS_ARB { already defined } + // GL_VERTEX_PROGRAM_POINT_SIZE_ARB { already defined } + // GL_VERTEX_PROGRAM_TWO_SIDE_ARB { already defined } + // GL_OBJECT_TYPE_ARB { already defined } + // GL_OBJECT_SUBTYPE_ARB { already defined } + GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = $8B89; + GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = $8B8A; + // GL_SHADER_OBJECT_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB { already defined } + // GL_CURRENT_VERTEX_ATTRIB_ARB { already defined } + // GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB { already defined } + // GL_FLOAT { already defined } + // GL_FLOAT_VEC2_ARB { already defined } + // GL_FLOAT_VEC3_ARB { already defined } + // GL_FLOAT_VEC4_ARB { already defined } + // GL_FLOAT_MAT2_ARB { already defined } + // GL_FLOAT_MAT3_ARB { already defined } + // GL_FLOAT_MAT4_ARB { already defined } + // glVertexAttrib1fARB { already defined } + // glVertexAttrib1sARB { already defined } + // glVertexAttrib1dARB { already defined } + // glVertexAttrib2fARB { already defined } + // glVertexAttrib2sARB { already defined } + // glVertexAttrib2dARB { already defined } + // glVertexAttrib3fARB { already defined } + // glVertexAttrib3sARB { already defined } + // glVertexAttrib3dARB { already defined } + // glVertexAttrib4fARB { already defined } + // glVertexAttrib4sARB { already defined } + // glVertexAttrib4dARB { already defined } + // glVertexAttrib4NubARB { already defined } + // glVertexAttrib1fvARB { already defined } + // glVertexAttrib1svARB { already defined } + // glVertexAttrib1dvARB { already defined } + // glVertexAttrib2fvARB { already defined } + // glVertexAttrib2svARB { already defined } + // glVertexAttrib2dvARB { already defined } + // glVertexAttrib3fvARB { already defined } + // glVertexAttrib3svARB { already defined } + // glVertexAttrib3dvARB { already defined } + // glVertexAttrib4fvARB { already defined } + // glVertexAttrib4svARB { already defined } + // glVertexAttrib4dvARB { already defined } + // glVertexAttrib4ivARB { already defined } + // glVertexAttrib4bvARB { already defined } + // glVertexAttrib4ubvARB { already defined } + // glVertexAttrib4usvARB { already defined } + // glVertexAttrib4uivARB { already defined } + // glVertexAttrib4NbvARB { already defined } + // glVertexAttrib4NsvARB { already defined } + // glVertexAttrib4NivARB { already defined } + // glVertexAttrib4NubvARB { already defined } + // glVertexAttrib4NusvARB { already defined } + // glVertexAttrib4NuivARB { already defined } + // glVertexAttribPointerARB { already defined } + // glEnableVertexAttribArrayARB { already defined } + // glDisableVertexAttribArrayARB { already defined } +var + glBindAttribLocationARB: procedure(programObj: GLhandleARB; index: GLuint; const name: PGLcharARB); extdecl; + glGetActiveAttribARB: procedure(programObj: GLhandleARB; index: GLuint; maxLength: GLsizei; length: PGLsizei; size: PGLint; _type: PGLenum; name: PGLcharARB); extdecl; + glGetAttribLocationARB: function(programObj: GLhandleARB; const name: PGLcharARB): GLint; extdecl; + // glGetVertexAttribdvARB { already defined } + // glGetVertexAttribfvARB { already defined } + // glGetVertexAttribivARB { already defined } + // glGetVertexAttribPointervARB { already defined } + +function Load_GL_ARB_vertex_shader: Boolean; + +//***** GL_ARB_fragment_shader *****// +const + GL_FRAGMENT_SHADER_ARB = $8B30; + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = $8B49; + // GL_MAX_TEXTURE_COORDS_ARB { already defined } + // GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } + // GL_OBJECT_TYPE_ARB { already defined } + // GL_OBJECT_SUBTYPE_ARB { already defined } + // GL_SHADER_OBJECT_ARB { already defined } + +function Load_GL_ARB_fragment_shader: Boolean; + +//***** GL_ARB_shading_language_100 *****// + +function Load_GL_ARB_shading_language_100: Boolean; + +//***** GL_ARB_texture_non_power_of_two *****// + +function Load_GL_ARB_texture_non_power_of_two: Boolean; + +//***** GL_ARB_point_sprite *****// +const + GL_POINT_SPRITE_ARB = $8861; + GL_COORD_REPLACE_ARB = $8862; + +function Load_GL_ARB_point_sprite: Boolean; + +//***** GL_EXT_depth_bounds_test *****// +const + GL_DEPTH_BOUNDS_TEST_EXT = $8890; + GL_DEPTH_BOUNDS_EXT = $8891; +var + glDepthBoundsEXT: procedure(zmin: GLclampd; zmax: GLclampd); extdecl; + +function Load_GL_EXT_depth_bounds_test: Boolean; + +//***** GL_EXT_texture_mirror_clamp *****// +const + GL_MIRROR_CLAMP_EXT = $8742; + GL_MIRROR_CLAMP_TO_EDGE_EXT = $8743; + GL_MIRROR_CLAMP_TO_BORDER_EXT = $8912; + +function Load_GL_EXT_texture_mirror_clamp: Boolean; + +//***** GL_EXT_blend_equation_separate *****// +const + GL_BLEND_EQUATION_RGB_EXT = $8009; + GL_BLEND_EQUATION_ALPHA_EXT = $883D; +var + glBlendEquationSeparateEXT: procedure(modeRGB: GLenum; modeAlpha: GLenum); extdecl; + +function Load_GL_EXT_blend_equation_separate: Boolean; + +//***** GL_MESA_pack_invert *****// +const + GL_PACK_INVERT_MESA = $8758; + +function Load_GL_MESA_pack_invert: Boolean; + +//***** GL_MESA_ycbcr_texture *****// +const + GL_YCBCR_MESA = $8757; + GL_UNSIGNED_SHORT_8_8_MESA = $85BA; + GL_UNSIGNED_SHORT_8_8_REV_MESA = $85BB; + +function Load_GL_MESA_ycbcr_texture: Boolean; + +//***** GL_ARB_fragment_program_shadow *****// + +function Load_GL_ARB_fragment_program_shadow: Boolean; + +//***** GL_NV_fragment_program_option *****// + +function Load_GL_NV_fragment_program_option: Boolean; + +//***** GL_EXT_pixel_buffer_object *****// +const + GL_PIXEL_PACK_BUFFER_EXT = $88EB; + GL_PIXEL_UNPACK_BUFFER_EXT = $88EC; + GL_PIXEL_PACK_BUFFER_BINDING_EXT = $88ED; + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = $88EF; + +function Load_GL_EXT_pixel_buffer_object: Boolean; + +//***** GL_NV_fragment_program2 *****// +const + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = $88F4; + GL_MAX_PROGRAM_CALL_DEPTH_NV = $88F5; + GL_MAX_PROGRAM_IF_DEPTH_NV = $88F6; + GL_MAX_PROGRAM_LOOP_DEPTH_NV = $88F7; + GL_MAX_PROGRAM_LOOP_COUNT_NV = $88F8; + +function Load_GL_NV_fragment_program2: Boolean; + +//***** GL_NV_vertex_program2_option *****// + // GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV { already defined } + // GL_MAX_PROGRAM_CALL_DEPTH_NV { already defined } + +function Load_GL_NV_vertex_program2_option: Boolean; + +//***** GL_NV_vertex_program3 *****// + // GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB { already defined } + +function Load_GL_NV_vertex_program3: Boolean; + +//***** GL_ARB_draw_buffers *****// +const + GL_MAX_DRAW_BUFFERS_ARB = $8824; + GL_DRAW_BUFFER0_ARB = $8825; + GL_DRAW_BUFFER1_ARB = $8826; + GL_DRAW_BUFFER2_ARB = $8827; + GL_DRAW_BUFFER3_ARB = $8828; + GL_DRAW_BUFFER4_ARB = $8829; + GL_DRAW_BUFFER5_ARB = $882A; + GL_DRAW_BUFFER6_ARB = $882B; + GL_DRAW_BUFFER7_ARB = $882C; + GL_DRAW_BUFFER8_ARB = $882D; + GL_DRAW_BUFFER9_ARB = $882E; + GL_DRAW_BUFFER10_ARB = $882F; + GL_DRAW_BUFFER11_ARB = $8830; + GL_DRAW_BUFFER12_ARB = $8831; + GL_DRAW_BUFFER13_ARB = $8832; + GL_DRAW_BUFFER14_ARB = $8833; + GL_DRAW_BUFFER15_ARB = $8834; +var + glDrawBuffersARB: procedure(n: GLsizei; const bufs: PGLenum); extdecl; + +function Load_GL_ARB_draw_buffers: Boolean; + +//***** GL_ARB_texture_rectangle *****// +const + GL_TEXTURE_RECTANGLE_ARB = $84F5; + GL_TEXTURE_BINDING_RECTANGLE_ARB = $84F6; + GL_PROXY_TEXTURE_RECTANGLE_ARB = $84F7; + GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = $84F8; + +function Load_GL_ARB_texture_rectangle: Boolean; + +//***** GL_ARB_color_buffer_float *****// +const + GL_RGBA_FLOAT_MODE_ARB = $8820; + GL_CLAMP_VERTEX_COLOR_ARB = $891A; + GL_CLAMP_FRAGMENT_COLOR_ARB = $891B; + GL_CLAMP_READ_COLOR_ARB = $891C; + GL_FIXED_ONLY_ARB = $891D; + WGL_TYPE_RGBA_FLOAT_ARB = $21A0; +var + glClampColorARB: procedure(target: GLenum; clamp: GLenum); extdecl; + +function Load_GL_ARB_color_buffer_float: Boolean; + +//***** GL_ARB_half_float_pixel *****// +const + GL_HALF_FLOAT_ARB = $140B; + +function Load_GL_ARB_half_float_pixel: Boolean; + +//***** GL_ARB_texture_float *****// +const + GL_TEXTURE_RED_TYPE_ARB = $8C10; + GL_TEXTURE_GREEN_TYPE_ARB = $8C11; + GL_TEXTURE_BLUE_TYPE_ARB = $8C12; + GL_TEXTURE_ALPHA_TYPE_ARB = $8C13; + GL_TEXTURE_LUMINANCE_TYPE_ARB = $8C14; + GL_TEXTURE_INTENSITY_TYPE_ARB = $8C15; + GL_TEXTURE_DEPTH_TYPE_ARB = $8C16; + GL_UNSIGNED_NORMALIZED_ARB = $8C17; + GL_RGBA32F_ARB = $8814; + GL_RGB32F_ARB = $8815; + GL_ALPHA32F_ARB = $8816; + GL_INTENSITY32F_ARB = $8817; + GL_LUMINANCE32F_ARB = $8818; + GL_LUMINANCE_ALPHA32F_ARB = $8819; + GL_RGBA16F_ARB = $881A; + GL_RGB16F_ARB = $881B; + GL_ALPHA16F_ARB = $881C; + GL_INTENSITY16F_ARB = $881D; + GL_LUMINANCE16F_ARB = $881E; + GL_LUMINANCE_ALPHA16F_ARB = $881F; + +function Load_GL_ARB_texture_float: Boolean; + +//***** GL_EXT_texture_compression_dxt1 *****// + // GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } + // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } + +function Load_GL_EXT_texture_compression_dxt1: Boolean; + +//***** GL_ARB_pixel_buffer_object *****// +const + GL_PIXEL_PACK_BUFFER_ARB = $88EB; + GL_PIXEL_UNPACK_BUFFER_ARB = $88EC; + GL_PIXEL_PACK_BUFFER_BINDING_ARB = $88ED; + GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = $88EF; + +function Load_GL_ARB_pixel_buffer_object: Boolean; + +//***** GL_EXT_framebuffer_object *****// +const + GL_FRAMEBUFFER_EXT = $8D40; + GL_RENDERBUFFER_EXT = $8D41; + GL_STENCIL_INDEX_EXT = $8D45; + GL_STENCIL_INDEX1_EXT = $8D46; + GL_STENCIL_INDEX4_EXT = $8D47; + GL_STENCIL_INDEX8_EXT = $8D48; + GL_STENCIL_INDEX16_EXT = $8D49; + GL_RENDERBUFFER_WIDTH_EXT = $8D42; + GL_RENDERBUFFER_HEIGHT_EXT = $8D43; + GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = $8D44; + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = $8CD0; + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = $8CD1; + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = $8CD2; + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = $8CD3; + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = $8CD4; + GL_COLOR_ATTACHMENT0_EXT = $8CE0; + GL_COLOR_ATTACHMENT1_EXT = $8CE1; + GL_COLOR_ATTACHMENT2_EXT = $8CE2; + GL_COLOR_ATTACHMENT3_EXT = $8CE3; + GL_COLOR_ATTACHMENT4_EXT = $8CE4; + GL_COLOR_ATTACHMENT5_EXT = $8CE5; + GL_COLOR_ATTACHMENT6_EXT = $8CE6; + GL_COLOR_ATTACHMENT7_EXT = $8CE7; + GL_COLOR_ATTACHMENT8_EXT = $8CE8; + GL_COLOR_ATTACHMENT9_EXT = $8CE9; + GL_COLOR_ATTACHMENT10_EXT = $8CEA; + GL_COLOR_ATTACHMENT11_EXT = $8CEB; + GL_COLOR_ATTACHMENT12_EXT = $8CEC; + GL_COLOR_ATTACHMENT13_EXT = $8CED; + GL_COLOR_ATTACHMENT14_EXT = $8CEE; + GL_COLOR_ATTACHMENT15_EXT = $8CEF; + GL_DEPTH_ATTACHMENT_EXT = $8D00; + GL_STENCIL_ATTACHMENT_EXT = $8D20; + GL_FRAMEBUFFER_COMPLETE_EXT = $8CD5; + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = $8CD6; + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = $8CD7; + GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT = $8CD8; + GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = $8CD9; + GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = $8CDA; + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = $8CDB; + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = $8CDC; + GL_FRAMEBUFFER_UNSUPPORTED_EXT = $8CDD; + GL_FRAMEBUFFER_STATUS_ERROR_EXT = $8CDE; + GL_FRAMEBUFFER_BINDING_EXT = $8CA6; + GL_RENDERBUFFER_BINDING_EXT = $8CA7; + GL_MAX_COLOR_ATTACHMENTS_EXT = $8CDF; + GL_MAX_RENDERBUFFER_SIZE_EXT = $84E8; + GL_INVALID_FRAMEBUFFER_OPERATION_EXT = $0506; +var + glIsRenderbufferEXT: function(renderbuffer: GLuint): GLboolean; extdecl; + glBindRenderbufferEXT: procedure(target: GLenum; renderbuffer: GLuint); extdecl; + glDeleteRenderbuffersEXT: procedure(n: GLsizei; const renderbuffers: PGLuint); extdecl; + glGenRenderbuffersEXT: procedure(n: GLsizei; renderbuffers: PGLuint); extdecl; + glRenderbufferStorageEXT: procedure(target: GLenum; internalformat: GLenum; width: GLsizei; height: GLsizei); extdecl; + glGetRenderbufferParameterivEXT: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glIsFramebufferEXT: function(framebuffer: GLuint): GLboolean; extdecl; + glBindFramebufferEXT: procedure(target: GLenum; framebuffer: GLuint); extdecl; + glDeleteFramebuffersEXT: procedure(n: GLsizei; const framebuffers: PGLuint); extdecl; + glGenFramebuffersEXT: procedure(n: GLsizei; framebuffers: PGLuint); extdecl; + glCheckFramebufferStatusEXT: function(target: GLenum): GLenum; extdecl; + glFramebufferTexture1DEXT: procedure(target: GLenum; attachment: GLenum; textarget: GLenum; texture: GLuint; level: GLint); extdecl; + glFramebufferTexture2DEXT: procedure(target: GLenum; attachment: GLenum; textarget: GLenum; texture: GLuint; level: GLint); extdecl; + glFramebufferTexture3DEXT: procedure(target: GLenum; attachment: GLenum; textarget: GLenum; texture: GLuint; level: GLint; zoffset: GLint); extdecl; + glFramebufferRenderbufferEXT: procedure(target: GLenum; attachment: GLenum; renderbuffertarget: GLenum; renderbuffer: GLuint); extdecl; + glGetFramebufferAttachmentParameterivEXT: procedure(target: GLenum; attachment: GLenum; pname: GLenum; params: PGLint); extdecl; + glGenerateMipmapEXT: procedure(target: GLenum); extdecl; + +function Load_GL_EXT_framebuffer_object: Boolean; + +//***** GL_version_1_4 *****// +const + GL_BLEND_DST_RGB = $80C8; + GL_BLEND_SRC_RGB = $80C9; + GL_BLEND_DST_ALPHA = $80CA; + GL_BLEND_SRC_ALPHA = $80CB; + GL_POINT_SIZE_MIN = $8126; + GL_POINT_SIZE_MAX = $8127; + GL_POINT_FADE_THRESHOLD_SIZE = $8128; + GL_POINT_DISTANCE_ATTENUATION = $8129; + GL_GENERATE_MIPMAP = $8191; + GL_GENERATE_MIPMAP_HINT = $8192; + GL_DEPTH_COMPONENT16 = $81A5; + GL_DEPTH_COMPONENT24 = $81A6; + GL_DEPTH_COMPONENT32 = $81A7; + GL_MIRRORED_REPEAT = $8370; + GL_FOG_COORDINATE_SOURCE = $8450; + GL_FOG_COORDINATE = $8451; + GL_FRAGMENT_DEPTH = $8452; + GL_CURRENT_FOG_COORDINATE = $8453; + GL_FOG_COORDINATE_ARRAY_TYPE = $8454; + GL_FOG_COORDINATE_ARRAY_STRIDE = $8455; + GL_FOG_COORDINATE_ARRAY_POINTER = $8456; + GL_FOG_COORDINATE_ARRAY = $8457; + GL_COLOR_SUM = $8458; + GL_CURRENT_SECONDARY_COLOR = $8459; + GL_SECONDARY_COLOR_ARRAY_SIZE = $845A; + GL_SECONDARY_COLOR_ARRAY_TYPE = $845B; + GL_SECONDARY_COLOR_ARRAY_STRIDE = $845C; + GL_SECONDARY_COLOR_ARRAY_POINTER = $845D; + GL_SECONDARY_COLOR_ARRAY = $845E; + GL_MAX_TEXTURE_LOD_BIAS = $84FD; + GL_TEXTURE_FILTER_CONTROL = $8500; + GL_TEXTURE_LOD_BIAS = $8501; + GL_INCR_WRAP = $8507; + GL_DECR_WRAP = $8508; + GL_TEXTURE_DEPTH_SIZE = $884A; + GL_DEPTH_TEXTURE_MODE = $884B; + GL_TEXTURE_COMPARE_MODE = $884C; + GL_TEXTURE_COMPARE_FUNC = $884D; + GL_COMPARE_R_TO_TEXTURE = $884E; +var + glBlendFuncSeparate: procedure(sfactorRGB: GLenum; dfactorRGB: GLenum; sfactorAlpha: GLenum; dfactorAlpha: GLenum); extdecl; + glFogCoordf: procedure(coord: GLfloat); extdecl; + glFogCoordfv: procedure(const coord: PGLfloat); extdecl; + glFogCoordd: procedure(coord: GLdouble); extdecl; + glFogCoorddv: procedure(const coord: PGLdouble); extdecl; + glFogCoordPointer: procedure(_type: GLenum; stride: GLsizei; const pointer: PGLvoid); extdecl; + glMultiDrawArrays: procedure(mode: GLenum; first: PGLint; count: PGLsizei; primcount: GLsizei); extdecl; + glMultiDrawElements: procedure(mode: GLenum; const count: PGLsizei; _type: GLenum; const indices: PGLvoid; primcount: GLsizei); extdecl; + glPointParameterf: procedure(pname: GLenum; param: GLfloat); extdecl; + glPointParameterfv: procedure(pname: GLenum; const params: PGLfloat); extdecl; + glPointParameteri: procedure(pname: GLenum; param: GLint); extdecl; + glPointParameteriv: procedure(pname: GLenum; const params: PGLint); extdecl; + glSecondaryColor3b: procedure(red: GLbyte; green: GLbyte; blue: GLbyte); extdecl; + glSecondaryColor3bv: procedure(const v: PGLbyte); extdecl; + glSecondaryColor3d: procedure(red: GLdouble; green: GLdouble; blue: GLdouble); extdecl; + glSecondaryColor3dv: procedure(const v: PGLdouble); extdecl; + glSecondaryColor3f: procedure(red: GLfloat; green: GLfloat; blue: GLfloat); extdecl; + glSecondaryColor3fv: procedure(const v: PGLfloat); extdecl; + glSecondaryColor3i: procedure(red: GLint; green: GLint; blue: GLint); extdecl; + glSecondaryColor3iv: procedure(const v: PGLint); extdecl; + glSecondaryColor3s: procedure(red: GLshort; green: GLshort; blue: GLshort); extdecl; + glSecondaryColor3sv: procedure(const v: PGLshort); extdecl; + glSecondaryColor3ub: procedure(red: GLubyte; green: GLubyte; blue: GLubyte); extdecl; + glSecondaryColor3ubv: procedure(const v: PGLubyte); extdecl; + glSecondaryColor3ui: procedure(red: GLuint; green: GLuint; blue: GLuint); extdecl; + glSecondaryColor3uiv: procedure(const v: PGLuint); extdecl; + glSecondaryColor3us: procedure(red: GLushort; green: GLushort; blue: GLushort); extdecl; + glSecondaryColor3usv: procedure(const v: PGLushort); extdecl; + glSecondaryColorPointer: procedure(size: GLint; _type: GLenum; stride: GLsizei; const pointer: PGLvoid); extdecl; + glWindowPos2d: procedure(x: GLdouble; y: GLdouble); extdecl; + glWindowPos2dv: procedure(const v: PGLdouble); extdecl; + glWindowPos2f: procedure(x: GLfloat; y: GLfloat); extdecl; + glWindowPos2fv: procedure(const v: PGLfloat); extdecl; + glWindowPos2i: procedure(x: GLint; y: GLint); extdecl; + glWindowPos2iv: procedure(const v: PGLint); extdecl; + glWindowPos2s: procedure(x: GLshort; y: GLshort); extdecl; + glWindowPos2sv: procedure(const v: PGLshort); extdecl; + glWindowPos3d: procedure(x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glWindowPos3dv: procedure(const v: PGLdouble); extdecl; + glWindowPos3f: procedure(x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glWindowPos3fv: procedure(const v: PGLfloat); extdecl; + glWindowPos3i: procedure(x: GLint; y: GLint; z: GLint); extdecl; + glWindowPos3iv: procedure(const v: PGLint); extdecl; + glWindowPos3s: procedure(x: GLshort; y: GLshort; z: GLshort); extdecl; + glWindowPos3sv: procedure(const v: PGLshort); extdecl; + +function Load_GL_version_1_4: Boolean; + +//***** GL_version_1_5 *****// +const + GL_BUFFER_SIZE = $8764; + GL_BUFFER_USAGE = $8765; + GL_QUERY_COUNTER_BITS = $8864; + GL_CURRENT_QUERY = $8865; + GL_QUERY_RESULT = $8866; + GL_QUERY_RESULT_AVAILABLE = $8867; + GL_ARRAY_BUFFER = $8892; + GL_ELEMENT_ARRAY_BUFFER = $8893; + GL_ARRAY_BUFFER_BINDING = $8894; + GL_ELEMENT_ARRAY_BUFFER_BINDING = $8895; + GL_VERTEX_ARRAY_BUFFER_BINDING = $8896; + GL_NORMAL_ARRAY_BUFFER_BINDING = $8897; + GL_COLOR_ARRAY_BUFFER_BINDING = $8898; + GL_INDEX_ARRAY_BUFFER_BINDING = $8899; + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = $889A; + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = $889B; + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = $889C; + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = $889D; + GL_WEIGHT_ARRAY_BUFFER_BINDING = $889E; + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = $889F; + GL_READ_ONLY = $88B8; + GL_WRITE_ONLY = $88B9; + GL_READ_WRITE = $88BA; + GL_BUFFER_ACCESS = $88BB; + GL_BUFFER_MAPPED = $88BC; + GL_BUFFER_MAP_POINTER = $88BD; + GL_STREAM_DRAW = $88E0; + GL_STREAM_READ = $88E1; + GL_STREAM_COPY = $88E2; + GL_STATIC_DRAW = $88E4; + GL_STATIC_READ = $88E5; + GL_STATIC_COPY = $88E6; + GL_DYNAMIC_DRAW = $88E8; + GL_DYNAMIC_READ = $88E9; + GL_DYNAMIC_COPY = $88EA; + GL_SAMPLES_PASSED = $8914; + GL_FOG_COORD_SRC = $8450; + GL_FOG_COORD = $8451; + GL_CURRENT_FOG_COORD = $8453; + GL_FOG_COORD_ARRAY_TYPE = $8454; + GL_FOG_COORD_ARRAY_STRIDE = $8455; + GL_FOG_COORD_ARRAY_POINTER = $8456; + GL_FOG_COORD_ARRAY = $8457; + GL_FOG_COORD_ARRAY_BUFFER_BINDING = $889D; + GL_SRC0_RGB = $8580; + GL_SRC1_RGB = $8581; + GL_SRC2_RGB = $8582; + GL_SRC0_ALPHA = $8588; + GL_SRC1_ALPHA = $8589; + GL_SRC2_ALPHA = $858A; +var + glGenQueries: procedure(n: GLsizei; ids: PGLuint); extdecl; + glDeleteQueries: procedure(n: GLsizei; const ids: PGLuint); extdecl; + glIsQuery: function(id: GLuint): GLboolean; extdecl; + glBeginQuery: procedure(target: GLenum; id: GLuint); extdecl; + glEndQuery: procedure(target: GLenum); extdecl; + glGetQueryiv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetQueryObjectiv: procedure(id: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetQueryObjectuiv: procedure(id: GLuint; pname: GLenum; params: PGLuint); extdecl; + glBindBuffer: procedure(target: GLenum; buffer: GLuint); extdecl; + glDeleteBuffers: procedure(n: GLsizei; const buffers: PGLuint); extdecl; + glGenBuffers: procedure(n: GLsizei; buffers: PGLuint); extdecl; + glIsBuffer: function(buffer: GLuint): GLboolean; extdecl; + glBufferData: procedure(target: GLenum; size: GLsizeiptr; const data: PGLvoid; usage: GLenum); extdecl; + glBufferSubData: procedure(target: GLenum; offset: GLintptr; size: GLsizeiptr; const data: PGLvoid); extdecl; + glGetBufferSubData: procedure(target: GLenum; offset: GLintptr; size: GLsizeiptr; data: PGLvoid); extdecl; + glMapBuffer: function(target: GLenum; access: GLenum): PGLvoid; extdecl; + glUnmapBuffer: function(target: GLenum): GLboolean; extdecl; + glGetBufferParameteriv: procedure(target: GLenum; pname: GLenum; params: PGLint); extdecl; + glGetBufferPointerv: procedure(target: GLenum; pname: GLenum; params: PGLvoid); extdecl; + +function Load_GL_version_1_5: Boolean; + +//***** GL_version_2_0 *****// +const + GL_BLEND_EQUATION_RGB = $8009; + GL_VERTEX_ATTRIB_ARRAY_ENABLED = $8622; + GL_VERTEX_ATTRIB_ARRAY_SIZE = $8623; + GL_VERTEX_ATTRIB_ARRAY_STRIDE = $8624; + GL_VERTEX_ATTRIB_ARRAY_TYPE = $8625; + GL_CURRENT_VERTEX_ATTRIB = $8626; + GL_VERTEX_PROGRAM_POINT_SIZE = $8642; + GL_VERTEX_PROGRAM_TWO_SIDE = $8643; + GL_VERTEX_ATTRIB_ARRAY_POINTER = $8645; + GL_STENCIL_BACK_FUNC = $8800; + GL_STENCIL_BACK_FAIL = $8801; + GL_STENCIL_BACK_PASS_DEPTH_FAIL = $8802; + GL_STENCIL_BACK_PASS_DEPTH_PASS = $8803; + GL_MAX_DRAW_BUFFERS = $8824; + GL_DRAW_BUFFER0 = $8825; + GL_DRAW_BUFFER1 = $8826; + GL_DRAW_BUFFER2 = $8827; + GL_DRAW_BUFFER3 = $8828; + GL_DRAW_BUFFER4 = $8829; + GL_DRAW_BUFFER5 = $882A; + GL_DRAW_BUFFER6 = $882B; + GL_DRAW_BUFFER7 = $882C; + GL_DRAW_BUFFER8 = $882D; + GL_DRAW_BUFFER9 = $882E; + GL_DRAW_BUFFER10 = $882F; + GL_DRAW_BUFFER11 = $8830; + GL_DRAW_BUFFER12 = $8831; + GL_DRAW_BUFFER13 = $8832; + GL_DRAW_BUFFER14 = $8833; + GL_DRAW_BUFFER15 = $8834; + GL_BLEND_EQUATION_ALPHA = $883D; + GL_POINT_SPRITE = $8861; + GL_COORD_REPLACE = $8862; + GL_MAX_VERTEX_ATTRIBS = $8869; + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = $886A; + GL_MAX_TEXTURE_COORDS = $8871; + GL_MAX_TEXTURE_IMAGE_UNITS = $8872; + GL_FRAGMENT_SHADER = $8B30; + GL_VERTEX_SHADER = $8B31; + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = $8B49; + GL_MAX_VERTEX_UNIFORM_COMPONENTS = $8B4A; + GL_MAX_VARYING_FLOATS = $8B4B; + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = $8B4C; + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = $8B4D; + GL_SHADER_TYPE = $8B4F; + GL_FLOAT_VEC2 = $8B50; + GL_FLOAT_VEC3 = $8B51; + GL_FLOAT_VEC4 = $8B52; + GL_INT_VEC2 = $8B53; + GL_INT_VEC3 = $8B54; + GL_INT_VEC4 = $8B55; + GL_BOOL = $8B56; + GL_BOOL_VEC2 = $8B57; + GL_BOOL_VEC3 = $8B58; + GL_BOOL_VEC4 = $8B59; + GL_FLOAT_MAT2 = $8B5A; + GL_FLOAT_MAT3 = $8B5B; + GL_FLOAT_MAT4 = $8B5C; + GL_SAMPLER_1D = $8B5D; + GL_SAMPLER_2D = $8B5E; + GL_SAMPLER_3D = $8B5F; + GL_SAMPLER_CUBE = $8B60; + GL_SAMPLER_1D_SHADOW = $8B61; + GL_SAMPLER_2D_SHADOW = $8B62; + GL_DELETE_STATUS = $8B80; + GL_COMPILE_STATUS = $8B81; + GL_LINK_STATUS = $8B82; + GL_VALIDATE_STATUS = $8B83; + GL_INFO_LOG_LENGTH = $8B84; + GL_ATTACHED_SHADERS = $8B85; + GL_ACTIVE_UNIFORMS = $8B86; + GL_ACTIVE_UNIFORM_MAX_LENGTH = $8B87; + GL_SHADER_SOURCE_LENGTH = $8B88; + GL_ACTIVE_ATTRIBUTES = $8B89; + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = $8B8A; + GL_FRAGMENT_SHADER_DERIVATIVE_HINT = $8B8B; + GL_SHADING_LANGUAGE_VERSION = $8B8C; + GL_CURRENT_PROGRAM = $8B8D; + GL_POINT_SPRITE_COORD_ORIGIN = $8CA0; + GL_LOWER_LEFT = $8CA1; + GL_UPPER_LEFT = $8CA2; + GL_STENCIL_BACK_REF = $8CA3; + GL_STENCIL_BACK_VALUE_MASK = $8CA4; + GL_STENCIL_BACK_WRITEMASK = $8CA5; +var + glBlendEquationSeparate: procedure(modeRGB: GLenum; modeAlpha: GLenum); extdecl; + glDrawBuffers: procedure(n: GLsizei; const bufs: PGLenum); extdecl; + glStencilOpSeparate: procedure(face: GLenum; sfail: GLenum; dpfail: GLenum; dppass: GLenum); extdecl; + glStencilFuncSeparate: procedure(frontfunc: GLenum; backfunc: GLenum; ref: GLint; mask: GLuint); extdecl; + glStencilMaskSeparate: procedure(face: GLenum; mask: GLuint); extdecl; + glAttachShader: procedure(_program: GLuint; shader: GLuint); extdecl; + glBindAttribLocation: procedure(_program: GLuint; index: GLuint; const name: PGLchar); extdecl; + glCompileShader: procedure(shader: GLuint); extdecl; + glCreateProgram: function(): GLuint; extdecl; + glCreateShader: function(_type: GLenum): GLuint; extdecl; + glDeleteProgram: procedure(_program: GLuint); extdecl; + glDeleteShader: procedure(shader: GLuint); extdecl; + glDetachShader: procedure(_program: GLuint; shader: GLuint); extdecl; + glDisableVertexAttribArray: procedure(index: GLuint); extdecl; + glEnableVertexAttribArray: procedure(index: GLuint); extdecl; + glGetActiveAttrib: procedure(_program: GLuint; index: GLuint; bufSize: GLsizei; length: PGLsizei; size: PGLint; _type: PGLenum; name: PGLchar); extdecl; + glGetActiveUniform: procedure(_program: GLuint; index: GLuint; bufSize: GLsizei; length: PGLsizei; size: PGLint; _type: PGLenum; name: PGLchar); extdecl; + glGetAttachedShaders: procedure(_program: GLuint; maxCount: GLsizei; count: PGLsizei; obj: PGLuint); extdecl; + glGetAttribLocation: function(_program: GLuint; const name: PGLchar): GLint; extdecl; + glGetProgramiv: procedure(_program: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetProgramInfoLog: procedure(_program: GLuint; bufSize: GLsizei; length: PGLsizei; infoLog: PGLchar); extdecl; + glGetShaderiv: procedure(shader: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetShaderInfoLog: procedure(shader: GLuint; bufSize: GLsizei; length: PGLsizei; infoLog: PGLchar); extdecl; + glGetShaderSource: procedure(shader: GLuint; bufSize: GLsizei; length: PGLsizei; source: PGLchar); extdecl; + glGetUniformLocation: function(_program: GLuint; const name: PGLchar): GLint; extdecl; + glGetUniformfv: procedure(_program: GLuint; location: GLint; params: PGLfloat); extdecl; + glGetUniformiv: procedure(_program: GLuint; location: GLint; params: PGLint); extdecl; + glGetVertexAttribdv: procedure(index: GLuint; pname: GLenum; params: PGLdouble); extdecl; + glGetVertexAttribfv: procedure(index: GLuint; pname: GLenum; params: PGLfloat); extdecl; + glGetVertexAttribiv: procedure(index: GLuint; pname: GLenum; params: PGLint); extdecl; + glGetVertexAttribPointerv: procedure(index: GLuint; pname: GLenum; pointer: PGLvoid); extdecl; + glIsProgram: function(_program: GLuint): GLboolean; extdecl; + glIsShader: function(shader: GLuint): GLboolean; extdecl; + glLinkProgram: procedure(_program: GLuint); extdecl; + glShaderSource: procedure(shader: GLuint; count: GLsizei; const _string: PGLchar; const length: PGLint); extdecl; + glUseProgram: procedure(_program: GLuint); extdecl; + glUniform1f: procedure(location: GLint; v0: GLfloat); extdecl; + glUniform2f: procedure(location: GLint; v0: GLfloat; v1: GLfloat); extdecl; + glUniform3f: procedure(location: GLint; v0: GLfloat; v1: GLfloat; v2: GLfloat); extdecl; + glUniform4f: procedure(location: GLint; v0: GLfloat; v1: GLfloat; v2: GLfloat; v3: GLfloat); extdecl; + glUniform1i: procedure(location: GLint; v0: GLint); extdecl; + glUniform2i: procedure(location: GLint; v0: GLint; v1: GLint); extdecl; + glUniform3i: procedure(location: GLint; v0: GLint; v1: GLint; v2: GLint); extdecl; + glUniform4i: procedure(location: GLint; v0: GLint; v1: GLint; v2: GLint; v3: GLint); extdecl; + glUniform1fv: procedure(location: GLint; count: GLsizei; const value: PGLfloat); extdecl; + glUniform2fv: procedure(location: GLint; count: GLsizei; const value: PGLfloat); extdecl; + glUniform3fv: procedure(location: GLint; count: GLsizei; const value: PGLfloat); extdecl; + glUniform4fv: procedure(location: GLint; count: GLsizei; const value: PGLfloat); extdecl; + glUniform1iv: procedure(location: GLint; count: GLsizei; const value: PGLint); extdecl; + glUniform2iv: procedure(location: GLint; count: GLsizei; const value: PGLint); extdecl; + glUniform3iv: procedure(location: GLint; count: GLsizei; const value: PGLint); extdecl; + glUniform4iv: procedure(location: GLint; count: GLsizei; const value: PGLint); extdecl; + glUniformMatrix2fv: procedure(location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl; + glUniformMatrix3fv: procedure(location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl; + glUniformMatrix4fv: procedure(location: GLint; count: GLsizei; transpose: GLboolean; const value: PGLfloat); extdecl; + glValidateProgram: procedure(_program: GLuint); extdecl; + glVertexAttrib1d: procedure(index: GLuint; x: GLdouble); extdecl; + glVertexAttrib1dv: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib1f: procedure(index: GLuint; x: GLfloat); extdecl; + glVertexAttrib1fv: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib1s: procedure(index: GLuint; x: GLshort); extdecl; + glVertexAttrib1sv: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib2d: procedure(index: GLuint; x: GLdouble; y: GLdouble); extdecl; + glVertexAttrib2dv: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib2f: procedure(index: GLuint; x: GLfloat; y: GLfloat); extdecl; + glVertexAttrib2fv: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib2s: procedure(index: GLuint; x: GLshort; y: GLshort); extdecl; + glVertexAttrib2sv: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib3d: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble); extdecl; + glVertexAttrib3dv: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib3f: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat); extdecl; + glVertexAttrib3fv: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib3s: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort); extdecl; + glVertexAttrib3sv: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4Nbv: procedure(index: GLuint; const v: PGLbyte); extdecl; + glVertexAttrib4Niv: procedure(index: GLuint; const v: PGLint); extdecl; + glVertexAttrib4Nsv: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4Nub: procedure(index: GLuint; x: GLubyte; y: GLubyte; z: GLubyte; w: GLubyte); extdecl; + glVertexAttrib4Nubv: procedure(index: GLuint; const v: PGLubyte); extdecl; + glVertexAttrib4Nuiv: procedure(index: GLuint; const v: PGLuint); extdecl; + glVertexAttrib4Nusv: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttrib4bv: procedure(index: GLuint; const v: PGLbyte); extdecl; + glVertexAttrib4d: procedure(index: GLuint; x: GLdouble; y: GLdouble; z: GLdouble; w: GLdouble); extdecl; + glVertexAttrib4dv: procedure(index: GLuint; const v: PGLdouble); extdecl; + glVertexAttrib4f: procedure(index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); extdecl; + glVertexAttrib4fv: procedure(index: GLuint; const v: PGLfloat); extdecl; + glVertexAttrib4iv: procedure(index: GLuint; const v: PGLint); extdecl; + glVertexAttrib4s: procedure(index: GLuint; x: GLshort; y: GLshort; z: GLshort; w: GLshort); extdecl; + glVertexAttrib4sv: procedure(index: GLuint; const v: PGLshort); extdecl; + glVertexAttrib4ubv: procedure(index: GLuint; const v: PGLubyte); extdecl; + glVertexAttrib4uiv: procedure(index: GLuint; const v: PGLuint); extdecl; + glVertexAttrib4usv: procedure(index: GLuint; const v: PGLushort); extdecl; + glVertexAttribPointer: procedure(index: GLuint; size: GLint; _type: GLenum; normalized: GLboolean; stride: GLsizei; const pointer: PGLvoid); extdecl; + +function Load_GL_version_2_0: Boolean; + + +implementation + +{$IFNDEF Windows} +function wglGetProcAddress(proc: PChar): Pointer; +begin + Result := GetProcAddress(LibGL, proc); +end; +{$ENDIF} + +function glext_ExtensionSupported(const extension: String; const searchIn: String): Boolean; +var + extensions: PChar; + start: PChar; + where, terminator: PChar; +begin + + if (Pos(' ', extension) <> 0) or (extension = '') then + begin + Result := FALSE; + Exit; + end; + + if searchIn = '' then extensions := PChar(glGetString(GL_EXTENSIONS)) + else extensions := PChar(searchIn); + start := extensions; + while TRUE do + begin + where := StrPos(start, PChar(extension)); + if where = nil then Break; + terminator := Pointer(PtrUInt(where) + Length(extension)); + if (where = start) or (PChar(PtrUInt(where) - 1)^ = ' ') then + begin + if (terminator^ = ' ') or (terminator^ = #0) then + begin + Result := TRUE; + Exit; + end; + end; + start := terminator; + end; + Result := FALSE; + +end; + +function Load_GL_version_1_2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + glBlendColor := wglGetProcAddress('glBlendColor'); + if not Assigned(glBlendColor) then Exit; + glBlendEquation := wglGetProcAddress('glBlendEquation'); + if not Assigned(glBlendEquation) then Exit; + glDrawRangeElements := wglGetProcAddress('glDrawRangeElements'); + if not Assigned(glDrawRangeElements) then Exit; + glColorTable := wglGetProcAddress('glColorTable'); + if not Assigned(glColorTable) then Exit; + glColorTableParameterfv := wglGetProcAddress('glColorTableParameterfv'); + if not Assigned(glColorTableParameterfv) then Exit; + glColorTableParameteriv := wglGetProcAddress('glColorTableParameteriv'); + if not Assigned(glColorTableParameteriv) then Exit; + glCopyColorTable := wglGetProcAddress('glCopyColorTable'); + if not Assigned(glCopyColorTable) then Exit; + glGetColorTable := wglGetProcAddress('glGetColorTable'); + if not Assigned(glGetColorTable) then Exit; + glGetColorTableParameterfv := wglGetProcAddress('glGetColorTableParameterfv'); + if not Assigned(glGetColorTableParameterfv) then Exit; + glGetColorTableParameteriv := wglGetProcAddress('glGetColorTableParameteriv'); + if not Assigned(glGetColorTableParameteriv) then Exit; + glColorSubTable := wglGetProcAddress('glColorSubTable'); + if not Assigned(glColorSubTable) then Exit; + glCopyColorSubTable := wglGetProcAddress('glCopyColorSubTable'); + if not Assigned(glCopyColorSubTable) then Exit; + glConvolutionFilter1D := wglGetProcAddress('glConvolutionFilter1D'); + if not Assigned(glConvolutionFilter1D) then Exit; + glConvolutionFilter2D := wglGetProcAddress('glConvolutionFilter2D'); + if not Assigned(glConvolutionFilter2D) then Exit; + glConvolutionParameterf := wglGetProcAddress('glConvolutionParameterf'); + if not Assigned(glConvolutionParameterf) then Exit; + glConvolutionParameterfv := wglGetProcAddress('glConvolutionParameterfv'); + if not Assigned(glConvolutionParameterfv) then Exit; + glConvolutionParameteri := wglGetProcAddress('glConvolutionParameteri'); + if not Assigned(glConvolutionParameteri) then Exit; + glConvolutionParameteriv := wglGetProcAddress('glConvolutionParameteriv'); + if not Assigned(glConvolutionParameteriv) then Exit; + glCopyConvolutionFilter1D := wglGetProcAddress('glCopyConvolutionFilter1D'); + if not Assigned(glCopyConvolutionFilter1D) then Exit; + glCopyConvolutionFilter2D := wglGetProcAddress('glCopyConvolutionFilter2D'); + if not Assigned(glCopyConvolutionFilter2D) then Exit; + glGetConvolutionFilter := wglGetProcAddress('glGetConvolutionFilter'); + if not Assigned(glGetConvolutionFilter) then Exit; + glGetConvolutionParameterfv := wglGetProcAddress('glGetConvolutionParameterfv'); + if not Assigned(glGetConvolutionParameterfv) then Exit; + glGetConvolutionParameteriv := wglGetProcAddress('glGetConvolutionParameteriv'); + if not Assigned(glGetConvolutionParameteriv) then Exit; + glGetSeparableFilter := wglGetProcAddress('glGetSeparableFilter'); + if not Assigned(glGetSeparableFilter) then Exit; + glSeparableFilter2D := wglGetProcAddress('glSeparableFilter2D'); + if not Assigned(glSeparableFilter2D) then Exit; + glGetHistogram := wglGetProcAddress('glGetHistogram'); + if not Assigned(glGetHistogram) then Exit; + glGetHistogramParameterfv := wglGetProcAddress('glGetHistogramParameterfv'); + if not Assigned(glGetHistogramParameterfv) then Exit; + glGetHistogramParameteriv := wglGetProcAddress('glGetHistogramParameteriv'); + if not Assigned(glGetHistogramParameteriv) then Exit; + glGetMinmax := wglGetProcAddress('glGetMinmax'); + if not Assigned(glGetMinmax) then Exit; + glGetMinmaxParameterfv := wglGetProcAddress('glGetMinmaxParameterfv'); + if not Assigned(glGetMinmaxParameterfv) then Exit; + glGetMinmaxParameteriv := wglGetProcAddress('glGetMinmaxParameteriv'); + if not Assigned(glGetMinmaxParameteriv) then Exit; + glHistogram := wglGetProcAddress('glHistogram'); + if not Assigned(glHistogram) then Exit; + glMinmax := wglGetProcAddress('glMinmax'); + if not Assigned(glMinmax) then Exit; + glResetHistogram := wglGetProcAddress('glResetHistogram'); + if not Assigned(glResetHistogram) then Exit; + glResetMinmax := wglGetProcAddress('glResetMinmax'); + if not Assigned(glResetMinmax) then Exit; + glTexImage3D := wglGetProcAddress('glTexImage3D'); + if not Assigned(glTexImage3D) then Exit; + glTexSubImage3D := wglGetProcAddress('glTexSubImage3D'); + if not Assigned(glTexSubImage3D) then Exit; + glCopyTexSubImage3D := wglGetProcAddress('glCopyTexSubImage3D'); + if not Assigned(glCopyTexSubImage3D) then Exit; + Result := TRUE; + +end; + +function Load_GL_ARB_imaging: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_imaging', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_version_1_3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + glActiveTexture := wglGetProcAddress('glActiveTexture'); + if not Assigned(glActiveTexture) then Exit; + glClientActiveTexture := wglGetProcAddress('glClientActiveTexture'); + if not Assigned(glClientActiveTexture) then Exit; + glMultiTexCoord1d := wglGetProcAddress('glMultiTexCoord1d'); + if not Assigned(glMultiTexCoord1d) then Exit; + glMultiTexCoord1dv := wglGetProcAddress('glMultiTexCoord1dv'); + if not Assigned(glMultiTexCoord1dv) then Exit; + glMultiTexCoord1f := wglGetProcAddress('glMultiTexCoord1f'); + if not Assigned(glMultiTexCoord1f) then Exit; + glMultiTexCoord1fv := wglGetProcAddress('glMultiTexCoord1fv'); + if not Assigned(glMultiTexCoord1fv) then Exit; + glMultiTexCoord1i := wglGetProcAddress('glMultiTexCoord1i'); + if not Assigned(glMultiTexCoord1i) then Exit; + glMultiTexCoord1iv := wglGetProcAddress('glMultiTexCoord1iv'); + if not Assigned(glMultiTexCoord1iv) then Exit; + glMultiTexCoord1s := wglGetProcAddress('glMultiTexCoord1s'); + if not Assigned(glMultiTexCoord1s) then Exit; + glMultiTexCoord1sv := wglGetProcAddress('glMultiTexCoord1sv'); + if not Assigned(glMultiTexCoord1sv) then Exit; + glMultiTexCoord2d := wglGetProcAddress('glMultiTexCoord2d'); + if not Assigned(glMultiTexCoord2d) then Exit; + glMultiTexCoord2dv := wglGetProcAddress('glMultiTexCoord2dv'); + if not Assigned(glMultiTexCoord2dv) then Exit; + glMultiTexCoord2f := wglGetProcAddress('glMultiTexCoord2f'); + if not Assigned(glMultiTexCoord2f) then Exit; + glMultiTexCoord2fv := wglGetProcAddress('glMultiTexCoord2fv'); + if not Assigned(glMultiTexCoord2fv) then Exit; + glMultiTexCoord2i := wglGetProcAddress('glMultiTexCoord2i'); + if not Assigned(glMultiTexCoord2i) then Exit; + glMultiTexCoord2iv := wglGetProcAddress('glMultiTexCoord2iv'); + if not Assigned(glMultiTexCoord2iv) then Exit; + glMultiTexCoord2s := wglGetProcAddress('glMultiTexCoord2s'); + if not Assigned(glMultiTexCoord2s) then Exit; + glMultiTexCoord2sv := wglGetProcAddress('glMultiTexCoord2sv'); + if not Assigned(glMultiTexCoord2sv) then Exit; + glMultiTexCoord3d := wglGetProcAddress('glMultiTexCoord3d'); + if not Assigned(glMultiTexCoord3d) then Exit; + glMultiTexCoord3dv := wglGetProcAddress('glMultiTexCoord3dv'); + if not Assigned(glMultiTexCoord3dv) then Exit; + glMultiTexCoord3f := wglGetProcAddress('glMultiTexCoord3f'); + if not Assigned(glMultiTexCoord3f) then Exit; + glMultiTexCoord3fv := wglGetProcAddress('glMultiTexCoord3fv'); + if not Assigned(glMultiTexCoord3fv) then Exit; + glMultiTexCoord3i := wglGetProcAddress('glMultiTexCoord3i'); + if not Assigned(glMultiTexCoord3i) then Exit; + glMultiTexCoord3iv := wglGetProcAddress('glMultiTexCoord3iv'); + if not Assigned(glMultiTexCoord3iv) then Exit; + glMultiTexCoord3s := wglGetProcAddress('glMultiTexCoord3s'); + if not Assigned(glMultiTexCoord3s) then Exit; + glMultiTexCoord3sv := wglGetProcAddress('glMultiTexCoord3sv'); + if not Assigned(glMultiTexCoord3sv) then Exit; + glMultiTexCoord4d := wglGetProcAddress('glMultiTexCoord4d'); + if not Assigned(glMultiTexCoord4d) then Exit; + glMultiTexCoord4dv := wglGetProcAddress('glMultiTexCoord4dv'); + if not Assigned(glMultiTexCoord4dv) then Exit; + glMultiTexCoord4f := wglGetProcAddress('glMultiTexCoord4f'); + if not Assigned(glMultiTexCoord4f) then Exit; + glMultiTexCoord4fv := wglGetProcAddress('glMultiTexCoord4fv'); + if not Assigned(glMultiTexCoord4fv) then Exit; + glMultiTexCoord4i := wglGetProcAddress('glMultiTexCoord4i'); + if not Assigned(glMultiTexCoord4i) then Exit; + glMultiTexCoord4iv := wglGetProcAddress('glMultiTexCoord4iv'); + if not Assigned(glMultiTexCoord4iv) then Exit; + glMultiTexCoord4s := wglGetProcAddress('glMultiTexCoord4s'); + if not Assigned(glMultiTexCoord4s) then Exit; + glMultiTexCoord4sv := wglGetProcAddress('glMultiTexCoord4sv'); + if not Assigned(glMultiTexCoord4sv) then Exit; + glLoadTransposeMatrixf := wglGetProcAddress('glLoadTransposeMatrixf'); + if not Assigned(glLoadTransposeMatrixf) then Exit; + glLoadTransposeMatrixd := wglGetProcAddress('glLoadTransposeMatrixd'); + if not Assigned(glLoadTransposeMatrixd) then Exit; + glMultTransposeMatrixf := wglGetProcAddress('glMultTransposeMatrixf'); + if not Assigned(glMultTransposeMatrixf) then Exit; + glMultTransposeMatrixd := wglGetProcAddress('glMultTransposeMatrixd'); + if not Assigned(glMultTransposeMatrixd) then Exit; + glSampleCoverage := wglGetProcAddress('glSampleCoverage'); + if not Assigned(glSampleCoverage) then Exit; + glCompressedTexImage3D := wglGetProcAddress('glCompressedTexImage3D'); + if not Assigned(glCompressedTexImage3D) then Exit; + glCompressedTexImage2D := wglGetProcAddress('glCompressedTexImage2D'); + if not Assigned(glCompressedTexImage2D) then Exit; + glCompressedTexImage1D := wglGetProcAddress('glCompressedTexImage1D'); + if not Assigned(glCompressedTexImage1D) then Exit; + glCompressedTexSubImage3D := wglGetProcAddress('glCompressedTexSubImage3D'); + if not Assigned(glCompressedTexSubImage3D) then Exit; + glCompressedTexSubImage2D := wglGetProcAddress('glCompressedTexSubImage2D'); + if not Assigned(glCompressedTexSubImage2D) then Exit; + glCompressedTexSubImage1D := wglGetProcAddress('glCompressedTexSubImage1D'); + if not Assigned(glCompressedTexSubImage1D) then Exit; + glGetCompressedTexImage := wglGetProcAddress('glGetCompressedTexImage'); + if not Assigned(glGetCompressedTexImage) then Exit; + Result := TRUE; + +end; + +function Load_GL_ARB_multitexture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_multitexture', extstring) then + begin + glActiveTextureARB := wglGetProcAddress('glActiveTextureARB'); + if not Assigned(glActiveTextureARB) then Exit; + glClientActiveTextureARB := wglGetProcAddress('glClientActiveTextureARB'); + if not Assigned(glClientActiveTextureARB) then Exit; + glMultiTexCoord1dARB := wglGetProcAddress('glMultiTexCoord1dARB'); + if not Assigned(glMultiTexCoord1dARB) then Exit; + glMultiTexCoord1dvARB := wglGetProcAddress('glMultiTexCoord1dvARB'); + if not Assigned(glMultiTexCoord1dvARB) then Exit; + glMultiTexCoord1fARB := wglGetProcAddress('glMultiTexCoord1fARB'); + if not Assigned(glMultiTexCoord1fARB) then Exit; + glMultiTexCoord1fvARB := wglGetProcAddress('glMultiTexCoord1fvARB'); + if not Assigned(glMultiTexCoord1fvARB) then Exit; + glMultiTexCoord1iARB := wglGetProcAddress('glMultiTexCoord1iARB'); + if not Assigned(glMultiTexCoord1iARB) then Exit; + glMultiTexCoord1ivARB := wglGetProcAddress('glMultiTexCoord1ivARB'); + if not Assigned(glMultiTexCoord1ivARB) then Exit; + glMultiTexCoord1sARB := wglGetProcAddress('glMultiTexCoord1sARB'); + if not Assigned(glMultiTexCoord1sARB) then Exit; + glMultiTexCoord1svARB := wglGetProcAddress('glMultiTexCoord1svARB'); + if not Assigned(glMultiTexCoord1svARB) then Exit; + glMultiTexCoord2dARB := wglGetProcAddress('glMultiTexCoord2dARB'); + if not Assigned(glMultiTexCoord2dARB) then Exit; + glMultiTexCoord2dvARB := wglGetProcAddress('glMultiTexCoord2dvARB'); + if not Assigned(glMultiTexCoord2dvARB) then Exit; + glMultiTexCoord2fARB := wglGetProcAddress('glMultiTexCoord2fARB'); + if not Assigned(glMultiTexCoord2fARB) then Exit; + glMultiTexCoord2fvARB := wglGetProcAddress('glMultiTexCoord2fvARB'); + if not Assigned(glMultiTexCoord2fvARB) then Exit; + glMultiTexCoord2iARB := wglGetProcAddress('glMultiTexCoord2iARB'); + if not Assigned(glMultiTexCoord2iARB) then Exit; + glMultiTexCoord2ivARB := wglGetProcAddress('glMultiTexCoord2ivARB'); + if not Assigned(glMultiTexCoord2ivARB) then Exit; + glMultiTexCoord2sARB := wglGetProcAddress('glMultiTexCoord2sARB'); + if not Assigned(glMultiTexCoord2sARB) then Exit; + glMultiTexCoord2svARB := wglGetProcAddress('glMultiTexCoord2svARB'); + if not Assigned(glMultiTexCoord2svARB) then Exit; + glMultiTexCoord3dARB := wglGetProcAddress('glMultiTexCoord3dARB'); + if not Assigned(glMultiTexCoord3dARB) then Exit; + glMultiTexCoord3dvARB := wglGetProcAddress('glMultiTexCoord3dvARB'); + if not Assigned(glMultiTexCoord3dvARB) then Exit; + glMultiTexCoord3fARB := wglGetProcAddress('glMultiTexCoord3fARB'); + if not Assigned(glMultiTexCoord3fARB) then Exit; + glMultiTexCoord3fvARB := wglGetProcAddress('glMultiTexCoord3fvARB'); + if not Assigned(glMultiTexCoord3fvARB) then Exit; + glMultiTexCoord3iARB := wglGetProcAddress('glMultiTexCoord3iARB'); + if not Assigned(glMultiTexCoord3iARB) then Exit; + glMultiTexCoord3ivARB := wglGetProcAddress('glMultiTexCoord3ivARB'); + if not Assigned(glMultiTexCoord3ivARB) then Exit; + glMultiTexCoord3sARB := wglGetProcAddress('glMultiTexCoord3sARB'); + if not Assigned(glMultiTexCoord3sARB) then Exit; + glMultiTexCoord3svARB := wglGetProcAddress('glMultiTexCoord3svARB'); + if not Assigned(glMultiTexCoord3svARB) then Exit; + glMultiTexCoord4dARB := wglGetProcAddress('glMultiTexCoord4dARB'); + if not Assigned(glMultiTexCoord4dARB) then Exit; + glMultiTexCoord4dvARB := wglGetProcAddress('glMultiTexCoord4dvARB'); + if not Assigned(glMultiTexCoord4dvARB) then Exit; + glMultiTexCoord4fARB := wglGetProcAddress('glMultiTexCoord4fARB'); + if not Assigned(glMultiTexCoord4fARB) then Exit; + glMultiTexCoord4fvARB := wglGetProcAddress('glMultiTexCoord4fvARB'); + if not Assigned(glMultiTexCoord4fvARB) then Exit; + glMultiTexCoord4iARB := wglGetProcAddress('glMultiTexCoord4iARB'); + if not Assigned(glMultiTexCoord4iARB) then Exit; + glMultiTexCoord4ivARB := wglGetProcAddress('glMultiTexCoord4ivARB'); + if not Assigned(glMultiTexCoord4ivARB) then Exit; + glMultiTexCoord4sARB := wglGetProcAddress('glMultiTexCoord4sARB'); + if not Assigned(glMultiTexCoord4sARB) then Exit; + glMultiTexCoord4svARB := wglGetProcAddress('glMultiTexCoord4svARB'); + if not Assigned(glMultiTexCoord4svARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_transpose_matrix: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_transpose_matrix', extstring) then + begin + glLoadTransposeMatrixfARB := wglGetProcAddress('glLoadTransposeMatrixfARB'); + if not Assigned(glLoadTransposeMatrixfARB) then Exit; + glLoadTransposeMatrixdARB := wglGetProcAddress('glLoadTransposeMatrixdARB'); + if not Assigned(glLoadTransposeMatrixdARB) then Exit; + glMultTransposeMatrixfARB := wglGetProcAddress('glMultTransposeMatrixfARB'); + if not Assigned(glMultTransposeMatrixfARB) then Exit; + glMultTransposeMatrixdARB := wglGetProcAddress('glMultTransposeMatrixdARB'); + if not Assigned(glMultTransposeMatrixdARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_multisample: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_multisample', extstring) then + begin + glSampleCoverageARB := wglGetProcAddress('glSampleCoverageARB'); + if not Assigned(glSampleCoverageARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_env_add: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_env_add', extstring) then + begin + Result := TRUE; + end; + +end; + +{$IFDEF Windows} +function Load_WGL_ARB_extensions_string: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_extensions_string', extstring) then + begin + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_ARB_buffer_region: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_buffer_region', extstring) then + begin + wglCreateBufferRegionARB := wglGetProcAddress('wglCreateBufferRegionARB'); + if not Assigned(wglCreateBufferRegionARB) then Exit; + wglDeleteBufferRegionARB := wglGetProcAddress('wglDeleteBufferRegionARB'); + if not Assigned(wglDeleteBufferRegionARB) then Exit; + wglSaveBufferRegionARB := wglGetProcAddress('wglSaveBufferRegionARB'); + if not Assigned(wglSaveBufferRegionARB) then Exit; + wglRestoreBufferRegionARB := wglGetProcAddress('wglRestoreBufferRegionARB'); + if not Assigned(wglRestoreBufferRegionARB) then Exit; + Result := TRUE; + end; + +end; +{$ENDIF} + +function Load_GL_ARB_texture_cube_map: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_cube_map', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_depth_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_depth_texture', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_point_parameters: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_point_parameters', extstring) then + begin + glPointParameterfARB := wglGetProcAddress('glPointParameterfARB'); + if not Assigned(glPointParameterfARB) then Exit; + glPointParameterfvARB := wglGetProcAddress('glPointParameterfvARB'); + if not Assigned(glPointParameterfvARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_shadow: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_shadow', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_shadow_ambient: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_shadow_ambient', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_border_clamp: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_border_clamp', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_compression: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_compression', extstring) then + begin + glCompressedTexImage3DARB := wglGetProcAddress('glCompressedTexImage3DARB'); + if not Assigned(glCompressedTexImage3DARB) then Exit; + glCompressedTexImage2DARB := wglGetProcAddress('glCompressedTexImage2DARB'); + if not Assigned(glCompressedTexImage2DARB) then Exit; + glCompressedTexImage1DARB := wglGetProcAddress('glCompressedTexImage1DARB'); + if not Assigned(glCompressedTexImage1DARB) then Exit; + glCompressedTexSubImage3DARB := wglGetProcAddress('glCompressedTexSubImage3DARB'); + if not Assigned(glCompressedTexSubImage3DARB) then Exit; + glCompressedTexSubImage2DARB := wglGetProcAddress('glCompressedTexSubImage2DARB'); + if not Assigned(glCompressedTexSubImage2DARB) then Exit; + glCompressedTexSubImage1DARB := wglGetProcAddress('glCompressedTexSubImage1DARB'); + if not Assigned(glCompressedTexSubImage1DARB) then Exit; + glGetCompressedTexImageARB := wglGetProcAddress('glGetCompressedTexImageARB'); + if not Assigned(glGetCompressedTexImageARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_env_combine: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_env_combine', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_env_crossbar: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_env_crossbar', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_env_dot3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_env_dot3', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_mirrored_repeat: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_mirrored_repeat', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_vertex_blend: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_vertex_blend', extstring) then + begin + glWeightbvARB := wglGetProcAddress('glWeightbvARB'); + if not Assigned(glWeightbvARB) then Exit; + glWeightsvARB := wglGetProcAddress('glWeightsvARB'); + if not Assigned(glWeightsvARB) then Exit; + glWeightivARB := wglGetProcAddress('glWeightivARB'); + if not Assigned(glWeightivARB) then Exit; + glWeightfvARB := wglGetProcAddress('glWeightfvARB'); + if not Assigned(glWeightfvARB) then Exit; + glWeightdvARB := wglGetProcAddress('glWeightdvARB'); + if not Assigned(glWeightdvARB) then Exit; + glWeightvARB := wglGetProcAddress('glWeightvARB'); + if not Assigned(glWeightvARB) then Exit; + glWeightubvARB := wglGetProcAddress('glWeightubvARB'); + if not Assigned(glWeightubvARB) then Exit; + glWeightusvARB := wglGetProcAddress('glWeightusvARB'); + if not Assigned(glWeightusvARB) then Exit; + glWeightuivARB := wglGetProcAddress('glWeightuivARB'); + if not Assigned(glWeightuivARB) then Exit; + glWeightPointerARB := wglGetProcAddress('glWeightPointerARB'); + if not Assigned(glWeightPointerARB) then Exit; + glVertexBlendARB := wglGetProcAddress('glVertexBlendARB'); + if not Assigned(glVertexBlendARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_vertex_program: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_vertex_program', extstring) then + begin + glVertexAttrib1sARB := wglGetProcAddress('glVertexAttrib1sARB'); + if not Assigned(glVertexAttrib1sARB) then Exit; + glVertexAttrib1fARB := wglGetProcAddress('glVertexAttrib1fARB'); + if not Assigned(glVertexAttrib1fARB) then Exit; + glVertexAttrib1dARB := wglGetProcAddress('glVertexAttrib1dARB'); + if not Assigned(glVertexAttrib1dARB) then Exit; + glVertexAttrib2sARB := wglGetProcAddress('glVertexAttrib2sARB'); + if not Assigned(glVertexAttrib2sARB) then Exit; + glVertexAttrib2fARB := wglGetProcAddress('glVertexAttrib2fARB'); + if not Assigned(glVertexAttrib2fARB) then Exit; + glVertexAttrib2dARB := wglGetProcAddress('glVertexAttrib2dARB'); + if not Assigned(glVertexAttrib2dARB) then Exit; + glVertexAttrib3sARB := wglGetProcAddress('glVertexAttrib3sARB'); + if not Assigned(glVertexAttrib3sARB) then Exit; + glVertexAttrib3fARB := wglGetProcAddress('glVertexAttrib3fARB'); + if not Assigned(glVertexAttrib3fARB) then Exit; + glVertexAttrib3dARB := wglGetProcAddress('glVertexAttrib3dARB'); + if not Assigned(glVertexAttrib3dARB) then Exit; + glVertexAttrib4sARB := wglGetProcAddress('glVertexAttrib4sARB'); + if not Assigned(glVertexAttrib4sARB) then Exit; + glVertexAttrib4fARB := wglGetProcAddress('glVertexAttrib4fARB'); + if not Assigned(glVertexAttrib4fARB) then Exit; + glVertexAttrib4dARB := wglGetProcAddress('glVertexAttrib4dARB'); + if not Assigned(glVertexAttrib4dARB) then Exit; + glVertexAttrib4NubARB := wglGetProcAddress('glVertexAttrib4NubARB'); + if not Assigned(glVertexAttrib4NubARB) then Exit; + glVertexAttrib1svARB := wglGetProcAddress('glVertexAttrib1svARB'); + if not Assigned(glVertexAttrib1svARB) then Exit; + glVertexAttrib1fvARB := wglGetProcAddress('glVertexAttrib1fvARB'); + if not Assigned(glVertexAttrib1fvARB) then Exit; + glVertexAttrib1dvARB := wglGetProcAddress('glVertexAttrib1dvARB'); + if not Assigned(glVertexAttrib1dvARB) then Exit; + glVertexAttrib2svARB := wglGetProcAddress('glVertexAttrib2svARB'); + if not Assigned(glVertexAttrib2svARB) then Exit; + glVertexAttrib2fvARB := wglGetProcAddress('glVertexAttrib2fvARB'); + if not Assigned(glVertexAttrib2fvARB) then Exit; + glVertexAttrib2dvARB := wglGetProcAddress('glVertexAttrib2dvARB'); + if not Assigned(glVertexAttrib2dvARB) then Exit; + glVertexAttrib3svARB := wglGetProcAddress('glVertexAttrib3svARB'); + if not Assigned(glVertexAttrib3svARB) then Exit; + glVertexAttrib3fvARB := wglGetProcAddress('glVertexAttrib3fvARB'); + if not Assigned(glVertexAttrib3fvARB) then Exit; + glVertexAttrib3dvARB := wglGetProcAddress('glVertexAttrib3dvARB'); + if not Assigned(glVertexAttrib3dvARB) then Exit; + glVertexAttrib4bvARB := wglGetProcAddress('glVertexAttrib4bvARB'); + if not Assigned(glVertexAttrib4bvARB) then Exit; + glVertexAttrib4svARB := wglGetProcAddress('glVertexAttrib4svARB'); + if not Assigned(glVertexAttrib4svARB) then Exit; + glVertexAttrib4ivARB := wglGetProcAddress('glVertexAttrib4ivARB'); + if not Assigned(glVertexAttrib4ivARB) then Exit; + glVertexAttrib4ubvARB := wglGetProcAddress('glVertexAttrib4ubvARB'); + if not Assigned(glVertexAttrib4ubvARB) then Exit; + glVertexAttrib4usvARB := wglGetProcAddress('glVertexAttrib4usvARB'); + if not Assigned(glVertexAttrib4usvARB) then Exit; + glVertexAttrib4uivARB := wglGetProcAddress('glVertexAttrib4uivARB'); + if not Assigned(glVertexAttrib4uivARB) then Exit; + glVertexAttrib4fvARB := wglGetProcAddress('glVertexAttrib4fvARB'); + if not Assigned(glVertexAttrib4fvARB) then Exit; + glVertexAttrib4dvARB := wglGetProcAddress('glVertexAttrib4dvARB'); + if not Assigned(glVertexAttrib4dvARB) then Exit; + glVertexAttrib4NbvARB := wglGetProcAddress('glVertexAttrib4NbvARB'); + if not Assigned(glVertexAttrib4NbvARB) then Exit; + glVertexAttrib4NsvARB := wglGetProcAddress('glVertexAttrib4NsvARB'); + if not Assigned(glVertexAttrib4NsvARB) then Exit; + glVertexAttrib4NivARB := wglGetProcAddress('glVertexAttrib4NivARB'); + if not Assigned(glVertexAttrib4NivARB) then Exit; + glVertexAttrib4NubvARB := wglGetProcAddress('glVertexAttrib4NubvARB'); + if not Assigned(glVertexAttrib4NubvARB) then Exit; + glVertexAttrib4NusvARB := wglGetProcAddress('glVertexAttrib4NusvARB'); + if not Assigned(glVertexAttrib4NusvARB) then Exit; + glVertexAttrib4NuivARB := wglGetProcAddress('glVertexAttrib4NuivARB'); + if not Assigned(glVertexAttrib4NuivARB) then Exit; + glVertexAttribPointerARB := wglGetProcAddress('glVertexAttribPointerARB'); + if not Assigned(glVertexAttribPointerARB) then Exit; + glEnableVertexAttribArrayARB := wglGetProcAddress('glEnableVertexAttribArrayARB'); + if not Assigned(glEnableVertexAttribArrayARB) then Exit; + glDisableVertexAttribArrayARB := wglGetProcAddress('glDisableVertexAttribArrayARB'); + if not Assigned(glDisableVertexAttribArrayARB) then Exit; + glProgramStringARB := wglGetProcAddress('glProgramStringARB'); + if not Assigned(glProgramStringARB) then Exit; + glBindProgramARB := wglGetProcAddress('glBindProgramARB'); + if not Assigned(glBindProgramARB) then Exit; + glDeleteProgramsARB := wglGetProcAddress('glDeleteProgramsARB'); + if not Assigned(glDeleteProgramsARB) then Exit; + glGenProgramsARB := wglGetProcAddress('glGenProgramsARB'); + if not Assigned(glGenProgramsARB) then Exit; + glProgramEnvParameter4dARB := wglGetProcAddress('glProgramEnvParameter4dARB'); + if not Assigned(glProgramEnvParameter4dARB) then Exit; + glProgramEnvParameter4dvARB := wglGetProcAddress('glProgramEnvParameter4dvARB'); + if not Assigned(glProgramEnvParameter4dvARB) then Exit; + glProgramEnvParameter4fARB := wglGetProcAddress('glProgramEnvParameter4fARB'); + if not Assigned(glProgramEnvParameter4fARB) then Exit; + glProgramEnvParameter4fvARB := wglGetProcAddress('glProgramEnvParameter4fvARB'); + if not Assigned(glProgramEnvParameter4fvARB) then Exit; + glProgramLocalParameter4dARB := wglGetProcAddress('glProgramLocalParameter4dARB'); + if not Assigned(glProgramLocalParameter4dARB) then Exit; + glProgramLocalParameter4dvARB := wglGetProcAddress('glProgramLocalParameter4dvARB'); + if not Assigned(glProgramLocalParameter4dvARB) then Exit; + glProgramLocalParameter4fARB := wglGetProcAddress('glProgramLocalParameter4fARB'); + if not Assigned(glProgramLocalParameter4fARB) then Exit; + glProgramLocalParameter4fvARB := wglGetProcAddress('glProgramLocalParameter4fvARB'); + if not Assigned(glProgramLocalParameter4fvARB) then Exit; + glGetProgramEnvParameterdvARB := wglGetProcAddress('glGetProgramEnvParameterdvARB'); + if not Assigned(glGetProgramEnvParameterdvARB) then Exit; + glGetProgramEnvParameterfvARB := wglGetProcAddress('glGetProgramEnvParameterfvARB'); + if not Assigned(glGetProgramEnvParameterfvARB) then Exit; + glGetProgramLocalParameterdvARB := wglGetProcAddress('glGetProgramLocalParameterdvARB'); + if not Assigned(glGetProgramLocalParameterdvARB) then Exit; + glGetProgramLocalParameterfvARB := wglGetProcAddress('glGetProgramLocalParameterfvARB'); + if not Assigned(glGetProgramLocalParameterfvARB) then Exit; + glGetProgramivARB := wglGetProcAddress('glGetProgramivARB'); + if not Assigned(glGetProgramivARB) then Exit; + glGetProgramStringARB := wglGetProcAddress('glGetProgramStringARB'); + if not Assigned(glGetProgramStringARB) then Exit; + glGetVertexAttribdvARB := wglGetProcAddress('glGetVertexAttribdvARB'); + if not Assigned(glGetVertexAttribdvARB) then Exit; + glGetVertexAttribfvARB := wglGetProcAddress('glGetVertexAttribfvARB'); + if not Assigned(glGetVertexAttribfvARB) then Exit; + glGetVertexAttribivARB := wglGetProcAddress('glGetVertexAttribivARB'); + if not Assigned(glGetVertexAttribivARB) then Exit; + glGetVertexAttribPointervARB := wglGetProcAddress('glGetVertexAttribPointervARB'); + if not Assigned(glGetVertexAttribPointervARB) then Exit; + glIsProgramARB := wglGetProcAddress('glIsProgramARB'); + if not Assigned(glIsProgramARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_window_pos: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_window_pos', extstring) then + begin + glWindowPos2dARB := wglGetProcAddress('glWindowPos2dARB'); + if not Assigned(glWindowPos2dARB) then Exit; + glWindowPos2fARB := wglGetProcAddress('glWindowPos2fARB'); + if not Assigned(glWindowPos2fARB) then Exit; + glWindowPos2iARB := wglGetProcAddress('glWindowPos2iARB'); + if not Assigned(glWindowPos2iARB) then Exit; + glWindowPos2sARB := wglGetProcAddress('glWindowPos2sARB'); + if not Assigned(glWindowPos2sARB) then Exit; + glWindowPos2dvARB := wglGetProcAddress('glWindowPos2dvARB'); + if not Assigned(glWindowPos2dvARB) then Exit; + glWindowPos2fvARB := wglGetProcAddress('glWindowPos2fvARB'); + if not Assigned(glWindowPos2fvARB) then Exit; + glWindowPos2ivARB := wglGetProcAddress('glWindowPos2ivARB'); + if not Assigned(glWindowPos2ivARB) then Exit; + glWindowPos2svARB := wglGetProcAddress('glWindowPos2svARB'); + if not Assigned(glWindowPos2svARB) then Exit; + glWindowPos3dARB := wglGetProcAddress('glWindowPos3dARB'); + if not Assigned(glWindowPos3dARB) then Exit; + glWindowPos3fARB := wglGetProcAddress('glWindowPos3fARB'); + if not Assigned(glWindowPos3fARB) then Exit; + glWindowPos3iARB := wglGetProcAddress('glWindowPos3iARB'); + if not Assigned(glWindowPos3iARB) then Exit; + glWindowPos3sARB := wglGetProcAddress('glWindowPos3sARB'); + if not Assigned(glWindowPos3sARB) then Exit; + glWindowPos3dvARB := wglGetProcAddress('glWindowPos3dvARB'); + if not Assigned(glWindowPos3dvARB) then Exit; + glWindowPos3fvARB := wglGetProcAddress('glWindowPos3fvARB'); + if not Assigned(glWindowPos3fvARB) then Exit; + glWindowPos3ivARB := wglGetProcAddress('glWindowPos3ivARB'); + if not Assigned(glWindowPos3ivARB) then Exit; + glWindowPos3svARB := wglGetProcAddress('glWindowPos3svARB'); + if not Assigned(glWindowPos3svARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_422_pixels: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_422_pixels', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_abgr: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_abgr', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_bgra: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_bgra', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_color: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_color', extstring) then + begin + glBlendColorEXT := wglGetProcAddress('glBlendColorEXT'); + if not Assigned(glBlendColorEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_func_separate: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_func_separate', extstring) then + begin + glBlendFuncSeparateEXT := wglGetProcAddress('glBlendFuncSeparateEXT'); + if not Assigned(glBlendFuncSeparateEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_logic_op: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_logic_op', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_minmax: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_minmax', extstring) then + begin + glBlendEquationEXT := wglGetProcAddress('glBlendEquationEXT'); + if not Assigned(glBlendEquationEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_subtract: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_subtract', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_clip_volume_hint: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_clip_volume_hint', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_color_subtable: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_color_subtable', extstring) then + begin + glColorSubTableEXT := wglGetProcAddress('glColorSubTableEXT'); + if not Assigned(glColorSubTableEXT) then Exit; + glCopyColorSubTableEXT := wglGetProcAddress('glCopyColorSubTableEXT'); + if not Assigned(glCopyColorSubTableEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_compiled_vertex_array: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_compiled_vertex_array', extstring) then + begin + glLockArraysEXT := wglGetProcAddress('glLockArraysEXT'); + if not Assigned(glLockArraysEXT) then Exit; + glUnlockArraysEXT := wglGetProcAddress('glUnlockArraysEXT'); + if not Assigned(glUnlockArraysEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_convolution: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_convolution', extstring) then + begin + glConvolutionFilter1DEXT := wglGetProcAddress('glConvolutionFilter1DEXT'); + if not Assigned(glConvolutionFilter1DEXT) then Exit; + glConvolutionFilter2DEXT := wglGetProcAddress('glConvolutionFilter2DEXT'); + if not Assigned(glConvolutionFilter2DEXT) then Exit; + glCopyConvolutionFilter1DEXT := wglGetProcAddress('glCopyConvolutionFilter1DEXT'); + if not Assigned(glCopyConvolutionFilter1DEXT) then Exit; + glCopyConvolutionFilter2DEXT := wglGetProcAddress('glCopyConvolutionFilter2DEXT'); + if not Assigned(glCopyConvolutionFilter2DEXT) then Exit; + glGetConvolutionFilterEXT := wglGetProcAddress('glGetConvolutionFilterEXT'); + if not Assigned(glGetConvolutionFilterEXT) then Exit; + glSeparableFilter2DEXT := wglGetProcAddress('glSeparableFilter2DEXT'); + if not Assigned(glSeparableFilter2DEXT) then Exit; + glGetSeparableFilterEXT := wglGetProcAddress('glGetSeparableFilterEXT'); + if not Assigned(glGetSeparableFilterEXT) then Exit; + glConvolutionParameteriEXT := wglGetProcAddress('glConvolutionParameteriEXT'); + if not Assigned(glConvolutionParameteriEXT) then Exit; + glConvolutionParameterivEXT := wglGetProcAddress('glConvolutionParameterivEXT'); + if not Assigned(glConvolutionParameterivEXT) then Exit; + glConvolutionParameterfEXT := wglGetProcAddress('glConvolutionParameterfEXT'); + if not Assigned(glConvolutionParameterfEXT) then Exit; + glConvolutionParameterfvEXT := wglGetProcAddress('glConvolutionParameterfvEXT'); + if not Assigned(glConvolutionParameterfvEXT) then Exit; + glGetConvolutionParameterivEXT := wglGetProcAddress('glGetConvolutionParameterivEXT'); + if not Assigned(glGetConvolutionParameterivEXT) then Exit; + glGetConvolutionParameterfvEXT := wglGetProcAddress('glGetConvolutionParameterfvEXT'); + if not Assigned(glGetConvolutionParameterfvEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_fog_coord: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_fog_coord', extstring) then + begin + glFogCoordfEXT := wglGetProcAddress('glFogCoordfEXT'); + if not Assigned(glFogCoordfEXT) then Exit; + glFogCoorddEXT := wglGetProcAddress('glFogCoorddEXT'); + if not Assigned(glFogCoorddEXT) then Exit; + glFogCoordfvEXT := wglGetProcAddress('glFogCoordfvEXT'); + if not Assigned(glFogCoordfvEXT) then Exit; + glFogCoorddvEXT := wglGetProcAddress('glFogCoorddvEXT'); + if not Assigned(glFogCoorddvEXT) then Exit; + glFogCoordPointerEXT := wglGetProcAddress('glFogCoordPointerEXT'); + if not Assigned(glFogCoordPointerEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_histogram: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_histogram', extstring) then + begin + glHistogramEXT := wglGetProcAddress('glHistogramEXT'); + if not Assigned(glHistogramEXT) then Exit; + glResetHistogramEXT := wglGetProcAddress('glResetHistogramEXT'); + if not Assigned(glResetHistogramEXT) then Exit; + glGetHistogramEXT := wglGetProcAddress('glGetHistogramEXT'); + if not Assigned(glGetHistogramEXT) then Exit; + glGetHistogramParameterivEXT := wglGetProcAddress('glGetHistogramParameterivEXT'); + if not Assigned(glGetHistogramParameterivEXT) then Exit; + glGetHistogramParameterfvEXT := wglGetProcAddress('glGetHistogramParameterfvEXT'); + if not Assigned(glGetHistogramParameterfvEXT) then Exit; + glMinmaxEXT := wglGetProcAddress('glMinmaxEXT'); + if not Assigned(glMinmaxEXT) then Exit; + glResetMinmaxEXT := wglGetProcAddress('glResetMinmaxEXT'); + if not Assigned(glResetMinmaxEXT) then Exit; + glGetMinmaxEXT := wglGetProcAddress('glGetMinmaxEXT'); + if not Assigned(glGetMinmaxEXT) then Exit; + glGetMinmaxParameterivEXT := wglGetProcAddress('glGetMinmaxParameterivEXT'); + if not Assigned(glGetMinmaxParameterivEXT) then Exit; + glGetMinmaxParameterfvEXT := wglGetProcAddress('glGetMinmaxParameterfvEXT'); + if not Assigned(glGetMinmaxParameterfvEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_multi_draw_arrays: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_multi_draw_arrays', extstring) then + begin + glMultiDrawArraysEXT := wglGetProcAddress('glMultiDrawArraysEXT'); + if not Assigned(glMultiDrawArraysEXT) then Exit; + glMultiDrawElementsEXT := wglGetProcAddress('glMultiDrawElementsEXT'); + if not Assigned(glMultiDrawElementsEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_packed_pixels: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_packed_pixels', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_paletted_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_paletted_texture', extstring) then + begin + glColorTableEXT := wglGetProcAddress('glColorTableEXT'); + if not Assigned(glColorTableEXT) then Exit; + glColorSubTableEXT := wglGetProcAddress('glColorSubTableEXT'); + if not Assigned(glColorSubTableEXT) then Exit; + glGetColorTableEXT := wglGetProcAddress('glGetColorTableEXT'); + if not Assigned(glGetColorTableEXT) then Exit; + glGetColorTableParameterivEXT := wglGetProcAddress('glGetColorTableParameterivEXT'); + if not Assigned(glGetColorTableParameterivEXT) then Exit; + glGetColorTableParameterfvEXT := wglGetProcAddress('glGetColorTableParameterfvEXT'); + if not Assigned(glGetColorTableParameterfvEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_point_parameters: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_point_parameters', extstring) then + begin + glPointParameterfEXT := wglGetProcAddress('glPointParameterfEXT'); + if not Assigned(glPointParameterfEXT) then Exit; + glPointParameterfvEXT := wglGetProcAddress('glPointParameterfvEXT'); + if not Assigned(glPointParameterfvEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_polygon_offset: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_polygon_offset', extstring) then + begin + glPolygonOffsetEXT := wglGetProcAddress('glPolygonOffsetEXT'); + if not Assigned(glPolygonOffsetEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_secondary_color: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_secondary_color', extstring) then + begin + glSecondaryColor3bEXT := wglGetProcAddress('glSecondaryColor3bEXT'); + if not Assigned(glSecondaryColor3bEXT) then Exit; + glSecondaryColor3sEXT := wglGetProcAddress('glSecondaryColor3sEXT'); + if not Assigned(glSecondaryColor3sEXT) then Exit; + glSecondaryColor3iEXT := wglGetProcAddress('glSecondaryColor3iEXT'); + if not Assigned(glSecondaryColor3iEXT) then Exit; + glSecondaryColor3fEXT := wglGetProcAddress('glSecondaryColor3fEXT'); + if not Assigned(glSecondaryColor3fEXT) then Exit; + glSecondaryColor3dEXT := wglGetProcAddress('glSecondaryColor3dEXT'); + if not Assigned(glSecondaryColor3dEXT) then Exit; + glSecondaryColor3ubEXT := wglGetProcAddress('glSecondaryColor3ubEXT'); + if not Assigned(glSecondaryColor3ubEXT) then Exit; + glSecondaryColor3usEXT := wglGetProcAddress('glSecondaryColor3usEXT'); + if not Assigned(glSecondaryColor3usEXT) then Exit; + glSecondaryColor3uiEXT := wglGetProcAddress('glSecondaryColor3uiEXT'); + if not Assigned(glSecondaryColor3uiEXT) then Exit; + glSecondaryColor3bvEXT := wglGetProcAddress('glSecondaryColor3bvEXT'); + if not Assigned(glSecondaryColor3bvEXT) then Exit; + glSecondaryColor3svEXT := wglGetProcAddress('glSecondaryColor3svEXT'); + if not Assigned(glSecondaryColor3svEXT) then Exit; + glSecondaryColor3ivEXT := wglGetProcAddress('glSecondaryColor3ivEXT'); + if not Assigned(glSecondaryColor3ivEXT) then Exit; + glSecondaryColor3fvEXT := wglGetProcAddress('glSecondaryColor3fvEXT'); + if not Assigned(glSecondaryColor3fvEXT) then Exit; + glSecondaryColor3dvEXT := wglGetProcAddress('glSecondaryColor3dvEXT'); + if not Assigned(glSecondaryColor3dvEXT) then Exit; + glSecondaryColor3ubvEXT := wglGetProcAddress('glSecondaryColor3ubvEXT'); + if not Assigned(glSecondaryColor3ubvEXT) then Exit; + glSecondaryColor3usvEXT := wglGetProcAddress('glSecondaryColor3usvEXT'); + if not Assigned(glSecondaryColor3usvEXT) then Exit; + glSecondaryColor3uivEXT := wglGetProcAddress('glSecondaryColor3uivEXT'); + if not Assigned(glSecondaryColor3uivEXT) then Exit; + glSecondaryColorPointerEXT := wglGetProcAddress('glSecondaryColorPointerEXT'); + if not Assigned(glSecondaryColorPointerEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_separate_specular_color: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_separate_specular_color', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_shadow_funcs: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_shadow_funcs', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_shared_texture_palette: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_shared_texture_palette', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_stencil_two_side: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_stencil_two_side', extstring) then + begin + glActiveStencilFaceEXT := wglGetProcAddress('glActiveStencilFaceEXT'); + if not Assigned(glActiveStencilFaceEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_stencil_wrap: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_stencil_wrap', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_subtexture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_subtexture', extstring) then + begin + glTexSubImage1DEXT := wglGetProcAddress('glTexSubImage1DEXT'); + if not Assigned(glTexSubImage1DEXT) then Exit; + glTexSubImage2DEXT := wglGetProcAddress('glTexSubImage2DEXT'); + if not Assigned(glTexSubImage2DEXT) then Exit; + glTexSubImage3DEXT := wglGetProcAddress('glTexSubImage3DEXT'); + if not Assigned(glTexSubImage3DEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture3D: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture3D', extstring) then + begin + glTexImage3DEXT := wglGetProcAddress('glTexImage3DEXT'); + if not Assigned(glTexImage3DEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_compression_s3tc: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_compression_s3tc', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_env_add: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_env_add', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_env_combine: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_env_combine', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_env_dot3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_env_dot3', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_filter_anisotropic: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_filter_anisotropic', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_lod_bias: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_lod_bias', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_object: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_object', extstring) then + begin + glGenTexturesEXT := wglGetProcAddress('glGenTexturesEXT'); + if not Assigned(glGenTexturesEXT) then Exit; + glDeleteTexturesEXT := wglGetProcAddress('glDeleteTexturesEXT'); + if not Assigned(glDeleteTexturesEXT) then Exit; + glBindTextureEXT := wglGetProcAddress('glBindTextureEXT'); + if not Assigned(glBindTextureEXT) then Exit; + glPrioritizeTexturesEXT := wglGetProcAddress('glPrioritizeTexturesEXT'); + if not Assigned(glPrioritizeTexturesEXT) then Exit; + glAreTexturesResidentEXT := wglGetProcAddress('glAreTexturesResidentEXT'); + if not Assigned(glAreTexturesResidentEXT) then Exit; + glIsTextureEXT := wglGetProcAddress('glIsTextureEXT'); + if not Assigned(glIsTextureEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_vertex_array: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_vertex_array', extstring) then + begin + glArrayElementEXT := wglGetProcAddress('glArrayElementEXT'); + if not Assigned(glArrayElementEXT) then Exit; + glDrawArraysEXT := wglGetProcAddress('glDrawArraysEXT'); + if not Assigned(glDrawArraysEXT) then Exit; + glVertexPointerEXT := wglGetProcAddress('glVertexPointerEXT'); + if not Assigned(glVertexPointerEXT) then Exit; + glNormalPointerEXT := wglGetProcAddress('glNormalPointerEXT'); + if not Assigned(glNormalPointerEXT) then Exit; + glColorPointerEXT := wglGetProcAddress('glColorPointerEXT'); + if not Assigned(glColorPointerEXT) then Exit; + glIndexPointerEXT := wglGetProcAddress('glIndexPointerEXT'); + if not Assigned(glIndexPointerEXT) then Exit; + glTexCoordPointerEXT := wglGetProcAddress('glTexCoordPointerEXT'); + if not Assigned(glTexCoordPointerEXT) then Exit; + glEdgeFlagPointerEXT := wglGetProcAddress('glEdgeFlagPointerEXT'); + if not Assigned(glEdgeFlagPointerEXT) then Exit; + glGetPointervEXT := wglGetProcAddress('glGetPointervEXT'); + if not Assigned(glGetPointervEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_vertex_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_vertex_shader', extstring) then + begin + glBeginVertexShaderEXT := wglGetProcAddress('glBeginVertexShaderEXT'); + if not Assigned(glBeginVertexShaderEXT) then Exit; + glEndVertexShaderEXT := wglGetProcAddress('glEndVertexShaderEXT'); + if not Assigned(glEndVertexShaderEXT) then Exit; + glBindVertexShaderEXT := wglGetProcAddress('glBindVertexShaderEXT'); + if not Assigned(glBindVertexShaderEXT) then Exit; + glGenVertexShadersEXT := wglGetProcAddress('glGenVertexShadersEXT'); + if not Assigned(glGenVertexShadersEXT) then Exit; + glDeleteVertexShaderEXT := wglGetProcAddress('glDeleteVertexShaderEXT'); + if not Assigned(glDeleteVertexShaderEXT) then Exit; + glShaderOp1EXT := wglGetProcAddress('glShaderOp1EXT'); + if not Assigned(glShaderOp1EXT) then Exit; + glShaderOp2EXT := wglGetProcAddress('glShaderOp2EXT'); + if not Assigned(glShaderOp2EXT) then Exit; + glShaderOp3EXT := wglGetProcAddress('glShaderOp3EXT'); + if not Assigned(glShaderOp3EXT) then Exit; + glSwizzleEXT := wglGetProcAddress('glSwizzleEXT'); + if not Assigned(glSwizzleEXT) then Exit; + glWriteMaskEXT := wglGetProcAddress('glWriteMaskEXT'); + if not Assigned(glWriteMaskEXT) then Exit; + glInsertComponentEXT := wglGetProcAddress('glInsertComponentEXT'); + if not Assigned(glInsertComponentEXT) then Exit; + glExtractComponentEXT := wglGetProcAddress('glExtractComponentEXT'); + if not Assigned(glExtractComponentEXT) then Exit; + glGenSymbolsEXT := wglGetProcAddress('glGenSymbolsEXT'); + if not Assigned(glGenSymbolsEXT) then Exit; + glSetInvariantEXT := wglGetProcAddress('glSetInvariantEXT'); + if not Assigned(glSetInvariantEXT) then Exit; + glSetLocalConstantEXT := wglGetProcAddress('glSetLocalConstantEXT'); + if not Assigned(glSetLocalConstantEXT) then Exit; + glVariantbvEXT := wglGetProcAddress('glVariantbvEXT'); + if not Assigned(glVariantbvEXT) then Exit; + glVariantsvEXT := wglGetProcAddress('glVariantsvEXT'); + if not Assigned(glVariantsvEXT) then Exit; + glVariantivEXT := wglGetProcAddress('glVariantivEXT'); + if not Assigned(glVariantivEXT) then Exit; + glVariantfvEXT := wglGetProcAddress('glVariantfvEXT'); + if not Assigned(glVariantfvEXT) then Exit; + glVariantdvEXT := wglGetProcAddress('glVariantdvEXT'); + if not Assigned(glVariantdvEXT) then Exit; + glVariantubvEXT := wglGetProcAddress('glVariantubvEXT'); + if not Assigned(glVariantubvEXT) then Exit; + glVariantusvEXT := wglGetProcAddress('glVariantusvEXT'); + if not Assigned(glVariantusvEXT) then Exit; + glVariantuivEXT := wglGetProcAddress('glVariantuivEXT'); + if not Assigned(glVariantuivEXT) then Exit; + glVariantPointerEXT := wglGetProcAddress('glVariantPointerEXT'); + if not Assigned(glVariantPointerEXT) then Exit; + glEnableVariantClientStateEXT := wglGetProcAddress('glEnableVariantClientStateEXT'); + if not Assigned(glEnableVariantClientStateEXT) then Exit; + glDisableVariantClientStateEXT := wglGetProcAddress('glDisableVariantClientStateEXT'); + if not Assigned(glDisableVariantClientStateEXT) then Exit; + glBindLightParameterEXT := wglGetProcAddress('glBindLightParameterEXT'); + if not Assigned(glBindLightParameterEXT) then Exit; + glBindMaterialParameterEXT := wglGetProcAddress('glBindMaterialParameterEXT'); + if not Assigned(glBindMaterialParameterEXT) then Exit; + glBindTexGenParameterEXT := wglGetProcAddress('glBindTexGenParameterEXT'); + if not Assigned(glBindTexGenParameterEXT) then Exit; + glBindTextureUnitParameterEXT := wglGetProcAddress('glBindTextureUnitParameterEXT'); + if not Assigned(glBindTextureUnitParameterEXT) then Exit; + glBindParameterEXT := wglGetProcAddress('glBindParameterEXT'); + if not Assigned(glBindParameterEXT) then Exit; + glIsVariantEnabledEXT := wglGetProcAddress('glIsVariantEnabledEXT'); + if not Assigned(glIsVariantEnabledEXT) then Exit; + glGetVariantBooleanvEXT := wglGetProcAddress('glGetVariantBooleanvEXT'); + if not Assigned(glGetVariantBooleanvEXT) then Exit; + glGetVariantIntegervEXT := wglGetProcAddress('glGetVariantIntegervEXT'); + if not Assigned(glGetVariantIntegervEXT) then Exit; + glGetVariantFloatvEXT := wglGetProcAddress('glGetVariantFloatvEXT'); + if not Assigned(glGetVariantFloatvEXT) then Exit; + glGetVariantPointervEXT := wglGetProcAddress('glGetVariantPointervEXT'); + if not Assigned(glGetVariantPointervEXT) then Exit; + glGetInvariantBooleanvEXT := wglGetProcAddress('glGetInvariantBooleanvEXT'); + if not Assigned(glGetInvariantBooleanvEXT) then Exit; + glGetInvariantIntegervEXT := wglGetProcAddress('glGetInvariantIntegervEXT'); + if not Assigned(glGetInvariantIntegervEXT) then Exit; + glGetInvariantFloatvEXT := wglGetProcAddress('glGetInvariantFloatvEXT'); + if not Assigned(glGetInvariantFloatvEXT) then Exit; + glGetLocalConstantBooleanvEXT := wglGetProcAddress('glGetLocalConstantBooleanvEXT'); + if not Assigned(glGetLocalConstantBooleanvEXT) then Exit; + glGetLocalConstantIntegervEXT := wglGetProcAddress('glGetLocalConstantIntegervEXT'); + if not Assigned(glGetLocalConstantIntegervEXT) then Exit; + glGetLocalConstantFloatvEXT := wglGetProcAddress('glGetLocalConstantFloatvEXT'); + if not Assigned(glGetLocalConstantFloatvEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_vertex_weighting: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_vertex_weighting', extstring) then + begin + glVertexWeightfEXT := wglGetProcAddress('glVertexWeightfEXT'); + if not Assigned(glVertexWeightfEXT) then Exit; + glVertexWeightfvEXT := wglGetProcAddress('glVertexWeightfvEXT'); + if not Assigned(glVertexWeightfvEXT) then Exit; + glVertexWeightPointerEXT := wglGetProcAddress('glVertexWeightPointerEXT'); + if not Assigned(glVertexWeightPointerEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_HP_occlusion_test: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_HP_occlusion_test', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_blend_square: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_blend_square', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_copy_depth_to_color: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_copy_depth_to_color', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_depth_clamp: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_depth_clamp', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_evaluators: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_evaluators', extstring) then + begin + glMapControlPointsNV := wglGetProcAddress('glMapControlPointsNV'); + if not Assigned(glMapControlPointsNV) then Exit; + glMapParameterivNV := wglGetProcAddress('glMapParameterivNV'); + if not Assigned(glMapParameterivNV) then Exit; + glMapParameterfvNV := wglGetProcAddress('glMapParameterfvNV'); + if not Assigned(glMapParameterfvNV) then Exit; + glGetMapControlPointsNV := wglGetProcAddress('glGetMapControlPointsNV'); + if not Assigned(glGetMapControlPointsNV) then Exit; + glGetMapParameterivNV := wglGetProcAddress('glGetMapParameterivNV'); + if not Assigned(glGetMapParameterivNV) then Exit; + glGetMapParameterfvNV := wglGetProcAddress('glGetMapParameterfvNV'); + if not Assigned(glGetMapParameterfvNV) then Exit; + glGetMapAttribParameterivNV := wglGetProcAddress('glGetMapAttribParameterivNV'); + if not Assigned(glGetMapAttribParameterivNV) then Exit; + glGetMapAttribParameterfvNV := wglGetProcAddress('glGetMapAttribParameterfvNV'); + if not Assigned(glGetMapAttribParameterfvNV) then Exit; + glEvalMapsNV := wglGetProcAddress('glEvalMapsNV'); + if not Assigned(glEvalMapsNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_fence: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_fence', extstring) then + begin + glGenFencesNV := wglGetProcAddress('glGenFencesNV'); + if not Assigned(glGenFencesNV) then Exit; + glDeleteFencesNV := wglGetProcAddress('glDeleteFencesNV'); + if not Assigned(glDeleteFencesNV) then Exit; + glSetFenceNV := wglGetProcAddress('glSetFenceNV'); + if not Assigned(glSetFenceNV) then Exit; + glTestFenceNV := wglGetProcAddress('glTestFenceNV'); + if not Assigned(glTestFenceNV) then Exit; + glFinishFenceNV := wglGetProcAddress('glFinishFenceNV'); + if not Assigned(glFinishFenceNV) then Exit; + glIsFenceNV := wglGetProcAddress('glIsFenceNV'); + if not Assigned(glIsFenceNV) then Exit; + glGetFenceivNV := wglGetProcAddress('glGetFenceivNV'); + if not Assigned(glGetFenceivNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_fog_distance: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_fog_distance', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_light_max_exponent: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_light_max_exponent', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_multisample_filter_hint: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_multisample_filter_hint', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_occlusion_query: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_occlusion_query', extstring) then + begin + glGenOcclusionQueriesNV := wglGetProcAddress('glGenOcclusionQueriesNV'); + if not Assigned(glGenOcclusionQueriesNV) then Exit; + glDeleteOcclusionQueriesNV := wglGetProcAddress('glDeleteOcclusionQueriesNV'); + if not Assigned(glDeleteOcclusionQueriesNV) then Exit; + glIsOcclusionQueryNV := wglGetProcAddress('glIsOcclusionQueryNV'); + if not Assigned(glIsOcclusionQueryNV) then Exit; + glBeginOcclusionQueryNV := wglGetProcAddress('glBeginOcclusionQueryNV'); + if not Assigned(glBeginOcclusionQueryNV) then Exit; + glEndOcclusionQueryNV := wglGetProcAddress('glEndOcclusionQueryNV'); + if not Assigned(glEndOcclusionQueryNV) then Exit; + glGetOcclusionQueryivNV := wglGetProcAddress('glGetOcclusionQueryivNV'); + if not Assigned(glGetOcclusionQueryivNV) then Exit; + glGetOcclusionQueryuivNV := wglGetProcAddress('glGetOcclusionQueryuivNV'); + if not Assigned(glGetOcclusionQueryuivNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_packed_depth_stencil: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_packed_depth_stencil', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_point_sprite: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_point_sprite', extstring) then + begin + glPointParameteriNV := wglGetProcAddress('glPointParameteriNV'); + if not Assigned(glPointParameteriNV) then Exit; + glPointParameterivNV := wglGetProcAddress('glPointParameterivNV'); + if not Assigned(glPointParameterivNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_register_combiners: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_register_combiners', extstring) then + begin + glCombinerParameterfvNV := wglGetProcAddress('glCombinerParameterfvNV'); + if not Assigned(glCombinerParameterfvNV) then Exit; + glCombinerParameterivNV := wglGetProcAddress('glCombinerParameterivNV'); + if not Assigned(glCombinerParameterivNV) then Exit; + glCombinerParameterfNV := wglGetProcAddress('glCombinerParameterfNV'); + if not Assigned(glCombinerParameterfNV) then Exit; + glCombinerParameteriNV := wglGetProcAddress('glCombinerParameteriNV'); + if not Assigned(glCombinerParameteriNV) then Exit; + glCombinerInputNV := wglGetProcAddress('glCombinerInputNV'); + if not Assigned(glCombinerInputNV) then Exit; + glCombinerOutputNV := wglGetProcAddress('glCombinerOutputNV'); + if not Assigned(glCombinerOutputNV) then Exit; + glFinalCombinerInputNV := wglGetProcAddress('glFinalCombinerInputNV'); + if not Assigned(glFinalCombinerInputNV) then Exit; + glGetCombinerInputParameterfvNV := wglGetProcAddress('glGetCombinerInputParameterfvNV'); + if not Assigned(glGetCombinerInputParameterfvNV) then Exit; + glGetCombinerInputParameterivNV := wglGetProcAddress('glGetCombinerInputParameterivNV'); + if not Assigned(glGetCombinerInputParameterivNV) then Exit; + glGetCombinerOutputParameterfvNV := wglGetProcAddress('glGetCombinerOutputParameterfvNV'); + if not Assigned(glGetCombinerOutputParameterfvNV) then Exit; + glGetCombinerOutputParameterivNV := wglGetProcAddress('glGetCombinerOutputParameterivNV'); + if not Assigned(glGetCombinerOutputParameterivNV) then Exit; + glGetFinalCombinerInputParameterfvNV := wglGetProcAddress('glGetFinalCombinerInputParameterfvNV'); + if not Assigned(glGetFinalCombinerInputParameterfvNV) then Exit; + glGetFinalCombinerInputParameterivNV := wglGetProcAddress('glGetFinalCombinerInputParameterivNV'); + if not Assigned(glGetFinalCombinerInputParameterivNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_register_combiners2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_register_combiners2', extstring) then + begin + glCombinerStageParameterfvNV := wglGetProcAddress('glCombinerStageParameterfvNV'); + if not Assigned(glCombinerStageParameterfvNV) then Exit; + glGetCombinerStageParameterfvNV := wglGetProcAddress('glGetCombinerStageParameterfvNV'); + if not Assigned(glGetCombinerStageParameterfvNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_texgen_emboss: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texgen_emboss', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texgen_reflection: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texgen_reflection', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_compression_vtc: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_compression_vtc', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_env_combine4: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_env_combine4', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_rectangle: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_rectangle', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_shader', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_shader2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_shader2', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_shader3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_shader3', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_array_range: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_array_range', extstring) then + begin + glVertexArrayRangeNV := wglGetProcAddress('glVertexArrayRangeNV'); + if not Assigned(glVertexArrayRangeNV) then Exit; + glFlushVertexArrayRangeNV := wglGetProcAddress('glFlushVertexArrayRangeNV'); + if not Assigned(glFlushVertexArrayRangeNV) then Exit; +{$IFDEF Windows} + wglAllocateMemoryNV := wglGetProcAddress('wglAllocateMemoryNV'); + if not Assigned(wglAllocateMemoryNV) then Exit; + wglFreeMemoryNV := wglGetProcAddress('wglFreeMemoryNV'); + if not Assigned(wglFreeMemoryNV) then Exit; +{$ENDIF} + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_array_range2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_array_range2', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_program: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_program', extstring) then + begin + glBindProgramNV := wglGetProcAddress('glBindProgramNV'); + if not Assigned(glBindProgramNV) then Exit; + glDeleteProgramsNV := wglGetProcAddress('glDeleteProgramsNV'); + if not Assigned(glDeleteProgramsNV) then Exit; + glExecuteProgramNV := wglGetProcAddress('glExecuteProgramNV'); + if not Assigned(glExecuteProgramNV) then Exit; + glGenProgramsNV := wglGetProcAddress('glGenProgramsNV'); + if not Assigned(glGenProgramsNV) then Exit; + glAreProgramsResidentNV := wglGetProcAddress('glAreProgramsResidentNV'); + if not Assigned(glAreProgramsResidentNV) then Exit; + glRequestResidentProgramsNV := wglGetProcAddress('glRequestResidentProgramsNV'); + if not Assigned(glRequestResidentProgramsNV) then Exit; + glGetProgramParameterfvNV := wglGetProcAddress('glGetProgramParameterfvNV'); + if not Assigned(glGetProgramParameterfvNV) then Exit; + glGetProgramParameterdvNV := wglGetProcAddress('glGetProgramParameterdvNV'); + if not Assigned(glGetProgramParameterdvNV) then Exit; + glGetProgramivNV := wglGetProcAddress('glGetProgramivNV'); + if not Assigned(glGetProgramivNV) then Exit; + glGetProgramStringNV := wglGetProcAddress('glGetProgramStringNV'); + if not Assigned(glGetProgramStringNV) then Exit; + glGetTrackMatrixivNV := wglGetProcAddress('glGetTrackMatrixivNV'); + if not Assigned(glGetTrackMatrixivNV) then Exit; + glGetVertexAttribdvNV := wglGetProcAddress('glGetVertexAttribdvNV'); + if not Assigned(glGetVertexAttribdvNV) then Exit; + glGetVertexAttribfvNV := wglGetProcAddress('glGetVertexAttribfvNV'); + if not Assigned(glGetVertexAttribfvNV) then Exit; + glGetVertexAttribivNV := wglGetProcAddress('glGetVertexAttribivNV'); + if not Assigned(glGetVertexAttribivNV) then Exit; + glGetVertexAttribPointervNV := wglGetProcAddress('glGetVertexAttribPointervNV'); + if not Assigned(glGetVertexAttribPointervNV) then Exit; + glIsProgramNV := wglGetProcAddress('glIsProgramNV'); + if not Assigned(glIsProgramNV) then Exit; + glLoadProgramNV := wglGetProcAddress('glLoadProgramNV'); + if not Assigned(glLoadProgramNV) then Exit; + glProgramParameter4fNV := wglGetProcAddress('glProgramParameter4fNV'); + if not Assigned(glProgramParameter4fNV) then Exit; + glProgramParameter4fvNV := wglGetProcAddress('glProgramParameter4fvNV'); + if not Assigned(glProgramParameter4fvNV) then Exit; + glProgramParameters4dvNV := wglGetProcAddress('glProgramParameters4dvNV'); + if not Assigned(glProgramParameters4dvNV) then Exit; + glProgramParameters4fvNV := wglGetProcAddress('glProgramParameters4fvNV'); + if not Assigned(glProgramParameters4fvNV) then Exit; + glTrackMatrixNV := wglGetProcAddress('glTrackMatrixNV'); + if not Assigned(glTrackMatrixNV) then Exit; + glVertexAttribPointerNV := wglGetProcAddress('glVertexAttribPointerNV'); + if not Assigned(glVertexAttribPointerNV) then Exit; + glVertexAttrib1sNV := wglGetProcAddress('glVertexAttrib1sNV'); + if not Assigned(glVertexAttrib1sNV) then Exit; + glVertexAttrib1fNV := wglGetProcAddress('glVertexAttrib1fNV'); + if not Assigned(glVertexAttrib1fNV) then Exit; + glVertexAttrib1dNV := wglGetProcAddress('glVertexAttrib1dNV'); + if not Assigned(glVertexAttrib1dNV) then Exit; + glVertexAttrib2sNV := wglGetProcAddress('glVertexAttrib2sNV'); + if not Assigned(glVertexAttrib2sNV) then Exit; + glVertexAttrib2fNV := wglGetProcAddress('glVertexAttrib2fNV'); + if not Assigned(glVertexAttrib2fNV) then Exit; + glVertexAttrib2dNV := wglGetProcAddress('glVertexAttrib2dNV'); + if not Assigned(glVertexAttrib2dNV) then Exit; + glVertexAttrib3sNV := wglGetProcAddress('glVertexAttrib3sNV'); + if not Assigned(glVertexAttrib3sNV) then Exit; + glVertexAttrib3fNV := wglGetProcAddress('glVertexAttrib3fNV'); + if not Assigned(glVertexAttrib3fNV) then Exit; + glVertexAttrib3dNV := wglGetProcAddress('glVertexAttrib3dNV'); + if not Assigned(glVertexAttrib3dNV) then Exit; + glVertexAttrib4sNV := wglGetProcAddress('glVertexAttrib4sNV'); + if not Assigned(glVertexAttrib4sNV) then Exit; + glVertexAttrib4fNV := wglGetProcAddress('glVertexAttrib4fNV'); + if not Assigned(glVertexAttrib4fNV) then Exit; + glVertexAttrib4dNV := wglGetProcAddress('glVertexAttrib4dNV'); + if not Assigned(glVertexAttrib4dNV) then Exit; + glVertexAttrib4ubNV := wglGetProcAddress('glVertexAttrib4ubNV'); + if not Assigned(glVertexAttrib4ubNV) then Exit; + glVertexAttrib1svNV := wglGetProcAddress('glVertexAttrib1svNV'); + if not Assigned(glVertexAttrib1svNV) then Exit; + glVertexAttrib1fvNV := wglGetProcAddress('glVertexAttrib1fvNV'); + if not Assigned(glVertexAttrib1fvNV) then Exit; + glVertexAttrib1dvNV := wglGetProcAddress('glVertexAttrib1dvNV'); + if not Assigned(glVertexAttrib1dvNV) then Exit; + glVertexAttrib2svNV := wglGetProcAddress('glVertexAttrib2svNV'); + if not Assigned(glVertexAttrib2svNV) then Exit; + glVertexAttrib2fvNV := wglGetProcAddress('glVertexAttrib2fvNV'); + if not Assigned(glVertexAttrib2fvNV) then Exit; + glVertexAttrib2dvNV := wglGetProcAddress('glVertexAttrib2dvNV'); + if not Assigned(glVertexAttrib2dvNV) then Exit; + glVertexAttrib3svNV := wglGetProcAddress('glVertexAttrib3svNV'); + if not Assigned(glVertexAttrib3svNV) then Exit; + glVertexAttrib3fvNV := wglGetProcAddress('glVertexAttrib3fvNV'); + if not Assigned(glVertexAttrib3fvNV) then Exit; + glVertexAttrib3dvNV := wglGetProcAddress('glVertexAttrib3dvNV'); + if not Assigned(glVertexAttrib3dvNV) then Exit; + glVertexAttrib4svNV := wglGetProcAddress('glVertexAttrib4svNV'); + if not Assigned(glVertexAttrib4svNV) then Exit; + glVertexAttrib4fvNV := wglGetProcAddress('glVertexAttrib4fvNV'); + if not Assigned(glVertexAttrib4fvNV) then Exit; + glVertexAttrib4dvNV := wglGetProcAddress('glVertexAttrib4dvNV'); + if not Assigned(glVertexAttrib4dvNV) then Exit; + glVertexAttrib4ubvNV := wglGetProcAddress('glVertexAttrib4ubvNV'); + if not Assigned(glVertexAttrib4ubvNV) then Exit; + glVertexAttribs1svNV := wglGetProcAddress('glVertexAttribs1svNV'); + if not Assigned(glVertexAttribs1svNV) then Exit; + glVertexAttribs1fvNV := wglGetProcAddress('glVertexAttribs1fvNV'); + if not Assigned(glVertexAttribs1fvNV) then Exit; + glVertexAttribs1dvNV := wglGetProcAddress('glVertexAttribs1dvNV'); + if not Assigned(glVertexAttribs1dvNV) then Exit; + glVertexAttribs2svNV := wglGetProcAddress('glVertexAttribs2svNV'); + if not Assigned(glVertexAttribs2svNV) then Exit; + glVertexAttribs2fvNV := wglGetProcAddress('glVertexAttribs2fvNV'); + if not Assigned(glVertexAttribs2fvNV) then Exit; + glVertexAttribs2dvNV := wglGetProcAddress('glVertexAttribs2dvNV'); + if not Assigned(glVertexAttribs2dvNV) then Exit; + glVertexAttribs3svNV := wglGetProcAddress('glVertexAttribs3svNV'); + if not Assigned(glVertexAttribs3svNV) then Exit; + glVertexAttribs3fvNV := wglGetProcAddress('glVertexAttribs3fvNV'); + if not Assigned(glVertexAttribs3fvNV) then Exit; + glVertexAttribs3dvNV := wglGetProcAddress('glVertexAttribs3dvNV'); + if not Assigned(glVertexAttribs3dvNV) then Exit; + glVertexAttribs4svNV := wglGetProcAddress('glVertexAttribs4svNV'); + if not Assigned(glVertexAttribs4svNV) then Exit; + glVertexAttribs4fvNV := wglGetProcAddress('glVertexAttribs4fvNV'); + if not Assigned(glVertexAttribs4fvNV) then Exit; + glVertexAttribs4dvNV := wglGetProcAddress('glVertexAttribs4dvNV'); + if not Assigned(glVertexAttribs4dvNV) then Exit; + glVertexAttribs4ubvNV := wglGetProcAddress('glVertexAttribs4ubvNV'); + if not Assigned(glVertexAttribs4ubvNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_program1_1: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_program1_1', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ATI_element_array: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_element_array', extstring) then + begin + glElementPointerATI := wglGetProcAddress('glElementPointerATI'); + if not Assigned(glElementPointerATI) then Exit; + glDrawElementArrayATI := wglGetProcAddress('glDrawElementArrayATI'); + if not Assigned(glDrawElementArrayATI) then Exit; + glDrawRangeElementArrayATI := wglGetProcAddress('glDrawRangeElementArrayATI'); + if not Assigned(glDrawRangeElementArrayATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_envmap_bumpmap: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_envmap_bumpmap', extstring) then + begin + glTexBumpParameterivATI := wglGetProcAddress('glTexBumpParameterivATI'); + if not Assigned(glTexBumpParameterivATI) then Exit; + glTexBumpParameterfvATI := wglGetProcAddress('glTexBumpParameterfvATI'); + if not Assigned(glTexBumpParameterfvATI) then Exit; + glGetTexBumpParameterivATI := wglGetProcAddress('glGetTexBumpParameterivATI'); + if not Assigned(glGetTexBumpParameterivATI) then Exit; + glGetTexBumpParameterfvATI := wglGetProcAddress('glGetTexBumpParameterfvATI'); + if not Assigned(glGetTexBumpParameterfvATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_fragment_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_fragment_shader', extstring) then + begin + glGenFragmentShadersATI := wglGetProcAddress('glGenFragmentShadersATI'); + if not Assigned(glGenFragmentShadersATI) then Exit; + glBindFragmentShaderATI := wglGetProcAddress('glBindFragmentShaderATI'); + if not Assigned(glBindFragmentShaderATI) then Exit; + glDeleteFragmentShaderATI := wglGetProcAddress('glDeleteFragmentShaderATI'); + if not Assigned(glDeleteFragmentShaderATI) then Exit; + glBeginFragmentShaderATI := wglGetProcAddress('glBeginFragmentShaderATI'); + if not Assigned(glBeginFragmentShaderATI) then Exit; + glEndFragmentShaderATI := wglGetProcAddress('glEndFragmentShaderATI'); + if not Assigned(glEndFragmentShaderATI) then Exit; + glPassTexCoordATI := wglGetProcAddress('glPassTexCoordATI'); + if not Assigned(glPassTexCoordATI) then Exit; + glSampleMapATI := wglGetProcAddress('glSampleMapATI'); + if not Assigned(glSampleMapATI) then Exit; + glColorFragmentOp1ATI := wglGetProcAddress('glColorFragmentOp1ATI'); + if not Assigned(glColorFragmentOp1ATI) then Exit; + glColorFragmentOp2ATI := wglGetProcAddress('glColorFragmentOp2ATI'); + if not Assigned(glColorFragmentOp2ATI) then Exit; + glColorFragmentOp3ATI := wglGetProcAddress('glColorFragmentOp3ATI'); + if not Assigned(glColorFragmentOp3ATI) then Exit; + glAlphaFragmentOp1ATI := wglGetProcAddress('glAlphaFragmentOp1ATI'); + if not Assigned(glAlphaFragmentOp1ATI) then Exit; + glAlphaFragmentOp2ATI := wglGetProcAddress('glAlphaFragmentOp2ATI'); + if not Assigned(glAlphaFragmentOp2ATI) then Exit; + glAlphaFragmentOp3ATI := wglGetProcAddress('glAlphaFragmentOp3ATI'); + if not Assigned(glAlphaFragmentOp3ATI) then Exit; + glSetFragmentShaderConstantATI := wglGetProcAddress('glSetFragmentShaderConstantATI'); + if not Assigned(glSetFragmentShaderConstantATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_pn_triangles: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_pn_triangles', extstring) then + begin + glPNTrianglesiATI := wglGetProcAddress('glPNTrianglesiATI'); + if not Assigned(glPNTrianglesiATI) then Exit; + glPNTrianglesfATI := wglGetProcAddress('glPNTrianglesfATI'); + if not Assigned(glPNTrianglesfATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_texture_mirror_once: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_texture_mirror_once', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ATI_vertex_array_object: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_vertex_array_object', extstring) then + begin + glNewObjectBufferATI := wglGetProcAddress('glNewObjectBufferATI'); + if not Assigned(glNewObjectBufferATI) then Exit; + glIsObjectBufferATI := wglGetProcAddress('glIsObjectBufferATI'); + if not Assigned(glIsObjectBufferATI) then Exit; + glUpdateObjectBufferATI := wglGetProcAddress('glUpdateObjectBufferATI'); + if not Assigned(glUpdateObjectBufferATI) then Exit; + glGetObjectBufferfvATI := wglGetProcAddress('glGetObjectBufferfvATI'); + if not Assigned(glGetObjectBufferfvATI) then Exit; + glGetObjectBufferivATI := wglGetProcAddress('glGetObjectBufferivATI'); + if not Assigned(glGetObjectBufferivATI) then Exit; + glDeleteObjectBufferATI := wglGetProcAddress('glDeleteObjectBufferATI'); + if not Assigned(glDeleteObjectBufferATI) then Exit; + glArrayObjectATI := wglGetProcAddress('glArrayObjectATI'); + if not Assigned(glArrayObjectATI) then Exit; + glGetArrayObjectfvATI := wglGetProcAddress('glGetArrayObjectfvATI'); + if not Assigned(glGetArrayObjectfvATI) then Exit; + glGetArrayObjectivATI := wglGetProcAddress('glGetArrayObjectivATI'); + if not Assigned(glGetArrayObjectivATI) then Exit; + glVariantArrayObjectATI := wglGetProcAddress('glVariantArrayObjectATI'); + if not Assigned(glVariantArrayObjectATI) then Exit; + glGetVariantArrayObjectfvATI := wglGetProcAddress('glGetVariantArrayObjectfvATI'); + if not Assigned(glGetVariantArrayObjectfvATI) then Exit; + glGetVariantArrayObjectivATI := wglGetProcAddress('glGetVariantArrayObjectivATI'); + if not Assigned(glGetVariantArrayObjectivATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_vertex_streams: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_vertex_streams', extstring) then + begin + glVertexStream1s := wglGetProcAddress('glVertexStream1s'); + if not Assigned(glVertexStream1s) then Exit; + glVertexStream1i := wglGetProcAddress('glVertexStream1i'); + if not Assigned(glVertexStream1i) then Exit; + glVertexStream1f := wglGetProcAddress('glVertexStream1f'); + if not Assigned(glVertexStream1f) then Exit; + glVertexStream1d := wglGetProcAddress('glVertexStream1d'); + if not Assigned(glVertexStream1d) then Exit; + glVertexStream1sv := wglGetProcAddress('glVertexStream1sv'); + if not Assigned(glVertexStream1sv) then Exit; + glVertexStream1iv := wglGetProcAddress('glVertexStream1iv'); + if not Assigned(glVertexStream1iv) then Exit; + glVertexStream1fv := wglGetProcAddress('glVertexStream1fv'); + if not Assigned(glVertexStream1fv) then Exit; + glVertexStream1dv := wglGetProcAddress('glVertexStream1dv'); + if not Assigned(glVertexStream1dv) then Exit; + glVertexStream2s := wglGetProcAddress('glVertexStream2s'); + if not Assigned(glVertexStream2s) then Exit; + glVertexStream2i := wglGetProcAddress('glVertexStream2i'); + if not Assigned(glVertexStream2i) then Exit; + glVertexStream2f := wglGetProcAddress('glVertexStream2f'); + if not Assigned(glVertexStream2f) then Exit; + glVertexStream2d := wglGetProcAddress('glVertexStream2d'); + if not Assigned(glVertexStream2d) then Exit; + glVertexStream2sv := wglGetProcAddress('glVertexStream2sv'); + if not Assigned(glVertexStream2sv) then Exit; + glVertexStream2iv := wglGetProcAddress('glVertexStream2iv'); + if not Assigned(glVertexStream2iv) then Exit; + glVertexStream2fv := wglGetProcAddress('glVertexStream2fv'); + if not Assigned(glVertexStream2fv) then Exit; + glVertexStream2dv := wglGetProcAddress('glVertexStream2dv'); + if not Assigned(glVertexStream2dv) then Exit; + glVertexStream3s := wglGetProcAddress('glVertexStream3s'); + if not Assigned(glVertexStream3s) then Exit; + glVertexStream3i := wglGetProcAddress('glVertexStream3i'); + if not Assigned(glVertexStream3i) then Exit; + glVertexStream3f := wglGetProcAddress('glVertexStream3f'); + if not Assigned(glVertexStream3f) then Exit; + glVertexStream3d := wglGetProcAddress('glVertexStream3d'); + if not Assigned(glVertexStream3d) then Exit; + glVertexStream3sv := wglGetProcAddress('glVertexStream3sv'); + if not Assigned(glVertexStream3sv) then Exit; + glVertexStream3iv := wglGetProcAddress('glVertexStream3iv'); + if not Assigned(glVertexStream3iv) then Exit; + glVertexStream3fv := wglGetProcAddress('glVertexStream3fv'); + if not Assigned(glVertexStream3fv) then Exit; + glVertexStream3dv := wglGetProcAddress('glVertexStream3dv'); + if not Assigned(glVertexStream3dv) then Exit; + glVertexStream4s := wglGetProcAddress('glVertexStream4s'); + if not Assigned(glVertexStream4s) then Exit; + glVertexStream4i := wglGetProcAddress('glVertexStream4i'); + if not Assigned(glVertexStream4i) then Exit; + glVertexStream4f := wglGetProcAddress('glVertexStream4f'); + if not Assigned(glVertexStream4f) then Exit; + glVertexStream4d := wglGetProcAddress('glVertexStream4d'); + if not Assigned(glVertexStream4d) then Exit; + glVertexStream4sv := wglGetProcAddress('glVertexStream4sv'); + if not Assigned(glVertexStream4sv) then Exit; + glVertexStream4iv := wglGetProcAddress('glVertexStream4iv'); + if not Assigned(glVertexStream4iv) then Exit; + glVertexStream4fv := wglGetProcAddress('glVertexStream4fv'); + if not Assigned(glVertexStream4fv) then Exit; + glVertexStream4dv := wglGetProcAddress('glVertexStream4dv'); + if not Assigned(glVertexStream4dv) then Exit; + glNormalStream3b := wglGetProcAddress('glNormalStream3b'); + if not Assigned(glNormalStream3b) then Exit; + glNormalStream3s := wglGetProcAddress('glNormalStream3s'); + if not Assigned(glNormalStream3s) then Exit; + glNormalStream3i := wglGetProcAddress('glNormalStream3i'); + if not Assigned(glNormalStream3i) then Exit; + glNormalStream3f := wglGetProcAddress('glNormalStream3f'); + if not Assigned(glNormalStream3f) then Exit; + glNormalStream3d := wglGetProcAddress('glNormalStream3d'); + if not Assigned(glNormalStream3d) then Exit; + glNormalStream3bv := wglGetProcAddress('glNormalStream3bv'); + if not Assigned(glNormalStream3bv) then Exit; + glNormalStream3sv := wglGetProcAddress('glNormalStream3sv'); + if not Assigned(glNormalStream3sv) then Exit; + glNormalStream3iv := wglGetProcAddress('glNormalStream3iv'); + if not Assigned(glNormalStream3iv) then Exit; + glNormalStream3fv := wglGetProcAddress('glNormalStream3fv'); + if not Assigned(glNormalStream3fv) then Exit; + glNormalStream3dv := wglGetProcAddress('glNormalStream3dv'); + if not Assigned(glNormalStream3dv) then Exit; + glClientActiveVertexStream := wglGetProcAddress('glClientActiveVertexStream'); + if not Assigned(glClientActiveVertexStream) then Exit; + glVertexBlendEnvi := wglGetProcAddress('glVertexBlendEnvi'); + if not Assigned(glVertexBlendEnvi) then Exit; + glVertexBlendEnvf := wglGetProcAddress('glVertexBlendEnvf'); + if not Assigned(glVertexBlendEnvf) then Exit; + Result := TRUE; + end; + +end; + +{$IFDEF Windows} +function Load_WGL_I3D_image_buffer: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_image_buffer', extstring) then + begin + wglCreateImageBufferI3D := wglGetProcAddress('wglCreateImageBufferI3D'); + if not Assigned(wglCreateImageBufferI3D) then Exit; + wglDestroyImageBufferI3D := wglGetProcAddress('wglDestroyImageBufferI3D'); + if not Assigned(wglDestroyImageBufferI3D) then Exit; + wglAssociateImageBufferEventsI3D := wglGetProcAddress('wglAssociateImageBufferEventsI3D'); + if not Assigned(wglAssociateImageBufferEventsI3D) then Exit; + wglReleaseImageBufferEventsI3D := wglGetProcAddress('wglReleaseImageBufferEventsI3D'); + if not Assigned(wglReleaseImageBufferEventsI3D) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_I3D_swap_frame_lock: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_swap_frame_lock', extstring) then + begin + wglEnableFrameLockI3D := wglGetProcAddress('wglEnableFrameLockI3D'); + if not Assigned(wglEnableFrameLockI3D) then Exit; + wglDisableFrameLockI3D := wglGetProcAddress('wglDisableFrameLockI3D'); + if not Assigned(wglDisableFrameLockI3D) then Exit; + wglIsEnabledFrameLockI3D := wglGetProcAddress('wglIsEnabledFrameLockI3D'); + if not Assigned(wglIsEnabledFrameLockI3D) then Exit; + wglQueryFrameLockMasterI3D := wglGetProcAddress('wglQueryFrameLockMasterI3D'); + if not Assigned(wglQueryFrameLockMasterI3D) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_I3D_swap_frame_usage: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_swap_frame_usage', extstring) then + begin + wglGetFrameUsageI3D := wglGetProcAddress('wglGetFrameUsageI3D'); + if not Assigned(wglGetFrameUsageI3D) then Exit; + wglBeginFrameTrackingI3D := wglGetProcAddress('wglBeginFrameTrackingI3D'); + if not Assigned(wglBeginFrameTrackingI3D) then Exit; + wglEndFrameTrackingI3D := wglGetProcAddress('wglEndFrameTrackingI3D'); + if not Assigned(wglEndFrameTrackingI3D) then Exit; + wglQueryFrameTrackingI3D := wglGetProcAddress('wglQueryFrameTrackingI3D'); + if not Assigned(wglQueryFrameTrackingI3D) then Exit; + Result := TRUE; + end; + +end; +{$ENDIF} + +function Load_GL_3DFX_texture_compression_FXT1: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_3DFX_texture_compression_FXT1', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_IBM_cull_vertex: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_IBM_cull_vertex', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_IBM_multimode_draw_arrays: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_IBM_multimode_draw_arrays', extstring) then + begin + glMultiModeDrawArraysIBM := wglGetProcAddress('glMultiModeDrawArraysIBM'); + if not Assigned(glMultiModeDrawArraysIBM) then Exit; + glMultiModeDrawElementsIBM := wglGetProcAddress('glMultiModeDrawElementsIBM'); + if not Assigned(glMultiModeDrawElementsIBM) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_IBM_raster_pos_clip: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_IBM_raster_pos_clip', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_IBM_texture_mirrored_repeat: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_IBM_texture_mirrored_repeat', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_IBM_vertex_array_lists: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_IBM_vertex_array_lists', extstring) then + begin + glColorPointerListIBM := wglGetProcAddress('glColorPointerListIBM'); + if not Assigned(glColorPointerListIBM) then Exit; + glSecondaryColorPointerListIBM := wglGetProcAddress('glSecondaryColorPointerListIBM'); + if not Assigned(glSecondaryColorPointerListIBM) then Exit; + glEdgeFlagPointerListIBM := wglGetProcAddress('glEdgeFlagPointerListIBM'); + if not Assigned(glEdgeFlagPointerListIBM) then Exit; + glFogCoordPointerListIBM := wglGetProcAddress('glFogCoordPointerListIBM'); + if not Assigned(glFogCoordPointerListIBM) then Exit; + glNormalPointerListIBM := wglGetProcAddress('glNormalPointerListIBM'); + if not Assigned(glNormalPointerListIBM) then Exit; + glTexCoordPointerListIBM := wglGetProcAddress('glTexCoordPointerListIBM'); + if not Assigned(glTexCoordPointerListIBM) then Exit; + glVertexPointerListIBM := wglGetProcAddress('glVertexPointerListIBM'); + if not Assigned(glVertexPointerListIBM) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_MESA_resize_buffers: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_MESA_resize_buffers', extstring) then + begin + glResizeBuffersMESA := wglGetProcAddress('glResizeBuffersMESA'); + if not Assigned(glResizeBuffersMESA) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_MESA_window_pos: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_MESA_window_pos', extstring) then + begin + glWindowPos2dMESA := wglGetProcAddress('glWindowPos2dMESA'); + if not Assigned(glWindowPos2dMESA) then Exit; + glWindowPos2fMESA := wglGetProcAddress('glWindowPos2fMESA'); + if not Assigned(glWindowPos2fMESA) then Exit; + glWindowPos2iMESA := wglGetProcAddress('glWindowPos2iMESA'); + if not Assigned(glWindowPos2iMESA) then Exit; + glWindowPos2sMESA := wglGetProcAddress('glWindowPos2sMESA'); + if not Assigned(glWindowPos2sMESA) then Exit; + glWindowPos2ivMESA := wglGetProcAddress('glWindowPos2ivMESA'); + if not Assigned(glWindowPos2ivMESA) then Exit; + glWindowPos2svMESA := wglGetProcAddress('glWindowPos2svMESA'); + if not Assigned(glWindowPos2svMESA) then Exit; + glWindowPos2fvMESA := wglGetProcAddress('glWindowPos2fvMESA'); + if not Assigned(glWindowPos2fvMESA) then Exit; + glWindowPos2dvMESA := wglGetProcAddress('glWindowPos2dvMESA'); + if not Assigned(glWindowPos2dvMESA) then Exit; + glWindowPos3iMESA := wglGetProcAddress('glWindowPos3iMESA'); + if not Assigned(glWindowPos3iMESA) then Exit; + glWindowPos3sMESA := wglGetProcAddress('glWindowPos3sMESA'); + if not Assigned(glWindowPos3sMESA) then Exit; + glWindowPos3fMESA := wglGetProcAddress('glWindowPos3fMESA'); + if not Assigned(glWindowPos3fMESA) then Exit; + glWindowPos3dMESA := wglGetProcAddress('glWindowPos3dMESA'); + if not Assigned(glWindowPos3dMESA) then Exit; + glWindowPos3ivMESA := wglGetProcAddress('glWindowPos3ivMESA'); + if not Assigned(glWindowPos3ivMESA) then Exit; + glWindowPos3svMESA := wglGetProcAddress('glWindowPos3svMESA'); + if not Assigned(glWindowPos3svMESA) then Exit; + glWindowPos3fvMESA := wglGetProcAddress('glWindowPos3fvMESA'); + if not Assigned(glWindowPos3fvMESA) then Exit; + glWindowPos3dvMESA := wglGetProcAddress('glWindowPos3dvMESA'); + if not Assigned(glWindowPos3dvMESA) then Exit; + glWindowPos4iMESA := wglGetProcAddress('glWindowPos4iMESA'); + if not Assigned(glWindowPos4iMESA) then Exit; + glWindowPos4sMESA := wglGetProcAddress('glWindowPos4sMESA'); + if not Assigned(glWindowPos4sMESA) then Exit; + glWindowPos4fMESA := wglGetProcAddress('glWindowPos4fMESA'); + if not Assigned(glWindowPos4fMESA) then Exit; + glWindowPos4dMESA := wglGetProcAddress('glWindowPos4dMESA'); + if not Assigned(glWindowPos4dMESA) then Exit; + glWindowPos4ivMESA := wglGetProcAddress('glWindowPos4ivMESA'); + if not Assigned(glWindowPos4ivMESA) then Exit; + glWindowPos4svMESA := wglGetProcAddress('glWindowPos4svMESA'); + if not Assigned(glWindowPos4svMESA) then Exit; + glWindowPos4fvMESA := wglGetProcAddress('glWindowPos4fvMESA'); + if not Assigned(glWindowPos4fvMESA) then Exit; + glWindowPos4dvMESA := wglGetProcAddress('glWindowPos4dvMESA'); + if not Assigned(glWindowPos4dvMESA) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_OML_interlace: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_OML_interlace', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_OML_resample: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_OML_resample', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_OML_subsample: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_OML_subsample', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_generate_mipmap: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_generate_mipmap', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_multisample: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_multisample', extstring) then + begin + glSampleMaskSGIS := wglGetProcAddress('glSampleMaskSGIS'); + if not Assigned(glSampleMaskSGIS) then Exit; + glSamplePatternSGIS := wglGetProcAddress('glSamplePatternSGIS'); + if not Assigned(glSamplePatternSGIS) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_pixel_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_pixel_texture', extstring) then + begin + glPixelTexGenParameteriSGIS := wglGetProcAddress('glPixelTexGenParameteriSGIS'); + if not Assigned(glPixelTexGenParameteriSGIS) then Exit; + glPixelTexGenParameterfSGIS := wglGetProcAddress('glPixelTexGenParameterfSGIS'); + if not Assigned(glPixelTexGenParameterfSGIS) then Exit; + glGetPixelTexGenParameterivSGIS := wglGetProcAddress('glGetPixelTexGenParameterivSGIS'); + if not Assigned(glGetPixelTexGenParameterivSGIS) then Exit; + glGetPixelTexGenParameterfvSGIS := wglGetProcAddress('glGetPixelTexGenParameterfvSGIS'); + if not Assigned(glGetPixelTexGenParameterfvSGIS) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_texture_border_clamp: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_texture_border_clamp', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_texture_color_mask: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_texture_color_mask', extstring) then + begin + glTextureColorMaskSGIS := wglGetProcAddress('glTextureColorMaskSGIS'); + if not Assigned(glTextureColorMaskSGIS) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_texture_edge_clamp: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_texture_edge_clamp', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_texture_lod: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_texture_lod', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIS_depth_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIS_depth_texture', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIX_fog_offset: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIX_fog_offset', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIX_interlace: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIX_interlace', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGIX_shadow_ambient: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGIX_shadow_ambient', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGI_color_matrix: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGI_color_matrix', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SGI_color_table: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGI_color_table', extstring) then + begin + glColorTableSGI := wglGetProcAddress('glColorTableSGI'); + if not Assigned(glColorTableSGI) then Exit; + glCopyColorTableSGI := wglGetProcAddress('glCopyColorTableSGI'); + if not Assigned(glCopyColorTableSGI) then Exit; + glColorTableParameterivSGI := wglGetProcAddress('glColorTableParameterivSGI'); + if not Assigned(glColorTableParameterivSGI) then Exit; + glColorTableParameterfvSGI := wglGetProcAddress('glColorTableParameterfvSGI'); + if not Assigned(glColorTableParameterfvSGI) then Exit; + glGetColorTableSGI := wglGetProcAddress('glGetColorTableSGI'); + if not Assigned(glGetColorTableSGI) then Exit; + glGetColorTableParameterivSGI := wglGetProcAddress('glGetColorTableParameterivSGI'); + if not Assigned(glGetColorTableParameterivSGI) then Exit; + glGetColorTableParameterfvSGI := wglGetProcAddress('glGetColorTableParameterfvSGI'); + if not Assigned(glGetColorTableParameterfvSGI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_SGI_texture_color_table: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SGI_texture_color_table', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_SUN_vertex: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_SUN_vertex', extstring) then + begin + glColor4ubVertex2fSUN := wglGetProcAddress('glColor4ubVertex2fSUN'); + if not Assigned(glColor4ubVertex2fSUN) then Exit; + glColor4ubVertex2fvSUN := wglGetProcAddress('glColor4ubVertex2fvSUN'); + if not Assigned(glColor4ubVertex2fvSUN) then Exit; + glColor4ubVertex3fSUN := wglGetProcAddress('glColor4ubVertex3fSUN'); + if not Assigned(glColor4ubVertex3fSUN) then Exit; + glColor4ubVertex3fvSUN := wglGetProcAddress('glColor4ubVertex3fvSUN'); + if not Assigned(glColor4ubVertex3fvSUN) then Exit; + glColor3fVertex3fSUN := wglGetProcAddress('glColor3fVertex3fSUN'); + if not Assigned(glColor3fVertex3fSUN) then Exit; + glColor3fVertex3fvSUN := wglGetProcAddress('glColor3fVertex3fvSUN'); + if not Assigned(glColor3fVertex3fvSUN) then Exit; + glNormal3fVertex3fSUN := wglGetProcAddress('glNormal3fVertex3fSUN'); + if not Assigned(glNormal3fVertex3fSUN) then Exit; + glNormal3fVertex3fvSUN := wglGetProcAddress('glNormal3fVertex3fvSUN'); + if not Assigned(glNormal3fVertex3fvSUN) then Exit; + glColor4fNormal3fVertex3fSUN := wglGetProcAddress('glColor4fNormal3fVertex3fSUN'); + if not Assigned(glColor4fNormal3fVertex3fSUN) then Exit; + glColor4fNormal3fVertex3fvSUN := wglGetProcAddress('glColor4fNormal3fVertex3fvSUN'); + if not Assigned(glColor4fNormal3fVertex3fvSUN) then Exit; + glTexCoord2fVertex3fSUN := wglGetProcAddress('glTexCoord2fVertex3fSUN'); + if not Assigned(glTexCoord2fVertex3fSUN) then Exit; + glTexCoord2fVertex3fvSUN := wglGetProcAddress('glTexCoord2fVertex3fvSUN'); + if not Assigned(glTexCoord2fVertex3fvSUN) then Exit; + glTexCoord4fVertex4fSUN := wglGetProcAddress('glTexCoord4fVertex4fSUN'); + if not Assigned(glTexCoord4fVertex4fSUN) then Exit; + glTexCoord4fVertex4fvSUN := wglGetProcAddress('glTexCoord4fVertex4fvSUN'); + if not Assigned(glTexCoord4fVertex4fvSUN) then Exit; + glTexCoord2fColor4ubVertex3fSUN := wglGetProcAddress('glTexCoord2fColor4ubVertex3fSUN'); + if not Assigned(glTexCoord2fColor4ubVertex3fSUN) then Exit; + glTexCoord2fColor4ubVertex3fvSUN := wglGetProcAddress('glTexCoord2fColor4ubVertex3fvSUN'); + if not Assigned(glTexCoord2fColor4ubVertex3fvSUN) then Exit; + glTexCoord2fColor3fVertex3fSUN := wglGetProcAddress('glTexCoord2fColor3fVertex3fSUN'); + if not Assigned(glTexCoord2fColor3fVertex3fSUN) then Exit; + glTexCoord2fColor3fVertex3fvSUN := wglGetProcAddress('glTexCoord2fColor3fVertex3fvSUN'); + if not Assigned(glTexCoord2fColor3fVertex3fvSUN) then Exit; + glTexCoord2fNormal3fVertex3fSUN := wglGetProcAddress('glTexCoord2fNormal3fVertex3fSUN'); + if not Assigned(glTexCoord2fNormal3fVertex3fSUN) then Exit; + glTexCoord2fNormal3fVertex3fvSUN := wglGetProcAddress('glTexCoord2fNormal3fVertex3fvSUN'); + if not Assigned(glTexCoord2fNormal3fVertex3fvSUN) then Exit; + glTexCoord2fColor4fNormal3fVertex3fSUN := wglGetProcAddress('glTexCoord2fColor4fNormal3fVertex3fSUN'); + if not Assigned(glTexCoord2fColor4fNormal3fVertex3fSUN) then Exit; + glTexCoord2fColor4fNormal3fVertex3fvSUN := wglGetProcAddress('glTexCoord2fColor4fNormal3fVertex3fvSUN'); + if not Assigned(glTexCoord2fColor4fNormal3fVertex3fvSUN) then Exit; + glTexCoord4fColor4fNormal3fVertex4fSUN := wglGetProcAddress('glTexCoord4fColor4fNormal3fVertex4fSUN'); + if not Assigned(glTexCoord4fColor4fNormal3fVertex4fSUN) then Exit; + glTexCoord4fColor4fNormal3fVertex4fvSUN := wglGetProcAddress('glTexCoord4fColor4fNormal3fVertex4fvSUN'); + if not Assigned(glTexCoord4fColor4fNormal3fVertex4fvSUN) then Exit; + glReplacementCodeuiVertex3fSUN := wglGetProcAddress('glReplacementCodeuiVertex3fSUN'); + if not Assigned(glReplacementCodeuiVertex3fSUN) then Exit; + glReplacementCodeuiVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiVertex3fvSUN'); + if not Assigned(glReplacementCodeuiVertex3fvSUN) then Exit; + glReplacementCodeuiColor4ubVertex3fSUN := wglGetProcAddress('glReplacementCodeuiColor4ubVertex3fSUN'); + if not Assigned(glReplacementCodeuiColor4ubVertex3fSUN) then Exit; + glReplacementCodeuiColor4ubVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiColor4ubVertex3fvSUN'); + if not Assigned(glReplacementCodeuiColor4ubVertex3fvSUN) then Exit; + glReplacementCodeuiColor3fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiColor3fVertex3fSUN'); + if not Assigned(glReplacementCodeuiColor3fVertex3fSUN) then Exit; + glReplacementCodeuiColor3fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiColor3fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiColor3fVertex3fvSUN) then Exit; + glReplacementCodeuiNormal3fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiNormal3fVertex3fSUN'); + if not Assigned(glReplacementCodeuiNormal3fVertex3fSUN) then Exit; + glReplacementCodeuiNormal3fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiNormal3fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiNormal3fVertex3fvSUN) then Exit; + glReplacementCodeuiColor4fNormal3fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiColor4fNormal3fVertex3fSUN'); + if not Assigned(glReplacementCodeuiColor4fNormal3fVertex3fSUN) then Exit; + glReplacementCodeuiColor4fNormal3fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiColor4fNormal3fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiColor4fNormal3fVertex3fvSUN) then Exit; + glReplacementCodeuiTexCoord2fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fVertex3fSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fVertex3fSUN) then Exit; + glReplacementCodeuiTexCoord2fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fVertex3fvSUN) then Exit; + glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) then Exit; + glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) then Exit; + glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) then Exit; + glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN := wglGetProcAddress('glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN'); + if not Assigned(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_fragment_program: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_fragment_program', extstring) then + begin + glProgramStringARB := wglGetProcAddress('glProgramStringARB'); + if not Assigned(glProgramStringARB) then Exit; + glBindProgramARB := wglGetProcAddress('glBindProgramARB'); + if not Assigned(glBindProgramARB) then Exit; + glDeleteProgramsARB := wglGetProcAddress('glDeleteProgramsARB'); + if not Assigned(glDeleteProgramsARB) then Exit; + glGenProgramsARB := wglGetProcAddress('glGenProgramsARB'); + if not Assigned(glGenProgramsARB) then Exit; + glProgramEnvParameter4dARB := wglGetProcAddress('glProgramEnvParameter4dARB'); + if not Assigned(glProgramEnvParameter4dARB) then Exit; + glProgramEnvParameter4dvARB := wglGetProcAddress('glProgramEnvParameter4dvARB'); + if not Assigned(glProgramEnvParameter4dvARB) then Exit; + glProgramEnvParameter4fARB := wglGetProcAddress('glProgramEnvParameter4fARB'); + if not Assigned(glProgramEnvParameter4fARB) then Exit; + glProgramEnvParameter4fvARB := wglGetProcAddress('glProgramEnvParameter4fvARB'); + if not Assigned(glProgramEnvParameter4fvARB) then Exit; + glProgramLocalParameter4dARB := wglGetProcAddress('glProgramLocalParameter4dARB'); + if not Assigned(glProgramLocalParameter4dARB) then Exit; + glProgramLocalParameter4dvARB := wglGetProcAddress('glProgramLocalParameter4dvARB'); + if not Assigned(glProgramLocalParameter4dvARB) then Exit; + glProgramLocalParameter4fARB := wglGetProcAddress('glProgramLocalParameter4fARB'); + if not Assigned(glProgramLocalParameter4fARB) then Exit; + glProgramLocalParameter4fvARB := wglGetProcAddress('glProgramLocalParameter4fvARB'); + if not Assigned(glProgramLocalParameter4fvARB) then Exit; + glGetProgramEnvParameterdvARB := wglGetProcAddress('glGetProgramEnvParameterdvARB'); + if not Assigned(glGetProgramEnvParameterdvARB) then Exit; + glGetProgramEnvParameterfvARB := wglGetProcAddress('glGetProgramEnvParameterfvARB'); + if not Assigned(glGetProgramEnvParameterfvARB) then Exit; + glGetProgramLocalParameterdvARB := wglGetProcAddress('glGetProgramLocalParameterdvARB'); + if not Assigned(glGetProgramLocalParameterdvARB) then Exit; + glGetProgramLocalParameterfvARB := wglGetProcAddress('glGetProgramLocalParameterfvARB'); + if not Assigned(glGetProgramLocalParameterfvARB) then Exit; + glGetProgramivARB := wglGetProcAddress('glGetProgramivARB'); + if not Assigned(glGetProgramivARB) then Exit; + glGetProgramStringARB := wglGetProcAddress('glGetProgramStringARB'); + if not Assigned(glGetProgramStringARB) then Exit; + glIsProgramARB := wglGetProcAddress('glIsProgramARB'); + if not Assigned(glIsProgramARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_text_fragment_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_text_fragment_shader', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_APPLE_client_storage: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_APPLE_client_storage', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_APPLE_element_array: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_APPLE_element_array', extstring) then + begin + glElementPointerAPPLE := wglGetProcAddress('glElementPointerAPPLE'); + if not Assigned(glElementPointerAPPLE) then Exit; + glDrawElementArrayAPPLE := wglGetProcAddress('glDrawElementArrayAPPLE'); + if not Assigned(glDrawElementArrayAPPLE) then Exit; + glDrawRangeElementArrayAPPLE := wglGetProcAddress('glDrawRangeElementArrayAPPLE'); + if not Assigned(glDrawRangeElementArrayAPPLE) then Exit; + glMultiDrawElementArrayAPPLE := wglGetProcAddress('glMultiDrawElementArrayAPPLE'); + if not Assigned(glMultiDrawElementArrayAPPLE) then Exit; + glMultiDrawRangeElementArrayAPPLE := wglGetProcAddress('glMultiDrawRangeElementArrayAPPLE'); + if not Assigned(glMultiDrawRangeElementArrayAPPLE) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_APPLE_fence: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_APPLE_fence', extstring) then + begin + glGenFencesAPPLE := wglGetProcAddress('glGenFencesAPPLE'); + if not Assigned(glGenFencesAPPLE) then Exit; + glDeleteFencesAPPLE := wglGetProcAddress('glDeleteFencesAPPLE'); + if not Assigned(glDeleteFencesAPPLE) then Exit; + glSetFenceAPPLE := wglGetProcAddress('glSetFenceAPPLE'); + if not Assigned(glSetFenceAPPLE) then Exit; + glIsFenceAPPLE := wglGetProcAddress('glIsFenceAPPLE'); + if not Assigned(glIsFenceAPPLE) then Exit; + glTestFenceAPPLE := wglGetProcAddress('glTestFenceAPPLE'); + if not Assigned(glTestFenceAPPLE) then Exit; + glFinishFenceAPPLE := wglGetProcAddress('glFinishFenceAPPLE'); + if not Assigned(glFinishFenceAPPLE) then Exit; + glTestObjectAPPLE := wglGetProcAddress('glTestObjectAPPLE'); + if not Assigned(glTestObjectAPPLE) then Exit; + glFinishObjectAPPLE := wglGetProcAddress('glFinishObjectAPPLE'); + if not Assigned(glFinishObjectAPPLE) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_APPLE_vertex_array_object: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_APPLE_vertex_array_object', extstring) then + begin + glBindVertexArrayAPPLE := wglGetProcAddress('glBindVertexArrayAPPLE'); + if not Assigned(glBindVertexArrayAPPLE) then Exit; + glDeleteVertexArraysAPPLE := wglGetProcAddress('glDeleteVertexArraysAPPLE'); + if not Assigned(glDeleteVertexArraysAPPLE) then Exit; + glGenVertexArraysAPPLE := wglGetProcAddress('glGenVertexArraysAPPLE'); + if not Assigned(glGenVertexArraysAPPLE) then Exit; + glIsVertexArrayAPPLE := wglGetProcAddress('glIsVertexArrayAPPLE'); + if not Assigned(glIsVertexArrayAPPLE) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_APPLE_vertex_array_range: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_APPLE_vertex_array_range', extstring) then + begin + glVertexArrayRangeAPPLE := wglGetProcAddress('glVertexArrayRangeAPPLE'); + if not Assigned(glVertexArrayRangeAPPLE) then Exit; + glFlushVertexArrayRangeAPPLE := wglGetProcAddress('glFlushVertexArrayRangeAPPLE'); + if not Assigned(glFlushVertexArrayRangeAPPLE) then Exit; + glVertexArrayParameteriAPPLE := wglGetProcAddress('glVertexArrayParameteriAPPLE'); + if not Assigned(glVertexArrayParameteriAPPLE) then Exit; + Result := TRUE; + end; + +end; + + +function load_GL_ARB_vertex_buffer_object : boolean; + +var extstring:string; + +begin + load_GL_ARB_vertex_buffer_object:=false; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + if glext_ExtensionSupported('GL_ARB_vertex_buffer_object',extstring) then + begin + glBindBufferARB := wglGetProcAddress('glBindBufferARB'); + if not Assigned(glBindBufferARB) then Exit; + glDeleteBuffersARB := wglGetProcAddress('glDeleteBuffersARB'); + if not Assigned(glDeleteBuffersARB) then Exit; + glGenBuffersARB := wglGetProcAddress('glGenBuffersARB'); + if not Assigned(glGenBuffersARB) then Exit; + glIsBufferARB := wglGetProcAddress('glIsBufferARB'); + if not Assigned(glIsBufferARB) then Exit; + glBufferDataARB := wglGetProcAddress('glBufferDataARB'); + if not Assigned(glBufferDataARB) then Exit; + glGetBufferSubDataARB := wglGetProcAddress('glGetBufferSubDataARB'); + if not Assigned(glGetBufferSubDataARB) then Exit; + glMapBufferARB := wglGetProcAddress('glMapBufferARB'); + if not Assigned(glMapBufferARB) then Exit; + glUnmapBufferARB := wglGetProcAddress('glUnmapBufferARB'); + if not Assigned(glMapBufferARB) then Exit; + glGetBufferParameterivARB := wglGetProcAddress('glGetBufferParameterivARB'); + if not Assigned(glGetBufferParameterivARB) then Exit; + glGetBufferPointervARB := wglGetProcAddress('glGetBufferPointervARB'); + if not Assigned(glGetBufferPointervARB) then Exit; + end; + load_GL_ARB_vertex_buffer_object:=true; +end; + +{$IFDEF Windows} +function Load_WGL_ARB_pixel_format: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_pixel_format', extstring) then + begin + wglGetPixelFormatAttribivARB := wglGetProcAddress('wglGetPixelFormatAttribivARB'); + if not Assigned(wglGetPixelFormatAttribivARB) then Exit; + wglGetPixelFormatAttribfvARB := wglGetProcAddress('wglGetPixelFormatAttribfvARB'); + if not Assigned(wglGetPixelFormatAttribfvARB) then Exit; + wglChoosePixelFormatARB := wglGetProcAddress('wglChoosePixelFormatARB'); + if not Assigned(wglChoosePixelFormatARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_ARB_make_current_read: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_make_current_read', extstring) then + begin + wglMakeContextCurrentARB := wglGetProcAddress('wglMakeContextCurrentARB'); + if not Assigned(wglMakeContextCurrentARB) then Exit; + wglGetCurrentReadDCARB := wglGetProcAddress('wglGetCurrentReadDCARB'); + if not Assigned(wglGetCurrentReadDCARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_ARB_pbuffer: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_pbuffer', extstring) then + begin + wglCreatePbufferARB := wglGetProcAddress('wglCreatePbufferARB'); + if not Assigned(wglCreatePbufferARB) then Exit; + wglGetPbufferDCARB := wglGetProcAddress('wglGetPbufferDCARB'); + if not Assigned(wglGetPbufferDCARB) then Exit; + wglReleasePbufferDCARB := wglGetProcAddress('wglReleasePbufferDCARB'); + if not Assigned(wglReleasePbufferDCARB) then Exit; + wglDestroyPbufferARB := wglGetProcAddress('wglDestroyPbufferARB'); + if not Assigned(wglDestroyPbufferARB) then Exit; + wglQueryPbufferARB := wglGetProcAddress('wglQueryPbufferARB'); + if not Assigned(wglQueryPbufferARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_EXT_swap_control: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_EXT_swap_control', extstring) then + begin + wglSwapIntervalEXT := wglGetProcAddress('wglSwapIntervalEXT'); + if not Assigned(wglSwapIntervalEXT) then Exit; + wglGetSwapIntervalEXT := wglGetProcAddress('wglGetSwapIntervalEXT'); + if not Assigned(wglGetSwapIntervalEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_ARB_render_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_ARB_render_texture', extstring) then + begin + wglBindTexImageARB := wglGetProcAddress('wglBindTexImageARB'); + if not Assigned(wglBindTexImageARB) then Exit; + wglReleaseTexImageARB := wglGetProcAddress('wglReleaseTexImageARB'); + if not Assigned(wglReleaseTexImageARB) then Exit; + wglSetPbufferAttribARB := wglGetProcAddress('wglSetPbufferAttribARB'); + if not Assigned(wglSetPbufferAttribARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_EXT_extensions_string: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_EXT_extensions_string', extstring) then + begin + wglGetExtensionsStringEXT := wglGetProcAddress('wglGetExtensionsStringEXT'); + if not Assigned(wglGetExtensionsStringEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_EXT_make_current_read: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_EXT_make_current_read', extstring) then + begin + wglMakeContextCurrentEXT := wglGetProcAddress('wglMakeContextCurrentEXT'); + if not Assigned(wglMakeContextCurrentEXT) then Exit; + wglGetCurrentReadDCEXT := wglGetProcAddress('wglGetCurrentReadDCEXT'); + if not Assigned(wglGetCurrentReadDCEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_EXT_pbuffer: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_EXT_pbuffer', extstring) then + begin + wglCreatePbufferEXT := wglGetProcAddress('wglCreatePbufferEXT'); + if not Assigned(wglCreatePbufferEXT) then Exit; + wglGetPbufferDCEXT := wglGetProcAddress('wglGetPbufferDCEXT'); + if not Assigned(wglGetPbufferDCEXT) then Exit; + wglReleasePbufferDCEXT := wglGetProcAddress('wglReleasePbufferDCEXT'); + if not Assigned(wglReleasePbufferDCEXT) then Exit; + wglDestroyPbufferEXT := wglGetProcAddress('wglDestroyPbufferEXT'); + if not Assigned(wglDestroyPbufferEXT) then Exit; + wglQueryPbufferEXT := wglGetProcAddress('wglQueryPbufferEXT'); + if not Assigned(wglQueryPbufferEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_EXT_pixel_format: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_EXT_pixel_format', extstring) then + begin + wglGetPixelFormatAttribivEXT := wglGetProcAddress('wglGetPixelFormatAttribivEXT'); + if not Assigned(wglGetPixelFormatAttribivEXT) then Exit; + wglGetPixelFormatAttribfvEXT := wglGetProcAddress('wglGetPixelFormatAttribfvEXT'); + if not Assigned(wglGetPixelFormatAttribfvEXT) then Exit; + wglChoosePixelFormatEXT := wglGetProcAddress('wglChoosePixelFormatEXT'); + if not Assigned(wglChoosePixelFormatEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_I3D_digital_video_control: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_digital_video_control', extstring) then + begin + wglGetDigitalVideoParametersI3D := wglGetProcAddress('wglGetDigitalVideoParametersI3D'); + if not Assigned(wglGetDigitalVideoParametersI3D) then Exit; + wglSetDigitalVideoParametersI3D := wglGetProcAddress('wglSetDigitalVideoParametersI3D'); + if not Assigned(wglSetDigitalVideoParametersI3D) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_I3D_gamma: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_gamma', extstring) then + begin + wglGetGammaTableParametersI3D := wglGetProcAddress('wglGetGammaTableParametersI3D'); + if not Assigned(wglGetGammaTableParametersI3D) then Exit; + wglSetGammaTableParametersI3D := wglGetProcAddress('wglSetGammaTableParametersI3D'); + if not Assigned(wglSetGammaTableParametersI3D) then Exit; + wglGetGammaTableI3D := wglGetProcAddress('wglGetGammaTableI3D'); + if not Assigned(wglGetGammaTableI3D) then Exit; + wglSetGammaTableI3D := wglGetProcAddress('wglSetGammaTableI3D'); + if not Assigned(wglSetGammaTableI3D) then Exit; + Result := TRUE; + end; + +end; + +function Load_WGL_I3D_genlock: Boolean; +var + extstring: String; +begin + + Result := FALSE; + wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := String(PChar(wglGetExtensionsStringARB(wglGetCurrentDC))); + + if glext_ExtensionSupported('WGL_I3D_genlock', extstring) then + begin + wglEnableGenlockI3D := wglGetProcAddress('wglEnableGenlockI3D'); + if not Assigned(wglEnableGenlockI3D) then Exit; + wglDisableGenlockI3D := wglGetProcAddress('wglDisableGenlockI3D'); + if not Assigned(wglDisableGenlockI3D) then Exit; + wglIsEnabledGenlockI3D := wglGetProcAddress('wglIsEnabledGenlockI3D'); + if not Assigned(wglIsEnabledGenlockI3D) then Exit; + wglGenlockSourceI3D := wglGetProcAddress('wglGenlockSourceI3D'); + if not Assigned(wglGenlockSourceI3D) then Exit; + wglGetGenlockSourceI3D := wglGetProcAddress('wglGetGenlockSourceI3D'); + if not Assigned(wglGetGenlockSourceI3D) then Exit; + wglGenlockSourceEdgeI3D := wglGetProcAddress('wglGenlockSourceEdgeI3D'); + if not Assigned(wglGenlockSourceEdgeI3D) then Exit; + wglGetGenlockSourceEdgeI3D := wglGetProcAddress('wglGetGenlockSourceEdgeI3D'); + if not Assigned(wglGetGenlockSourceEdgeI3D) then Exit; + wglGenlockSampleRateI3D := wglGetProcAddress('wglGenlockSampleRateI3D'); + if not Assigned(wglGenlockSampleRateI3D) then Exit; + wglGetGenlockSampleRateI3D := wglGetProcAddress('wglGetGenlockSampleRateI3D'); + if not Assigned(wglGetGenlockSampleRateI3D) then Exit; + wglGenlockSourceDelayI3D := wglGetProcAddress('wglGenlockSourceDelayI3D'); + if not Assigned(wglGenlockSourceDelayI3D) then Exit; + wglGetGenlockSourceDelayI3D := wglGetProcAddress('wglGetGenlockSourceDelayI3D'); + if not Assigned(wglGetGenlockSourceDelayI3D) then Exit; + wglQueryGenlockMaxSourceDelayI3D := wglGetProcAddress('wglQueryGenlockMaxSourceDelayI3D'); + if not Assigned(wglQueryGenlockMaxSourceDelayI3D) then Exit; + Result := TRUE; + end; + +end; +{$ENDIF} + +function Load_GL_ARB_matrix_palette: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_matrix_palette', extstring) then + begin + glCurrentPaletteMatrixARB := wglGetProcAddress('glCurrentPaletteMatrixARB'); + if not Assigned(glCurrentPaletteMatrixARB) then Exit; + glMatrixIndexubvARB := wglGetProcAddress('glMatrixIndexubvARB'); + if not Assigned(glMatrixIndexubvARB) then Exit; + glMatrixIndexusvARB := wglGetProcAddress('glMatrixIndexusvARB'); + if not Assigned(glMatrixIndexusvARB) then Exit; + glMatrixIndexuivARB := wglGetProcAddress('glMatrixIndexuivARB'); + if not Assigned(glMatrixIndexuivARB) then Exit; + glMatrixIndexPointerARB := wglGetProcAddress('glMatrixIndexPointerARB'); + if not Assigned(glMatrixIndexPointerARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_element_array: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_element_array', extstring) then + begin + glElementPointerNV := wglGetProcAddress('glElementPointerNV'); + if not Assigned(glElementPointerNV) then Exit; + glDrawElementArrayNV := wglGetProcAddress('glDrawElementArrayNV'); + if not Assigned(glDrawElementArrayNV) then Exit; + glDrawRangeElementArrayNV := wglGetProcAddress('glDrawRangeElementArrayNV'); + if not Assigned(glDrawRangeElementArrayNV) then Exit; + glMultiDrawElementArrayNV := wglGetProcAddress('glMultiDrawElementArrayNV'); + if not Assigned(glMultiDrawElementArrayNV) then Exit; + glMultiDrawRangeElementArrayNV := wglGetProcAddress('glMultiDrawRangeElementArrayNV'); + if not Assigned(glMultiDrawRangeElementArrayNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_float_buffer: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_float_buffer', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_fragment_program: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_fragment_program', extstring) then + begin + glProgramNamedParameter4fNV := wglGetProcAddress('glProgramNamedParameter4fNV'); + if not Assigned(glProgramNamedParameter4fNV) then Exit; + glProgramNamedParameter4dNV := wglGetProcAddress('glProgramNamedParameter4dNV'); + if not Assigned(glProgramNamedParameter4dNV) then Exit; + glGetProgramNamedParameterfvNV := wglGetProcAddress('glGetProgramNamedParameterfvNV'); + if not Assigned(glGetProgramNamedParameterfvNV) then Exit; + glGetProgramNamedParameterdvNV := wglGetProcAddress('glGetProgramNamedParameterdvNV'); + if not Assigned(glGetProgramNamedParameterdvNV) then Exit; + glProgramLocalParameter4dARB := wglGetProcAddress('glProgramLocalParameter4dARB'); + if not Assigned(glProgramLocalParameter4dARB) then Exit; + glProgramLocalParameter4dvARB := wglGetProcAddress('glProgramLocalParameter4dvARB'); + if not Assigned(glProgramLocalParameter4dvARB) then Exit; + glProgramLocalParameter4fARB := wglGetProcAddress('glProgramLocalParameter4fARB'); + if not Assigned(glProgramLocalParameter4fARB) then Exit; + glProgramLocalParameter4fvARB := wglGetProcAddress('glProgramLocalParameter4fvARB'); + if not Assigned(glProgramLocalParameter4fvARB) then Exit; + glGetProgramLocalParameterdvARB := wglGetProcAddress('glGetProgramLocalParameterdvARB'); + if not Assigned(glGetProgramLocalParameterdvARB) then Exit; + glGetProgramLocalParameterfvARB := wglGetProcAddress('glGetProgramLocalParameterfvARB'); + if not Assigned(glGetProgramLocalParameterfvARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_primitive_restart: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_primitive_restart', extstring) then + begin + glPrimitiveRestartNV := wglGetProcAddress('glPrimitiveRestartNV'); + if not Assigned(glPrimitiveRestartNV) then Exit; + glPrimitiveRestartIndexNV := wglGetProcAddress('glPrimitiveRestartIndexNV'); + if not Assigned(glPrimitiveRestartIndexNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_program2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_program2', extstring) then + begin + Result := TRUE; + end; + +end; + +{$IFDEF Windows} +function Load_WGL_NV_render_texture_rectangle: Boolean; +var + extstring: String; +begin + + Result := FALSE; + @wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := wglGetExtensionsStringARB(wglGetCurrentDC); + + if glext_ExtensionSupported('WGL_NV_render_texture_rectangle', extstring) then + begin + Result := TRUE; + end; + +end; +{$ENDIF} + +function Load_GL_NV_pixel_data_range: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_pixel_data_range', extstring) then + begin + @glPixelDataRangeNV := wglGetProcAddress('glPixelDataRangeNV'); + if not Assigned(glPixelDataRangeNV) then Exit; + @glFlushPixelDataRangeNV := wglGetProcAddress('glFlushPixelDataRangeNV'); + if not Assigned(glFlushPixelDataRangeNV) then Exit; + {$IFDEF Windows} + @wglAllocateMemoryNV := wglGetProcAddress('wglAllocateMemoryNV'); + if not Assigned(wglAllocateMemoryNV) then Exit; + @wglFreeMemoryNV := wglGetProcAddress('wglFreeMemoryNV'); + if not Assigned(wglFreeMemoryNV) then Exit; + {$ENDIF} + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_rectangle: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_rectangle', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_S3_s3tc: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_S3_s3tc', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ATI_draw_buffers: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_draw_buffers', extstring) then + begin + @glDrawBuffersATI := wglGetProcAddress('glDrawBuffersATI'); + if not Assigned(glDrawBuffersATI) then Exit; + Result := TRUE; + end; + +end; + +{$IFDEF Windows} +function Load_WGL_ATI_pixel_format_float: Boolean; +var + extstring: String; +begin + + Result := FALSE; + @wglGetExtensionsStringARB := wglGetProcAddress('wglGetExtensionsStringARB'); + if not Assigned(wglGetExtensionsStringARB) then Exit; + extstring := wglGetExtensionsStringARB(wglGetCurrentDC); + + if glext_ExtensionSupported('WGL_ATI_pixel_format_float', extstring) then + begin + Result := TRUE; + end; + +end; +{$ENDIF} + +function Load_GL_ATI_texture_env_combine3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_texture_env_combine3', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ATI_texture_float: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_texture_float', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_texture_expand_normal: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_texture_expand_normal', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_half_float: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_half_float', extstring) then + begin + @glVertex2hNV := wglGetProcAddress('glVertex2hNV'); + if not Assigned(glVertex2hNV) then Exit; + @glVertex2hvNV := wglGetProcAddress('glVertex2hvNV'); + if not Assigned(glVertex2hvNV) then Exit; + @glVertex3hNV := wglGetProcAddress('glVertex3hNV'); + if not Assigned(glVertex3hNV) then Exit; + @glVertex3hvNV := wglGetProcAddress('glVertex3hvNV'); + if not Assigned(glVertex3hvNV) then Exit; + @glVertex4hNV := wglGetProcAddress('glVertex4hNV'); + if not Assigned(glVertex4hNV) then Exit; + @glVertex4hvNV := wglGetProcAddress('glVertex4hvNV'); + if not Assigned(glVertex4hvNV) then Exit; + @glNormal3hNV := wglGetProcAddress('glNormal3hNV'); + if not Assigned(glNormal3hNV) then Exit; + @glNormal3hvNV := wglGetProcAddress('glNormal3hvNV'); + if not Assigned(glNormal3hvNV) then Exit; + @glColor3hNV := wglGetProcAddress('glColor3hNV'); + if not Assigned(glColor3hNV) then Exit; + @glColor3hvNV := wglGetProcAddress('glColor3hvNV'); + if not Assigned(glColor3hvNV) then Exit; + @glColor4hNV := wglGetProcAddress('glColor4hNV'); + if not Assigned(glColor4hNV) then Exit; + @glColor4hvNV := wglGetProcAddress('glColor4hvNV'); + if not Assigned(glColor4hvNV) then Exit; + @glTexCoord1hNV := wglGetProcAddress('glTexCoord1hNV'); + if not Assigned(glTexCoord1hNV) then Exit; + @glTexCoord1hvNV := wglGetProcAddress('glTexCoord1hvNV'); + if not Assigned(glTexCoord1hvNV) then Exit; + @glTexCoord2hNV := wglGetProcAddress('glTexCoord2hNV'); + if not Assigned(glTexCoord2hNV) then Exit; + @glTexCoord2hvNV := wglGetProcAddress('glTexCoord2hvNV'); + if not Assigned(glTexCoord2hvNV) then Exit; + @glTexCoord3hNV := wglGetProcAddress('glTexCoord3hNV'); + if not Assigned(glTexCoord3hNV) then Exit; + @glTexCoord3hvNV := wglGetProcAddress('glTexCoord3hvNV'); + if not Assigned(glTexCoord3hvNV) then Exit; + @glTexCoord4hNV := wglGetProcAddress('glTexCoord4hNV'); + if not Assigned(glTexCoord4hNV) then Exit; + @glTexCoord4hvNV := wglGetProcAddress('glTexCoord4hvNV'); + if not Assigned(glTexCoord4hvNV) then Exit; + @glMultiTexCoord1hNV := wglGetProcAddress('glMultiTexCoord1hNV'); + if not Assigned(glMultiTexCoord1hNV) then Exit; + @glMultiTexCoord1hvNV := wglGetProcAddress('glMultiTexCoord1hvNV'); + if not Assigned(glMultiTexCoord1hvNV) then Exit; + @glMultiTexCoord2hNV := wglGetProcAddress('glMultiTexCoord2hNV'); + if not Assigned(glMultiTexCoord2hNV) then Exit; + @glMultiTexCoord2hvNV := wglGetProcAddress('glMultiTexCoord2hvNV'); + if not Assigned(glMultiTexCoord2hvNV) then Exit; + @glMultiTexCoord3hNV := wglGetProcAddress('glMultiTexCoord3hNV'); + if not Assigned(glMultiTexCoord3hNV) then Exit; + @glMultiTexCoord3hvNV := wglGetProcAddress('glMultiTexCoord3hvNV'); + if not Assigned(glMultiTexCoord3hvNV) then Exit; + @glMultiTexCoord4hNV := wglGetProcAddress('glMultiTexCoord4hNV'); + if not Assigned(glMultiTexCoord4hNV) then Exit; + @glMultiTexCoord4hvNV := wglGetProcAddress('glMultiTexCoord4hvNV'); + if not Assigned(glMultiTexCoord4hvNV) then Exit; + @glFogCoordhNV := wglGetProcAddress('glFogCoordhNV'); + if not Assigned(glFogCoordhNV) then Exit; + @glFogCoordhvNV := wglGetProcAddress('glFogCoordhvNV'); + if not Assigned(glFogCoordhvNV) then Exit; + @glSecondaryColor3hNV := wglGetProcAddress('glSecondaryColor3hNV'); + if not Assigned(glSecondaryColor3hNV) then Exit; + @glSecondaryColor3hvNV := wglGetProcAddress('glSecondaryColor3hvNV'); + if not Assigned(glSecondaryColor3hvNV) then Exit; + @glVertexWeighthNV := wglGetProcAddress('glVertexWeighthNV'); + if not Assigned(glVertexWeighthNV) then Exit; + @glVertexWeighthvNV := wglGetProcAddress('glVertexWeighthvNV'); + if not Assigned(glVertexWeighthvNV) then Exit; + @glVertexAttrib1hNV := wglGetProcAddress('glVertexAttrib1hNV'); + if not Assigned(glVertexAttrib1hNV) then Exit; + @glVertexAttrib1hvNV := wglGetProcAddress('glVertexAttrib1hvNV'); + if not Assigned(glVertexAttrib1hvNV) then Exit; + @glVertexAttrib2hNV := wglGetProcAddress('glVertexAttrib2hNV'); + if not Assigned(glVertexAttrib2hNV) then Exit; + @glVertexAttrib2hvNV := wglGetProcAddress('glVertexAttrib2hvNV'); + if not Assigned(glVertexAttrib2hvNV) then Exit; + @glVertexAttrib3hNV := wglGetProcAddress('glVertexAttrib3hNV'); + if not Assigned(glVertexAttrib3hNV) then Exit; + @glVertexAttrib3hvNV := wglGetProcAddress('glVertexAttrib3hvNV'); + if not Assigned(glVertexAttrib3hvNV) then Exit; + @glVertexAttrib4hNV := wglGetProcAddress('glVertexAttrib4hNV'); + if not Assigned(glVertexAttrib4hNV) then Exit; + @glVertexAttrib4hvNV := wglGetProcAddress('glVertexAttrib4hvNV'); + if not Assigned(glVertexAttrib4hvNV) then Exit; + @glVertexAttribs1hvNV := wglGetProcAddress('glVertexAttribs1hvNV'); + if not Assigned(glVertexAttribs1hvNV) then Exit; + @glVertexAttribs2hvNV := wglGetProcAddress('glVertexAttribs2hvNV'); + if not Assigned(glVertexAttribs2hvNV) then Exit; + @glVertexAttribs3hvNV := wglGetProcAddress('glVertexAttribs3hvNV'); + if not Assigned(glVertexAttribs3hvNV) then Exit; + @glVertexAttribs4hvNV := wglGetProcAddress('glVertexAttribs4hvNV'); + if not Assigned(glVertexAttribs4hvNV) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_map_object_buffer: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_map_object_buffer', extstring) then + begin + @glMapObjectBufferATI := wglGetProcAddress('glMapObjectBufferATI'); + if not Assigned(glMapObjectBufferATI) then Exit; + @glUnmapObjectBufferATI := wglGetProcAddress('glUnmapObjectBufferATI'); + if not Assigned(glUnmapObjectBufferATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_separate_stencil: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_separate_stencil', extstring) then + begin + @glStencilOpSeparateATI := wglGetProcAddress('glStencilOpSeparateATI'); + if not Assigned(glStencilOpSeparateATI) then Exit; + @glStencilFuncSeparateATI := wglGetProcAddress('glStencilFuncSeparateATI'); + if not Assigned(glStencilFuncSeparateATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ATI_vertex_attrib_array_object: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ATI_vertex_attrib_array_object', extstring) then + begin + @glVertexAttribArrayObjectATI := wglGetProcAddress('glVertexAttribArrayObjectATI'); + if not Assigned(glVertexAttribArrayObjectATI) then Exit; + @glGetVertexAttribArrayObjectfvATI := wglGetProcAddress('glGetVertexAttribArrayObjectfvATI'); + if not Assigned(glGetVertexAttribArrayObjectfvATI) then Exit; + @glGetVertexAttribArrayObjectivATI := wglGetProcAddress('glGetVertexAttribArrayObjectivATI'); + if not Assigned(glGetVertexAttribArrayObjectivATI) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_occlusion_query: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_occlusion_query', extstring) then + begin + @glGenQueriesARB := wglGetProcAddress('glGenQueriesARB'); + if not Assigned(glGenQueriesARB) then Exit; + @glDeleteQueriesARB := wglGetProcAddress('glDeleteQueriesARB'); + if not Assigned(glDeleteQueriesARB) then Exit; + @glIsQueryARB := wglGetProcAddress('glIsQueryARB'); + if not Assigned(glIsQueryARB) then Exit; + @glBeginQueryARB := wglGetProcAddress('glBeginQueryARB'); + if not Assigned(glBeginQueryARB) then Exit; + @glEndQueryARB := wglGetProcAddress('glEndQueryARB'); + if not Assigned(glEndQueryARB) then Exit; + @glGetQueryivARB := wglGetProcAddress('glGetQueryivARB'); + if not Assigned(glGetQueryivARB) then Exit; + @glGetQueryObjectivARB := wglGetProcAddress('glGetQueryObjectivARB'); + if not Assigned(glGetQueryObjectivARB) then Exit; + @glGetQueryObjectuivARB := wglGetProcAddress('glGetQueryObjectuivARB'); + if not Assigned(glGetQueryObjectuivARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_shader_objects: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_shader_objects', extstring) then + begin + @glDeleteObjectARB := wglGetProcAddress('glDeleteObjectARB'); + if not Assigned(glDeleteObjectARB) then Exit; + @glGetHandleARB := wglGetProcAddress('glGetHandleARB'); + if not Assigned(glGetHandleARB) then Exit; + @glDetachObjectARB := wglGetProcAddress('glDetachObjectARB'); + if not Assigned(glDetachObjectARB) then Exit; + @glCreateShaderObjectARB := wglGetProcAddress('glCreateShaderObjectARB'); + if not Assigned(glCreateShaderObjectARB) then Exit; + @glShaderSourceARB := wglGetProcAddress('glShaderSourceARB'); + if not Assigned(glShaderSourceARB) then Exit; + @glCompileShaderARB := wglGetProcAddress('glCompileShaderARB'); + if not Assigned(glCompileShaderARB) then Exit; + @glCreateProgramObjectARB := wglGetProcAddress('glCreateProgramObjectARB'); + if not Assigned(glCreateProgramObjectARB) then Exit; + @glAttachObjectARB := wglGetProcAddress('glAttachObjectARB'); + if not Assigned(glAttachObjectARB) then Exit; + @glLinkProgramARB := wglGetProcAddress('glLinkProgramARB'); + if not Assigned(glLinkProgramARB) then Exit; + @glUseProgramObjectARB := wglGetProcAddress('glUseProgramObjectARB'); + if not Assigned(glUseProgramObjectARB) then Exit; + @glValidateProgramARB := wglGetProcAddress('glValidateProgramARB'); + if not Assigned(glValidateProgramARB) then Exit; + @glUniform1fARB := wglGetProcAddress('glUniform1fARB'); + if not Assigned(glUniform1fARB) then Exit; + @glUniform2fARB := wglGetProcAddress('glUniform2fARB'); + if not Assigned(glUniform2fARB) then Exit; + @glUniform3fARB := wglGetProcAddress('glUniform3fARB'); + if not Assigned(glUniform3fARB) then Exit; + @glUniform4fARB := wglGetProcAddress('glUniform4fARB'); + if not Assigned(glUniform4fARB) then Exit; + @glUniform1iARB := wglGetProcAddress('glUniform1iARB'); + if not Assigned(glUniform1iARB) then Exit; + @glUniform2iARB := wglGetProcAddress('glUniform2iARB'); + if not Assigned(glUniform2iARB) then Exit; + @glUniform3iARB := wglGetProcAddress('glUniform3iARB'); + if not Assigned(glUniform3iARB) then Exit; + @glUniform4iARB := wglGetProcAddress('glUniform4iARB'); + if not Assigned(glUniform4iARB) then Exit; + @glUniform1fvARB := wglGetProcAddress('glUniform1fvARB'); + if not Assigned(glUniform1fvARB) then Exit; + @glUniform2fvARB := wglGetProcAddress('glUniform2fvARB'); + if not Assigned(glUniform2fvARB) then Exit; + @glUniform3fvARB := wglGetProcAddress('glUniform3fvARB'); + if not Assigned(glUniform3fvARB) then Exit; + @glUniform4fvARB := wglGetProcAddress('glUniform4fvARB'); + if not Assigned(glUniform4fvARB) then Exit; + @glUniform1ivARB := wglGetProcAddress('glUniform1ivARB'); + if not Assigned(glUniform1ivARB) then Exit; + @glUniform2ivARB := wglGetProcAddress('glUniform2ivARB'); + if not Assigned(glUniform2ivARB) then Exit; + @glUniform3ivARB := wglGetProcAddress('glUniform3ivARB'); + if not Assigned(glUniform3ivARB) then Exit; + @glUniform4ivARB := wglGetProcAddress('glUniform4ivARB'); + if not Assigned(glUniform4ivARB) then Exit; + @glUniformMatrix2fvARB := wglGetProcAddress('glUniformMatrix2fvARB'); + if not Assigned(glUniformMatrix2fvARB) then Exit; + @glUniformMatrix3fvARB := wglGetProcAddress('glUniformMatrix3fvARB'); + if not Assigned(glUniformMatrix3fvARB) then Exit; + @glUniformMatrix4fvARB := wglGetProcAddress('glUniformMatrix4fvARB'); + if not Assigned(glUniformMatrix4fvARB) then Exit; + @glGetObjectParameterfvARB := wglGetProcAddress('glGetObjectParameterfvARB'); + if not Assigned(glGetObjectParameterfvARB) then Exit; + @glGetObjectParameterivARB := wglGetProcAddress('glGetObjectParameterivARB'); + if not Assigned(glGetObjectParameterivARB) then Exit; + @glGetInfoLogARB := wglGetProcAddress('glGetInfoLogARB'); + if not Assigned(glGetInfoLogARB) then Exit; + @glGetAttachedObjectsARB := wglGetProcAddress('glGetAttachedObjectsARB'); + if not Assigned(glGetAttachedObjectsARB) then Exit; + @glGetUniformLocationARB := wglGetProcAddress('glGetUniformLocationARB'); + if not Assigned(glGetUniformLocationARB) then Exit; + @glGetActiveUniformARB := wglGetProcAddress('glGetActiveUniformARB'); + if not Assigned(glGetActiveUniformARB) then Exit; + @glGetUniformfvARB := wglGetProcAddress('glGetUniformfvARB'); + if not Assigned(glGetUniformfvARB) then Exit; + @glGetUniformivARB := wglGetProcAddress('glGetUniformivARB'); + if not Assigned(glGetUniformivARB) then Exit; + @glGetShaderSourceARB := wglGetProcAddress('glGetShaderSourceARB'); + if not Assigned(glGetShaderSourceARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_vertex_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_vertex_shader', extstring) then + begin + @glVertexAttrib1fARB := wglGetProcAddress('glVertexAttrib1fARB'); + if not Assigned(glVertexAttrib1fARB) then Exit; + @glVertexAttrib1sARB := wglGetProcAddress('glVertexAttrib1sARB'); + if not Assigned(glVertexAttrib1sARB) then Exit; + @glVertexAttrib1dARB := wglGetProcAddress('glVertexAttrib1dARB'); + if not Assigned(glVertexAttrib1dARB) then Exit; + @glVertexAttrib2fARB := wglGetProcAddress('glVertexAttrib2fARB'); + if not Assigned(glVertexAttrib2fARB) then Exit; + @glVertexAttrib2sARB := wglGetProcAddress('glVertexAttrib2sARB'); + if not Assigned(glVertexAttrib2sARB) then Exit; + @glVertexAttrib2dARB := wglGetProcAddress('glVertexAttrib2dARB'); + if not Assigned(glVertexAttrib2dARB) then Exit; + @glVertexAttrib3fARB := wglGetProcAddress('glVertexAttrib3fARB'); + if not Assigned(glVertexAttrib3fARB) then Exit; + @glVertexAttrib3sARB := wglGetProcAddress('glVertexAttrib3sARB'); + if not Assigned(glVertexAttrib3sARB) then Exit; + @glVertexAttrib3dARB := wglGetProcAddress('glVertexAttrib3dARB'); + if not Assigned(glVertexAttrib3dARB) then Exit; + @glVertexAttrib4fARB := wglGetProcAddress('glVertexAttrib4fARB'); + if not Assigned(glVertexAttrib4fARB) then Exit; + @glVertexAttrib4sARB := wglGetProcAddress('glVertexAttrib4sARB'); + if not Assigned(glVertexAttrib4sARB) then Exit; + @glVertexAttrib4dARB := wglGetProcAddress('glVertexAttrib4dARB'); + if not Assigned(glVertexAttrib4dARB) then Exit; + @glVertexAttrib4NubARB := wglGetProcAddress('glVertexAttrib4NubARB'); + if not Assigned(glVertexAttrib4NubARB) then Exit; + @glVertexAttrib1fvARB := wglGetProcAddress('glVertexAttrib1fvARB'); + if not Assigned(glVertexAttrib1fvARB) then Exit; + @glVertexAttrib1svARB := wglGetProcAddress('glVertexAttrib1svARB'); + if not Assigned(glVertexAttrib1svARB) then Exit; + @glVertexAttrib1dvARB := wglGetProcAddress('glVertexAttrib1dvARB'); + if not Assigned(glVertexAttrib1dvARB) then Exit; + @glVertexAttrib2fvARB := wglGetProcAddress('glVertexAttrib2fvARB'); + if not Assigned(glVertexAttrib2fvARB) then Exit; + @glVertexAttrib2svARB := wglGetProcAddress('glVertexAttrib2svARB'); + if not Assigned(glVertexAttrib2svARB) then Exit; + @glVertexAttrib2dvARB := wglGetProcAddress('glVertexAttrib2dvARB'); + if not Assigned(glVertexAttrib2dvARB) then Exit; + @glVertexAttrib3fvARB := wglGetProcAddress('glVertexAttrib3fvARB'); + if not Assigned(glVertexAttrib3fvARB) then Exit; + @glVertexAttrib3svARB := wglGetProcAddress('glVertexAttrib3svARB'); + if not Assigned(glVertexAttrib3svARB) then Exit; + @glVertexAttrib3dvARB := wglGetProcAddress('glVertexAttrib3dvARB'); + if not Assigned(glVertexAttrib3dvARB) then Exit; + @glVertexAttrib4fvARB := wglGetProcAddress('glVertexAttrib4fvARB'); + if not Assigned(glVertexAttrib4fvARB) then Exit; + @glVertexAttrib4svARB := wglGetProcAddress('glVertexAttrib4svARB'); + if not Assigned(glVertexAttrib4svARB) then Exit; + @glVertexAttrib4dvARB := wglGetProcAddress('glVertexAttrib4dvARB'); + if not Assigned(glVertexAttrib4dvARB) then Exit; + @glVertexAttrib4ivARB := wglGetProcAddress('glVertexAttrib4ivARB'); + if not Assigned(glVertexAttrib4ivARB) then Exit; + @glVertexAttrib4bvARB := wglGetProcAddress('glVertexAttrib4bvARB'); + if not Assigned(glVertexAttrib4bvARB) then Exit; + @glVertexAttrib4ubvARB := wglGetProcAddress('glVertexAttrib4ubvARB'); + if not Assigned(glVertexAttrib4ubvARB) then Exit; + @glVertexAttrib4usvARB := wglGetProcAddress('glVertexAttrib4usvARB'); + if not Assigned(glVertexAttrib4usvARB) then Exit; + @glVertexAttrib4uivARB := wglGetProcAddress('glVertexAttrib4uivARB'); + if not Assigned(glVertexAttrib4uivARB) then Exit; + @glVertexAttrib4NbvARB := wglGetProcAddress('glVertexAttrib4NbvARB'); + if not Assigned(glVertexAttrib4NbvARB) then Exit; + @glVertexAttrib4NsvARB := wglGetProcAddress('glVertexAttrib4NsvARB'); + if not Assigned(glVertexAttrib4NsvARB) then Exit; + @glVertexAttrib4NivARB := wglGetProcAddress('glVertexAttrib4NivARB'); + if not Assigned(glVertexAttrib4NivARB) then Exit; + @glVertexAttrib4NubvARB := wglGetProcAddress('glVertexAttrib4NubvARB'); + if not Assigned(glVertexAttrib4NubvARB) then Exit; + @glVertexAttrib4NusvARB := wglGetProcAddress('glVertexAttrib4NusvARB'); + if not Assigned(glVertexAttrib4NusvARB) then Exit; + @glVertexAttrib4NuivARB := wglGetProcAddress('glVertexAttrib4NuivARB'); + if not Assigned(glVertexAttrib4NuivARB) then Exit; + @glVertexAttribPointerARB := wglGetProcAddress('glVertexAttribPointerARB'); + if not Assigned(glVertexAttribPointerARB) then Exit; + @glEnableVertexAttribArrayARB := wglGetProcAddress('glEnableVertexAttribArrayARB'); + if not Assigned(glEnableVertexAttribArrayARB) then Exit; + @glDisableVertexAttribArrayARB := wglGetProcAddress('glDisableVertexAttribArrayARB'); + if not Assigned(glDisableVertexAttribArrayARB) then Exit; + @glBindAttribLocationARB := wglGetProcAddress('glBindAttribLocationARB'); + if not Assigned(glBindAttribLocationARB) then Exit; + @glGetActiveAttribARB := wglGetProcAddress('glGetActiveAttribARB'); + if not Assigned(glGetActiveAttribARB) then Exit; + @glGetAttribLocationARB := wglGetProcAddress('glGetAttribLocationARB'); + if not Assigned(glGetAttribLocationARB) then Exit; + @glGetVertexAttribdvARB := wglGetProcAddress('glGetVertexAttribdvARB'); + if not Assigned(glGetVertexAttribdvARB) then Exit; + @glGetVertexAttribfvARB := wglGetProcAddress('glGetVertexAttribfvARB'); + if not Assigned(glGetVertexAttribfvARB) then Exit; + @glGetVertexAttribivARB := wglGetProcAddress('glGetVertexAttribivARB'); + if not Assigned(glGetVertexAttribivARB) then Exit; + @glGetVertexAttribPointervARB := wglGetProcAddress('glGetVertexAttribPointervARB'); + if not Assigned(glGetVertexAttribPointervARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_fragment_shader: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_fragment_shader', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_shading_language_100: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_shading_language_100', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_non_power_of_two: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_texture_non_power_of_two', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_point_sprite: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_point_sprite', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_depth_bounds_test: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_depth_bounds_test', extstring) then + begin + @glDepthBoundsEXT := wglGetProcAddress('glDepthBoundsEXT'); + if not Assigned(glDepthBoundsEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_mirror_clamp: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_texture_mirror_clamp', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_blend_equation_separate: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_blend_equation_separate', extstring) then + begin + @glBlendEquationSeparateEXT := wglGetProcAddress('glBlendEquationSeparateEXT'); + if not Assigned(glBlendEquationSeparateEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_MESA_pack_invert: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_MESA_pack_invert', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_MESA_ycbcr_texture: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_MESA_ycbcr_texture', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_fragment_program_shadow: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_ARB_fragment_program_shadow', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_fragment_program_option: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_fragment_program_option', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_pixel_buffer_object: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_EXT_pixel_buffer_object', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_fragment_program2: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_fragment_program2', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_program2_option: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_program2_option', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_NV_vertex_program3: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + if glext_ExtensionSupported('GL_NV_vertex_program3', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_draw_buffers: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_draw_buffers', extstring) then + begin + glDrawBuffersARB := wglGetProcAddress('glDrawBuffersARB'); + if not Assigned(glDrawBuffersARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_rectangle: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_texture_rectangle', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_color_buffer_float: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_color_buffer_float', extstring) then + begin + glClampColorARB := wglGetProcAddress('glClampColorARB'); + if not Assigned(glClampColorARB) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_ARB_half_float_pixel: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_half_float_pixel', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_texture_float: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_texture_float', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_texture_compression_dxt1: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_EXT_texture_compression_dxt1', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_ARB_pixel_buffer_object: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_ARB_pixel_buffer_object', extstring) then + begin + Result := TRUE; + end; + +end; + +function Load_GL_EXT_framebuffer_object: Boolean; +var + extstring: PChar; +begin + + Result := FALSE; + extstring := glGetString(GL_EXTENSIONS); + + if glext_ExtensionSupported('GL_EXT_framebuffer_object', extstring) then + begin + glIsRenderbufferEXT := wglGetProcAddress('glIsRenderbufferEXT'); + if not Assigned(glIsRenderbufferEXT) then Exit; + glBindRenderbufferEXT := wglGetProcAddress('glBindRenderbufferEXT'); + if not Assigned(glBindRenderbufferEXT) then Exit; + glDeleteRenderbuffersEXT := wglGetProcAddress('glDeleteRenderbuffersEXT'); + if not Assigned(glDeleteRenderbuffersEXT) then Exit; + glGenRenderbuffersEXT := wglGetProcAddress('glGenRenderbuffersEXT'); + if not Assigned(glGenRenderbuffersEXT) then Exit; + glRenderbufferStorageEXT := wglGetProcAddress('glRenderbufferStorageEXT'); + if not Assigned(glRenderbufferStorageEXT) then Exit; + glGetRenderbufferParameterivEXT := wglGetProcAddress('glGetRenderbufferParameterivEXT'); + if not Assigned(glGetRenderbufferParameterivEXT) then Exit; + glIsFramebufferEXT := wglGetProcAddress('glIsFramebufferEXT'); + if not Assigned(glIsFramebufferEXT) then Exit; + glBindFramebufferEXT := wglGetProcAddress('glBindFramebufferEXT'); + if not Assigned(glBindFramebufferEXT) then Exit; + glDeleteFramebuffersEXT := wglGetProcAddress('glDeleteFramebuffersEXT'); + if not Assigned(glDeleteFramebuffersEXT) then Exit; + glGenFramebuffersEXT := wglGetProcAddress('glGenFramebuffersEXT'); + if not Assigned(glGenFramebuffersEXT) then Exit; + glCheckFramebufferStatusEXT := wglGetProcAddress('glCheckFramebufferStatusEXT'); + if not Assigned(glCheckFramebufferStatusEXT) then Exit; + glFramebufferTexture1DEXT := wglGetProcAddress('glFramebufferTexture1DEXT'); + if not Assigned(glFramebufferTexture1DEXT) then Exit; + glFramebufferTexture2DEXT := wglGetProcAddress('glFramebufferTexture2DEXT'); + if not Assigned(glFramebufferTexture2DEXT) then Exit; + glFramebufferTexture3DEXT := wglGetProcAddress('glFramebufferTexture3DEXT'); + if not Assigned(glFramebufferTexture3DEXT) then Exit; + glFramebufferRenderbufferEXT := wglGetProcAddress('glFramebufferRenderbufferEXT'); + if not Assigned(glFramebufferRenderbufferEXT) then Exit; + glGetFramebufferAttachmentParameterivEXT := wglGetProcAddress('glGetFramebufferAttachmentParameterivEXT'); + if not Assigned(glGetFramebufferAttachmentParameterivEXT) then Exit; + glGenerateMipmapEXT := wglGetProcAddress('glGenerateMipmapEXT'); + if not Assigned(glGenerateMipmapEXT) then Exit; + Result := TRUE; + end; + +end; + +function Load_GL_version_1_4: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + glBlendFuncSeparate := wglGetProcAddress('glBlendFuncSeparate'); + if not Assigned(glBlendFuncSeparate) then Exit; + glFogCoordf := wglGetProcAddress('glFogCoordf'); + if not Assigned(glFogCoordf) then Exit; + glFogCoordfv := wglGetProcAddress('glFogCoordfv'); + if not Assigned(glFogCoordfv) then Exit; + glFogCoordd := wglGetProcAddress('glFogCoordd'); + if not Assigned(glFogCoordd) then Exit; + glFogCoorddv := wglGetProcAddress('glFogCoorddv'); + if not Assigned(glFogCoorddv) then Exit; + glFogCoordPointer := wglGetProcAddress('glFogCoordPointer'); + if not Assigned(glFogCoordPointer) then Exit; + glMultiDrawArrays := wglGetProcAddress('glMultiDrawArrays'); + if not Assigned(glMultiDrawArrays) then Exit; + glMultiDrawElements := wglGetProcAddress('glMultiDrawElements'); + if not Assigned(glMultiDrawElements) then Exit; + glPointParameterf := wglGetProcAddress('glPointParameterf'); + if not Assigned(glPointParameterf) then Exit; + glPointParameterfv := wglGetProcAddress('glPointParameterfv'); + if not Assigned(glPointParameterfv) then Exit; + glPointParameteri := wglGetProcAddress('glPointParameteri'); + if not Assigned(glPointParameteri) then Exit; + glPointParameteriv := wglGetProcAddress('glPointParameteriv'); + if not Assigned(glPointParameteriv) then Exit; + glSecondaryColor3b := wglGetProcAddress('glSecondaryColor3b'); + if not Assigned(glSecondaryColor3b) then Exit; + glSecondaryColor3bv := wglGetProcAddress('glSecondaryColor3bv'); + if not Assigned(glSecondaryColor3bv) then Exit; + glSecondaryColor3d := wglGetProcAddress('glSecondaryColor3d'); + if not Assigned(glSecondaryColor3d) then Exit; + glSecondaryColor3dv := wglGetProcAddress('glSecondaryColor3dv'); + if not Assigned(glSecondaryColor3dv) then Exit; + glSecondaryColor3f := wglGetProcAddress('glSecondaryColor3f'); + if not Assigned(glSecondaryColor3f) then Exit; + glSecondaryColor3fv := wglGetProcAddress('glSecondaryColor3fv'); + if not Assigned(glSecondaryColor3fv) then Exit; + glSecondaryColor3i := wglGetProcAddress('glSecondaryColor3i'); + if not Assigned(glSecondaryColor3i) then Exit; + glSecondaryColor3iv := wglGetProcAddress('glSecondaryColor3iv'); + if not Assigned(glSecondaryColor3iv) then Exit; + glSecondaryColor3s := wglGetProcAddress('glSecondaryColor3s'); + if not Assigned(glSecondaryColor3s) then Exit; + glSecondaryColor3sv := wglGetProcAddress('glSecondaryColor3sv'); + if not Assigned(glSecondaryColor3sv) then Exit; + glSecondaryColor3ub := wglGetProcAddress('glSecondaryColor3ub'); + if not Assigned(glSecondaryColor3ub) then Exit; + glSecondaryColor3ubv := wglGetProcAddress('glSecondaryColor3ubv'); + if not Assigned(glSecondaryColor3ubv) then Exit; + glSecondaryColor3ui := wglGetProcAddress('glSecondaryColor3ui'); + if not Assigned(glSecondaryColor3ui) then Exit; + glSecondaryColor3uiv := wglGetProcAddress('glSecondaryColor3uiv'); + if not Assigned(glSecondaryColor3uiv) then Exit; + glSecondaryColor3us := wglGetProcAddress('glSecondaryColor3us'); + if not Assigned(glSecondaryColor3us) then Exit; + glSecondaryColor3usv := wglGetProcAddress('glSecondaryColor3usv'); + if not Assigned(glSecondaryColor3usv) then Exit; + glSecondaryColorPointer := wglGetProcAddress('glSecondaryColorPointer'); + if not Assigned(glSecondaryColorPointer) then Exit; + glWindowPos2d := wglGetProcAddress('glWindowPos2d'); + if not Assigned(glWindowPos2d) then Exit; + glWindowPos2dv := wglGetProcAddress('glWindowPos2dv'); + if not Assigned(glWindowPos2dv) then Exit; + glWindowPos2f := wglGetProcAddress('glWindowPos2f'); + if not Assigned(glWindowPos2f) then Exit; + glWindowPos2fv := wglGetProcAddress('glWindowPos2fv'); + if not Assigned(glWindowPos2fv) then Exit; + glWindowPos2i := wglGetProcAddress('glWindowPos2i'); + if not Assigned(glWindowPos2i) then Exit; + glWindowPos2iv := wglGetProcAddress('glWindowPos2iv'); + if not Assigned(glWindowPos2iv) then Exit; + glWindowPos2s := wglGetProcAddress('glWindowPos2s'); + if not Assigned(glWindowPos2s) then Exit; + glWindowPos2sv := wglGetProcAddress('glWindowPos2sv'); + if not Assigned(glWindowPos2sv) then Exit; + glWindowPos3d := wglGetProcAddress('glWindowPos3d'); + if not Assigned(glWindowPos3d) then Exit; + glWindowPos3dv := wglGetProcAddress('glWindowPos3dv'); + if not Assigned(glWindowPos3dv) then Exit; + glWindowPos3f := wglGetProcAddress('glWindowPos3f'); + if not Assigned(glWindowPos3f) then Exit; + glWindowPos3fv := wglGetProcAddress('glWindowPos3fv'); + if not Assigned(glWindowPos3fv) then Exit; + glWindowPos3i := wglGetProcAddress('glWindowPos3i'); + if not Assigned(glWindowPos3i) then Exit; + glWindowPos3iv := wglGetProcAddress('glWindowPos3iv'); + if not Assigned(glWindowPos3iv) then Exit; + glWindowPos3s := wglGetProcAddress('glWindowPos3s'); + if not Assigned(glWindowPos3s) then Exit; + glWindowPos3sv := wglGetProcAddress('glWindowPos3sv'); + if not Assigned(glWindowPos3sv) then Exit; + Result := TRUE; + +end; + +function Load_GL_version_1_5: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + glGenQueries := wglGetProcAddress('glGenQueries'); + if not Assigned(glGenQueries) then Exit; + glDeleteQueries := wglGetProcAddress('glDeleteQueries'); + if not Assigned(glDeleteQueries) then Exit; + glIsQuery := wglGetProcAddress('glIsQuery'); + if not Assigned(glIsQuery) then Exit; + glBeginQuery := wglGetProcAddress('glBeginQuery'); + if not Assigned(glBeginQuery) then Exit; + glEndQuery := wglGetProcAddress('glEndQuery'); + if not Assigned(glEndQuery) then Exit; + glGetQueryiv := wglGetProcAddress('glGetQueryiv'); + if not Assigned(glGetQueryiv) then Exit; + glGetQueryObjectiv := wglGetProcAddress('glGetQueryObjectiv'); + if not Assigned(glGetQueryObjectiv) then Exit; + glGetQueryObjectuiv := wglGetProcAddress('glGetQueryObjectuiv'); + if not Assigned(glGetQueryObjectuiv) then Exit; + glBindBuffer := wglGetProcAddress('glBindBuffer'); + if not Assigned(glBindBuffer) then Exit; + glDeleteBuffers := wglGetProcAddress('glDeleteBuffers'); + if not Assigned(glDeleteBuffers) then Exit; + glGenBuffers := wglGetProcAddress('glGenBuffers'); + if not Assigned(glGenBuffers) then Exit; + glIsBuffer := wglGetProcAddress('glIsBuffer'); + if not Assigned(glIsBuffer) then Exit; + glBufferData := wglGetProcAddress('glBufferData'); + if not Assigned(glBufferData) then Exit; + glBufferSubData := wglGetProcAddress('glBufferSubData'); + if not Assigned(glBufferSubData) then Exit; + glGetBufferSubData := wglGetProcAddress('glGetBufferSubData'); + if not Assigned(glGetBufferSubData) then Exit; + glMapBuffer := wglGetProcAddress('glMapBuffer'); + if not Assigned(glMapBuffer) then Exit; + glUnmapBuffer := wglGetProcAddress('glUnmapBuffer'); + if not Assigned(glUnmapBuffer) then Exit; + glGetBufferParameteriv := wglGetProcAddress('glGetBufferParameteriv'); + if not Assigned(glGetBufferParameteriv) then Exit; + glGetBufferPointerv := wglGetProcAddress('glGetBufferPointerv'); + if not Assigned(glGetBufferPointerv) then Exit; + Result := TRUE; + +end; + +function Load_GL_version_2_0: Boolean; +var + extstring: String; +begin + + Result := FALSE; + extstring := String(PChar(glGetString(GL_EXTENSIONS))); + + glBlendEquationSeparate := wglGetProcAddress('glBlendEquationSeparate'); + if not Assigned(glBlendEquationSeparate) then Exit; + glDrawBuffers := wglGetProcAddress('glDrawBuffers'); + if not Assigned(glDrawBuffers) then Exit; + glStencilOpSeparate := wglGetProcAddress('glStencilOpSeparate'); + if not Assigned(glStencilOpSeparate) then Exit; + glStencilFuncSeparate := wglGetProcAddress('glStencilFuncSeparate'); + if not Assigned(glStencilFuncSeparate) then Exit; + glStencilMaskSeparate := wglGetProcAddress('glStencilMaskSeparate'); + if not Assigned(glStencilMaskSeparate) then Exit; + glAttachShader := wglGetProcAddress('glAttachShader'); + if not Assigned(glAttachShader) then Exit; + glBindAttribLocation := wglGetProcAddress('glBindAttribLocation'); + if not Assigned(glBindAttribLocation) then Exit; + glCompileShader := wglGetProcAddress('glCompileShader'); + if not Assigned(glCompileShader) then Exit; + glCreateProgram := wglGetProcAddress('glCreateProgram'); + if not Assigned(glCreateProgram) then Exit; + glCreateShader := wglGetProcAddress('glCreateShader'); + if not Assigned(glCreateShader) then Exit; + glDeleteProgram := wglGetProcAddress('glDeleteProgram'); + if not Assigned(glDeleteProgram) then Exit; + glDeleteShader := wglGetProcAddress('glDeleteShader'); + if not Assigned(glDeleteShader) then Exit; + glDetachShader := wglGetProcAddress('glDetachShader'); + if not Assigned(glDetachShader) then Exit; + glDisableVertexAttribArray := wglGetProcAddress('glDisableVertexAttribArray'); + if not Assigned(glDisableVertexAttribArray) then Exit; + glEnableVertexAttribArray := wglGetProcAddress('glEnableVertexAttribArray'); + if not Assigned(glEnableVertexAttribArray) then Exit; + glGetActiveAttrib := wglGetProcAddress('glGetActiveAttrib'); + if not Assigned(glGetActiveAttrib) then Exit; + glGetActiveUniform := wglGetProcAddress('glGetActiveUniform'); + if not Assigned(glGetActiveUniform) then Exit; + glGetAttachedShaders := wglGetProcAddress('glGetAttachedShaders'); + if not Assigned(glGetAttachedShaders) then Exit; + glGetAttribLocation := wglGetProcAddress('glGetAttribLocation'); + if not Assigned(glGetAttribLocation) then Exit; + glGetProgramiv := wglGetProcAddress('glGetProgramiv'); + if not Assigned(glGetProgramiv) then Exit; + glGetProgramInfoLog := wglGetProcAddress('glGetProgramInfoLog'); + if not Assigned(glGetProgramInfoLog) then Exit; + glGetShaderiv := wglGetProcAddress('glGetShaderiv'); + if not Assigned(glGetShaderiv) then Exit; + glGetShaderInfoLog := wglGetProcAddress('glGetShaderInfoLog'); + if not Assigned(glGetShaderInfoLog) then Exit; + glGetShaderSource := wglGetProcAddress('glGetShaderSource'); + if not Assigned(glGetShaderSource) then Exit; + glGetUniformLocation := wglGetProcAddress('glGetUniformLocation'); + if not Assigned(glGetUniformLocation) then Exit; + glGetUniformfv := wglGetProcAddress('glGetUniformfv'); + if not Assigned(glGetUniformfv) then Exit; + glGetUniformiv := wglGetProcAddress('glGetUniformiv'); + if not Assigned(glGetUniformiv) then Exit; + glGetVertexAttribdv := wglGetProcAddress('glGetVertexAttribdv'); + if not Assigned(glGetVertexAttribdv) then Exit; + glGetVertexAttribfv := wglGetProcAddress('glGetVertexAttribfv'); + if not Assigned(glGetVertexAttribfv) then Exit; + glGetVertexAttribiv := wglGetProcAddress('glGetVertexAttribiv'); + if not Assigned(glGetVertexAttribiv) then Exit; + glGetVertexAttribPointerv := wglGetProcAddress('glGetVertexAttribPointerv'); + if not Assigned(glGetVertexAttribPointerv) then Exit; + glIsProgram := wglGetProcAddress('glIsProgram'); + if not Assigned(glIsProgram) then Exit; + glIsShader := wglGetProcAddress('glIsShader'); + if not Assigned(glIsShader) then Exit; + glLinkProgram := wglGetProcAddress('glLinkProgram'); + if not Assigned(glLinkProgram) then Exit; + glShaderSource := wglGetProcAddress('glShaderSource'); + if not Assigned(glShaderSource) then Exit; + glUseProgram := wglGetProcAddress('glUseProgram'); + if not Assigned(glUseProgram) then Exit; + glUniform1f := wglGetProcAddress('glUniform1f'); + if not Assigned(glUniform1f) then Exit; + glUniform2f := wglGetProcAddress('glUniform2f'); + if not Assigned(glUniform2f) then Exit; + glUniform3f := wglGetProcAddress('glUniform3f'); + if not Assigned(glUniform3f) then Exit; + glUniform4f := wglGetProcAddress('glUniform4f'); + if not Assigned(glUniform4f) then Exit; + glUniform1i := wglGetProcAddress('glUniform1i'); + if not Assigned(glUniform1i) then Exit; + glUniform2i := wglGetProcAddress('glUniform2i'); + if not Assigned(glUniform2i) then Exit; + glUniform3i := wglGetProcAddress('glUniform3i'); + if not Assigned(glUniform3i) then Exit; + glUniform4i := wglGetProcAddress('glUniform4i'); + if not Assigned(glUniform4i) then Exit; + glUniform1fv := wglGetProcAddress('glUniform1fv'); + if not Assigned(glUniform1fv) then Exit; + glUniform2fv := wglGetProcAddress('glUniform2fv'); + if not Assigned(glUniform2fv) then Exit; + glUniform3fv := wglGetProcAddress('glUniform3fv'); + if not Assigned(glUniform3fv) then Exit; + glUniform4fv := wglGetProcAddress('glUniform4fv'); + if not Assigned(glUniform4fv) then Exit; + glUniform1iv := wglGetProcAddress('glUniform1iv'); + if not Assigned(glUniform1iv) then Exit; + glUniform2iv := wglGetProcAddress('glUniform2iv'); + if not Assigned(glUniform2iv) then Exit; + glUniform3iv := wglGetProcAddress('glUniform3iv'); + if not Assigned(glUniform3iv) then Exit; + glUniform4iv := wglGetProcAddress('glUniform4iv'); + if not Assigned(glUniform4iv) then Exit; + glUniformMatrix2fv := wglGetProcAddress('glUniformMatrix2fv'); + if not Assigned(glUniformMatrix2fv) then Exit; + glUniformMatrix3fv := wglGetProcAddress('glUniformMatrix3fv'); + if not Assigned(glUniformMatrix3fv) then Exit; + glUniformMatrix4fv := wglGetProcAddress('glUniformMatrix4fv'); + if not Assigned(glUniformMatrix4fv) then Exit; + glValidateProgram := wglGetProcAddress('glValidateProgram'); + if not Assigned(glValidateProgram) then Exit; + glVertexAttrib1d := wglGetProcAddress('glVertexAttrib1d'); + if not Assigned(glVertexAttrib1d) then Exit; + glVertexAttrib1dv := wglGetProcAddress('glVertexAttrib1dv'); + if not Assigned(glVertexAttrib1dv) then Exit; + glVertexAttrib1f := wglGetProcAddress('glVertexAttrib1f'); + if not Assigned(glVertexAttrib1f) then Exit; + glVertexAttrib1fv := wglGetProcAddress('glVertexAttrib1fv'); + if not Assigned(glVertexAttrib1fv) then Exit; + glVertexAttrib1s := wglGetProcAddress('glVertexAttrib1s'); + if not Assigned(glVertexAttrib1s) then Exit; + glVertexAttrib1sv := wglGetProcAddress('glVertexAttrib1sv'); + if not Assigned(glVertexAttrib1sv) then Exit; + glVertexAttrib2d := wglGetProcAddress('glVertexAttrib2d'); + if not Assigned(glVertexAttrib2d) then Exit; + glVertexAttrib2dv := wglGetProcAddress('glVertexAttrib2dv'); + if not Assigned(glVertexAttrib2dv) then Exit; + glVertexAttrib2f := wglGetProcAddress('glVertexAttrib2f'); + if not Assigned(glVertexAttrib2f) then Exit; + glVertexAttrib2fv := wglGetProcAddress('glVertexAttrib2fv'); + if not Assigned(glVertexAttrib2fv) then Exit; + glVertexAttrib2s := wglGetProcAddress('glVertexAttrib2s'); + if not Assigned(glVertexAttrib2s) then Exit; + glVertexAttrib2sv := wglGetProcAddress('glVertexAttrib2sv'); + if not Assigned(glVertexAttrib2sv) then Exit; + glVertexAttrib3d := wglGetProcAddress('glVertexAttrib3d'); + if not Assigned(glVertexAttrib3d) then Exit; + glVertexAttrib3dv := wglGetProcAddress('glVertexAttrib3dv'); + if not Assigned(glVertexAttrib3dv) then Exit; + glVertexAttrib3f := wglGetProcAddress('glVertexAttrib3f'); + if not Assigned(glVertexAttrib3f) then Exit; + glVertexAttrib3fv := wglGetProcAddress('glVertexAttrib3fv'); + if not Assigned(glVertexAttrib3fv) then Exit; + glVertexAttrib3s := wglGetProcAddress('glVertexAttrib3s'); + if not Assigned(glVertexAttrib3s) then Exit; + glVertexAttrib3sv := wglGetProcAddress('glVertexAttrib3sv'); + if not Assigned(glVertexAttrib3sv) then Exit; + glVertexAttrib4Nbv := wglGetProcAddress('glVertexAttrib4Nbv'); + if not Assigned(glVertexAttrib4Nbv) then Exit; + glVertexAttrib4Niv := wglGetProcAddress('glVertexAttrib4Niv'); + if not Assigned(glVertexAttrib4Niv) then Exit; + glVertexAttrib4Nsv := wglGetProcAddress('glVertexAttrib4Nsv'); + if not Assigned(glVertexAttrib4Nsv) then Exit; + glVertexAttrib4Nub := wglGetProcAddress('glVertexAttrib4Nub'); + if not Assigned(glVertexAttrib4Nub) then Exit; + glVertexAttrib4Nubv := wglGetProcAddress('glVertexAttrib4Nubv'); + if not Assigned(glVertexAttrib4Nubv) then Exit; + glVertexAttrib4Nuiv := wglGetProcAddress('glVertexAttrib4Nuiv'); + if not Assigned(glVertexAttrib4Nuiv) then Exit; + glVertexAttrib4Nusv := wglGetProcAddress('glVertexAttrib4Nusv'); + if not Assigned(glVertexAttrib4Nusv) then Exit; + glVertexAttrib4bv := wglGetProcAddress('glVertexAttrib4bv'); + if not Assigned(glVertexAttrib4bv) then Exit; + glVertexAttrib4d := wglGetProcAddress('glVertexAttrib4d'); + if not Assigned(glVertexAttrib4d) then Exit; + glVertexAttrib4dv := wglGetProcAddress('glVertexAttrib4dv'); + if not Assigned(glVertexAttrib4dv) then Exit; + glVertexAttrib4f := wglGetProcAddress('glVertexAttrib4f'); + if not Assigned(glVertexAttrib4f) then Exit; + glVertexAttrib4fv := wglGetProcAddress('glVertexAttrib4fv'); + if not Assigned(glVertexAttrib4fv) then Exit; + glVertexAttrib4iv := wglGetProcAddress('glVertexAttrib4iv'); + if not Assigned(glVertexAttrib4iv) then Exit; + glVertexAttrib4s := wglGetProcAddress('glVertexAttrib4s'); + if not Assigned(glVertexAttrib4s) then Exit; + glVertexAttrib4sv := wglGetProcAddress('glVertexAttrib4sv'); + if not Assigned(glVertexAttrib4sv) then Exit; + glVertexAttrib4ubv := wglGetProcAddress('glVertexAttrib4ubv'); + if not Assigned(glVertexAttrib4ubv) then Exit; + glVertexAttrib4uiv := wglGetProcAddress('glVertexAttrib4uiv'); + if not Assigned(glVertexAttrib4uiv) then Exit; + glVertexAttrib4usv := wglGetProcAddress('glVertexAttrib4usv'); + if not Assigned(glVertexAttrib4usv) then Exit; + glVertexAttribPointer := wglGetProcAddress('glVertexAttribPointer'); + if not Assigned(glVertexAttribPointer) then Exit; + Result := TRUE; + +end; + +function glext_LoadExtension(ext: String): Boolean; +begin + + Result := FALSE; + + if ext = 'GL_version_1_2' then Result := Load_GL_version_1_2 + else if ext = 'GL_ARB_imaging' then Result := Load_GL_ARB_imaging + else if ext = 'GL_version_1_3' then Result := Load_GL_version_1_3 + else if ext = 'GL_ARB_multitexture' then Result := Load_GL_ARB_multitexture + else if ext = 'GL_ARB_transpose_matrix' then Result := Load_GL_ARB_transpose_matrix + else if ext = 'GL_ARB_multisample' then Result := Load_GL_ARB_multisample + else if ext = 'GL_ARB_texture_env_add' then Result := Load_GL_ARB_texture_env_add +{$IFDEF Windows} + else if ext = 'WGL_ARB_extensions_string' then Result := Load_WGL_ARB_extensions_string + else if ext = 'WGL_ARB_buffer_region' then Result := Load_WGL_ARB_buffer_region +{$ENDIF} + else if ext = 'GL_ARB_texture_cube_map' then Result := Load_GL_ARB_texture_cube_map + else if ext = 'GL_ARB_depth_texture' then Result := Load_GL_ARB_depth_texture + else if ext = 'GL_ARB_point_parameters' then Result := Load_GL_ARB_point_parameters + else if ext = 'GL_ARB_shadow' then Result := Load_GL_ARB_shadow + else if ext = 'GL_ARB_shadow_ambient' then Result := Load_GL_ARB_shadow_ambient + else if ext = 'GL_ARB_texture_border_clamp' then Result := Load_GL_ARB_texture_border_clamp + else if ext = 'GL_ARB_texture_compression' then Result := Load_GL_ARB_texture_compression + else if ext = 'GL_ARB_texture_env_combine' then Result := Load_GL_ARB_texture_env_combine + else if ext = 'GL_ARB_texture_env_crossbar' then Result := Load_GL_ARB_texture_env_crossbar + else if ext = 'GL_ARB_texture_env_dot3' then Result := Load_GL_ARB_texture_env_dot3 + else if ext = 'GL_ARB_texture_mirrored_repeat' then Result := Load_GL_ARB_texture_mirrored_repeat + else if ext = 'GL_ARB_vertex_blend' then Result := Load_GL_ARB_vertex_blend + else if ext = 'GL_ARB_vertex_program' then Result := Load_GL_ARB_vertex_program + else if ext = 'GL_ARB_window_pos' then Result := Load_GL_ARB_window_pos + else if ext = 'GL_EXT_422_pixels' then Result := Load_GL_EXT_422_pixels + else if ext = 'GL_EXT_abgr' then Result := Load_GL_EXT_abgr + else if ext = 'GL_EXT_bgra' then Result := Load_GL_EXT_bgra + else if ext = 'GL_EXT_blend_color' then Result := Load_GL_EXT_blend_color + else if ext = 'GL_EXT_blend_func_separate' then Result := Load_GL_EXT_blend_func_separate + else if ext = 'GL_EXT_blend_logic_op' then Result := Load_GL_EXT_blend_logic_op + else if ext = 'GL_EXT_blend_minmax' then Result := Load_GL_EXT_blend_minmax + else if ext = 'GL_EXT_blend_subtract' then Result := Load_GL_EXT_blend_subtract + else if ext = 'GL_EXT_clip_volume_hint' then Result := Load_GL_EXT_clip_volume_hint + else if ext = 'GL_EXT_color_subtable' then Result := Load_GL_EXT_color_subtable + else if ext = 'GL_EXT_compiled_vertex_array' then Result := Load_GL_EXT_compiled_vertex_array + else if ext = 'GL_EXT_convolution' then Result := Load_GL_EXT_convolution + else if ext = 'GL_EXT_fog_coord' then Result := Load_GL_EXT_fog_coord + else if ext = 'GL_EXT_histogram' then Result := Load_GL_EXT_histogram + else if ext = 'GL_EXT_multi_draw_arrays' then Result := Load_GL_EXT_multi_draw_arrays + else if ext = 'GL_EXT_packed_pixels' then Result := Load_GL_EXT_packed_pixels + else if ext = 'GL_EXT_paletted_texture' then Result := Load_GL_EXT_paletted_texture + else if ext = 'GL_EXT_point_parameters' then Result := Load_GL_EXT_point_parameters + else if ext = 'GL_EXT_polygon_offset' then Result := Load_GL_EXT_polygon_offset + else if ext = 'GL_EXT_secondary_color' then Result := Load_GL_EXT_secondary_color + else if ext = 'GL_EXT_separate_specular_color' then Result := Load_GL_EXT_separate_specular_color + else if ext = 'GL_EXT_shadow_funcs' then Result := Load_GL_EXT_shadow_funcs + else if ext = 'GL_EXT_shared_texture_palette' then Result := Load_GL_EXT_shared_texture_palette + else if ext = 'GL_EXT_stencil_two_side' then Result := Load_GL_EXT_stencil_two_side + else if ext = 'GL_EXT_stencil_wrap' then Result := Load_GL_EXT_stencil_wrap + else if ext = 'GL_EXT_subtexture' then Result := Load_GL_EXT_subtexture + else if ext = 'GL_EXT_texture3D' then Result := Load_GL_EXT_texture3D + else if ext = 'GL_EXT_texture_compression_s3tc' then Result := Load_GL_EXT_texture_compression_s3tc + else if ext = 'GL_EXT_texture_env_add' then Result := Load_GL_EXT_texture_env_add + else if ext = 'GL_EXT_texture_env_combine' then Result := Load_GL_EXT_texture_env_combine + else if ext = 'GL_EXT_texture_env_dot3' then Result := Load_GL_EXT_texture_env_dot3 + else if ext = 'GL_EXT_texture_filter_anisotropic' then Result := Load_GL_EXT_texture_filter_anisotropic + else if ext = 'GL_EXT_texture_lod_bias' then Result := Load_GL_EXT_texture_lod_bias + else if ext = 'GL_EXT_texture_object' then Result := Load_GL_EXT_texture_object + else if ext = 'GL_EXT_vertex_array' then Result := Load_GL_EXT_vertex_array + else if ext = 'GL_EXT_vertex_shader' then Result := Load_GL_EXT_vertex_shader + else if ext = 'GL_EXT_vertex_weighting' then Result := Load_GL_EXT_vertex_weighting + else if ext = 'GL_HP_occlusion_test' then Result := Load_GL_HP_occlusion_test + else if ext = 'GL_NV_blend_square' then Result := Load_GL_NV_blend_square + else if ext = 'GL_NV_copy_depth_to_color' then Result := Load_GL_NV_copy_depth_to_color + else if ext = 'GL_NV_depth_clamp' then Result := Load_GL_NV_depth_clamp + else if ext = 'GL_NV_evaluators' then Result := Load_GL_NV_evaluators + else if ext = 'GL_NV_fence' then Result := Load_GL_NV_fence + else if ext = 'GL_NV_fog_distance' then Result := Load_GL_NV_fog_distance + else if ext = 'GL_NV_light_max_exponent' then Result := Load_GL_NV_light_max_exponent + else if ext = 'GL_NV_multisample_filter_hint' then Result := Load_GL_NV_multisample_filter_hint + else if ext = 'GL_NV_occlusion_query' then Result := Load_GL_NV_occlusion_query + else if ext = 'GL_NV_packed_depth_stencil' then Result := Load_GL_NV_packed_depth_stencil + else if ext = 'GL_NV_point_sprite' then Result := Load_GL_NV_point_sprite + else if ext = 'GL_NV_register_combiners' then Result := Load_GL_NV_register_combiners + else if ext = 'GL_NV_register_combiners2' then Result := Load_GL_NV_register_combiners2 + else if ext = 'GL_NV_texgen_emboss' then Result := Load_GL_NV_texgen_emboss + else if ext = 'GL_NV_texgen_reflection' then Result := Load_GL_NV_texgen_reflection + else if ext = 'GL_NV_texture_compression_vtc' then Result := Load_GL_NV_texture_compression_vtc + else if ext = 'GL_NV_texture_env_combine4' then Result := Load_GL_NV_texture_env_combine4 + else if ext = 'GL_NV_texture_rectangle' then Result := Load_GL_NV_texture_rectangle + else if ext = 'GL_NV_texture_shader' then Result := Load_GL_NV_texture_shader + else if ext = 'GL_NV_texture_shader2' then Result := Load_GL_NV_texture_shader2 + else if ext = 'GL_NV_texture_shader3' then Result := Load_GL_NV_texture_shader3 + else if ext = 'GL_NV_vertex_array_range' then Result := Load_GL_NV_vertex_array_range + else if ext = 'GL_NV_vertex_array_range2' then Result := Load_GL_NV_vertex_array_range2 + else if ext = 'GL_NV_vertex_program' then Result := Load_GL_NV_vertex_program + else if ext = 'GL_NV_vertex_program1_1' then Result := Load_GL_NV_vertex_program1_1 + else if ext = 'GL_ATI_element_array' then Result := Load_GL_ATI_element_array + else if ext = 'GL_ATI_envmap_bumpmap' then Result := Load_GL_ATI_envmap_bumpmap + else if ext = 'GL_ATI_fragment_shader' then Result := Load_GL_ATI_fragment_shader + else if ext = 'GL_ATI_pn_triangles' then Result := Load_GL_ATI_pn_triangles + else if ext = 'GL_ATI_texture_mirror_once' then Result := Load_GL_ATI_texture_mirror_once + else if ext = 'GL_ATI_vertex_array_object' then Result := Load_GL_ATI_vertex_array_object + else if ext = 'GL_ATI_vertex_streams' then Result := Load_GL_ATI_vertex_streams +{$IFDEF Windows} + else if ext = 'WGL_I3D_image_buffer' then Result := Load_WGL_I3D_image_buffer + else if ext = 'WGL_I3D_swap_frame_lock' then Result := Load_WGL_I3D_swap_frame_lock + else if ext = 'WGL_I3D_swap_frame_usage' then Result := Load_WGL_I3D_swap_frame_usage +{$ENDIF} + else if ext = 'GL_3DFX_texture_compression_FXT1' then Result := Load_GL_3DFX_texture_compression_FXT1 + else if ext = 'GL_IBM_cull_vertex' then Result := Load_GL_IBM_cull_vertex + else if ext = 'GL_IBM_multimode_draw_arrays' then Result := Load_GL_IBM_multimode_draw_arrays + else if ext = 'GL_IBM_raster_pos_clip' then Result := Load_GL_IBM_raster_pos_clip + else if ext = 'GL_IBM_texture_mirrored_repeat' then Result := Load_GL_IBM_texture_mirrored_repeat + else if ext = 'GL_IBM_vertex_array_lists' then Result := Load_GL_IBM_vertex_array_lists + else if ext = 'GL_MESA_resize_buffers' then Result := Load_GL_MESA_resize_buffers + else if ext = 'GL_MESA_window_pos' then Result := Load_GL_MESA_window_pos + else if ext = 'GL_OML_interlace' then Result := Load_GL_OML_interlace + else if ext = 'GL_OML_resample' then Result := Load_GL_OML_resample + else if ext = 'GL_OML_subsample' then Result := Load_GL_OML_subsample + else if ext = 'GL_SGIS_generate_mipmap' then Result := Load_GL_SGIS_generate_mipmap + else if ext = 'GL_SGIS_multisample' then Result := Load_GL_SGIS_multisample + else if ext = 'GL_SGIS_pixel_texture' then Result := Load_GL_SGIS_pixel_texture + else if ext = 'GL_SGIS_texture_border_clamp' then Result := Load_GL_SGIS_texture_border_clamp + else if ext = 'GL_SGIS_texture_color_mask' then Result := Load_GL_SGIS_texture_color_mask + else if ext = 'GL_SGIS_texture_edge_clamp' then Result := Load_GL_SGIS_texture_edge_clamp + else if ext = 'GL_SGIS_texture_lod' then Result := Load_GL_SGIS_texture_lod + else if ext = 'GL_SGIS_depth_texture' then Result := Load_GL_SGIS_depth_texture + else if ext = 'GL_SGIX_fog_offset' then Result := Load_GL_SGIX_fog_offset + else if ext = 'GL_SGIX_interlace' then Result := Load_GL_SGIX_interlace + else if ext = 'GL_SGIX_shadow_ambient' then Result := Load_GL_SGIX_shadow_ambient + else if ext = 'GL_SGI_color_matrix' then Result := Load_GL_SGI_color_matrix + else if ext = 'GL_SGI_color_table' then Result := Load_GL_SGI_color_table + else if ext = 'GL_SGI_texture_color_table' then Result := Load_GL_SGI_texture_color_table + else if ext = 'GL_SUN_vertex' then Result := Load_GL_SUN_vertex + else if ext = 'GL_ARB_fragment_program' then Result := Load_GL_ARB_fragment_program + else if ext = 'GL_ATI_text_fragment_shader' then Result := Load_GL_ATI_text_fragment_shader + else if ext = 'GL_APPLE_client_storage' then Result := Load_GL_APPLE_client_storage + else if ext = 'GL_APPLE_element_array' then Result := Load_GL_APPLE_element_array + else if ext = 'GL_APPLE_fence' then Result := Load_GL_APPLE_fence + else if ext = 'GL_APPLE_vertex_array_object' then Result := Load_GL_APPLE_vertex_array_object + else if ext = 'GL_APPLE_vertex_array_range' then Result := Load_GL_APPLE_vertex_array_range +{$IFDEF Windows} + else if ext = 'WGL_ARB_pixel_format' then Result := Load_WGL_ARB_pixel_format + else if ext = 'WGL_ARB_make_current_read' then Result := Load_WGL_ARB_make_current_read + else if ext = 'WGL_ARB_pbuffer' then Result := Load_WGL_ARB_pbuffer + else if ext = 'WGL_EXT_swap_control' then Result := Load_WGL_EXT_swap_control + else if ext = 'WGL_ARB_render_texture' then Result := Load_WGL_ARB_render_texture + else if ext = 'WGL_EXT_extensions_string' then Result := Load_WGL_EXT_extensions_string + else if ext = 'WGL_EXT_make_current_read' then Result := Load_WGL_EXT_make_current_read + else if ext = 'WGL_EXT_pbuffer' then Result := Load_WGL_EXT_pbuffer + else if ext = 'WGL_EXT_pixel_format' then Result := Load_WGL_EXT_pixel_format + else if ext = 'WGL_I3D_digital_video_control' then Result := Load_WGL_I3D_digital_video_control + else if ext = 'WGL_I3D_gamma' then Result := Load_WGL_I3D_gamma + else if ext = 'WGL_I3D_genlock' then Result := Load_WGL_I3D_genlock +{$ENDIF} + else if ext = 'GL_ARB_matrix_palette' then Result := Load_GL_ARB_matrix_palette + else if ext = 'GL_NV_element_array' then Result := Load_GL_NV_element_array + else if ext = 'GL_NV_float_buffer' then Result := Load_GL_NV_float_buffer + else if ext = 'GL_NV_fragment_program' then Result := Load_GL_NV_fragment_program + else if ext = 'GL_NV_primitive_restart' then Result := Load_GL_NV_primitive_restart + else if ext = 'GL_NV_vertex_program2' then Result := Load_GL_NV_vertex_program2 + {$IFDEF Windows} + else if ext = 'WGL_NV_render_texture_rectangle' then Result := Load_WGL_NV_render_texture_rectangle + {$ENDIF} + else if ext = 'GL_NV_pixel_data_range' then Result := Load_GL_NV_pixel_data_range + else if ext = 'GL_EXT_texture_rectangle' then Result := Load_GL_EXT_texture_rectangle + else if ext = 'GL_S3_s3tc' then Result := Load_GL_S3_s3tc + else if ext = 'GL_ATI_draw_buffers' then Result := Load_GL_ATI_draw_buffers + {$IFDEF Windows} + else if ext = 'WGL_ATI_pixel_format_float' then Result := Load_WGL_ATI_pixel_format_float + {$ENDIF} + else if ext = 'GL_ATI_texture_env_combine3' then Result := Load_GL_ATI_texture_env_combine3 + else if ext = 'GL_ATI_texture_float' then Result := Load_GL_ATI_texture_float + else if ext = 'GL_NV_texture_expand_normal' then Result := Load_GL_NV_texture_expand_normal + else if ext = 'GL_NV_half_float' then Result := Load_GL_NV_half_float + else if ext = 'GL_ATI_map_object_buffer' then Result := Load_GL_ATI_map_object_buffer + else if ext = 'GL_ATI_separate_stencil' then Result := Load_GL_ATI_separate_stencil + else if ext = 'GL_ATI_vertex_attrib_array_object' then Result := Load_GL_ATI_vertex_attrib_array_object + else if ext = 'GL_ARB_vertex_buffer_object' then Result := Load_GL_ARB_vertex_buffer_object + else if ext = 'GL_ARB_occlusion_query' then Result := Load_GL_ARB_occlusion_query + else if ext = 'GL_ARB_shader_objects' then Result := Load_GL_ARB_shader_objects + else if ext = 'GL_ARB_vertex_shader' then Result := Load_GL_ARB_vertex_shader + else if ext = 'GL_ARB_fragment_shader' then Result := Load_GL_ARB_fragment_shader + else if ext = 'GL_ARB_shading_language_100' then Result := Load_GL_ARB_shading_language_100 + else if ext = 'GL_ARB_texture_non_power_of_two' then Result := Load_GL_ARB_texture_non_power_of_two + else if ext = 'GL_ARB_point_sprite' then Result := Load_GL_ARB_point_sprite + else if ext = 'GL_EXT_depth_bounds_test' then Result := Load_GL_EXT_depth_bounds_test + else if ext = 'GL_EXT_texture_mirror_clamp' then Result := Load_GL_EXT_texture_mirror_clamp + else if ext = 'GL_EXT_blend_equation_separate' then Result := Load_GL_EXT_blend_equation_separate + else if ext = 'GL_MESA_pack_invert' then Result := Load_GL_MESA_pack_invert + else if ext = 'GL_MESA_ycbcr_texture' then Result := Load_GL_MESA_ycbcr_texture + else if ext = 'GL_ARB_fragment_program_shadow' then Result := Load_GL_ARB_fragment_program_shadow + else if ext = 'GL_NV_fragment_program_option' then Result := Load_GL_NV_fragment_program_option + else if ext = 'GL_EXT_pixel_buffer_object' then Result := Load_GL_EXT_pixel_buffer_object + else if ext = 'GL_NV_fragment_program2' then Result := Load_GL_NV_fragment_program2 + else if ext = 'GL_NV_vertex_program2_option' then Result := Load_GL_NV_vertex_program2_option + else if ext = 'GL_NV_vertex_program3' then Result := Load_GL_NV_vertex_program3 + else if ext = 'GL_ARB_draw_buffers' then Result := Load_GL_ARB_draw_buffers + else if ext = 'GL_ARB_texture_rectangle' then Result := Load_GL_ARB_texture_rectangle + else if ext = 'GL_ARB_color_buffer_float' then Result := Load_GL_ARB_color_buffer_float + else if ext = 'GL_ARB_half_float_pixel' then Result := Load_GL_ARB_half_float_pixel + else if ext = 'GL_ARB_texture_float' then Result := Load_GL_ARB_texture_float + else if ext = 'GL_EXT_texture_compression_dxt1' then Result := Load_GL_EXT_texture_compression_dxt1 + else if ext = 'GL_ARB_pixel_buffer_object' then Result := Load_GL_ARB_pixel_buffer_object + else if ext = 'GL_EXT_framebuffer_object' then Result := Load_GL_EXT_framebuffer_object + else if ext = 'GL_version_1_4' then Result := Load_GL_version_1_4 + else if ext = 'GL_version_1_5' then Result := Load_GL_version_1_5 + else if ext = 'GL_version_2_0' then Result := Load_GL_version_2_0 + +end; + +end. diff --git a/packages/opengl/src/glu.pp b/packages/opengl/src/glu.pp new file mode 100644 index 0000000000..707aef743f --- /dev/null +++ b/packages/opengl/src/glu.pp @@ -0,0 +1,572 @@ +{ + + Adaption of the delphi3d.net OpenGL units to FreePascal + Sebastian Guenther (sg@freepascal.org) in 2002 + These units are free to use +} + +{*++ BUILD Version: 0004 // Increment this if a change has global effects + +Copyright (c) 1985-95, Microsoft Corporation + +Module Name: + + glu.h + +Abstract: + + Procedure declarations, constant definitions and macros for the OpenGL + Utility Library. + +--*} + +{* +** Copyright 1991-1993, Silicon Graphics, Inc. +** All Rights Reserved. +** +** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; +** the contents of this file may not be disclosed to third parties, copied or +** duplicated in any form, in whole or in part, without the prior written +** permission of Silicon Graphics, Inc. +** +** RESTRICTED RIGHTS LEGEND: +** Use, duplication or disclosure by the Government is subject to restrictions +** as set forth in subdivision (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, DOD or NASA FAR Supplement. Unpublished - +** rights reserved under the Copyright Laws of the United States. +*} + +{* +** Return the error string associated with a particular error code. +** This will return 0 for an invalid error code. +** +** The generic function prototype that can be compiled for ANSI or Unicode +** is defined as follows: +** +** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode); +*} + +{******************************************************************************} +{ Converted to Delphi by Tom Nuydens (tom@delphi3d.net) } +{ For the latest updates, visit Delphi3D: http://www.delphi3d.net } +{******************************************************************************} + +{$MACRO ON} +{$MODE Delphi} +{$IFDEF Windows} + {$DEFINE extdecl := stdcall} +{$ELSE} + {$DEFINE extdecl := cdecl} +{$ENDIF} + +{$IFDEF MORPHOS} +{$INLINE ON} +{$DEFINE GLU_UNIT} +{$ENDIF} + +unit GLu; + +interface + +uses + SysUtils, + {$IFDEF Windows} + Windows, + {$ELSE} + {$IFDEF MORPHOS} + TinyGL, + {$ENDIF} + {$ENDIF} + GL; + +type + TViewPortArray = array [0..3] of GLint; + T16dArray = array [0..15] of GLdouble; + TCallBack = procedure; + T3dArray = array [0..2] of GLdouble; + T4pArray = array [0..3] of Pointer; + T4fArray = array [0..3] of GLfloat; + PPointer = ^Pointer; + +type + GLUnurbs = record end; PGLUnurbs = ^GLUnurbs; + GLUquadric = record end; PGLUquadric = ^GLUquadric; + GLUtesselator = record end; PGLUtesselator = ^GLUtesselator; + + // backwards compatibility: + GLUnurbsObj = GLUnurbs; PGLUnurbsObj = PGLUnurbs; + GLUquadricObj = GLUquadric; PGLUquadricObj = PGLUquadric; + GLUtesselatorObj = GLUtesselator; PGLUtesselatorObj = PGLUtesselator; + GLUtriangulatorObj = GLUtesselator; PGLUtriangulatorObj = PGLUtesselator; + + TGLUnurbs = GLUnurbs; + TGLUquadric = GLUquadric; + TGLUtesselator = GLUtesselator; + + TGLUnurbsObj = GLUnurbsObj; + TGLUquadricObj = GLUquadricObj; + TGLUtesselatorObj = GLUtesselatorObj; + TGLUtriangulatorObj = GLUtriangulatorObj; + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its headers are included here. } +{$INCLUDE tinyglh.inc} + +{$ELSE MORPHOS} +var + gluErrorString: function(errCode: GLenum): PChar; extdecl; + gluErrorUnicodeStringEXT: function(errCode: GLenum): PWideChar; extdecl; + gluGetString: function(name: GLenum): PChar; extdecl; + gluOrtho2D: procedure(left,right, bottom, top: GLdouble); extdecl; + gluPerspective: procedure(fovy, aspect, zNear, zFar: GLdouble); extdecl; + gluPickMatrix: procedure(x, y, width, height: GLdouble; var viewport: TViewPortArray); extdecl; + gluLookAt: procedure(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); extdecl; + gluProject: function(objx, objy, objz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; winx, winy, winz: PGLdouble): Integer; extdecl; + gluUnProject: function(winx, winy, winz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; objx, objy, objz: PGLdouble): Integer; extdecl; + gluScaleImage: function(format: GLenum; widthin, heightin: GLint; typein: GLenum; const datain: Pointer; widthout, heightout: GLint; typeout: GLenum; dataout: Pointer): Integer; extdecl; + gluBuild1DMipmaps: function(target: GLenum; components, width: GLint; format, atype: GLenum; const data: Pointer): Integer; extdecl; + gluBuild2DMipmaps: function(target: GLenum; components, width, height: GLint; format, atype: GLenum; const data: Pointer): Integer; extdecl; + +var + gluNewQuadric: function: PGLUquadric; extdecl; + gluDeleteQuadric: procedure(state: PGLUquadric); extdecl; + gluQuadricNormals: procedure(quadObject: PGLUquadric; normals: GLenum); extdecl; + gluQuadricTexture: procedure(quadObject: PGLUquadric; textureCoords: GLboolean); extdecl; + gluQuadricOrientation: procedure(quadObject: PGLUquadric; orientation: GLenum); extdecl; + gluQuadricDrawStyle: procedure(quadObject: PGLUquadric; drawStyle: GLenum); extdecl; + gluCylinder: procedure(qobj: PGLUquadric; baseRadius, topRadius, height: GLdouble; slices, stacks: GLint); extdecl; + gluDisk: procedure(qobj: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint); extdecl; + gluPartialDisk: procedure(qobj: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint; startAngle, sweepAngle: GLdouble); extdecl; + gluSphere: procedure(qobj: PGLuquadric; radius: GLdouble; slices, stacks: GLint); extdecl; + gluQuadricCallback: procedure(qobj: PGLUquadric; which: GLenum; fn: TCallBack); extdecl; + gluNewTess: function: PGLUtesselator; extdecl; + gluDeleteTess: procedure(tess: PGLUtesselator); extdecl; + gluTessBeginPolygon: procedure(tess: PGLUtesselator; polygon_data: Pointer); extdecl; + gluTessBeginContour: procedure(tess: PGLUtesselator); extdecl; + gluTessVertex: procedure(tess: PGLUtesselator; var coords: T3dArray; data: Pointer); extdecl; + gluTessEndContour: procedure(tess: PGLUtesselator); extdecl; + gluTessEndPolygon: procedure(tess: PGLUtesselator); extdecl; + gluTessProperty: procedure(tess: PGLUtesselator; which: GLenum; value: GLdouble); extdecl; + gluTessNormal: procedure(tess: PGLUtesselator; x, y, z: GLdouble); extdecl; + gluTessCallback: procedure(tess: PGLUtesselator; which: GLenum;fn: TCallBack); extdecl; + gluGetTessProperty: procedure(tess: PGLUtesselator; which: GLenum; value: PGLdouble); extdecl; + gluNewNurbsRenderer: function: PGLUnurbs; extdecl; + gluDeleteNurbsRenderer: procedure(nobj: PGLUnurbs); extdecl; + gluBeginSurface: procedure(nobj: PGLUnurbs); extdecl; + gluBeginCurve: procedure(nobj: PGLUnurbs); extdecl; + gluEndCurve: procedure(nobj: PGLUnurbs); extdecl; + gluEndSurface: procedure(nobj: PGLUnurbs); extdecl; + gluBeginTrim: procedure(nobj: PGLUnurbs); extdecl; + gluEndTrim: procedure(nobj: PGLUnurbs); extdecl; + gluPwlCurve: procedure(nobj: PGLUnurbs; count: GLint; aarray: PGLfloat; stride: GLint; atype: GLenum); extdecl; + gluNurbsCurve: procedure(nobj: PGLUnurbs; nknots: GLint; knot: PGLfloat; stride: GLint; ctlarray: PGLfloat; order: GLint; atype: GLenum); extdecl; + gluNurbsSurface: procedure(nobj: PGLUnurbs; sknot_count: GLint; sknot: PGLfloat; tknot_count: GLint; tknot: PGLfloat; s_stride, t_stride: GLint; ctlarray: PGLfloat; sorder, torder: GLint; atype: GLenum); extdecl; + gluLoadSamplingMatrices: procedure(nobj: PGLUnurbs; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray); extdecl; + gluNurbsProperty: procedure(nobj: PGLUnurbs; aproperty: GLenum; value: GLfloat); extdecl; + gluGetNurbsProperty: procedure(nobj: PGLUnurbs; aproperty: GLenum; value: PGLfloat); extdecl; + gluNurbsCallback: procedure(nobj: PGLUnurbs; which: GLenum; fn: TCallBack); extdecl; +{$ENDIF MORPHOS} + +(**** Callback function prototypes ****) + +type + // gluQuadricCallback + GLUquadricErrorProc = procedure(p: GLenum); extdecl; + + // gluTessCallback + GLUtessBeginProc = procedure(p: GLenum); extdecl; + GLUtessEdgeFlagProc = procedure(p: GLboolean); extdecl; + GLUtessVertexProc = procedure(p: Pointer); extdecl; + GLUtessEndProc = procedure; extdecl; + GLUtessErrorProc = procedure(p: GLenum); extdecl; + GLUtessCombineProc = procedure(var p1: T3dArray; p2: T4pArray; p3: T4fArray; p4: PPointer); extdecl; + GLUtessBeginDataProc = procedure(p1: GLenum; p2: Pointer); extdecl; + GLUtessEdgeFlagDataProc = procedure(p1: GLboolean; p2: Pointer); extdecl; + GLUtessVertexDataProc = procedure(p1, p2: Pointer); extdecl; + GLUtessEndDataProc = procedure(p: Pointer); extdecl; + GLUtessErrorDataProc = procedure(p1: GLenum; p2: Pointer); extdecl; + GLUtessCombineDataProc = procedure(var p1: T3dArray; var p2: T4pArray; var p3: T4fArray; + p4: PPointer; p5: Pointer); extdecl; + + // gluNurbsCallback + GLUnurbsErrorProc = procedure(p: GLenum); extdecl; + + +//*** Generic constants ****/ + +const + // Version + GLU_VERSION_1_1 = 1; + GLU_VERSION_1_2 = 1; + + // Errors: (return value 0 = no error) + GLU_INVALID_ENUM = 100900; + GLU_INVALID_VALUE = 100901; + GLU_OUT_OF_MEMORY = 100902; + GLU_INCOMPATIBLE_GL_VERSION = 100903; + + // StringName + GLU_VERSION = 100800; + GLU_EXTENSIONS = 100801; + + // Boolean + GLU_TRUE = GL_TRUE; + GLU_FALSE = GL_FALSE; + + + //*** Quadric constants ****/ + + // QuadricNormal + GLU_SMOOTH = 100000; + GLU_FLAT = 100001; + GLU_NONE = 100002; + + // QuadricDrawStyle + GLU_POINT = 100010; + GLU_LINE = 100011; + GLU_FILL = 100012; + GLU_SILHOUETTE = 100013; + + // QuadricOrientation + GLU_OUTSIDE = 100020; + GLU_INSIDE = 100021; + + // Callback types: + // GLU_ERROR = 100103; + + + //*** Tesselation constants ****/ + + GLU_TESS_MAX_COORD = 1.0e150; + + // TessProperty + GLU_TESS_WINDING_RULE = 100140; + GLU_TESS_BOUNDARY_ONLY = 100141; + GLU_TESS_TOLERANCE = 100142; + + // TessWinding + GLU_TESS_WINDING_ODD = 100130; + GLU_TESS_WINDING_NONZERO = 100131; + GLU_TESS_WINDING_POSITIVE = 100132; + GLU_TESS_WINDING_NEGATIVE = 100133; + GLU_TESS_WINDING_ABS_GEQ_TWO = 100134; + + // TessCallback + GLU_TESS_BEGIN = 100100; // void (CALLBACK*)(GLenum type) + GLU_TESS_VERTEX = 100101; // void (CALLBACK*)(void *data) + GLU_TESS_END = 100102; // void (CALLBACK*)(void) + GLU_TESS_ERROR = 100103; // void (CALLBACK*)(GLenum errno) + GLU_TESS_EDGE_FLAG = 100104; // void (CALLBACK*)(GLboolean boundaryEdge) + GLU_TESS_COMBINE = 100105; { void (CALLBACK*)(GLdouble coords[3], + void *data[4], + GLfloat weight[4], + void **dataOut) } + GLU_TESS_BEGIN_DATA = 100106; { void (CALLBACK*)(GLenum type, + void *polygon_data) } + GLU_TESS_VERTEX_DATA = 100107; { void (CALLBACK*)(void *data, + void *polygon_data) } + GLU_TESS_END_DATA = 100108; // void (CALLBACK*)(void *polygon_data) + GLU_TESS_ERROR_DATA = 100109; { void (CALLBACK*)(GLenum errno, + void *polygon_data) } + GLU_TESS_EDGE_FLAG_DATA = 100110; { void (CALLBACK*)(GLboolean boundaryEdge, + void *polygon_data) } + GLU_TESS_COMBINE_DATA = 100111; { void (CALLBACK*)(GLdouble coords[3], + void *data[4], + GLfloat weight[4], + void **dataOut, + void *polygon_data) } + + // TessError + GLU_TESS_ERROR1 = 100151; + GLU_TESS_ERROR2 = 100152; + GLU_TESS_ERROR3 = 100153; + GLU_TESS_ERROR4 = 100154; + GLU_TESS_ERROR5 = 100155; + GLU_TESS_ERROR6 = 100156; + GLU_TESS_ERROR7 = 100157; + GLU_TESS_ERROR8 = 100158; + + GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1; + GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2; + GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3; + GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4; + GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5; + GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6; + + //*** NURBS constants ****/ + + // NurbsProperty + GLU_AUTO_LOAD_MATRIX = 100200; + GLU_CULLING = 100201; + GLU_SAMPLING_TOLERANCE = 100203; + GLU_DISPLAY_MODE = 100204; + GLU_PARAMETRIC_TOLERANCE = 100202; + GLU_SAMPLING_METHOD = 100205; + GLU_U_STEP = 100206; + GLU_V_STEP = 100207; + + // NurbsSampling + GLU_PATH_LENGTH = 100215; + GLU_PARAMETRIC_ERROR = 100216; + GLU_DOMAIN_DISTANCE = 100217; + + + // NurbsTrim + GLU_MAP1_TRIM_2 = 100210; + GLU_MAP1_TRIM_3 = 100211; + + // NurbsDisplay + // GLU_FILL = 100012; + GLU_OUTLINE_POLYGON = 100240; + GLU_OUTLINE_PATCH = 100241; + + // NurbsCallback + // GLU_ERROR = 100103; + + // NurbsErrors + GLU_NURBS_ERROR1 = 100251; + GLU_NURBS_ERROR2 = 100252; + GLU_NURBS_ERROR3 = 100253; + GLU_NURBS_ERROR4 = 100254; + GLU_NURBS_ERROR5 = 100255; + GLU_NURBS_ERROR6 = 100256; + GLU_NURBS_ERROR7 = 100257; + GLU_NURBS_ERROR8 = 100258; + GLU_NURBS_ERROR9 = 100259; + GLU_NURBS_ERROR10 = 100260; + GLU_NURBS_ERROR11 = 100261; + GLU_NURBS_ERROR12 = 100262; + GLU_NURBS_ERROR13 = 100263; + GLU_NURBS_ERROR14 = 100264; + GLU_NURBS_ERROR15 = 100265; + GLU_NURBS_ERROR16 = 100266; + GLU_NURBS_ERROR17 = 100267; + GLU_NURBS_ERROR18 = 100268; + GLU_NURBS_ERROR19 = 100269; + GLU_NURBS_ERROR20 = 100270; + GLU_NURBS_ERROR21 = 100271; + GLU_NURBS_ERROR22 = 100272; + GLU_NURBS_ERROR23 = 100273; + GLU_NURBS_ERROR24 = 100274; + GLU_NURBS_ERROR25 = 100275; + GLU_NURBS_ERROR26 = 100276; + GLU_NURBS_ERROR27 = 100277; + GLU_NURBS_ERROR28 = 100278; + GLU_NURBS_ERROR29 = 100279; + GLU_NURBS_ERROR30 = 100280; + GLU_NURBS_ERROR31 = 100281; + GLU_NURBS_ERROR32 = 100282; + GLU_NURBS_ERROR33 = 100283; + GLU_NURBS_ERROR34 = 100284; + GLU_NURBS_ERROR35 = 100285; + GLU_NURBS_ERROR36 = 100286; + GLU_NURBS_ERROR37 = 100287; + +//*** Backwards compatibility for old tesselator ****/ + +var + gluBeginPolygon: procedure(tess: PGLUtesselator); extdecl; + gluNextContour: procedure(tess: PGLUtesselator; atype: GLenum); extdecl; + gluEndPolygon: procedure(tess: PGLUtesselator); extdecl; + +const + // Contours types -- obsolete! + GLU_CW = 100120; + GLU_CCW = 100121; + GLU_INTERIOR = 100122; + GLU_EXTERIOR = 100123; + GLU_UNKNOWN = 100124; + + // Names without "TESS_" prefix + GLU_BEGIN = GLU_TESS_BEGIN; + GLU_VERTEX = GLU_TESS_VERTEX; + GLU_END = GLU_TESS_END; + GLU_ERROR = GLU_TESS_ERROR; + GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG; + +procedure LoadGLu(const dll: String); +procedure FreeGLu; + +implementation + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its functions are included here. } +{$INCLUDE tinygl.inc} + +{$ELSE MORPHOS} +uses + dynlibs; + +var + hDLL: TLibHandle; + +{$ENDIF MORPHOS} + +procedure FreeGLu; +begin +{$IFDEF MORPHOS} + // MorphOS's GL will closed down by TinyGL unit, nothing is needed here. +{$ELSE MORPHOS} + @gluErrorString := nil; + @gluErrorUnicodeStringEXT := nil; + @gluGetString := nil; + @gluOrtho2D := nil; + @gluPerspective := nil; + @gluPickMatrix := nil; + @gluLookAt := nil; + @gluProject := nil; + @gluUnProject := nil; + @gluScaleImage := nil; + @gluBuild1DMipmaps := nil; + @gluBuild2DMipmaps := nil; + @gluNewQuadric := nil; + @gluDeleteQuadric := nil; + @gluQuadricNormals := nil; + @gluQuadricTexture := nil; + @gluQuadricOrientation := nil; + @gluQuadricDrawStyle := nil; + @gluCylinder := nil; + @gluDisk := nil; + @gluPartialDisk := nil; + @gluSphere := nil; + @gluQuadricCallback := nil; + @gluNewTess := nil; + @gluDeleteTess := nil; + @gluTessBeginPolygon := nil; + @gluTessBeginContour := nil; + @gluTessVertex := nil; + @gluTessEndContour := nil; + @gluTessEndPolygon := nil; + @gluTessProperty := nil; + @gluTessNormal := nil; + @gluTessCallback := nil; + @gluGetTessProperty := nil; + @gluNewNurbsRenderer := nil; + @gluDeleteNurbsRenderer := nil; + @gluBeginSurface := nil; + @gluBeginCurve := nil; + @gluEndCurve := nil; + @gluEndSurface := nil; + @gluBeginTrim := nil; + @gluEndTrim := nil; + @gluPwlCurve := nil; + @gluNurbsCurve := nil; + @gluNurbsSurface := nil; + @gluLoadSamplingMatrices := nil; + @gluNurbsProperty := nil; + @gluGetNurbsProperty := nil; + @gluNurbsCallback := nil; + @gluBeginPolygon := nil; + @gluNextContour := nil; + @gluEndPolygon := nil; + + if (hDLL <> 0) then + FreeLibrary(hDLL); +{$ENDIF MORPHOS} +end; + +procedure LoadGLu(const dll: String); +{$IFDEF MORPHOS} +begin + // MorphOS's GL has own initialization in TinyGL unit, nothing is needed here. +end; +{$ELSE MORPHOS} +var + MethodName: string = ''; + + function GetGLuProcAddress(Lib: PtrInt; ProcName: PChar): Pointer; + begin + MethodName:=ProcName; + Result:=GetProcAddress(Lib, ProcName); + end; + +begin + + FreeGLu; + + hDLL := LoadLibrary(PChar(dll)); + if hDLL = 0 then raise Exception.Create('Could not load GLu from ' + dll); + try + @gluErrorString := GetGLuProcAddress(hDLL, 'gluErrorString'); + @gluErrorUnicodeStringEXT := GetGLuProcAddress(hDLL, 'gluErrorUnicodeStringEXT'); + @gluGetString := GetGLuProcAddress(hDLL, 'gluGetString'); + @gluOrtho2D := GetGLuProcAddress(hDLL, 'gluOrtho2D'); + @gluPerspective := GetGLuProcAddress(hDLL, 'gluPerspective'); + @gluPickMatrix := GetGLuProcAddress(hDLL, 'gluPickMatrix'); + @gluLookAt := GetGLuProcAddress(hDLL, 'gluLookAt'); + @gluProject := GetGLuProcAddress(hDLL, 'gluProject'); + @gluUnProject := GetGLuProcAddress(hDLL, 'gluUnProject'); + @gluScaleImage := GetGLuProcAddress(hDLL, 'gluScaleImage'); + @gluBuild1DMipmaps := GetGLuProcAddress(hDLL, 'gluBuild1DMipmaps'); + @gluBuild2DMipmaps := GetGLuProcAddress(hDLL, 'gluBuild2DMipmaps'); + @gluNewQuadric := GetGLuProcAddress(hDLL, 'gluNewQuadric'); + @gluDeleteQuadric := GetGLuProcAddress(hDLL, 'gluDeleteQuadric'); + @gluQuadricNormals := GetGLuProcAddress(hDLL, 'gluQuadricNormals'); + @gluQuadricTexture := GetGLuProcAddress(hDLL, 'gluQuadricTexture'); + @gluQuadricOrientation := GetGLuProcAddress(hDLL, 'gluQuadricOrientation'); + @gluQuadricDrawStyle := GetGLuProcAddress(hDLL, 'gluQuadricDrawStyle'); + @gluCylinder := GetGLuProcAddress(hDLL, 'gluCylinder'); + @gluDisk := GetGLuProcAddress(hDLL, 'gluDisk'); + @gluPartialDisk := GetGLuProcAddress(hDLL, 'gluPartialDisk'); + @gluSphere := GetGLuProcAddress(hDLL, 'gluSphere'); + @gluQuadricCallback := GetGLuProcAddress(hDLL, 'gluQuadricCallback'); + @gluNewTess := GetGLuProcAddress(hDLL, 'gluNewTess'); + @gluDeleteTess := GetGLuProcAddress(hDLL, 'gluDeleteTess'); + @gluTessBeginPolygon := GetGLuProcAddress(hDLL, 'gluTessBeginPolygon'); + @gluTessBeginContour := GetGLuProcAddress(hDLL, 'gluTessBeginContour'); + @gluTessVertex := GetGLuProcAddress(hDLL, 'gluTessVertex'); + @gluTessEndContour := GetGLuProcAddress(hDLL, 'gluTessEndContour'); + @gluTessEndPolygon := GetGLuProcAddress(hDLL, 'gluTessEndPolygon'); + @gluTessProperty := GetGLuProcAddress(hDLL, 'gluTessProperty'); + @gluTessNormal := GetGLuProcAddress(hDLL, 'gluTessNormal'); + @gluTessCallback := GetGLuProcAddress(hDLL, 'gluTessCallback'); + @gluGetTessProperty := GetGLuProcAddress(hDLL, 'gluGetTessProperty'); + @gluNewNurbsRenderer := GetGLuProcAddress(hDLL, 'gluNewNurbsRenderer'); + @gluDeleteNurbsRenderer := GetGLuProcAddress(hDLL, 'gluDeleteNurbsRenderer'); + @gluBeginSurface := GetGLuProcAddress(hDLL, 'gluBeginSurface'); + @gluBeginCurve := GetGLuProcAddress(hDLL, 'gluBeginCurve'); + @gluEndCurve := GetGLuProcAddress(hDLL, 'gluEndCurve'); + @gluEndSurface := GetGLuProcAddress(hDLL, 'gluEndSurface'); + @gluBeginTrim := GetGLuProcAddress(hDLL, 'gluBeginTrim'); + @gluEndTrim := GetGLuProcAddress(hDLL, 'gluEndTrim'); + @gluPwlCurve := GetGLuProcAddress(hDLL, 'gluPwlCurve'); + @gluNurbsCurve := GetGLuProcAddress(hDLL, 'gluNurbsCurve'); + @gluNurbsSurface := GetGLuProcAddress(hDLL, 'gluNurbsSurface'); + @gluLoadSamplingMatrices := GetGLuProcAddress(hDLL, 'gluLoadSamplingMatrices'); + @gluNurbsProperty := GetGLuProcAddress(hDLL, 'gluNurbsProperty'); + @gluGetNurbsProperty := GetGLuProcAddress(hDLL, 'gluGetNurbsProperty'); + @gluNurbsCallback := GetGLuProcAddress(hDLL, 'gluNurbsCallback'); + + @gluBeginPolygon := GetGLuProcAddress(hDLL, 'gluBeginPolygon'); + @gluNextContour := GetGLuProcAddress(hDLL, 'gluNextContour'); + @gluEndPolygon := GetGLuProcAddress(hDLL, 'gluEndPolygon'); + except + raise Exception.Create('Could not load ' + MethodName + ' from ' + dll); + end; +end; +{$ENDIF MORPHOS} + +initialization + + {$IFDEF Windows} + LoadGLu('glu32.dll'); + {$ELSE} + {$ifdef darwin} + LoadGLu('/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib'); + {$else} + {$ifndef MorphOS} + LoadGLu('libGLU.so.1'); + {$endif} + {$ENDIF} + {$endif} + +finalization + + FreeGLu; + +end. diff --git a/packages/opengl/src/glut.pp b/packages/opengl/src/glut.pp new file mode 100644 index 0000000000..225eec49cd --- /dev/null +++ b/packages/opengl/src/glut.pp @@ -0,0 +1,2102 @@ +{ Adaption of the delphi3d.net OpenGL units to FreePascal + Sebastian Guenther (sg@freepascal.org) in 2002 + These units are free to use + + 19.6.07 : Added GLUT_EXCLUSIVE_FPUMODE to allow for + unsafe glut-libs, that don't handle FPU-exceptions in + a compatible way. Jan Bruns (post@abnuto.de) +} + +{$MACRO ON} +{$MODE Delphi} +{$IFDEF Windows} + {$DEFINE extdecl := stdcall} +{$ELSE} + {$DEFINE extdecl := cdecl} +{$ENDIF} + + +{$IFDEF CPU86} + {$DEFINE GLUT_EXCLUSIVE_FPUMODE} + {$DEFINE mode_inline := register} //inine or local-calling +{$ENDIF} + + +{$IFDEF MORPHOS} +{$INLINE ON} +{$DEFINE GLUT_UNIT} +{$ENDIF} + +unit Glut; + +// Copyright (c) Mark J. Kilgard, 1994, 1995, 1996. */ + +(* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. *) + +{******************************************************************************} +{ Converted to Delphi by Tom Nuydens (tom@delphi3d.net) } +{ Contributions by Igor Karpov (glygrik@hotbox.ru) } +{ For the latest updates, visit Delphi3D: http://www.delphi3d.net } +{******************************************************************************} + +interface + +uses + SysUtils, + {$IFDEF Windows} + Windows, dynlibs, + {$ELSE} + {$IFDEF MORPHOS} + TinyGL, + {$ELSE} + dynlibs, + {$ENDIF} + {$ENDIF} + {$IFDEF GLUT_EXCLUSIVE_FPUMODE} + math, + {$ENDIF} + GL; + +type + PInteger = ^Integer; + PPChar = ^PChar; + TGlutVoidCallback = procedure; cdecl; + TGlut1IntCallback = procedure(value: Integer); cdecl; + TGlut2IntCallback = procedure(v1, v2: Integer); cdecl; + TGlut3IntCallback = procedure(v1, v2, v3: Integer); cdecl; + TGlut4IntCallback = procedure(v1, v2, v3, v4: Integer); cdecl; + TGlut1Char2IntCallback = procedure(c: Byte; v1, v2: Integer); cdecl; + TGlut1UInt3IntCallback = procedure(u: Cardinal; v1, v2, v3: Integer); cdecl; + +const + GLUT_API_VERSION = 3; + GLUT_XLIB_IMPLEMENTATION = 12; + // Display mode bit masks. + GLUT_RGB = 0; + GLUT_RGBA = GLUT_RGB; + GLUT_INDEX = 1; + GLUT_SINGLE = 0; + GLUT_DOUBLE = 2; + GLUT_ACCUM = 4; + GLUT_ALPHA = 8; + GLUT_DEPTH = 16; + GLUT_STENCIL = 32; + GLUT_MULTISAMPLE = 128; + GLUT_STEREO = 256; + GLUT_LUMINANCE = 512; + + // Mouse buttons. + GLUT_LEFT_BUTTON = 0; + GLUT_MIDDLE_BUTTON = 1; + GLUT_RIGHT_BUTTON = 2; + + // Mouse button state. + GLUT_DOWN = 0; + GLUT_UP = 1; + + // function keys + GLUT_KEY_F1 = 1; + GLUT_KEY_F2 = 2; + GLUT_KEY_F3 = 3; + GLUT_KEY_F4 = 4; + GLUT_KEY_F5 = 5; + GLUT_KEY_F6 = 6; + GLUT_KEY_F7 = 7; + GLUT_KEY_F8 = 8; + GLUT_KEY_F9 = 9; + GLUT_KEY_F10 = 10; + GLUT_KEY_F11 = 11; + GLUT_KEY_F12 = 12; + // directional keys + GLUT_KEY_LEFT = 100; + GLUT_KEY_UP = 101; + GLUT_KEY_RIGHT = 102; + GLUT_KEY_DOWN = 103; + GLUT_KEY_PAGE_UP = 104; + GLUT_KEY_PAGE_DOWN = 105; + GLUT_KEY_HOME = 106; + GLUT_KEY_END = 107; + GLUT_KEY_INSERT = 108; + + // Entry/exit state. + GLUT_LEFT = 0; + GLUT_ENTERED = 1; + + // Menu usage state. + GLUT_MENU_NOT_IN_USE = 0; + GLUT_MENU_IN_USE = 1; + + // Visibility state. + GLUT_NOT_VISIBLE = 0; + GLUT_VISIBLE = 1; + + // Window status state. + GLUT_HIDDEN = 0; + GLUT_FULLY_RETAINED = 1; + GLUT_PARTIALLY_RETAINED = 2; + GLUT_FULLY_COVERED = 3; + + // Color index component selection values. + GLUT_RED = 0; + GLUT_GREEN = 1; + GLUT_BLUE = 2; + + // Layers for use. + GLUT_NORMAL = 0; + GLUT_OVERLAY = 1; + +{$ifdef Windows} + // Stroke font constants (use these in GLUT program). + GLUT_STROKE_ROMAN = Pointer(0); + GLUT_STROKE_MONO_ROMAN = Pointer(1); + + // Bitmap font constants (use these in GLUT program). + GLUT_BITMAP_9_BY_15 = Pointer(2); + GLUT_BITMAP_8_BY_13 = Pointer(3); + GLUT_BITMAP_TIMES_ROMAN_10 = Pointer(4); + GLUT_BITMAP_TIMES_ROMAN_24 = Pointer(5); + GLUT_BITMAP_HELVETICA_10 = Pointer(6); + GLUT_BITMAP_HELVETICA_12 = Pointer(7); + GLUT_BITMAP_HELVETICA_18 = Pointer(8); +{$else Windows} +var + // Stroke font constants (use these in GLUT program). + GLUT_STROKE_ROMAN : Pointer; + GLUT_STROKE_MONO_ROMAN : Pointer; + + // Bitmap font constants (use these in GLUT program). + GLUT_BITMAP_9_BY_15 : Pointer; + GLUT_BITMAP_8_BY_13 : Pointer; + GLUT_BITMAP_TIMES_ROMAN_10 : Pointer; + GLUT_BITMAP_TIMES_ROMAN_24 : Pointer; + GLUT_BITMAP_HELVETICA_10 : Pointer; + GLUT_BITMAP_HELVETICA_12 : Pointer; + GLUT_BITMAP_HELVETICA_18 : Pointer; + +const +{$endif Windows} + + // glutGet parameters. + GLUT_WINDOW_X = 100; + GLUT_WINDOW_Y = 101; + GLUT_WINDOW_WIDTH = 102; + GLUT_WINDOW_HEIGHT = 103; + GLUT_WINDOW_BUFFER_SIZE = 104; + GLUT_WINDOW_STENCIL_SIZE = 105; + GLUT_WINDOW_DEPTH_SIZE = 106; + GLUT_WINDOW_RED_SIZE = 107; + GLUT_WINDOW_GREEN_SIZE = 108; + GLUT_WINDOW_BLUE_SIZE = 109; + GLUT_WINDOW_ALPHA_SIZE = 110; + GLUT_WINDOW_ACCUM_RED_SIZE = 111; + GLUT_WINDOW_ACCUM_GREEN_SIZE = 112; + GLUT_WINDOW_ACCUM_BLUE_SIZE = 113; + GLUT_WINDOW_ACCUM_ALPHA_SIZE = 114; + GLUT_WINDOW_DOUBLEBUFFER = 115; + GLUT_WINDOW_RGBA = 116; + GLUT_WINDOW_PARENT = 117; + GLUT_WINDOW_NUM_CHILDREN = 118; + GLUT_WINDOW_COLORMAP_SIZE = 119; + GLUT_WINDOW_NUM_SAMPLES = 120; + GLUT_WINDOW_STEREO = 121; + GLUT_WINDOW_CURSOR = 122; + GLUT_SCREEN_WIDTH = 200; + GLUT_SCREEN_HEIGHT = 201; + GLUT_SCREEN_WIDTH_MM = 202; + GLUT_SCREEN_HEIGHT_MM = 203; + GLUT_MENU_NUM_ITEMS = 300; + GLUT_DISPLAY_MODE_POSSIBLE = 400; + GLUT_INIT_WINDOW_X = 500; + GLUT_INIT_WINDOW_Y = 501; + GLUT_INIT_WINDOW_WIDTH = 502; + GLUT_INIT_WINDOW_HEIGHT = 503; + GLUT_INIT_DISPLAY_MODE = 504; + GLUT_ELAPSED_TIME = 700; + GLUT_WINDOW_FORMAT_ID = 123; + + // glutDeviceGet parameters. + GLUT_HAS_KEYBOARD = 600; + GLUT_HAS_MOUSE = 601; + GLUT_HAS_SPACEBALL = 602; + GLUT_HAS_DIAL_AND_BUTTON_BOX = 603; + GLUT_HAS_TABLET = 604; + GLUT_NUM_MOUSE_BUTTONS = 605; + GLUT_NUM_SPACEBALL_BUTTONS = 606; + GLUT_NUM_BUTTON_BOX_BUTTONS = 607; + GLUT_NUM_DIALS = 608; + GLUT_NUM_TABLET_BUTTONS = 609; + GLUT_DEVICE_IGNORE_KEY_REPEAT = 610; + GLUT_DEVICE_KEY_REPEAT = 611; + GLUT_HAS_JOYSTICK = 612; + GLUT_OWNS_JOYSTICK = 613; + GLUT_JOYSTICK_BUTTONS = 614; + GLUT_JOYSTICK_AXES = 615; + GLUT_JOYSTICK_POLL_RATE = 616; + + + // glutLayerGet parameters. + GLUT_OVERLAY_POSSIBLE = 800; + GLUT_LAYER_IN_USE = 801; + GLUT_HAS_OVERLAY = 802; + GLUT_TRANSPARENT_INDEX = 803; + GLUT_NORMAL_DAMAGED = 804; + GLUT_OVERLAY_DAMAGED = 805; + + // glutVideoResizeGet parameters. + GLUT_VIDEO_RESIZE_POSSIBLE = 900; + GLUT_VIDEO_RESIZE_IN_USE = 901; + GLUT_VIDEO_RESIZE_X_DELTA = 902; + GLUT_VIDEO_RESIZE_Y_DELTA = 903; + GLUT_VIDEO_RESIZE_WIDTH_DELTA = 904; + GLUT_VIDEO_RESIZE_HEIGHT_DELTA = 905; + GLUT_VIDEO_RESIZE_X = 906; + GLUT_VIDEO_RESIZE_Y = 907; + GLUT_VIDEO_RESIZE_WIDTH = 908; + GLUT_VIDEO_RESIZE_HEIGHT = 909; + + // glutGetModifiers return mask. + GLUT_ACTIVE_SHIFT = 1; + GLUT_ACTIVE_CTRL = 2; + GLUT_ACTIVE_ALT = 4; + + // glutSetCursor parameters. + // Basic arrows. + GLUT_CURSOR_RIGHT_ARROW = 0; + GLUT_CURSOR_LEFT_ARROW = 1; + // Symbolic cursor shapes. + GLUT_CURSOR_INFO = 2; + GLUT_CURSOR_DESTROY = 3; + GLUT_CURSOR_HELP = 4; + GLUT_CURSOR_CYCLE = 5; + GLUT_CURSOR_SPRAY = 6; + GLUT_CURSOR_WAIT = 7; + GLUT_CURSOR_TEXT = 8; + GLUT_CURSOR_CROSSHAIR = 9; + // Directional cursors. + GLUT_CURSOR_UP_DOWN = 10; + GLUT_CURSOR_LEFT_RIGHT = 11; + // Sizing cursors. + GLUT_CURSOR_TOP_SIDE = 12; + GLUT_CURSOR_BOTTOM_SIDE = 13; + GLUT_CURSOR_LEFT_SIDE = 14; + GLUT_CURSOR_RIGHT_SIDE = 15; + GLUT_CURSOR_TOP_LEFT_CORNER = 16; + GLUT_CURSOR_TOP_RIGHT_CORNER = 17; + GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18; + GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19; + // Inherit from parent window. + GLUT_CURSOR_INHERIT = 100; + // Blank cursor. + GLUT_CURSOR_NONE = 101; + // Fullscreen crosshair (if available). + GLUT_CURSOR_FULL_CROSSHAIR = 102; + + // GLUT device control sub-API. + // glutSetKeyRepeat modes. + GLUT_KEY_REPEAT_OFF = 0; + GLUT_KEY_REPEAT_ON = 1; + GLUT_KEY_REPEAT_DEFAULT = 2; + +// Joystick button masks. + GLUT_JOYSTICK_BUTTON_A = 1; + GLUT_JOYSTICK_BUTTON_B = 2; + GLUT_JOYSTICK_BUTTON_C = 4; + GLUT_JOYSTICK_BUTTON_D = 8; + + // GLUT game mode sub-API. + // glutGameModeGet. + GLUT_GAME_MODE_ACTIVE = 0; + GLUT_GAME_MODE_POSSIBLE = 1; + GLUT_GAME_MODE_WIDTH = 2; + GLUT_GAME_MODE_HEIGHT = 3; + GLUT_GAME_MODE_PIXEL_DEPTH = 4; + GLUT_GAME_MODE_REFRESH_RATE = 5; + GLUT_GAME_MODE_DISPLAY_CHANGED = 6; + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its headers are included here. } +{$INCLUDE tinyglh.inc} + +{$ELSE MORPHOS} + +{$IFDEF GLUT_EXCLUSIVE_FPUMODE} +var +OLD_glutInit:procedure(argcp: PInteger; argv: PPChar); extdecl; +OLD_glutInitDisplayMode:procedure(mode: Cardinal); extdecl; +OLD_glutInitDisplayString:procedure(const str: PChar); extdecl; +OLD_glutInitWindowPosition:procedure(x, y: Integer); extdecl; +OLD_glutInitWindowSize:procedure(width, height: Integer); extdecl; +OLD_glutMainLoop:procedure; extdecl; +OLD_glutCreateWindow:function(const title: PChar): Integer; extdecl; +OLD_glutCreateSubWindow:function(win, x, y, width, height: Integer): Integer; extdecl; +OLD_glutDestroyWindow:procedure(win: Integer); extdecl; +OLD_glutPostRedisplay:procedure; extdecl; +OLD_glutPostWindowRedisplay:procedure(win: Integer); extdecl; +OLD_glutSwapBuffers:procedure; extdecl; +OLD_glutGetWindow:function: Integer; extdecl; +OLD_glutSetWindow:procedure(win: Integer); extdecl; +OLD_glutSetWindowTitle:procedure(const title: PChar); extdecl; +OLD_glutSetIconTitle:procedure(const title: PChar); extdecl; +OLD_glutPositionWindow:procedure(x, y: Integer); extdecl; +OLD_glutReshapeWindow:procedure(width, height: Integer); extdecl; +OLD_glutPopWindow:procedure; extdecl; +OLD_glutPushWindow:procedure; extdecl; +OLD_glutIconifyWindow:procedure; extdecl; +OLD_glutShowWindow:procedure; extdecl; +OLD_glutHideWindow:procedure; extdecl; +OLD_glutFullScreen:procedure; extdecl; +OLD_glutSetCursor:procedure(cursor: Integer); extdecl; +OLD_glutWarpPointer:procedure(x, y: Integer); extdecl; +OLD_glutEstablishOverlay:procedure; extdecl; +OLD_glutRemoveOverlay:procedure; extdecl; +OLD_glutUseLayer:procedure(layer: GLenum); extdecl; +OLD_glutPostOverlayRedisplay:procedure; extdecl; +OLD_glutPostWindowOverlayRedisplay:procedure(win: Integer); extdecl; +OLD_glutShowOverlay:procedure; extdecl; +OLD_glutHideOverlay:procedure; extdecl; +OLD_glutCreateMenu:function(callback: TGlut1IntCallback): Integer; extdecl; +OLD_glutDestroyMenu:procedure(menu: Integer); extdecl; +OLD_glutGetMenu:function: Integer; extdecl; +OLD_glutSetMenu:procedure(menu: Integer); extdecl; +OLD_glutAddMenuEntry:procedure(const caption: PChar; value: Integer); extdecl; +OLD_glutAddSubMenu:procedure(const caption: PChar; submenu: Integer); extdecl; +OLD_glutChangeToMenuEntry:procedure(item: Integer; const caption: PChar; value: Integer); extdecl; +OLD_glutChangeToSubMenu:procedure(item: Integer; const caption: PChar; submenu: Integer); extdecl; +OLD_glutRemoveMenuItem:procedure(item: Integer); extdecl; +OLD_glutAttachMenu:procedure(button: Integer); extdecl; +OLD_glutDetachMenu:procedure(button: Integer); extdecl; +OLD_glutDisplayFunc:procedure(f: TGlutVoidCallback); extdecl; +OLD_glutReshapeFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutKeyboardFunc:procedure(f: TGlut1Char2IntCallback); extdecl; +OLD_glutMouseFunc:procedure(f: TGlut4IntCallback); extdecl; +OLD_glutMotionFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutPassiveMotionFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutEntryFunc:procedure(f: TGlut1IntCallback); extdecl; +OLD_glutVisibilityFunc:procedure(f: TGlut1IntCallback); extdecl; +OLD_glutIdleFunc:procedure(f: TGlutVoidCallback); extdecl; +OLD_glutTimerFunc:procedure(millis: Cardinal; f: TGlut1IntCallback; value: Integer); extdecl; +OLD_glutMenuStateFunc:procedure(f: TGlut1IntCallback); extdecl; +OLD_glutSpecialFunc:procedure(f: TGlut3IntCallback); extdecl; +OLD_glutSpaceballMotionFunc:procedure(f: TGlut3IntCallback); extdecl; +OLD_glutSpaceballRotateFunc:procedure(f: TGlut3IntCallback); extdecl; +OLD_glutSpaceballButtonFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutButtonBoxFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutDialsFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutTabletMotionFunc:procedure(f: TGlut2IntCallback); extdecl; +OLD_glutTabletButtonFunc:procedure(f: TGlut4IntCallback); extdecl; +OLD_glutMenuStatusFunc:procedure(f: TGlut3IntCallback); extdecl; +OLD_glutOverlayDisplayFunc:procedure(f:TGlutVoidCallback); extdecl; +OLD_glutWindowStatusFunc:procedure(f: TGlut1IntCallback); extdecl; +OLD_glutKeyboardUpFunc:procedure(f: TGlut1Char2IntCallback); extdecl; +OLD_glutSpecialUpFunc:procedure(f: TGlut3IntCallback); extdecl; +OLD_glutJoystickFunc:procedure(f: TGlut1UInt3IntCallback; pollInterval: Integer); extdecl; +OLD_glutSetColor:procedure(cell: Integer; red, green, blue: GLfloat); extdecl; +OLD_glutGetColor:function(ndx, component: Integer): GLfloat; extdecl; +OLD_glutCopyColormap:procedure(win: Integer); extdecl; +OLD_glutGet:function(t: GLenum): Integer; extdecl; +OLD_glutDeviceGet:function(t: GLenum): Integer; extdecl; +OLD_glutExtensionSupported:function(const name: PChar): Integer; extdecl; +OLD_glutGetModifiers:function: Integer; extdecl; +OLD_glutLayerGet:function(t: GLenum): Integer; extdecl; +OLD_glutBitmapCharacter:procedure(font : pointer; character: Integer); extdecl; +OLD_glutBitmapWidth:function(font : pointer; character: Integer): Integer; extdecl; +OLD_glutStrokeCharacter:procedure(font : pointer; character: Integer); extdecl; +OLD_glutStrokeWidth:function(font : pointer; character: Integer): Integer; extdecl; +OLD_glutBitmapLength:function(font: pointer; const str: PChar): Integer; extdecl; +OLD_glutStrokeLength:function(font: pointer; const str: PChar): Integer; extdecl; +OLD_glutWireSphere:procedure(radius: GLdouble; slices, stacks: GLint); extdecl; +OLD_glutSolidSphere:procedure(radius: GLdouble; slices, stacks: GLint); extdecl; +OLD_glutWireCone:procedure(base, height: GLdouble; slices, stacks: GLint); extdecl; +OLD_glutSolidCone:procedure(base, height: GLdouble; slices, stacks: GLint); extdecl; +OLD_glutWireCube:procedure(size: GLdouble); extdecl; +OLD_glutSolidCube:procedure(size: GLdouble); extdecl; +OLD_glutWireTorus:procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); extdecl; +OLD_glutSolidTorus:procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); extdecl; +OLD_glutWireDodecahedron:procedure; extdecl; +OLD_glutSolidDodecahedron:procedure; extdecl; +OLD_glutWireTeapot:procedure(size: GLdouble); extdecl; +OLD_glutSolidTeapot:procedure(size: GLdouble); extdecl; +OLD_glutWireOctahedron:procedure; extdecl; +OLD_glutSolidOctahedron:procedure; extdecl; +OLD_glutWireTetrahedron:procedure; extdecl; +OLD_glutSolidTetrahedron:procedure; extdecl; +OLD_glutWireIcosahedron:procedure; extdecl; +OLD_glutSolidIcosahedron:procedure; extdecl; +OLD_glutVideoResizeGet:function(param: GLenum): Integer; extdecl; +OLD_glutSetupVideoResizing:procedure; extdecl; +OLD_glutStopVideoResizing:procedure; extdecl; +OLD_glutVideoResize:procedure(x, y, width, height: Integer); extdecl; +OLD_glutVideoPan:procedure(x, y, width, height: Integer); extdecl; +OLD_glutReportErrors:procedure; extdecl; +OLD_glutIgnoreKeyRepeat:procedure(ignore: Integer); extdecl; +OLD_glutSetKeyRepeat:procedure(repeatMode: Integer); extdecl; +OLD_glutForceJoystickFunc:procedure; extdecl; +OLD_glutGameModeString:procedure(const AString : PChar); extdecl; +OLD_glutEnterGameMode:function: integer; extdecl; +OLD_glutLeaveGameMode:procedure; extdecl; +OLD_glutGameModeGet:function(mode : GLenum): integer; extdecl; + +procedure glutInit(argcp: PInteger; argv: PPChar); mode_inline; +procedure glutInitDisplayMode(mode: Cardinal); mode_inline; +procedure glutInitDisplayString(const str: PChar); mode_inline; +procedure glutInitWindowPosition(x, y: Integer); mode_inline; +procedure glutInitWindowSize(width, height: Integer); mode_inline; +procedure glutMainLoop; mode_inline; +function glutCreateWindow(const title: PChar): Integer; mode_inline; +function glutCreateSubWindow(win, x, y, width, height: Integer): Integer; mode_inline; +procedure glutDestroyWindow(win: Integer); mode_inline; +procedure glutPostRedisplay; mode_inline; +procedure glutPostWindowRedisplay(win: Integer); mode_inline; +procedure glutSwapBuffers; mode_inline; +function glutGetWindow: Integer; mode_inline; +procedure glutSetWindow(win: Integer); mode_inline; +procedure glutSetWindowTitle(const title: PChar); mode_inline; +procedure glutSetIconTitle(const title: PChar); mode_inline; +procedure glutPositionWindow(x, y: Integer); mode_inline; +procedure glutReshapeWindow(width, height: Integer); mode_inline; +procedure glutPopWindow; mode_inline; +procedure glutPushWindow; mode_inline; +procedure glutIconifyWindow; mode_inline; +procedure glutShowWindow; mode_inline; +procedure glutHideWindow; mode_inline; +procedure glutFullScreen; mode_inline; +procedure glutSetCursor(cursor: Integer); mode_inline; +procedure glutWarpPointer(x, y: Integer); mode_inline; +procedure glutEstablishOverlay; mode_inline; +procedure glutRemoveOverlay; mode_inline; +procedure glutUseLayer(layer: GLenum); mode_inline; +procedure glutPostOverlayRedisplay; mode_inline; +procedure glutPostWindowOverlayRedisplay(win: Integer); mode_inline; +procedure glutShowOverlay; mode_inline; +procedure glutHideOverlay; mode_inline; +function glutCreateMenu(callback: TGlut1IntCallback): Integer; mode_inline; +procedure glutDestroyMenu(menu: Integer); mode_inline; +function glutGetMenu: Integer; mode_inline; +procedure glutSetMenu(menu: Integer); mode_inline; +procedure glutAddMenuEntry(const caption: PChar; value: Integer); mode_inline; +procedure glutAddSubMenu(const caption: PChar; submenu: Integer); mode_inline; +procedure glutChangeToMenuEntry(item: Integer; const caption: PChar; value: Integer); mode_inline; +procedure glutChangeToSubMenu(item: Integer; const caption: PChar; submenu: Integer); mode_inline; +procedure glutRemoveMenuItem(item: Integer); mode_inline; +procedure glutAttachMenu(button: Integer); mode_inline; +procedure glutDetachMenu(button: Integer); mode_inline; +procedure glutDisplayFunc(f: TGlutVoidCallback); mode_inline; +procedure glutReshapeFunc(f: TGlut2IntCallback); mode_inline; +procedure glutKeyboardFunc(f: TGlut1Char2IntCallback); mode_inline; +procedure glutMouseFunc(f: TGlut4IntCallback); mode_inline; +procedure glutMotionFunc(f: TGlut2IntCallback); mode_inline; +procedure glutPassiveMotionFunc(f: TGlut2IntCallback); mode_inline; +procedure glutEntryFunc(f: TGlut1IntCallback); mode_inline; +procedure glutVisibilityFunc(f: TGlut1IntCallback); mode_inline; +procedure glutIdleFunc(f: TGlutVoidCallback); mode_inline; +procedure glutTimerFunc(millis: Cardinal; f: TGlut1IntCallback; value: Integer); mode_inline; +procedure glutMenuStateFunc(f: TGlut1IntCallback); mode_inline; +procedure glutSpecialFunc(f: TGlut3IntCallback); mode_inline; +procedure glutSpaceballMotionFunc(f: TGlut3IntCallback); mode_inline; +procedure glutSpaceballRotateFunc(f: TGlut3IntCallback); mode_inline; +procedure glutSpaceballButtonFunc(f: TGlut2IntCallback); mode_inline; +procedure glutButtonBoxFunc(f: TGlut2IntCallback); mode_inline; +procedure glutDialsFunc(f: TGlut2IntCallback); mode_inline; +procedure glutTabletMotionFunc(f: TGlut2IntCallback); mode_inline; +procedure glutTabletButtonFunc(f: TGlut4IntCallback); mode_inline; +procedure glutMenuStatusFunc(f: TGlut3IntCallback); mode_inline; +procedure glutOverlayDisplayFunc(f:TGlutVoidCallback); mode_inline; +procedure glutWindowStatusFunc(f: TGlut1IntCallback); mode_inline; +procedure glutKeyboardUpFunc(f: TGlut1Char2IntCallback); mode_inline; +procedure glutSpecialUpFunc(f: TGlut3IntCallback); mode_inline; +procedure glutJoystickFunc(f: TGlut1UInt3IntCallback; pollInterval: Integer); mode_inline; +procedure glutSetColor(cell: Integer; red, green, blue: GLfloat); mode_inline; +function glutGetColor(ndx, component: Integer): GLfloat; mode_inline; +procedure glutCopyColormap(win: Integer); mode_inline; +function glutGet(t: GLenum): Integer; mode_inline; +function glutDeviceGet(t: GLenum): Integer; mode_inline; +function glutExtensionSupported(const name: PChar): Integer; mode_inline; +function glutGetModifiers: Integer; mode_inline; +function glutLayerGet(t: GLenum): Integer; mode_inline; +procedure glutBitmapCharacter(font : pointer; character: Integer); mode_inline; +function glutBitmapWidth(font : pointer; character: Integer): Integer; mode_inline; +procedure glutStrokeCharacter(font : pointer; character: Integer); mode_inline; +function glutStrokeWidth(font : pointer; character: Integer): Integer; mode_inline; +function glutBitmapLength(font: pointer; const str: PChar): Integer; mode_inline; +function glutStrokeLength(font: pointer; const str: PChar): Integer; mode_inline; +procedure glutWireSphere(radius: GLdouble; slices, stacks: GLint); mode_inline; +procedure glutSolidSphere(radius: GLdouble; slices, stacks: GLint); mode_inline; +procedure glutWireCone(base, height: GLdouble; slices, stacks: GLint); mode_inline; +procedure glutSolidCone(base, height: GLdouble; slices, stacks: GLint); mode_inline; +procedure glutWireCube(size: GLdouble); mode_inline; +procedure glutSolidCube(size: GLdouble); mode_inline; +procedure glutWireTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); mode_inline; +procedure glutSolidTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); mode_inline; +procedure glutWireDodecahedron; mode_inline; +procedure glutSolidDodecahedron; mode_inline; +procedure glutWireTeapot(size: GLdouble); mode_inline; +procedure glutSolidTeapot(size: GLdouble); mode_inline; +procedure glutWireOctahedron; mode_inline; +procedure glutSolidOctahedron; mode_inline; +procedure glutWireTetrahedron; mode_inline; +procedure glutSolidTetrahedron; mode_inline; +procedure glutWireIcosahedron; mode_inline; +procedure glutSolidIcosahedron; mode_inline; +function glutVideoResizeGet(param: GLenum): Integer; mode_inline; +procedure glutSetupVideoResizing; mode_inline; +procedure glutStopVideoResizing; mode_inline; +procedure glutVideoResize(x, y, width, height: Integer); mode_inline; +procedure glutVideoPan(x, y, width, height: Integer); mode_inline; +procedure glutReportErrors; mode_inline; +procedure glutIgnoreKeyRepeat(ignore: Integer); mode_inline; +procedure glutSetKeyRepeat(repeatMode: Integer); mode_inline; +procedure glutForceJoystickFunc; mode_inline; +procedure glutGameModeString(const AString : PChar); mode_inline; +function glutEnterGameMode: integer; mode_inline; +procedure glutLeaveGameMode; mode_inline; +function glutGameModeGet(mode : GLenum): integer; mode_inline; + + +{$ELSE GLUT_EXCLUSIVE_FPUMODE} +var +// GLUT initialization sub-API. + glutInit: procedure(argcp: PInteger; argv: PPChar); extdecl; + glutInitDisplayMode: procedure(mode: Cardinal); extdecl; + glutInitDisplayString: procedure(const str: PChar); extdecl; + glutInitWindowPosition: procedure(x, y: Integer); extdecl; + glutInitWindowSize: procedure(width, height: Integer); extdecl; + glutMainLoop: procedure; extdecl; + +// GLUT window sub-API. + glutCreateWindow: function(const title: PChar): Integer; extdecl; + glutCreateSubWindow: function(win, x, y, width, height: Integer): Integer; extdecl; + glutDestroyWindow: procedure(win: Integer); extdecl; + glutPostRedisplay: procedure; extdecl; + glutPostWindowRedisplay: procedure(win: Integer); extdecl; + glutSwapBuffers: procedure; extdecl; + glutGetWindow: function: Integer; extdecl; + glutSetWindow: procedure(win: Integer); extdecl; + glutSetWindowTitle: procedure(const title: PChar); extdecl; + glutSetIconTitle: procedure(const title: PChar); extdecl; + glutPositionWindow: procedure(x, y: Integer); extdecl; + glutReshapeWindow: procedure(width, height: Integer); extdecl; + glutPopWindow: procedure; extdecl; + glutPushWindow: procedure; extdecl; + glutIconifyWindow: procedure; extdecl; + glutShowWindow: procedure; extdecl; + glutHideWindow: procedure; extdecl; + glutFullScreen: procedure; extdecl; + glutSetCursor: procedure(cursor: Integer); extdecl; + glutWarpPointer: procedure(x, y: Integer); extdecl; + +// GLUT overlay sub-API. + glutEstablishOverlay: procedure; extdecl; + glutRemoveOverlay: procedure; extdecl; + glutUseLayer: procedure(layer: GLenum); extdecl; + glutPostOverlayRedisplay: procedure; extdecl; + glutPostWindowOverlayRedisplay: procedure(win: Integer); extdecl; + glutShowOverlay: procedure; extdecl; + glutHideOverlay: procedure; extdecl; + +// GLUT menu sub-API. + glutCreateMenu: function(callback: TGlut1IntCallback): Integer; extdecl; + glutDestroyMenu: procedure(menu: Integer); extdecl; + glutGetMenu: function: Integer; extdecl; + glutSetMenu: procedure(menu: Integer); extdecl; + glutAddMenuEntry: procedure(const caption: PChar; value: Integer); extdecl; + glutAddSubMenu: procedure(const caption: PChar; submenu: Integer); extdecl; + glutChangeToMenuEntry: procedure(item: Integer; const caption: PChar; value: Integer); extdecl; + glutChangeToSubMenu: procedure(item: Integer; const caption: PChar; submenu: Integer); extdecl; + glutRemoveMenuItem: procedure(item: Integer); extdecl; + glutAttachMenu: procedure(button: Integer); extdecl; + glutDetachMenu: procedure(button: Integer); extdecl; + +// GLUT window callback sub-API. + glutDisplayFunc: procedure(f: TGlutVoidCallback); extdecl; + glutReshapeFunc: procedure(f: TGlut2IntCallback); extdecl; + glutKeyboardFunc: procedure(f: TGlut1Char2IntCallback); extdecl; + glutMouseFunc: procedure(f: TGlut4IntCallback); extdecl; + glutMotionFunc: procedure(f: TGlut2IntCallback); extdecl; + glutPassiveMotionFunc: procedure(f: TGlut2IntCallback); extdecl; + glutEntryFunc: procedure(f: TGlut1IntCallback); extdecl; + glutVisibilityFunc: procedure(f: TGlut1IntCallback); extdecl; + glutIdleFunc: procedure(f: TGlutVoidCallback); extdecl; + glutTimerFunc: procedure(millis: Cardinal; f: TGlut1IntCallback; value: Integer); extdecl; + glutMenuStateFunc: procedure(f: TGlut1IntCallback); extdecl; + glutSpecialFunc: procedure(f: TGlut3IntCallback); extdecl; + glutSpaceballMotionFunc: procedure(f: TGlut3IntCallback); extdecl; + glutSpaceballRotateFunc: procedure(f: TGlut3IntCallback); extdecl; + glutSpaceballButtonFunc: procedure(f: TGlut2IntCallback); extdecl; + glutButtonBoxFunc: procedure(f: TGlut2IntCallback); extdecl; + glutDialsFunc: procedure(f: TGlut2IntCallback); extdecl; + glutTabletMotionFunc: procedure(f: TGlut2IntCallback); extdecl; + glutTabletButtonFunc: procedure(f: TGlut4IntCallback); extdecl; + glutMenuStatusFunc: procedure(f: TGlut3IntCallback); extdecl; + glutOverlayDisplayFunc: procedure(f:TGlutVoidCallback); extdecl; + glutWindowStatusFunc: procedure(f: TGlut1IntCallback); extdecl; + glutKeyboardUpFunc: procedure(f: TGlut1Char2IntCallback); extdecl; + glutSpecialUpFunc: procedure(f: TGlut3IntCallback); extdecl; + glutJoystickFunc: procedure(f: TGlut1UInt3IntCallback; pollInterval: Integer); extdecl; + +// GLUT color index sub-API. + glutSetColor: procedure(cell: Integer; red, green, blue: GLfloat); extdecl; + glutGetColor: function(ndx, component: Integer): GLfloat; extdecl; + glutCopyColormap: procedure(win: Integer); extdecl; + +// GLUT state retrieval sub-API. + glutGet: function(t: GLenum): Integer; extdecl; + glutDeviceGet: function(t: GLenum): Integer; extdecl; + +// GLUT extension support sub-API + glutExtensionSupported: function(const name: PChar): Integer; extdecl; + glutGetModifiers: function: Integer; extdecl; + glutLayerGet: function(t: GLenum): Integer; extdecl; + +// GLUT font sub-API + glutBitmapCharacter: procedure(font : pointer; character: Integer); extdecl; + glutBitmapWidth: function(font : pointer; character: Integer): Integer; extdecl; + glutStrokeCharacter: procedure(font : pointer; character: Integer); extdecl; + glutStrokeWidth: function(font : pointer; character: Integer): Integer; extdecl; + glutBitmapLength: function(font: pointer; const str: PChar): Integer; extdecl; + glutStrokeLength: function(font: pointer; const str: PChar): Integer; extdecl; + +// GLUT pre-built models sub-API + glutWireSphere: procedure(radius: GLdouble; slices, stacks: GLint); extdecl; + glutSolidSphere: procedure(radius: GLdouble; slices, stacks: GLint); extdecl; + glutWireCone: procedure(base, height: GLdouble; slices, stacks: GLint); extdecl; + glutSolidCone: procedure(base, height: GLdouble; slices, stacks: GLint); extdecl; + glutWireCube: procedure(size: GLdouble); extdecl; + glutSolidCube: procedure(size: GLdouble); extdecl; + glutWireTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); extdecl; + glutSolidTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); extdecl; + glutWireDodecahedron: procedure; extdecl; + glutSolidDodecahedron: procedure; extdecl; + glutWireTeapot: procedure(size: GLdouble); extdecl; + glutSolidTeapot: procedure(size: GLdouble); extdecl; + glutWireOctahedron: procedure; extdecl; + glutSolidOctahedron: procedure; extdecl; + glutWireTetrahedron: procedure; extdecl; + glutSolidTetrahedron: procedure; extdecl; + glutWireIcosahedron: procedure; extdecl; + glutSolidIcosahedron: procedure; extdecl; + +// GLUT video resize sub-API. + glutVideoResizeGet: function(param: GLenum): Integer; extdecl; + glutSetupVideoResizing: procedure; extdecl; + glutStopVideoResizing: procedure; extdecl; + glutVideoResize: procedure(x, y, width, height: Integer); extdecl; + glutVideoPan: procedure(x, y, width, height: Integer); extdecl; + +// GLUT debugging sub-API. + glutReportErrors: procedure; extdecl; + +// GLUT device control sub-API. + + glutIgnoreKeyRepeat: procedure(ignore: Integer); extdecl; + glutSetKeyRepeat: procedure(repeatMode: Integer); extdecl; + glutForceJoystickFunc: procedure; extdecl; + +// GLUT game mode sub-API. + + //example glutGameModeString('1280x1024:32@75'); + glutGameModeString : procedure (const AString : PChar); extdecl; + glutEnterGameMode : function : integer; extdecl; + glutLeaveGameMode : procedure; extdecl; + glutGameModeGet : function (mode : GLenum) : integer; extdecl; + +{$ENDIF GLUT_EXCLUSIVE_FPUMODE} +{$ENDIF MORPHOS} + +procedure LoadGlut(const dll: String); +procedure FreeGlut; + +implementation + +{$IFDEF MORPHOS} + +{ MorphOS GL works differently due to different dynamic-library handling on Amiga-like } +{ systems, so its functions are included here. } +{$INCLUDE tinygl.inc} + +{$ELSE MORPHOS} +var + hDLL: TLibHandle; +{$ENDIF MORPHOS} + +procedure FreeGlut; +begin +{$IFDEF MORPHOS} + // MorphOS's GL will closed down by TinyGL unit, nothing is needed here. +{$ELSE MORPHOS} + + if (hDLL <> 0) then + FreeLibrary(hDLL); + +{$IFDEF GLUT_EXCLUSIVE_FPUMODE} + + @OLD_glutInit := nil; + @OLD_glutInitDisplayMode := nil; + @OLD_glutInitDisplayString := nil; + @OLD_glutInitWindowPosition := nil; + @OLD_glutInitWindowSize := nil; + @OLD_glutMainLoop := nil; + @OLD_glutCreateWindow := nil; + @OLD_glutCreateSubWindow := nil; + @OLD_glutDestroyWindow := nil; + @OLD_glutPostRedisplay := nil; + @OLD_glutPostWindowRedisplay := nil; + @OLD_glutSwapBuffers := nil; + @OLD_glutGetWindow := nil; + @OLD_glutSetWindow := nil; + @OLD_glutSetWindowTitle := nil; + @OLD_glutSetIconTitle := nil; + @OLD_glutPositionWindow := nil; + @OLD_glutReshapeWindow := nil; + @OLD_glutPopWindow := nil; + @OLD_glutPushWindow := nil; + @OLD_glutIconifyWindow := nil; + @OLD_glutShowWindow := nil; + @OLD_glutHideWindow := nil; + @OLD_glutFullScreen := nil; + @OLD_glutSetCursor := nil; + @OLD_glutWarpPointer := nil; + @OLD_glutEstablishOverlay := nil; + @OLD_glutRemoveOverlay := nil; + @OLD_glutUseLayer := nil; + @OLD_glutPostOverlayRedisplay := nil; + @OLD_glutPostWindowOverlayRedisplay := nil; + @OLD_glutShowOverlay := nil; + @OLD_glutHideOverlay := nil; + @OLD_glutCreateMenu := nil; + @OLD_glutDestroyMenu := nil; + @OLD_glutGetMenu := nil; + @OLD_glutSetMenu := nil; + @OLD_glutAddMenuEntry := nil; + @OLD_glutAddSubMenu := nil; + @OLD_glutChangeToMenuEntry := nil; + @OLD_glutChangeToSubMenu := nil; + @OLD_glutRemoveMenuItem := nil; + @OLD_glutAttachMenu := nil; + @OLD_glutDetachMenu := nil; + @OLD_glutDisplayFunc := nil; + @OLD_glutReshapeFunc := nil; + @OLD_glutKeyboardFunc := nil; + @OLD_glutMouseFunc := nil; + @OLD_glutMotionFunc := nil; + @OLD_glutPassiveMotionFunc := nil; + @OLD_glutEntryFunc := nil; + @OLD_glutVisibilityFunc := nil; + @OLD_glutIdleFunc := nil; + @OLD_glutTimerFunc := nil; + @OLD_glutMenuStateFunc := nil; + @OLD_glutSpecialFunc := nil; + @OLD_glutSpaceballMotionFunc := nil; + @OLD_glutSpaceballRotateFunc := nil; + @OLD_glutSpaceballButtonFunc := nil; + @OLD_glutButtonBoxFunc := nil; + @OLD_glutDialsFunc := nil; + @OLD_glutTabletMotionFunc := nil; + @OLD_glutTabletButtonFunc := nil; + @OLD_glutMenuStatusFunc := nil; + @OLD_glutOverlayDisplayFunc := nil; + @OLD_glutWindowStatusFunc := nil; + @OLD_glutKeyboardUpFunc := nil; + @OLD_glutSpecialUpFunc := nil; + @OLD_glutJoystickFunc := nil; + @OLD_glutSetColor := nil; + @OLD_glutGetColor := nil; + @OLD_glutCopyColormap := nil; + @OLD_glutGet := nil; + @OLD_glutDeviceGet := nil; + @OLD_glutExtensionSupported := nil; + @OLD_glutGetModifiers := nil; + @OLD_glutLayerGet := nil; + @OLD_glutBitmapCharacter := nil; + @OLD_glutBitmapWidth := nil; + @OLD_glutStrokeCharacter := nil; + @OLD_glutStrokeWidth := nil; + @OLD_glutBitmapLength := nil; + @OLD_glutStrokeLength := nil; + @OLD_glutWireSphere := nil; + @OLD_glutSolidSphere := nil; + @OLD_glutWireCone := nil; + @OLD_glutSolidCone := nil; + @OLD_glutWireCube := nil; + @OLD_glutSolidCube := nil; + @OLD_glutWireTorus := nil; + @OLD_glutSolidTorus := nil; + @OLD_glutWireDodecahedron := nil; + @OLD_glutSolidDodecahedron := nil; + @OLD_glutWireTeapot := nil; + @OLD_glutSolidTeapot := nil; + @OLD_glutWireOctahedron := nil; + @OLD_glutSolidOctahedron := nil; + @OLD_glutWireTetrahedron := nil; + @OLD_glutSolidTetrahedron := nil; + @OLD_glutWireIcosahedron := nil; + @OLD_glutSolidIcosahedron := nil; + @OLD_glutVideoResizeGet := nil; + @OLD_glutSetupVideoResizing := nil; + @OLD_glutStopVideoResizing := nil; + @OLD_glutVideoResize := nil; + @OLD_glutVideoPan := nil; + @OLD_glutReportErrors := nil; + @OLD_glutIgnoreKeyRepeat := nil; + @OLD_glutSetKeyRepeat := nil; + @OLD_glutForceJoystickFunc := nil; + @OLD_glutGameModeString := nil; + @OLD_glutEnterGameMode := nil; + @OLD_glutLeaveGameMode := nil; + @OLD_glutGameModeGet := nil; + +{$ELSE GLUT_EXCLUSIVE_FPUMODE} + @glutInit := nil; + @glutInitDisplayMode := nil; + @glutInitDisplayString := nil; + @glutInitWindowPosition := nil; + @glutInitWindowSize := nil; + @glutMainLoop := nil; + @glutCreateWindow := nil; + @glutCreateSubWindow := nil; + @glutDestroyWindow := nil; + @glutPostRedisplay := nil; + @glutPostWindowRedisplay := nil; + @glutSwapBuffers := nil; + @glutGetWindow := nil; + @glutSetWindow := nil; + @glutSetWindowTitle := nil; + @glutSetIconTitle := nil; + @glutPositionWindow := nil; + @glutReshapeWindow := nil; + @glutPopWindow := nil; + @glutPushWindow := nil; + @glutIconifyWindow := nil; + @glutShowWindow := nil; + @glutHideWindow := nil; + @glutFullScreen := nil; + @glutSetCursor := nil; + @glutWarpPointer := nil; + @glutEstablishOverlay := nil; + @glutRemoveOverlay := nil; + @glutUseLayer := nil; + @glutPostOverlayRedisplay := nil; + @glutPostWindowOverlayRedisplay := nil; + @glutShowOverlay := nil; + @glutHideOverlay := nil; + @glutCreateMenu := nil; + @glutDestroyMenu := nil; + @glutGetMenu := nil; + @glutSetMenu := nil; + @glutAddMenuEntry := nil; + @glutAddSubMenu := nil; + @glutChangeToMenuEntry := nil; + @glutChangeToSubMenu := nil; + @glutRemoveMenuItem := nil; + @glutAttachMenu := nil; + @glutDetachMenu := nil; + @glutDisplayFunc := nil; + @glutReshapeFunc := nil; + @glutKeyboardFunc := nil; + @glutMouseFunc := nil; + @glutMotionFunc := nil; + @glutPassiveMotionFunc := nil; + @glutEntryFunc := nil; + @glutVisibilityFunc := nil; + @glutIdleFunc := nil; + @glutTimerFunc := nil; + @glutMenuStateFunc := nil; + @glutSpecialFunc := nil; + @glutSpaceballMotionFunc := nil; + @glutSpaceballRotateFunc := nil; + @glutSpaceballButtonFunc := nil; + @glutButtonBoxFunc := nil; + @glutDialsFunc := nil; + @glutTabletMotionFunc := nil; + @glutTabletButtonFunc := nil; + @glutMenuStatusFunc := nil; + @glutOverlayDisplayFunc := nil; + @glutWindowStatusFunc := nil; + @glutKeyboardUpFunc := nil; + @glutSpecialUpFunc := nil; + @glutJoystickFunc := nil; + @glutSetColor := nil; + @glutGetColor := nil; + @glutCopyColormap := nil; + @glutGet := nil; + @glutDeviceGet := nil; + @glutExtensionSupported := nil; + @glutGetModifiers := nil; + @glutLayerGet := nil; + @glutBitmapCharacter := nil; + @glutBitmapWidth := nil; + @glutStrokeCharacter := nil; + @glutStrokeWidth := nil; + @glutBitmapLength := nil; + @glutStrokeLength := nil; + @glutWireSphere := nil; + @glutSolidSphere := nil; + @glutWireCone := nil; + @glutSolidCone := nil; + @glutWireCube := nil; + @glutSolidCube := nil; + @glutWireTorus := nil; + @glutSolidTorus := nil; + @glutWireDodecahedron := nil; + @glutSolidDodecahedron := nil; + @glutWireTeapot := nil; + @glutSolidTeapot := nil; + @glutWireOctahedron := nil; + @glutSolidOctahedron := nil; + @glutWireTetrahedron := nil; + @glutSolidTetrahedron := nil; + @glutWireIcosahedron := nil; + @glutSolidIcosahedron := nil; + @glutVideoResizeGet := nil; + @glutSetupVideoResizing := nil; + @glutStopVideoResizing := nil; + @glutVideoResize := nil; + @glutVideoPan := nil; + @glutReportErrors := nil; + @glutIgnoreKeyRepeat := nil; + @glutSetKeyRepeat := nil; + @glutForceJoystickFunc := nil; + @glutGameModeString := nil; + @glutEnterGameMode := nil; + @glutLeaveGameMode := nil; + @glutGameModeGet := nil; +{$ENDIF GLUT_EXCLUSIVE_FPUMODE} +{$ENDIF MORPHOS} +end; + +procedure LoadGlut(const dll: String); +{$IFDEF MORPHOS} +begin + // MorphOS's GL has own initialization in TinyGL unit, nothing is needed here. +end; +{$ELSE MORPHOS} +var + MethodName: string = ''; + + function GetGLutProcAddress(Lib: PtrInt; ProcName: PChar): Pointer; + begin + MethodName:=ProcName; + Result:=GetProcAddress(Lib, ProcName); + end; + +begin + + FreeGlut; + + hDLL := LoadLibrary(PChar(dll)); + if hDLL = 0 then raise Exception.Create('Could not load Glut from ' + dll); + try +{$IFDEF GLUT_EXCLUSIVE_FPUMODE} + @OLD_glutInit := GetGLutProcAddress(hDLL, 'glutInit'); + @OLD_glutInitDisplayMode := GetGLutProcAddress(hDLL, 'glutInitDisplayMode'); + @OLD_glutInitDisplayString := GetGLutProcAddress(hDLL, 'glutInitDisplayString'); + @OLD_glutInitWindowPosition := GetGLutProcAddress(hDLL, 'glutInitWindowPosition'); + @OLD_glutInitWindowSize := GetGLutProcAddress(hDLL, 'glutInitWindowSize'); + @OLD_glutMainLoop := GetGLutProcAddress(hDLL, 'glutMainLoop'); + @OLD_glutCreateWindow := GetGLutProcAddress(hDLL, 'glutCreateWindow'); + @OLD_glutCreateSubWindow := GetGLutProcAddress(hDLL, 'glutCreateSubWindow'); + @OLD_glutDestroyWindow := GetGLutProcAddress(hDLL, 'glutDestroyWindow'); + @OLD_glutPostRedisplay := GetGLutProcAddress(hDLL, 'glutPostRedisplay'); + @OLD_glutPostWindowRedisplay := GetGLutProcAddress(hDLL, 'glutPostWindowRedisplay'); + @OLD_glutSwapBuffers := GetGLutProcAddress(hDLL, 'glutSwapBuffers'); + @OLD_glutGetWindow := GetGLutProcAddress(hDLL, 'glutGetWindow'); + @OLD_glutSetWindow := GetGLutProcAddress(hDLL, 'glutSetWindow'); + @OLD_glutSetWindowTitle := GetGLutProcAddress(hDLL, 'glutSetWindowTitle'); + @OLD_glutSetIconTitle := GetGLutProcAddress(hDLL, 'glutSetIconTitle'); + @OLD_glutPositionWindow := GetGLutProcAddress(hDLL, 'glutPositionWindow'); + @OLD_glutReshapeWindow := GetGLutProcAddress(hDLL, 'glutReshapeWindow'); + @OLD_glutPopWindow := GetGLutProcAddress(hDLL, 'glutPopWindow'); + @OLD_glutPushWindow := GetGLutProcAddress(hDLL, 'glutPushWindow'); + @OLD_glutIconifyWindow := GetGLutProcAddress(hDLL, 'glutIconifyWindow'); + @OLD_glutShowWindow := GetGLutProcAddress(hDLL, 'glutShowWindow'); + @OLD_glutHideWindow := GetGLutProcAddress(hDLL, 'glutHideWindow'); + @OLD_glutFullScreen := GetGLutProcAddress(hDLL, 'glutFullScreen'); + @OLD_glutSetCursor := GetGLutProcAddress(hDLL, 'glutSetCursor'); + @OLD_glutWarpPointer := GetGLutProcAddress(hDLL, 'glutWarpPointer'); + @OLD_glutEstablishOverlay := GetGLutProcAddress(hDLL, 'glutEstablishOverlay'); + @OLD_glutRemoveOverlay := GetGLutProcAddress(hDLL, 'glutRemoveOverlay'); + @OLD_glutUseLayer := GetGLutProcAddress(hDLL, 'glutUseLayer'); + @OLD_glutPostOverlayRedisplay := GetGLutProcAddress(hDLL, 'glutPostOverlayRedisplay'); + @OLD_glutPostWindowOverlayRedisplay := GetGLutProcAddress(hDLL, 'glutPostWindowOverlayRedisplay'); + @OLD_glutShowOverlay := GetGLutProcAddress(hDLL, 'glutShowOverlay'); + @OLD_glutHideOverlay := GetGLutProcAddress(hDLL, 'glutHideOverlay'); + @OLD_glutCreateMenu := GetGLutProcAddress(hDLL, 'glutCreateMenu'); + @OLD_glutDestroyMenu := GetGLutProcAddress(hDLL, 'glutDestroyMenu'); + @OLD_glutGetMenu := GetGLutProcAddress(hDLL, 'glutGetMenu'); + @OLD_glutSetMenu := GetGLutProcAddress(hDLL, 'glutSetMenu'); + @OLD_glutAddMenuEntry := GetGLutProcAddress(hDLL, 'glutAddMenuEntry'); + @OLD_glutAddSubMenu := GetGLutProcAddress(hDLL, 'glutAddSubMenu'); + @OLD_glutChangeToMenuEntry := GetGLutProcAddress(hDLL, 'glutChangeToMenuEntry'); + @OLD_glutChangeToSubMenu := GetGLutProcAddress(hDLL, 'glutChangeToSubMenu'); + @OLD_glutRemoveMenuItem := GetGLutProcAddress(hDLL, 'glutRemoveMenuItem'); + @OLD_glutAttachMenu := GetGLutProcAddress(hDLL, 'glutAttachMenu'); + @OLD_glutDetachMenu := GetGLutProcAddress(hDLL, 'glutDetachMenu'); + @OLD_glutDisplayFunc := GetGLutProcAddress(hDLL, 'glutDisplayFunc'); + @OLD_glutReshapeFunc := GetGLutProcAddress(hDLL, 'glutReshapeFunc'); + @OLD_glutKeyboardFunc := GetGLutProcAddress(hDLL, 'glutKeyboardFunc'); + @OLD_glutMouseFunc := GetGLutProcAddress(hDLL, 'glutMouseFunc'); + @OLD_glutMotionFunc := GetGLutProcAddress(hDLL, 'glutMotionFunc'); + @OLD_glutPassiveMotionFunc := GetGLutProcAddress(hDLL, 'glutPassiveMotionFunc'); + @OLD_glutEntryFunc := GetGLutProcAddress(hDLL, 'glutEntryFunc'); + @OLD_glutVisibilityFunc := GetGLutProcAddress(hDLL, 'glutVisibilityFunc'); + @OLD_glutIdleFunc := GetGLutProcAddress(hDLL, 'glutIdleFunc'); + @OLD_glutTimerFunc := GetGLutProcAddress(hDLL, 'glutTimerFunc'); + @OLD_glutMenuStateFunc := GetGLutProcAddress(hDLL, 'glutMenuStateFunc'); + @OLD_glutSpecialFunc := GetGLutProcAddress(hDLL, 'glutSpecialFunc'); + @OLD_glutSpaceballMotionFunc := GetGLutProcAddress(hDLL, 'glutSpaceballMotionFunc'); + @OLD_glutSpaceballRotateFunc := GetGLutProcAddress(hDLL, 'glutSpaceballRotateFunc'); + @OLD_glutSpaceballButtonFunc := GetGLutProcAddress(hDLL, 'glutSpaceballButtonFunc'); + @OLD_glutButtonBoxFunc := GetGLutProcAddress(hDLL, 'glutButtonBoxFunc'); + @OLD_glutDialsFunc := GetGLutProcAddress(hDLL, 'glutDialsFunc'); + @OLD_glutTabletMotionFunc := GetGLutProcAddress(hDLL, 'glutTabletMotionFunc'); + @OLD_glutTabletButtonFunc := GetGLutProcAddress(hDLL, 'glutTabletButtonFunc'); + @OLD_glutMenuStatusFunc := GetGLutProcAddress(hDLL, 'glutMenuStatusFunc'); + @OLD_glutOverlayDisplayFunc := GetGLutProcAddress(hDLL, 'glutOverlayDisplayFunc'); + @OLD_glutWindowStatusFunc := GetGLutProcAddress(hDLL, 'glutWindowStatusFunc'); + @OLD_glutKeyboardUpFunc := GetGLutProcAddress(hDLL, 'glutKeyboardUpFunc'); + @OLD_glutSpecialUpFunc := GetGLutProcAddress(hDLL, 'glutSpecialUpFunc'); + @OLD_glutJoystickFunc := GetGLutProcAddress(hDLL, 'glutJoystickFunc'); + @OLD_glutSetColor := GetGLutProcAddress(hDLL, 'glutSetColor'); + @OLD_glutGetColor := GetGLutProcAddress(hDLL, 'glutGetColor'); + @OLD_glutCopyColormap := GetGLutProcAddress(hDLL, 'glutCopyColormap'); + @OLD_glutGet := GetGLutProcAddress(hDLL, 'glutGet'); + @OLD_glutDeviceGet := GetGLutProcAddress(hDLL, 'glutDeviceGet'); + @OLD_glutExtensionSupported := GetGLutProcAddress(hDLL, 'glutExtensionSupported'); + @OLD_glutGetModifiers := GetGLutProcAddress(hDLL, 'glutGetModifiers'); + @OLD_glutLayerGet := GetGLutProcAddress(hDLL, 'glutLayerGet'); + @OLD_glutBitmapCharacter := GetGLutProcAddress(hDLL, 'glutBitmapCharacter'); + @OLD_glutBitmapWidth := GetGLutProcAddress(hDLL, 'glutBitmapWidth'); + @OLD_glutStrokeCharacter := GetGLutProcAddress(hDLL, 'glutStrokeCharacter'); + @OLD_glutStrokeWidth := GetGLutProcAddress(hDLL, 'glutStrokeWidth'); + @OLD_glutBitmapLength := GetGLutProcAddress(hDLL, 'glutBitmapLength'); + @OLD_glutStrokeLength := GetGLutProcAddress(hDLL, 'glutStrokeLength'); + @OLD_glutWireSphere := GetGLutProcAddress(hDLL, 'glutWireSphere'); + @OLD_glutSolidSphere := GetGLutProcAddress(hDLL, 'glutSolidSphere'); + @OLD_glutWireCone := GetGLutProcAddress(hDLL, 'glutWireCone'); + @OLD_glutSolidCone := GetGLutProcAddress(hDLL, 'glutSolidCone'); + @OLD_glutWireCube := GetGLutProcAddress(hDLL, 'glutWireCube'); + @OLD_glutSolidCube := GetGLutProcAddress(hDLL, 'glutSolidCube'); + @OLD_glutWireTorus := GetGLutProcAddress(hDLL, 'glutWireTorus'); + @OLD_glutSolidTorus := GetGLutProcAddress(hDLL, 'glutSolidTorus'); + @OLD_glutWireDodecahedron := GetGLutProcAddress(hDLL, 'glutWireDodecahedron'); + @OLD_glutSolidDodecahedron := GetGLutProcAddress(hDLL, 'glutSolidDodecahedron'); + @OLD_glutWireTeapot := GetGLutProcAddress(hDLL, 'glutWireTeapot'); + @OLD_glutSolidTeapot := GetGLutProcAddress(hDLL, 'glutSolidTeapot'); + @OLD_glutWireOctahedron := GetGLutProcAddress(hDLL, 'glutWireOctahedron'); + @OLD_glutSolidOctahedron := GetGLutProcAddress(hDLL, 'glutSolidOctahedron'); + @OLD_glutWireTetrahedron := GetGLutProcAddress(hDLL, 'glutWireTetrahedron'); + @OLD_glutSolidTetrahedron := GetGLutProcAddress(hDLL, 'glutSolidTetrahedron'); + @OLD_glutWireIcosahedron := GetGLutProcAddress(hDLL, 'glutWireIcosahedron'); + @OLD_glutSolidIcosahedron := GetGLutProcAddress(hDLL, 'glutSolidIcosahedron'); + @OLD_glutVideoResizeGet := GetGLutProcAddress(hDLL, 'glutVideoResizeGet'); + @OLD_glutSetupVideoResizing := GetGLutProcAddress(hDLL, 'glutSetupVideoResizing'); + @OLD_glutStopVideoResizing := GetGLutProcAddress(hDLL, 'glutStopVideoResizing'); + @OLD_glutVideoResize := GetGLutProcAddress(hDLL, 'glutVideoResize'); + @OLD_glutVideoPan := GetGLutProcAddress(hDLL, 'glutVideoPan'); + @OLD_glutReportErrors := GetGLutProcAddress(hDLL, 'glutReportErrors'); + @OLD_glutIgnoreKeyRepeat := GetGLutProcAddress(hDLL, 'glutIgnoreKeyRepeat'); + @OLD_glutSetKeyRepeat := GetGLutProcAddress(hDLL, 'glutSetKeyRepeat'); + @OLD_glutForceJoystickFunc := GetGLutProcAddress(hDLL, 'glutForceJoystickFunc'); + @OLD_glutGameModeString := GetGLutProcAddress(hDLL, 'glutGameModeString'); + @OLD_glutEnterGameMode := GetGLutProcAddress(hDLL, 'glutEnterGameMode'); + @OLD_glutLeaveGameMode := GetGLutProcAddress(hDLL, 'glutLeaveGameMode'); + @OLD_glutGameModeGet := GetGLutProcAddress(hDLL, 'glutGameModeGet'); +{$ELSE GLUT_EXCLUSIVE_FPUMODE} + @glutInit := GetGLutProcAddress(hDLL, 'glutInit'); + @glutInitDisplayMode := GetGLutProcAddress(hDLL, 'glutInitDisplayMode'); + @glutInitDisplayString := GetGLutProcAddress(hDLL, 'glutInitDisplayString'); + @glutInitWindowPosition := GetGLutProcAddress(hDLL, 'glutInitWindowPosition'); + @glutInitWindowSize := GetGLutProcAddress(hDLL, 'glutInitWindowSize'); + @glutMainLoop := GetGLutProcAddress(hDLL, 'glutMainLoop'); + @glutCreateWindow := GetGLutProcAddress(hDLL, 'glutCreateWindow'); + @glutCreateSubWindow := GetGLutProcAddress(hDLL, 'glutCreateSubWindow'); + @glutDestroyWindow := GetGLutProcAddress(hDLL, 'glutDestroyWindow'); + @glutPostRedisplay := GetGLutProcAddress(hDLL, 'glutPostRedisplay'); + @glutPostWindowRedisplay := GetGLutProcAddress(hDLL, 'glutPostWindowRedisplay'); + @glutSwapBuffers := GetGLutProcAddress(hDLL, 'glutSwapBuffers'); + @glutGetWindow := GetGLutProcAddress(hDLL, 'glutGetWindow'); + @glutSetWindow := GetGLutProcAddress(hDLL, 'glutSetWindow'); + @glutSetWindowTitle := GetGLutProcAddress(hDLL, 'glutSetWindowTitle'); + @glutSetIconTitle := GetGLutProcAddress(hDLL, 'glutSetIconTitle'); + @glutPositionWindow := GetGLutProcAddress(hDLL, 'glutPositionWindow'); + @glutReshapeWindow := GetGLutProcAddress(hDLL, 'glutReshapeWindow'); + @glutPopWindow := GetGLutProcAddress(hDLL, 'glutPopWindow'); + @glutPushWindow := GetGLutProcAddress(hDLL, 'glutPushWindow'); + @glutIconifyWindow := GetGLutProcAddress(hDLL, 'glutIconifyWindow'); + @glutShowWindow := GetGLutProcAddress(hDLL, 'glutShowWindow'); + @glutHideWindow := GetGLutProcAddress(hDLL, 'glutHideWindow'); + @glutFullScreen := GetGLutProcAddress(hDLL, 'glutFullScreen'); + @glutSetCursor := GetGLutProcAddress(hDLL, 'glutSetCursor'); + @glutWarpPointer := GetGLutProcAddress(hDLL, 'glutWarpPointer'); + @glutEstablishOverlay := GetGLutProcAddress(hDLL, 'glutEstablishOverlay'); + @glutRemoveOverlay := GetGLutProcAddress(hDLL, 'glutRemoveOverlay'); + @glutUseLayer := GetGLutProcAddress(hDLL, 'glutUseLayer'); + @glutPostOverlayRedisplay := GetGLutProcAddress(hDLL, 'glutPostOverlayRedisplay'); + @glutPostWindowOverlayRedisplay := GetGLutProcAddress(hDLL, 'glutPostWindowOverlayRedisplay'); + @glutShowOverlay := GetGLutProcAddress(hDLL, 'glutShowOverlay'); + @glutHideOverlay := GetGLutProcAddress(hDLL, 'glutHideOverlay'); + @glutCreateMenu := GetGLutProcAddress(hDLL, 'glutCreateMenu'); + @glutDestroyMenu := GetGLutProcAddress(hDLL, 'glutDestroyMenu'); + @glutGetMenu := GetGLutProcAddress(hDLL, 'glutGetMenu'); + @glutSetMenu := GetGLutProcAddress(hDLL, 'glutSetMenu'); + @glutAddMenuEntry := GetGLutProcAddress(hDLL, 'glutAddMenuEntry'); + @glutAddSubMenu := GetGLutProcAddress(hDLL, 'glutAddSubMenu'); + @glutChangeToMenuEntry := GetGLutProcAddress(hDLL, 'glutChangeToMenuEntry'); + @glutChangeToSubMenu := GetGLutProcAddress(hDLL, 'glutChangeToSubMenu'); + @glutRemoveMenuItem := GetGLutProcAddress(hDLL, 'glutRemoveMenuItem'); + @glutAttachMenu := GetGLutProcAddress(hDLL, 'glutAttachMenu'); + @glutDetachMenu := GetGLutProcAddress(hDLL, 'glutDetachMenu'); + @glutDisplayFunc := GetGLutProcAddress(hDLL, 'glutDisplayFunc'); + @glutReshapeFunc := GetGLutProcAddress(hDLL, 'glutReshapeFunc'); + @glutKeyboardFunc := GetGLutProcAddress(hDLL, 'glutKeyboardFunc'); + @glutMouseFunc := GetGLutProcAddress(hDLL, 'glutMouseFunc'); + @glutMotionFunc := GetGLutProcAddress(hDLL, 'glutMotionFunc'); + @glutPassiveMotionFunc := GetGLutProcAddress(hDLL, 'glutPassiveMotionFunc'); + @glutEntryFunc := GetGLutProcAddress(hDLL, 'glutEntryFunc'); + @glutVisibilityFunc := GetGLutProcAddress(hDLL, 'glutVisibilityFunc'); + @glutIdleFunc := GetGLutProcAddress(hDLL, 'glutIdleFunc'); + @glutTimerFunc := GetGLutProcAddress(hDLL, 'glutTimerFunc'); + @glutMenuStateFunc := GetGLutProcAddress(hDLL, 'glutMenuStateFunc'); + @glutSpecialFunc := GetGLutProcAddress(hDLL, 'glutSpecialFunc'); + @glutSpaceballMotionFunc := GetGLutProcAddress(hDLL, 'glutSpaceballMotionFunc'); + @glutSpaceballRotateFunc := GetGLutProcAddress(hDLL, 'glutSpaceballRotateFunc'); + @glutSpaceballButtonFunc := GetGLutProcAddress(hDLL, 'glutSpaceballButtonFunc'); + @glutButtonBoxFunc := GetGLutProcAddress(hDLL, 'glutButtonBoxFunc'); + @glutDialsFunc := GetGLutProcAddress(hDLL, 'glutDialsFunc'); + @glutTabletMotionFunc := GetGLutProcAddress(hDLL, 'glutTabletMotionFunc'); + @glutTabletButtonFunc := GetGLutProcAddress(hDLL, 'glutTabletButtonFunc'); + @glutMenuStatusFunc := GetGLutProcAddress(hDLL, 'glutMenuStatusFunc'); + @glutOverlayDisplayFunc := GetGLutProcAddress(hDLL, 'glutOverlayDisplayFunc'); + @glutWindowStatusFunc := GetGLutProcAddress(hDLL, 'glutWindowStatusFunc'); + @glutKeyboardUpFunc := GetGLutProcAddress(hDLL, 'glutKeyboardUpFunc'); + @glutSpecialUpFunc := GetGLutProcAddress(hDLL, 'glutSpecialUpFunc'); + @glutJoystickFunc := GetGLutProcAddress(hDLL, 'glutJoystickFunc'); + @glutSetColor := GetGLutProcAddress(hDLL, 'glutSetColor'); + @glutGetColor := GetGLutProcAddress(hDLL, 'glutGetColor'); + @glutCopyColormap := GetGLutProcAddress(hDLL, 'glutCopyColormap'); + @glutGet := GetGLutProcAddress(hDLL, 'glutGet'); + @glutDeviceGet := GetGLutProcAddress(hDLL, 'glutDeviceGet'); + @glutExtensionSupported := GetGLutProcAddress(hDLL, 'glutExtensionSupported'); + @glutGetModifiers := GetGLutProcAddress(hDLL, 'glutGetModifiers'); + @glutLayerGet := GetGLutProcAddress(hDLL, 'glutLayerGet'); + @glutBitmapCharacter := GetGLutProcAddress(hDLL, 'glutBitmapCharacter'); + @glutBitmapWidth := GetGLutProcAddress(hDLL, 'glutBitmapWidth'); + @glutStrokeCharacter := GetGLutProcAddress(hDLL, 'glutStrokeCharacter'); + @glutStrokeWidth := GetGLutProcAddress(hDLL, 'glutStrokeWidth'); + @glutBitmapLength := GetGLutProcAddress(hDLL, 'glutBitmapLength'); + @glutStrokeLength := GetGLutProcAddress(hDLL, 'glutStrokeLength'); + @glutWireSphere := GetGLutProcAddress(hDLL, 'glutWireSphere'); + @glutSolidSphere := GetGLutProcAddress(hDLL, 'glutSolidSphere'); + @glutWireCone := GetGLutProcAddress(hDLL, 'glutWireCone'); + @glutSolidCone := GetGLutProcAddress(hDLL, 'glutSolidCone'); + @glutWireCube := GetGLutProcAddress(hDLL, 'glutWireCube'); + @glutSolidCube := GetGLutProcAddress(hDLL, 'glutSolidCube'); + @glutWireTorus := GetGLutProcAddress(hDLL, 'glutWireTorus'); + @glutSolidTorus := GetGLutProcAddress(hDLL, 'glutSolidTorus'); + @glutWireDodecahedron := GetGLutProcAddress(hDLL, 'glutWireDodecahedron'); + @glutSolidDodecahedron := GetGLutProcAddress(hDLL, 'glutSolidDodecahedron'); + @glutWireTeapot := GetGLutProcAddress(hDLL, 'glutWireTeapot'); + @glutSolidTeapot := GetGLutProcAddress(hDLL, 'glutSolidTeapot'); + @glutWireOctahedron := GetGLutProcAddress(hDLL, 'glutWireOctahedron'); + @glutSolidOctahedron := GetGLutProcAddress(hDLL, 'glutSolidOctahedron'); + @glutWireTetrahedron := GetGLutProcAddress(hDLL, 'glutWireTetrahedron'); + @glutSolidTetrahedron := GetGLutProcAddress(hDLL, 'glutSolidTetrahedron'); + @glutWireIcosahedron := GetGLutProcAddress(hDLL, 'glutWireIcosahedron'); + @glutSolidIcosahedron := GetGLutProcAddress(hDLL, 'glutSolidIcosahedron'); + @glutVideoResizeGet := GetGLutProcAddress(hDLL, 'glutVideoResizeGet'); + @glutSetupVideoResizing := GetGLutProcAddress(hDLL, 'glutSetupVideoResizing'); + @glutStopVideoResizing := GetGLutProcAddress(hDLL, 'glutStopVideoResizing'); + @glutVideoResize := GetGLutProcAddress(hDLL, 'glutVideoResize'); + @glutVideoPan := GetGLutProcAddress(hDLL, 'glutVideoPan'); + @glutReportErrors := GetGLutProcAddress(hDLL, 'glutReportErrors'); + @glutIgnoreKeyRepeat := GetGLutProcAddress(hDLL, 'glutIgnoreKeyRepeat'); + @glutSetKeyRepeat := GetGLutProcAddress(hDLL, 'glutSetKeyRepeat'); + @glutForceJoystickFunc := GetGLutProcAddress(hDLL, 'glutForceJoystickFunc'); + @glutGameModeString := GetGLutProcAddress(hDLL, 'glutGameModeString'); + @glutEnterGameMode := GetGLutProcAddress(hDLL, 'glutEnterGameMode'); + @glutLeaveGameMode := GetGLutProcAddress(hDLL, 'glutLeaveGameMode'); + @glutGameModeGet := GetGLutProcAddress(hDLL, 'glutGameModeGet'); +{$ENDIF GLUT_EXCLUSIVE_FPUMODE} + +{$ifndef Windows} + GLUT_STROKE_ROMAN := GetGLutProcAddress(hDll, 'glutStrokeRoman'); + GLUT_STROKE_MONO_ROMAN := GetGLutProcAddress(hDll,'glutStrokeMonoRoman'); + GLUT_BITMAP_9_BY_15 := GetGLutProcAddress(hDll, 'glutBitmap9By15'); + GLUT_BITMAP_8_BY_13 := GetGLutProcAddress(hDll, 'glutBitmap8By13'); + GLUT_BITMAP_TIMES_ROMAN_10 := GetGLutProcAddress(hDll, 'glutBitmapTimesRoman10'); + GLUT_BITMAP_TIMES_ROMAN_24 := GetGLutProcAddress(hDll, 'glutBitmapTimesRoman24'); + GLUT_BITMAP_HELVETICA_10 := GetGLutProcAddress(hDll, 'glutBitmapHelvetica10'); + GLUT_BITMAP_HELVETICA_12 := GetGLutProcAddress(hDll, 'glutBitmapHelvetica12'); + GLUT_BITMAP_HELVETICA_18 := GetGLutProcAddress(hDll, 'glutBitmapHelvetica18'); +{$endif Windows} + except + raise Exception.Create('Could not load ' + MethodName + ' from ' + dll); + end; +end; +{$ENDIF MORPHOS} + +{$IFDEF GLUT_EXCLUSIVE_FPUMODE} + +VAR +GLUT_EXCLUSIVE_glut_ExceptionMask : TFPUExceptionMask; +GLUT_EXCLUSIVE_fpc__ExceptionMask : TFPUExceptionMask; +GLUT_EXCLUSIVE_glut_PrecisionMode : TFPUPrecisionMode; +GLUT_EXCLUSIVE_fpc__PrecisionMode : TFPUPrecisionMode; +GLUT_EXCLUSIVE_glut_RoundMode : TFPURoundingMode; +GLUT_EXCLUSIVE_fpc__RoundMode : TFPURoundingMode; + + +PROCEDURE init_fpumode; +BEGIN + GLUT_EXCLUSIVE_glut_ExceptionMask := GetExceptionMask+[exDenormalized, exInvalidOp, exOverflow, exPrecision, exUnderflow, exZeroDivide]; + GLUT_EXCLUSIVE_glut_PrecisionMode := GetPrecisionMode; + GLUT_EXCLUSIVE_glut_RoundMode := GetRoundMode; +END; + + +PROCEDURE switch_to_glut_fpumode; mode_inline; +BEGIN + GLUT_EXCLUSIVE_fpc__ExceptionMask := GetExceptionMask; + GLUT_EXCLUSIVE_fpc__PrecisionMode := GetPrecisionMode; + GLUT_EXCLUSIVE_fpc__RoundMode := GetRoundMode; + SetExceptionMask(GLUT_EXCLUSIVE_glut_ExceptionMask); + SetPrecisionMode(GLUT_EXCLUSIVE_glut_PrecisionMode); + SetRoundMode(GLUT_EXCLUSIVE_glut_RoundMode); +END; + +PROCEDURE switch_to_FPC_fpumode; mode_inline; +BEGIN + GLUT_EXCLUSIVE_glut_ExceptionMask := GetExceptionMask; + GLUT_EXCLUSIVE_glut_PrecisionMode := GetPrecisionMode; + GLUT_EXCLUSIVE_glut_RoundMode := GetRoundMode; + SetExceptionMask(GLUT_EXCLUSIVE_fpc__ExceptionMask); + SetPrecisionMode(GLUT_EXCLUSIVE_fpc__PrecisionMode); + SetRoundMode(GLUT_EXCLUSIVE_fpc__RoundMode); +END; + + +procedure glutInit(argcp: PInteger; argv: PPChar); +begin + switch_to_glut_fpumode; + OLD_glutInit(argcp,argv); + switch_to_FPC_fpumode; +end; + +procedure glutInitDisplayMode(mode: Cardinal); +begin + switch_to_glut_fpumode; + OLD_glutInitDisplayMode(mode); + switch_to_FPC_fpumode; +end; + +procedure glutInitDisplayString(const str: PChar); +begin + switch_to_glut_fpumode; + OLD_glutInitDisplayString(str); + switch_to_FPC_fpumode; +end; + +procedure glutInitWindowPosition(x, y: Integer); +begin + switch_to_glut_fpumode; + OLD_glutInitWindowPosition(x,y); + switch_to_FPC_fpumode; +end; + +procedure glutInitWindowSize(width, height: Integer); +begin + switch_to_glut_fpumode; + OLD_glutInitWindowSize(width,height); + switch_to_FPC_fpumode; +end; + +procedure glutMainLoop; +begin + switch_to_glut_fpumode; + OLD_glutMainLoop(); + switch_to_FPC_fpumode; +end; + +function glutCreateWindow(const title: PChar): Integer; +begin + switch_to_glut_fpumode; + glutCreateWindow := OLD_glutCreateWindow(title); + switch_to_FPC_fpumode; +end; + +function glutCreateSubWindow(win, x, y, width, height: Integer): Integer; +begin + switch_to_glut_fpumode; + glutCreateSubWindow := OLD_glutCreateSubWindow(win,x,y,width,height); + switch_to_FPC_fpumode; +end; + +procedure glutDestroyWindow(win: Integer); +begin + switch_to_glut_fpumode; + OLD_glutDestroyWindow(win); + switch_to_FPC_fpumode; +end; + +procedure glutPostRedisplay; +begin + switch_to_glut_fpumode; + OLD_glutPostRedisplay(); + switch_to_FPC_fpumode; +end; + +procedure glutPostWindowRedisplay(win: Integer); +begin + switch_to_glut_fpumode; + OLD_glutPostWindowRedisplay(win); + switch_to_FPC_fpumode; +end; + +procedure glutSwapBuffers; +begin + switch_to_glut_fpumode; + OLD_glutSwapBuffers(); + switch_to_FPC_fpumode; +end; + +function glutGetWindow: Integer; +begin + switch_to_glut_fpumode; + glutGetWindow := OLD_glutGetWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutSetWindow(win: Integer); +begin + switch_to_glut_fpumode; + OLD_glutSetWindow(win); + switch_to_FPC_fpumode; +end; + +procedure glutSetWindowTitle(const title: PChar); +begin + switch_to_glut_fpumode; + OLD_glutSetWindowTitle(title); + switch_to_FPC_fpumode; +end; + +procedure glutSetIconTitle(const title: PChar); +begin + switch_to_glut_fpumode; + OLD_glutSetIconTitle(title); + switch_to_FPC_fpumode; +end; + +procedure glutPositionWindow(x, y: Integer); +begin + switch_to_glut_fpumode; + OLD_glutPositionWindow(x,y); + switch_to_FPC_fpumode; +end; + +procedure glutReshapeWindow(width, height: Integer); +begin + switch_to_glut_fpumode; + OLD_glutReshapeWindow(width,height); + switch_to_FPC_fpumode; +end; + +procedure glutPopWindow; +begin + switch_to_glut_fpumode; + OLD_glutPopWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutPushWindow; +begin + switch_to_glut_fpumode; + OLD_glutPushWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutIconifyWindow; +begin + switch_to_glut_fpumode; + OLD_glutIconifyWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutShowWindow; +begin + switch_to_glut_fpumode; + OLD_glutShowWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutHideWindow; +begin + switch_to_glut_fpumode; + OLD_glutHideWindow(); + switch_to_FPC_fpumode; +end; + +procedure glutFullScreen; +begin + switch_to_glut_fpumode; + OLD_glutFullScreen(); + switch_to_FPC_fpumode; +end; + +procedure glutSetCursor(cursor: Integer); +begin + switch_to_glut_fpumode; + OLD_glutSetCursor(cursor); + switch_to_FPC_fpumode; +end; + +procedure glutWarpPointer(x, y: Integer); +begin + switch_to_glut_fpumode; + OLD_glutWarpPointer(x,y); + switch_to_FPC_fpumode; +end; + +procedure glutEstablishOverlay; +begin + switch_to_glut_fpumode; + OLD_glutEstablishOverlay(); + switch_to_FPC_fpumode; +end; + +procedure glutRemoveOverlay; +begin + switch_to_glut_fpumode; + OLD_glutRemoveOverlay(); + switch_to_FPC_fpumode; +end; + +procedure glutUseLayer(layer: GLenum); +begin + switch_to_glut_fpumode; + OLD_glutUseLayer(layer); + switch_to_FPC_fpumode; +end; + +procedure glutPostOverlayRedisplay; +begin + switch_to_glut_fpumode; + OLD_glutPostOverlayRedisplay(); + switch_to_FPC_fpumode; +end; + +procedure glutPostWindowOverlayRedisplay(win: Integer); +begin + switch_to_glut_fpumode; + OLD_glutPostWindowOverlayRedisplay(win); + switch_to_FPC_fpumode; +end; + +procedure glutShowOverlay; +begin + switch_to_glut_fpumode; + OLD_glutShowOverlay(); + switch_to_FPC_fpumode; +end; + +procedure glutHideOverlay; +begin + switch_to_glut_fpumode; + OLD_glutHideOverlay(); + switch_to_FPC_fpumode; +end; + +function glutCreateMenu(callback: TGlut1IntCallback): Integer; +begin + switch_to_glut_fpumode; + glutCreateMenu := OLD_glutCreateMenu(callback); + switch_to_FPC_fpumode; +end; + +procedure glutDestroyMenu(menu: Integer); +begin + switch_to_glut_fpumode; + OLD_glutDestroyMenu(menu); + switch_to_FPC_fpumode; +end; + +function glutGetMenu: Integer; +begin + switch_to_glut_fpumode; + glutGetMenu := OLD_glutGetMenu(); + switch_to_FPC_fpumode; +end; + +procedure glutSetMenu(menu: Integer); +begin + switch_to_glut_fpumode; + OLD_glutSetMenu(menu); + switch_to_FPC_fpumode; +end; + +procedure glutAddMenuEntry(const caption: PChar; value: Integer); +begin + switch_to_glut_fpumode; + OLD_glutAddMenuEntry(caption,value); + switch_to_FPC_fpumode; +end; + +procedure glutAddSubMenu(const caption: PChar; submenu: Integer); +begin + switch_to_glut_fpumode; + OLD_glutAddSubMenu(caption,submenu); + switch_to_FPC_fpumode; +end; + +procedure glutChangeToMenuEntry(item: Integer; const caption: PChar; value: Integer); +begin + switch_to_glut_fpumode; + OLD_glutChangeToMenuEntry(item,caption,value); + switch_to_FPC_fpumode; +end; + +procedure glutChangeToSubMenu(item: Integer; const caption: PChar; submenu: Integer); +begin + switch_to_glut_fpumode; + OLD_glutChangeToSubMenu(item,caption,submenu); + switch_to_FPC_fpumode; +end; + +procedure glutRemoveMenuItem(item: Integer); +begin + switch_to_glut_fpumode; + OLD_glutRemoveMenuItem(item); + switch_to_FPC_fpumode; +end; + +procedure glutAttachMenu(button: Integer); +begin + switch_to_glut_fpumode; + OLD_glutAttachMenu(button); + switch_to_FPC_fpumode; +end; + +procedure glutDetachMenu(button: Integer); +begin + switch_to_glut_fpumode; + OLD_glutDetachMenu(button); + switch_to_FPC_fpumode; +end; + +procedure glutDisplayFunc(f: TGlutVoidCallback); +begin + switch_to_glut_fpumode; + OLD_glutDisplayFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutReshapeFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutReshapeFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutKeyboardFunc(f: TGlut1Char2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutKeyboardFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutMouseFunc(f: TGlut4IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutMouseFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutMotionFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutMotionFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutPassiveMotionFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutPassiveMotionFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutEntryFunc(f: TGlut1IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutEntryFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutVisibilityFunc(f: TGlut1IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutVisibilityFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutIdleFunc(f: TGlutVoidCallback); +begin + switch_to_glut_fpumode; + OLD_glutIdleFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutTimerFunc(millis: Cardinal; f: TGlut1IntCallback; value: Integer); +begin + switch_to_glut_fpumode; + OLD_glutTimerFunc(millis,f,value); + switch_to_FPC_fpumode; +end; + +procedure glutMenuStateFunc(f: TGlut1IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutMenuStateFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutSpecialFunc(f: TGlut3IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutSpecialFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutSpaceballMotionFunc(f: TGlut3IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutSpaceballMotionFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutSpaceballRotateFunc(f: TGlut3IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutSpaceballRotateFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutSpaceballButtonFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutSpaceballButtonFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutButtonBoxFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutButtonBoxFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutDialsFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutDialsFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutTabletMotionFunc(f: TGlut2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutTabletMotionFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutTabletButtonFunc(f: TGlut4IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutTabletButtonFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutMenuStatusFunc(f: TGlut3IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutMenuStatusFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutOverlayDisplayFunc(f:TGlutVoidCallback); +begin + switch_to_glut_fpumode; + OLD_glutOverlayDisplayFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutWindowStatusFunc(f: TGlut1IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutWindowStatusFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutKeyboardUpFunc(f: TGlut1Char2IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutKeyboardUpFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutSpecialUpFunc(f: TGlut3IntCallback); +begin + switch_to_glut_fpumode; + OLD_glutSpecialUpFunc(f); + switch_to_FPC_fpumode; +end; + +procedure glutJoystickFunc(f: TGlut1UInt3IntCallback; pollInterval: Integer); +begin + switch_to_glut_fpumode; + OLD_glutJoystickFunc(f,pollInterval); + switch_to_FPC_fpumode; +end; + +procedure glutSetColor(cell: Integer; red, green, blue: GLfloat); +begin + switch_to_glut_fpumode; + OLD_glutSetColor(cell,red,green,blue); + switch_to_FPC_fpumode; +end; + +function glutGetColor(ndx, component: Integer): GLfloat; +begin + switch_to_glut_fpumode; + glutGetColor := OLD_glutGetColor(ndx,component); + switch_to_FPC_fpumode; +end; + +procedure glutCopyColormap(win: Integer); +begin + switch_to_glut_fpumode; + OLD_glutCopyColormap(win); + switch_to_FPC_fpumode; +end; + +function glutGet(t: GLenum): Integer; +begin + switch_to_glut_fpumode; + glutGet := OLD_glutGet(t); + switch_to_FPC_fpumode; +end; + +function glutDeviceGet(t: GLenum): Integer; +begin + switch_to_glut_fpumode; + glutDeviceGet := OLD_glutDeviceGet(t); + switch_to_FPC_fpumode; +end; + +function glutExtensionSupported(const name: PChar): Integer; +begin + switch_to_glut_fpumode; + glutExtensionSupported := OLD_glutExtensionSupported(name); + switch_to_FPC_fpumode; +end; + +function glutGetModifiers: Integer; +begin + switch_to_glut_fpumode; + glutGetModifiers := OLD_glutGetModifiers(); + switch_to_FPC_fpumode; +end; + +function glutLayerGet(t: GLenum): Integer; +begin + switch_to_glut_fpumode; + glutLayerGet := OLD_glutLayerGet(t); + switch_to_FPC_fpumode; +end; + +procedure glutBitmapCharacter(font : pointer; character: Integer); +begin + switch_to_glut_fpumode; + OLD_glutBitmapCharacter(font,character); + switch_to_FPC_fpumode; +end; + +function glutBitmapWidth(font : pointer; character: Integer): Integer; +begin + switch_to_glut_fpumode; + glutBitmapWidth := OLD_glutBitmapWidth(font,character); + switch_to_FPC_fpumode; +end; + +procedure glutStrokeCharacter(font : pointer; character: Integer); +begin + switch_to_glut_fpumode; + OLD_glutStrokeCharacter(font,character); + switch_to_FPC_fpumode; +end; + +function glutStrokeWidth(font : pointer; character: Integer): Integer; +begin + switch_to_glut_fpumode; + glutStrokeWidth := OLD_glutStrokeWidth(font,character); + switch_to_FPC_fpumode; +end; + +function glutBitmapLength(font: pointer; const str: PChar): Integer; +begin + switch_to_glut_fpumode; + glutBitmapLength := OLD_glutBitmapLength(font,str); + switch_to_FPC_fpumode; +end; + +function glutStrokeLength(font: pointer; const str: PChar): Integer; +begin + switch_to_glut_fpumode; + glutStrokeLength := OLD_glutStrokeLength(font,str); + switch_to_FPC_fpumode; +end; + +procedure glutWireSphere(radius: GLdouble; slices, stacks: GLint); +begin + switch_to_glut_fpumode; + OLD_glutWireSphere(radius,slices,stacks); + switch_to_FPC_fpumode; +end; + +procedure glutSolidSphere(radius: GLdouble; slices, stacks: GLint); +begin + switch_to_glut_fpumode; + OLD_glutSolidSphere(radius,slices,stacks); + switch_to_FPC_fpumode; +end; + +procedure glutWireCone(base, height: GLdouble; slices, stacks: GLint); +begin + switch_to_glut_fpumode; + OLD_glutWireCone(base,height,slices,stacks); + switch_to_FPC_fpumode; +end; + +procedure glutSolidCone(base, height: GLdouble; slices, stacks: GLint); +begin + switch_to_glut_fpumode; + OLD_glutSolidCone(base,height,slices,stacks); + switch_to_FPC_fpumode; +end; + +procedure glutWireCube(size: GLdouble); +begin + switch_to_glut_fpumode; + OLD_glutWireCube(size); + switch_to_FPC_fpumode; +end; + +procedure glutSolidCube(size: GLdouble); +begin + switch_to_glut_fpumode; + OLD_glutSolidCube(size); + switch_to_FPC_fpumode; +end; + +procedure glutWireTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); +begin + switch_to_glut_fpumode; + OLD_glutWireTorus(innerRadius,outerRadius,sides,rings); + switch_to_FPC_fpumode; +end; + +procedure glutSolidTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); +begin + switch_to_glut_fpumode; + OLD_glutSolidTorus(innerRadius,outerRadius,sides,rings); + switch_to_FPC_fpumode; +end; + +procedure glutWireDodecahedron; +begin + switch_to_glut_fpumode; + OLD_glutWireDodecahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutSolidDodecahedron; +begin + switch_to_glut_fpumode; + OLD_glutSolidDodecahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutWireTeapot(size: GLdouble); +begin + switch_to_glut_fpumode; + OLD_glutWireTeapot(size); + switch_to_FPC_fpumode; +end; + +procedure glutSolidTeapot(size: GLdouble); +begin + switch_to_glut_fpumode; + OLD_glutSolidTeapot(size); + switch_to_FPC_fpumode; +end; + +procedure glutWireOctahedron; +begin + switch_to_glut_fpumode; + OLD_glutWireOctahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutSolidOctahedron; +begin + switch_to_glut_fpumode; + OLD_glutSolidOctahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutWireTetrahedron; +begin + switch_to_glut_fpumode; + OLD_glutWireTetrahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutSolidTetrahedron; +begin + switch_to_glut_fpumode; + OLD_glutSolidTetrahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutWireIcosahedron; +begin + switch_to_glut_fpumode; + OLD_glutWireIcosahedron(); + switch_to_FPC_fpumode; +end; + +procedure glutSolidIcosahedron; +begin + switch_to_glut_fpumode; + OLD_glutSolidIcosahedron(); + switch_to_FPC_fpumode; +end; + +function glutVideoResizeGet(param: GLenum): Integer; +begin + switch_to_glut_fpumode; + glutVideoResizeGet := OLD_glutVideoResizeGet(param); + switch_to_FPC_fpumode; +end; + +procedure glutSetupVideoResizing; +begin + switch_to_glut_fpumode; + OLD_glutSetupVideoResizing(); + switch_to_FPC_fpumode; +end; + +procedure glutStopVideoResizing; +begin + switch_to_glut_fpumode; + OLD_glutStopVideoResizing(); + switch_to_FPC_fpumode; +end; + +procedure glutVideoResize(x, y, width, height: Integer); +begin + switch_to_glut_fpumode; + OLD_glutVideoResize(x,y,width,height); + switch_to_FPC_fpumode; +end; + +procedure glutVideoPan(x, y, width, height: Integer); +begin + switch_to_glut_fpumode; + OLD_glutVideoPan(x,y,width,height); + switch_to_FPC_fpumode; +end; + +procedure glutReportErrors; +begin + switch_to_glut_fpumode; + OLD_glutReportErrors(); + switch_to_FPC_fpumode; +end; + +procedure glutIgnoreKeyRepeat(ignore: Integer); +begin + switch_to_glut_fpumode; + OLD_glutIgnoreKeyRepeat(ignore); + switch_to_FPC_fpumode; +end; + +procedure glutSetKeyRepeat(repeatMode: Integer); +begin + switch_to_glut_fpumode; + OLD_glutSetKeyRepeat(repeatMode); + switch_to_FPC_fpumode; +end; + +procedure glutForceJoystickFunc; +begin + switch_to_glut_fpumode; + OLD_glutForceJoystickFunc(); + switch_to_FPC_fpumode; +end; + +procedure glutGameModeString(const AString : PChar); +begin + switch_to_glut_fpumode; + OLD_glutGameModeString(AString); + switch_to_FPC_fpumode; +end; + +function glutEnterGameMode: integer; +begin + switch_to_glut_fpumode; + glutEnterGameMode := OLD_glutEnterGameMode(); + switch_to_FPC_fpumode; +end; + +procedure glutLeaveGameMode; +begin + switch_to_glut_fpumode; + OLD_glutLeaveGameMode(); + switch_to_FPC_fpumode; +end; + +function glutGameModeGet(mode : GLenum): integer; +begin + switch_to_glut_fpumode; + glutGameModeGet := OLD_glutGameModeGet(mode); + switch_to_FPC_fpumode; +end; + + +{$ENDIF GLUT_EXCLUSIVE_FPUMODE} + +initialization + + {$IFDEF GLUT_EXCLUSIVE_FPUMODE} + init_fpumode; + {$ENDIF GLUT_EXCLUSIVE_FPUMODE} + + {$IFDEF Windows} + LoadGlut('glut32.dll'); + {$ELSE} + {$ifdef darwin} + LoadGlut('/System/Library/Frameworks/GLUT.framework/GLUT'); + {$else} + {$IFNDEF MORPHOS} + LoadGlut('libglut.so.3'); + {$ENDIF} + {$endif} + {$ENDIF} + +finalization + FreeGlut; +end. diff --git a/packages/opengl/src/glx.pp b/packages/opengl/src/glx.pp new file mode 100644 index 0000000000..2799dde360 --- /dev/null +++ b/packages/opengl/src/glx.pp @@ -0,0 +1,240 @@ +{ + + Translation of the Mesa GLX headers for FreePascal + Copyright (C) 1999 Sebastian Guenther + + + Mesa 3-D graphics library + Version: 3.0 + Copyright (C) 1995-1998 Brian Paul + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +} + +{$MODE delphi} // objfpc would not work because of direct proc var assignments + +{You have to enable Macros (compiler switch "-Sm") for compiling this unit! + This is necessary for supporting different platforms with different calling + conventions via a single unit.} + +unit GLX; + +interface + +{$MACRO ON} + +{$IFDEF Unix} + uses + X, XLib, XUtil; + {$DEFINE HasGLX} // Activate GLX stuff +{$ELSE} + {$MESSAGE Unsupported platform.} +{$ENDIF} + +{$IFNDEF HasGLX} + {$MESSAGE GLX not present on this platform.} +{$ENDIF} + + +// ======================================================= +// Unit specific extensions +// ======================================================= + +// Note: Requires that the GL library has already been initialized +function InitGLX: Boolean; + +var + GLXDumpUnresolvedFunctions, + GLXInitialized: Boolean; + + +// ======================================================= +// GLX consts, types and functions +// ======================================================= + +// Tokens for glXChooseVisual and glXGetConfig: +const + GLX_USE_GL = 1; + GLX_BUFFER_SIZE = 2; + GLX_LEVEL = 3; + GLX_RGBA = 4; + GLX_DOUBLEBUFFER = 5; + GLX_STEREO = 6; + GLX_AUX_BUFFERS = 7; + GLX_RED_SIZE = 8; + GLX_GREEN_SIZE = 9; + GLX_BLUE_SIZE = 10; + GLX_ALPHA_SIZE = 11; + GLX_DEPTH_SIZE = 12; + GLX_STENCIL_SIZE = 13; + GLX_ACCUM_RED_SIZE = 14; + GLX_ACCUM_GREEN_SIZE = 15; + GLX_ACCUM_BLUE_SIZE = 16; + GLX_ACCUM_ALPHA_SIZE = 17; + + // GLX_EXT_visual_info extension + GLX_X_VISUAL_TYPE_EXT = $22; + GLX_TRANSPARENT_TYPE_EXT = $23; + GLX_TRANSPARENT_INDEX_VALUE_EXT = $24; + GLX_TRANSPARENT_RED_VALUE_EXT = $25; + GLX_TRANSPARENT_GREEN_VALUE_EXT = $26; + GLX_TRANSPARENT_BLUE_VALUE_EXT = $27; + GLX_TRANSPARENT_ALPHA_VALUE_EXT = $28; + + + // Error codes returned by glXGetConfig: + GLX_BAD_SCREEN = 1; + GLX_BAD_ATTRIBUTE = 2; + GLX_NO_EXTENSION = 3; + GLX_BAD_VISUAL = 4; + GLX_BAD_CONTEXT = 5; + GLX_BAD_VALUE = 6; + GLX_BAD_ENUM = 7; + + // GLX 1.1 and later: + GLX_VENDOR = 1; + GLX_VERSION = 2; + GLX_EXTENSIONS = 3; + + // GLX_visual_info extension + GLX_TRUE_COLOR_EXT = $8002; + GLX_DIRECT_COLOR_EXT = $8003; + GLX_PSEUDO_COLOR_EXT = $8004; + GLX_STATIC_COLOR_EXT = $8005; + GLX_GRAY_SCALE_EXT = $8006; + GLX_STATIC_GRAY_EXT = $8007; + GLX_NONE_EXT = $8000; + GLX_TRANSPARENT_RGB_EXT = $8008; + GLX_TRANSPARENT_INDEX_EXT = $8009; + +type + // From XLib: + XPixmap = TXID; + XFont = TXID; + XColormap = TXID; + + GLXContext = Pointer; + GLXPixmap = TXID; + GLXDrawable = TXID; + GLXContextID = TXID; + + TXPixmap = XPixmap; + TXFont = XFont; + TXColormap = XColormap; + + TGLXContext = GLXContext; + TGLXPixmap = GLXPixmap; + TGLXDrawable = GLXDrawable; + TGLXContextID = GLXContextID; + +var + glXChooseVisual: function(dpy: PDisplay; screen: Integer; attribList: PInteger): PXVisualInfo; cdecl; + glXCreateContext: function(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext; cdecl; + glXDestroyContext: procedure(dpy: PDisplay; ctx: GLXContext); cdecl; + glXMakeCurrent: function(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): Boolean; cdecl; + glXCopyContext: procedure(dpy: PDisplay; src, dst: GLXContext; mask: LongWord); cdecl; + glXSwapBuffers: procedure(dpy: PDisplay; drawable: GLXDrawable); cdecl; + glXCreateGLXPixmap: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap): GLXPixmap; cdecl; + glXDestroyGLXPixmap: procedure(dpy: PDisplay; pixmap: GLXPixmap); cdecl; + glXQueryExtension: function(dpy: PDisplay; var errorb, event: Integer): Boolean; cdecl; + glXQueryVersion: function(dpy: PDisplay; var maj, min: Integer): Boolean; cdecl; + glXIsDirect: function(dpy: PDisplay; ctx: GLXContext): Boolean; cdecl; + glXGetConfig: function(dpy: PDisplay; visual: PXVisualInfo; attrib: Integer; var value: Integer): Integer; cdecl; + glXGetCurrentContext: function: GLXContext; cdecl; + glXGetCurrentDrawable: function: GLXDrawable; cdecl; + glXWaitGL: procedure; cdecl; + glXWaitX: procedure; cdecl; + glXUseXFont: procedure(font: XFont; first, count, list: Integer); cdecl; + + // GLX 1.1 and later + glXQueryExtensionsString: function(dpy: PDisplay; screen: Integer): PChar; cdecl; + glXQueryServerString: function(dpy: PDisplay; screen, name: Integer): PChar; cdecl; + glXGetClientString: function(dpy: PDisplay; name: Integer): PChar; cdecl; + + // Mesa GLX Extensions + glXCreateGLXPixmapMESA: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl; + glXReleaseBufferMESA: function(dpy: PDisplay; d: GLXDrawable): Boolean; cdecl; + glXCopySubBufferMESA: procedure(dpy: PDisplay; drawbale: GLXDrawable; x, y, width, height: Integer); cdecl; + glXGetVideoSyncSGI: function(var counter: LongWord): Integer; cdecl; + glXWaitVideoSyncSGI: function(divisor, remainder: Integer; var count: LongWord): Integer; cdecl; + + +// ======================================================= +// +// ======================================================= + +implementation + +uses GL, dynlibs; + +{$LINKLIB m} + +function GetProc(handle: PtrInt; name: PChar): Pointer; +begin + Result := GetProcAddress(handle, name); + if (Result = nil) and GLXDumpUnresolvedFunctions then + WriteLn('Unresolved: ', name); +end; + +function InitGLX: Boolean; +var + OurLibGL: TLibHandle; +begin + Result := False; + +{$ifndef darwin} + OurLibGL := libGl; +{$else darwin} + OurLibGL := LoadLibrary('/usr/X11R6/lib/libGL.dylib'); +{$endif darwin} + + if OurLibGL = 0 then + exit; + + glXChooseVisual := GetProc(OurLibGL, 'glXChooseVisual'); + glXCreateContext := GetProc(OurLibGL, 'glXCreateContext'); + glXDestroyContext := GetProc(OurLibGL, 'glXDestroyContext'); + glXMakeCurrent := GetProc(OurLibGL, 'glXMakeCurrent'); + glXCopyContext := GetProc(OurLibGL, 'glXCopyContext'); + glXSwapBuffers := GetProc(OurLibGL, 'glXSwapBuffers'); + glXCreateGLXPixmap := GetProc(OurLibGL, 'glXCreateGLXPixmap'); + glXDestroyGLXPixmap := GetProc(OurLibGL, 'glXDestroyGLXPixmap'); + glXQueryExtension := GetProc(OurLibGL, 'glXQueryExtension'); + glXQueryVersion := GetProc(OurLibGL, 'glXQueryVersion'); + glXIsDirect := GetProc(OurLibGL, 'glXIsDirect'); + glXGetConfig := GetProc(OurLibGL, 'glXGetConfig'); + glXGetCurrentContext := GetProc(OurLibGL, 'glXGetCurrentContext'); + glXGetCurrentDrawable := GetProc(OurLibGL, 'glXGetCurrentDrawable'); + glXWaitGL := GetProc(OurLibGL, 'glXWaitGL'); + glXWaitX := GetProc(OurLibGL, 'glXWaitX'); + glXUseXFont := GetProc(OurLibGL, 'glXUseXFont'); + // GLX 1.1 and later + glXQueryExtensionsString := GetProc(OurLibGL, 'glXQueryExtensionsString'); + glXQueryServerString := GetProc(OurLibGL, 'glXQueryServerString'); + glXGetClientString := GetProc(OurLibGL, 'glXGetClientString'); + // Mesa GLX Extensions + glXCreateGLXPixmapMESA := GetProc(OurLibGL, 'glXCreateGLXPixmapMESA'); + glXReleaseBufferMESA := GetProc(OurLibGL, 'glXReleaseBufferMESA'); + glXCopySubBufferMESA := GetProc(OurLibGL, 'glXCopySubBufferMESA'); + glXGetVideoSyncSGI := GetProc(OurLibGL, 'glXGetVideoSyncSGI'); + glXWaitVideoSyncSGI := GetProc(OurLibGL, 'glXWaitVideoSyncSGI'); + + GLXInitialized := True; + Result := True; +end; + +initialization + InitGLX; +end. diff --git a/packages/opengl/src/tinygl.inc b/packages/opengl/src/tinygl.inc new file mode 100644 index 0000000000..f9969bca15 --- /dev/null +++ b/packages/opengl/src/tinygl.inc @@ -0,0 +1,846 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 by Karoly Balogh + + TinyGL/OpenGL wrapper include for MorphOS/PowerPC + + Thanks to Michal 'kiero' Wozniak and Mark 'bigfoot' Olsen + for their help. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +{ ****************************************************************************************************** } +{ ** TinyGL syscalls ** } +{ ****************************************************************************************************** } + +{$IFDEF GL_UNIT} +procedure _GLEnable(gcl: pointer; cap: GLenum); +syscall sysvbase TinyGLBase 28; + +procedure _GLDisable(gcl: pointer; cap: GLenum); +syscall sysvbase TinyGLBase 34; + +procedure _GLShadeModel(gcl: pointer; mode: GLenum); +syscall sysvbase TinyGLBase 46; + +procedure _GLCullFace(gcl: pointer; mode: GLenum); +syscall sysvbase TinyGLBase 52; + +procedure _GLBegin(gcl: pointer; mode: GLenum); +syscall sysvbase TinyGLBase 64; + +procedure _GLEnd(gcl: pointer); +syscall sysvbase TinyGLBase 70; + +procedure _GLVertex3f(gcl: pointer; x, y, z: GLfloat); +syscall sysvbase TinyGLBase 76; + +procedure _GlVertex3fv(gcl: pointer; const v: PGLfloat); +syscall sysvbase TinyGLBase 88; + +procedure _GLColor3f(gcl: pointer; red, green, blue: GLfloat); +syscall sysvbase TinyGLBase 100; + +procedure _GLColor4f(gcl: pointer; red, green, blue, alpha: GLfloat); +syscall sysvbase TinyGLBase 106; + +procedure _GLNormal3f(gcl: pointer; nx, ny, nz: GLfloat); +syscall sysvbase TinyGLBase 148; + +procedure _GLTexCoord2f(gcl: pointer; s, t: GLfloat); +syscall sysvbase TinyGLBase 160; + +procedure _GLMatrixMode(gcl: pointer; mode: GLenum); +syscall sysvbase TinyGLBase 190; + +procedure _GLLoadIdentity(gcl: pointer); +syscall sysvbase TinyGLBase 202; + +procedure _GLPushMatrix(gcl: pointer); +syscall sysvbase TinyGLBase 214; + +procedure _GLPopMatrix(gcl: pointer); +syscall sysvbase TinyGLBase 220; + +procedure _GLRotatef(gcl: pointer; angle, x, y, z: GLfloat); +syscall sysvbase TinyGLBase 226; + +procedure _GLTranslatef(gcl: pointer; x, y, z: GLfloat); +syscall sysvbase TinyGLBase 232; + +procedure _GLScalef(gcl: pointer; x, y, z: GLfloat); +syscall sysvbase TinyGLBase 238; + +procedure _GLViewPort(gcl: pointer; x, y: GLint; width, height: GLsizei); +syscall sysvbase TinyGLBase 244; + +procedure _GLFrustum(gcl: pointer; left, right, bottom, top, zNear, zFar: GLdouble); +syscall sysvbase TinyGLBase 250; +{$ENDIF GL_UNIT} + +{$IF DEFINED(GL_UNIT) OR DEFINED(GLU_UNIT)} +procedure _GLOrtho(gcl: pointer; left, right, bottom, top, zNear, zFar: GLdouble); +syscall sysvbase TinyGLBase 256; +{$ENDIF} + +{$IFDEF GL_UNIT} +function _GLGenLists(gcl: pointer; range: GLsizei): GLuint; +syscall sysvbase TinyGLBase 262; + +procedure _GLNewList(gcl: pointer; list: GLuint; mode: GLenum); +syscall sysvbase TinyGLBase 274; + +procedure _GLEndList(gcl: pointer); +syscall sysvbase TinyGLBase 280; + +procedure _GLCallList(gcl: pointer; list: GLuint); +syscall sysvbase TinyGLBase 286; + +procedure _GLDeleteLists(gcl: pointer; list: GLuint; range: GLsizei); +syscall sysvbase TinyGLBase 292; + +procedure _GLClear(gcl: pointer; mask: GLbitfield); +syscall sysvbase TinyGLBase 298; + +procedure _GLClearColor(gcl: pointer; red, green, blue, alpha: GLclampf); +syscall sysvbase TinyGLBase 304; + +procedure _GLClearDepth(gcl: pointer; depth: GLclampd); +syscall sysvbase TinyGLBase 310; + +procedure _GLGenTextures(gcl: pointer; n: GLsizei; textures: PGLuint); +syscall sysvbase TinyGLBase 352; + +procedure _GLDeleteTextures(gcl: pointer; n: GLsizei; const textures: PGLuint); +syscall sysvbase TinyGLBase 358; + +procedure _GLBindTexture(gcl: pointer; target: GLenum; texture: GLuint); +syscall sysvbase TinyGLBase 364; + +procedure _GLTexImage2D(gcl: pointer; target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer); +syscall sysvbase TinyGLBase 370; + +procedure _GLTexParameteri(gcl: pointer; target: GLenum; pname: GLenum; param: GLint); +syscall sysvbase TinyGLBase 394; + +procedure _GLTexParameterf(gcl: pointer; target: GLenum; pname: GLenum; param: GLfloat); +syscall sysvbase TinyGLBase 400; + +procedure _GLTexGeni(gcl: pointer; coord: GLenum; pname: GLenum; param: GLint); +syscall sysvbase TinyGLBase 418; + +procedure _GLMaterialfv(gcl: pointer; face, pname: GLenum; const params: PGLfloat); +syscall sysvbase TinyGLBase 430; + +procedure _GLMaterialf(gcl: pointer; face, pname: GLenum; param: GLfloat); +syscall sysvbase TinyGLBase 436; + +procedure _GLLightfv(gcl: pointer; light, pname: GLenum; const params: PGLfloat); +syscall sysvbase TinyGLBase 448; + +procedure _GLLightf(gcl: pointer; light, pname: GLenum; param: GLfloat); +syscall sysvbase TinyGLBase 454; + +procedure _GLLightModelfv(gcl: pointer; pname: GLenum; const params: PGLfloat); +syscall sysvbase TinyGLBase 466; + +procedure _GLFlush(gcl: pointer); +syscall sysvbase TinyGLBase 478; + +procedure _GLHint(gcl: pointer; target, mode: GLenum); +syscall sysvbase TinyGLBase 484; + +procedure _GLGetFloatv(gcl: pointer; pname: GLenum; params: PGLfloat); +syscall sysvbase TinyGLBase 496; + +procedure _GLEnableClientState(gcl: pointer; aarray: GLenum); +syscall sysvbase TinyGLBase 508; + +procedure _GLDisableClientState(gcl: pointer; aarray: GLenum); +syscall sysvbase TinyGLBase 514; + +procedure _GLVertexPointer(gcl: pointer; size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); +syscall sysvbase TinyGLBase 526; + +procedure _GLColorPointer(gcl: pointer; size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); +syscall sysvbase TinyGLBase 532; + +procedure _GLNormalPointer(gcl: pointer; atype: GLenum; stride: GLsizei; const pointer: Pointer); +syscall sysvbase TinyGLBase 538; + +procedure _GLTexCoordPointer(gcl: pointer; size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); +syscall sysvbase TinyGLBase 544; + +procedure _GLDrawElements(gcl: pointer; mode: GLenum; count: GLsizei; atype: GLenum; const indices: Pointer); +syscall sysvbase TinyGLBase 562; + +procedure _GLBlendFunc(gcl: pointer; sfactor, dfactor: GLenum); +syscall sysvbase TinyGLBase 586; + +procedure _GLDepthMask(gcl: pointer; flag: GLboolean); +syscall sysvbase TinyGLBase 592; + +procedure _GLAlphaFunc(gcl: pointer; func: GLenum; ref: GLclampf); +syscall sysvbase TinyGLBase 598; + +procedure _GLPointSize(gcl: pointer; size: GLfloat); +syscall sysvbase TinyGLBase 604; + +procedure _GLDepthFunc(gcl: pointer; func: GLenum); +syscall sysvbase TinyGLBase 628; + +function _GLInit: Pointer; +syscall sysvbase TinyGLBase 640; + +procedure _GLClose(gcl: pointer); +syscall sysvbase TinyGLBase 646; +{$ENDIF GL_UNIT} + +{$IFDEF GLU_UNIT} +procedure _GLUPerspective(gcl: pointer; fovy, aspect, zNear, zFar: GLdouble); +syscall sysvbase TinyGLBase 652; + +procedure _GLULookAt(gcl: pointer; eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); +syscall sysvbase TinyGLBase 658; +{$ENDIF GLU_UNIT} + +{$IFDEF GLUT_UNIT} +procedure _GLUTInit(gcl: pointer; argcp: PLongInt; argv: PPChar); +syscall sysvbase TinyGLBase 664; + +procedure _GLUTInitWindowPosition(gcl: pointer; x, y: Integer); +syscall sysvbase TinyGLBase 670; + +procedure _GLUTInitWindowSize(gcl: pointer; width, height: LongInt); +syscall sysvbase TinyGLBase 676; + +function _GLUTCreateWindow(gcl: pointer; const title: PChar): LongInt; +syscall sysvbase TinyGLBase 682; + +procedure _GLUTFullScreen(gcl: pointer); +syscall sysvbase TinyGLBase 688; + +procedure _GLUTDestroyWindow(gcl: pointer; win: LongInt); +syscall sysvbase TinyGLBase 706; + +procedure _GLUTSwapBuffers(gcl: pointer); +syscall sysvbase TinyGLBase 712; + +procedure _GLUTMainLoop(gcl: pointer); +syscall sysvbase TinyGLBase 718; + +procedure _GLUTPostRedisplay(gcl: pointer); +syscall sysvbase TinyGLBase 724; + +procedure _GLUTDisplayFunc(gcl: pointer; f: TGlutVoidCallback); +syscall sysvbase TinyGLBase 730; + +procedure _GLUTReshapeFunc(gcl: pointer; f: TGlut2IntCallback); +syscall sysvbase TinyGLBase 736; + +procedure _GLUTIdleFunc(gcl: pointer; f: TGlutVoidCallback); +syscall sysvbase TinyGLBase 742; + +procedure _GLUTKeyboardFunc(gcl: pointer; f: TGlut1Char2IntCallback); +syscall sysvbase TinyGLBase 748; + +procedure _GLUTMouseFunc(gcl: pointer; f: TGlut4IntCallback); +syscall sysvbase TinyGLBase 760; + +procedure _GLUTMotionFunc(gcl: pointer; f: TGlut2IntCallback); +syscall sysvbase TinyGLBase 766; + +function _GLUTGet(gcl: pointer; t: GLenum): LongInt; +syscall sysvbase TinyGLBase 802; + +procedure _GLUTInitDisplayMode(gcl: pointer; mode: Word); +syscall sysvbase TinyGLBase 808; + +procedure _GLUTSpecialFunc(gcl: pointer; f: TGlut3IntCallback); +syscall sysvbase TinyGLBase 814; + +procedure _GLUTTimerFunc(gcl: pointer; millis: Word; f: TGlut1IntCallback; value: LongInt); +syscall sysvbase TinyGLBase 820; + +procedure _GLUTPassiveMotionFunc(gcl: pointer; f: TGlut2IntCallback); +syscall sysvbase TinyGLBase 832; + +// MorphOS specific GLUT call, returns Intuition window handle +function _GLUTGetWindowHandle(gcl: pointer): Pointer; +syscall sysvbase TinyGLBase 856; +{$ENDIF GLUT_UNIT} + +{$IFDEF GL_UNIT} +function _GLGetString(gcl: pointer; name: GLenum): PChar; +syscall sysvbase TinyGLBase 862; + +procedure _GLCallLists(gcl: pointer; n: GLsizei; atype: GLenum; const lists: Pointer); +syscall sysvbase TinyGLBase 892; + +procedure _GLLineWidth(gcl: pointer; width: GLfloat); +syscall sysvbase TinyGLBase 910; + +procedure _GLRasterPos3f(gcl: pointer; x, y, z: GLfloat); +syscall sysvbase TinyGLBase 1108; +{$ENDIF GL_UNIT} + +{$IFDEF GLUT_UNIT} +procedure _GLUTVisibilityFunc(gcl: pointer; f: TGlut1IntCallback); +syscall sysvbase TinyGLBase 1114; +{$ENDIF GLUT_UNIT} + +{$IFDEF GL_UNIT} +procedure _GLFogf(gcl: pointer; pname: GLenum; param: GLfloat); +syscall sysvbase TinyGLBase 1120; + +procedure _GLFogfv(gcl: pointer; pname: GLenum; const params: PGLfloat); +syscall sysvbase TinyGLBase 1126; + +procedure _GLReadPixels(gcl: pointer; x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); +syscall sysvbase TinyGLBase 1180; + +procedure _GLStencilFunc(gcl: pointer; func: GLenum; ref: GLint; mask: GLuint); +syscall sysvbase TinyGLBase 1210; + +procedure _GLStencilOp(gcl: pointer; fail, zfail, zpass: GLenum); +syscall sysvbase TinyGLBase 1216; + +procedure _GLColorMask(gcl: pointer; red, green, blue, alpha: GLboolean); +syscall sysvbase TinyGLBase 1282; +{$ENDIF GL_UNIT} + + +{ ****************************************************************************************************** } +{ ** GL functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GL_UNIT} +procedure glAlphaFunc(func: GLenum; ref: GLclampf); inline; +begin + _GLAlphaFunc(tglContext, func, ref); +end; + +procedure glBegin(mode: GLenum); inline; +begin + _GLBegin(tglContext, mode); +end; + +procedure glCallList(list: GLuint); inline; +begin + _GLCallList(tglContext, list); +end; + +procedure glCallLists(n: GLsizei; atype: GLenum; const lists: Pointer); inline; +begin + _GLCallLists(tglContext, n, atype, lists); +end; + +procedure glClear(mask: GLbitfield); inline; +begin + _GLClear(tglContext, mask); +end; + +procedure glClearColor(red, green, blue, alpha: GLclampf); inline; +begin + _GLClearColor(tglContext, red, green, blue, alpha); +end; + +procedure glClearDepth(depth: GLclampd); inline; +begin + _GLClearDepth(tglContext, depth); +end; + +procedure glColorMask(red, green, blue, alpha: GLboolean); inline; +begin + _GLColorMask(tglContext, red, green, blue, alpha); +end; + +procedure glColorPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +begin + _GLColorPointer(tglContext, size, atype, stride, pointer); +end; + +procedure glCopyTexImage2D(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); inline; +begin +{$WARNING glCopyTexImage2D is dummy.} + // DUMMY, FIX ME!!! + // TinyGL doesn't support this yet. +end; + +procedure glCullFace(mode: GLenum); inline; +begin + _GLCullFace(tglContext, mode); +end; + +procedure glDeleteLists(list: GLuint; range: GLsizei); inline; +begin + _GLDeleteLists(tglContext, list, range); +end; + +procedure glEnd; inline; +begin + _GLEnd(tglContext); +end; + +procedure glEndList; inline; +begin + _GLEndList(tglContext); +end; + +procedure glFlush; inline; +begin + _GLFlush(tglContext); +end; + +function glGenLists(range: GLsizei): GLuint; inline; +begin + glGenLists:=_GLGenLists(tglContext, range); +end; + +procedure glGetFloatv(pname: GLenum; params: PGLfloat); inline; +begin + _GLGetFloatv(tglContext, pname, params); +end; + +function glGetString(name: GLenum): PChar; inline; +begin + glGetString:=_GLGetString(tglContext, name); +end; + +procedure glHint(target, mode: GLenum); inline; +begin + _GLHint(tglContext, target, mode); +end; + +procedure glIndexi(c: GLint); inline; +begin +{$WARNING glIndexi is dummy.} + // DUMMY, FIX ME!!! +end; + +procedure glLightModelfv(pname: GLenum; const params: PGLfloat); inline; +begin + _GLLightModelfv(tglContext, pname, params); +end; + +procedure glNewList(list: GLuint; mode: GLenum); inline; +begin + _GLNewList(tglContext, list, mode); +end; + +procedure glVertex2f(x, y: GLfloat); inline; +begin + _GLVertex3f(tglContext, x, y, 0); +end; + +procedure glVertex2i(x, y: GLint); inline; +begin + _GLVertex3f(tglContext, x, y, 0); +end; + +procedure glVertex3f(x, y, z: GLfloat); inline; +begin + _GLVertex3f(tglContext, x, y ,z); +end; + +procedure glVertex3fv(const v: PGLfloat); inline; +begin + _GLVertex3fv(tglContext, v); +end; + +procedure glLightf(light, pname: GLenum; param: GLfloat); inline; +begin + _GLLightf(tglContext, light, pname, param); +end; + +procedure glLightfv(light, pname: GLenum; const params: PGLfloat); inline; +begin + _GLLightfv(tglContext, light, pname, params); +end; + +procedure glLineWidth(width: GLfloat); inline; +begin + _GLLineWidth(tglContext, width); +end; + +procedure glLoadIdentity; inline; +begin + _GLLoadIdentity(tglContext); +end; + +procedure glMaterialf(face, pname: GLenum; param: GLfloat); inline; +begin + _GLMaterialf(tglContext, face, pname, param); +end; + +procedure glMaterialfv(face, pname: GLenum; const params: PGLfloat); inline; +begin + _GLMaterialfv(tglContext, face, pname, params); +end; + +procedure glMateriali(face, pname: GLenum; param: GLint); inline; +begin + // WTF?! + _GLMaterialf(tglContext, face, pname, param); +end; + +procedure glMaterialiv(face, pname: GLenum; const params: PGLint); inline; +begin + // WTF?! + _GLMaterialfv(tglContext, face, pname, PGLfloat(params)); +end; + +procedure glMatrixMode(mode: GLenum); inline; +begin + _GLMatrixMode(tglContext, mode); +end; + +procedure glNormalPointer(atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +begin + _GLNormalPointer(tglContext, atype, stride, pointer); +end; + +procedure glPointSize(size: GLfloat); inline; +begin + // 604! :) + _GLPointSize(tglContext, size); +end; + +procedure glRasterPos3f(x, y, z: GLfloat); inline; +begin + _GLRasterPos3f(tglContext, x, y, z); +end; + +procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); inline; +begin + _GLReadPixels(tglContext, x, y, width, height, format, atype, pixels); +end; + +procedure glShadeModel(mode: GLenum); inline; +begin + _GLShadeModel(tglContext, mode); +end; + +procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint); inline; +begin + _GLStencilFunc(tglContext, func, ref, mask); +end; + +procedure glStencilOp(fail, zfail, zpass: GLenum); inline; +begin + _GLStencilOp(tglContext, fail, zfail, zpass); +end; + +procedure glTexCoordPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +begin + _GLTexCoordPointer(tglContext, size, atype, stride, pointer); +end; + +procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat); inline; +begin + _GLTexParameterf(tglContext, target, pname, param); +end; + +procedure glFrustum(left, right, bottom, top, zNear, zFar: GLdouble); inline; +begin + _GLFrustum(tglContext, left, right, bottom, top, zNear, zFar); +end; + +procedure glTranslatef(x, y, z: GLfloat); inline; +begin + _GLTranslatef(tglContext, x, y, z); +end; + +procedure glScalef(x, y, z: GLfloat); inline; +begin + _GLScalef(tglContext, x, y, z); +end; + +procedure glRotatef(angle, x, y, z: GLfloat); inline; +begin + _GLRotatef(tglContext, angle, x, y, z); +end; + +procedure glColor3f(red, green, blue: GLfloat); inline; +begin + _GLColor3f(tglContext, red, green, blue); +end; + +procedure glColor4f(red, green, blue, alpha: GLfloat); inline; +begin + _GLColor4f(tglContext, red, green, blue, alpha); +end; + +procedure glNormal3f(nx, ny, nz: GLfloat); inline; +begin + _GLNormal3f(tglContext, nx, ny, nz); +end; + +procedure glDeleteTextures(n: GLsizei; const textures: PGLuint); inline; +begin + _GLDeleteTextures(tglContext, n, textures); +end; + +procedure glDisable(cap: GLenum); inline; +begin + _GLDisable(tglContext, cap); +end; + +procedure glDisableClientState(aarray: GLenum); inline; +begin + _GLDisableClientState(tglContext, aarray); +end; + +procedure glDrawElements(mode: GLenum; count: GLsizei; atype: GLenum; const indices: Pointer); inline; +begin + _GLDrawElements(tglContext, mode, count, atype, indices); +end; + +procedure glEnable(cap: GLenum); inline; +begin + _GLEnable(tglContext, cap); +end; + +procedure glEnableClientState(aarray: GLenum); inline; +begin + _GLEnableClientState(tglContext, aarray); +end; + +procedure glFogf(pname: GLenum; param: GLfloat); inline; +begin + _GLFogf(tglContext, pname, param); +end; + +procedure glFogfv(pname: GLenum; const params: PGLfloat); inline; +begin + _GLFogfv(tglContext, pname, params); +end; + +procedure glFogi(pname: GLenum; param: GLint); inline; +begin + // WTF!? And it actually works! + _GLFogf(tglContext, pname, param); +end; + +procedure glOrtho(left, right, bottom, top, zNear, zFar: GLdouble); inline; +begin + _GLOrtho(tglContext, left, right, bottom, top, zNear, zFar); +end; + +procedure glPopMatrix; inline; +begin + _GLPopMatrix(tglContext); +end; + +procedure glPushMatrix; inline; +begin + _GLPushMatrix(tglContext); +end; + +procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer); inline; +begin + _GLTexImage2D(tglContext, target, level, internalformat, width, height, border, format, atype, pixels); +end; + +procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint); inline; +begin + _GLTexParameteri(tglContext, target, pname, param); +end; + +procedure glTexCoord2f(s, t: GLfloat); inline; +begin + _GLTexCoord2f(tglContext, s, t); +end; + +procedure glTexGeni(coord: GLenum; pname: GLenum; param: GLint); inline; +begin + _GLTexGeni(tglContext, coord, pname, param); +end; + +procedure glBindTexture(target: GLenum; texture: GLuint); inline; +begin + _GLBindTexture(tglContext, target, texture); +end; + +procedure glGenTextures(n: GLsizei; textures: PGLuint); inline; +begin + _GLGenTextures(tglContext, n, textures); +end; + +procedure glBlendFunc(sfactor, dfactor: GLenum); inline; +begin + _GLBlendFunc(tglContext, sfactor, dfactor); +end; + +procedure glDepthFunc(func: GLenum); inline; +begin + _GLDepthFunc(tglContext, func); +end; + +procedure glDepthMask(flag: GLboolean); inline; +begin + _GLDepthMask(tglContext, flag); +end; + +procedure glVertexPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +begin + _GLVertexPointer(tglContext, size, atype, stride, pointer); +end; + +procedure glViewport(x, y: GLint; width, height: GLsizei); inline; +begin + _GLViewport(tglContext, x, x, width, height); +end; +{$ENDIF GL_UNIT} + + +{ ****************************************************************************************************** } +{ ** GLU functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GLU_UNIT} +procedure gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); inline; +begin + _GLULookAt(tglContext, eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz); +end; + +procedure gluOrtho2D(left,right, bottom, top: GLdouble); inline; +begin + _GLOrtho(tglContext, left, right, bottom, top, -1.0, 1.0) +end; + +procedure gluPerspective(fovy, aspect, zNear, zFar: GLdouble); inline; +begin + _GLUPerspective(tglContext, fovy, aspect, zNear, zFar); +end; +{$ENDIF GLU_UNIT} + + +{ ****************************************************************************************************** } +{ ** GLUT functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GLUT_UNIT} +procedure GLUTInit(argcp: PLongInt; argv: PPChar); inline; +begin + _GLUTInit(tglContext,argcp,argv); +end; + +procedure GLUTInitDisplayMode(mode: Word); inline; +begin + _GLUTInitDisplayMode(tglContext,mode); +end; + +procedure GLUTInitWindowPosition(x, y: Integer); inline; +begin + _GLUTInitWindowPosition(tglContext, x, y); +end; + +procedure GLUTInitWindowSize(width, height: LongInt); inline; +begin + _GLUTInitWindowSize(tglContext, width, height); +end; + +procedure GLUTSwapBuffers; inline; +begin + _GLUTSwapBuffers(tglContext); +end; + +procedure GLUTPostRedisplay; inline; +begin + _GLUTPostRedisplay(tglContext); +end; + +procedure GLUTReshapeFunc(f: TGlut2IntCallback); inline; +begin + _GLUTReshapeFunc(tglContext, f); +end; + +function GLUTCreateWindow(const title: PChar): LongInt; inline; +begin + GLUTCreateWindow:=_GLUTCreateWindow(tglContext, title); +end; + +procedure GLUTDestroyWindow(win: LongInt); inline; +begin + _GLUTDestroyWindow(tglContext, win); +end; + +procedure GLUTDisplayFunc(f: TGlutVoidCallback); inline; +begin + _GLUTDisplayFunc(tglContext, f); +end; + +procedure GLUTIdleFunc(f: TGlutVoidCallback); inline; +begin + _GLUTIdleFunc(tglContext, f); +end; + +procedure GLUTTimerFunc(millis: Word; f: TGlut1IntCallback; value: LongInt); inline; +begin + _GLUTTimerFunc(tglContext, millis, f, value); +end; + +procedure GLUTKeyboardFunc(f: TGlut1Char2IntCallback); inline; +begin + _GLUTKeyboardFunc(tglContext, f); +end; + +procedure GLUTMouseFunc(f: TGlut4IntCallback); inline; +begin + _GLUTMouseFunc(tglContext, f); +end; + +procedure GLUTSpecialFunc(f: TGlut3IntCallback); inline; +begin + _GLUTSpecialFunc(tglContext, f); +end; + +procedure GLUTMotionFunc(f: TGlut2IntCallback); inline; +begin + _GLUTMotionFunc(tglContext, f); +end; + +procedure GLUTPassiveMotionFunc(f: TGlut2IntCallback); inline; +begin + _GLUTPassiveMotionFunc(tglContext, f); +end; + +function GLUTGetWindowHandle: pointer; inline; +begin + GLUTGetWindowHandle:=_GLUTGetWindowHandle(tglContext); +end; + +procedure GLUTVisibilityFunc(f: TGlut1IntCallback); inline; +begin + _GLUTVisibilityFunc(tglContext, f); +end; + +function GLUTGet(t: GLenum): LongInt; inline; +begin + GLUTGet:=_GLUTGet(tglContext,t); +end; + +procedure GLUTMainLoop; inline; +begin + _GLUTMainLoop(tglContext); +end; + +procedure GLUTFullScreen; inline; +begin + _GLUTFullScreen(tglContext); +end; + +procedure GLUTSetColor(cell: Integer; red, green, blue: GLfloat); inline; +begin +{$WARNING GLUTSetColor is dummy.} + // DUMMY, FIX ME!!! +end; +{$ENDIF GLUT_UNIT} diff --git a/packages/opengl/src/tinyglh.inc b/packages/opengl/src/tinyglh.inc new file mode 100644 index 0000000000..6ff3852eb7 --- /dev/null +++ b/packages/opengl/src/tinyglh.inc @@ -0,0 +1,165 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2005 by Karoly Balogh + + TinyGL/OpenGL wrapper include header for MorphOS/PowerPC + + Thanks to Michal 'kiero' Wozniak and Mark 'bigfoot' Olsen + for their help. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +{ ****************************************************************************************************** } +{ ** GL functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GL_UNIT} +procedure glAlphaFunc(func: GLenum; ref: GLclampf); inline; + +procedure glBegin(mode: GLenum); inline; + +procedure glCallList(list: GLuint); inline; +procedure glCallLists(n: GLsizei; atype: GLenum; const lists: Pointer); inline; +procedure glClear(mask: GLbitfield); inline; +procedure glClearColor(red, green, blue, alpha: GLclampf); inline; +procedure glClearDepth(depth: GLclampd); inline; +procedure glColor3f(red, green, blue: GLfloat); inline; +procedure glColor4f(red, green, blue, alpha: GLfloat); inline; +procedure glColorMask(red, green, blue, alpha: GLboolean); inline; +procedure glColorPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +procedure glCopyTexImage2D(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); inline; +procedure glCullFace(mode: GLenum); inline; + +procedure glDeleteLists(list: GLuint; range: GLsizei); inline; +procedure glDeleteTextures(n: GLsizei; const textures: PGLuint); inline; +procedure glDepthFunc(func: GLenum); inline; +procedure glDepthMask(flag: GLboolean); inline; +procedure glDisable(cap: GLenum); inline; +procedure glDisableClientState(aarray: GLenum); inline; +procedure glDrawElements(mode: GLenum; count: GLsizei; atype: GLenum; const indices: Pointer); inline; + +procedure glEnable(cap: GLenum); inline; +procedure glEnableClientState(aarray: GLenum); inline; +procedure glEnd; inline; +procedure glEndList; inline; + +procedure glFlush; inline; +procedure glFogf(pname: GLenum; param: GLfloat); inline; +procedure glFogfv(pname: GLenum; const params: PGLfloat); inline; +procedure glFogi(pname: GLenum; param: GLint); inline; + +function glGenLists(range: GLsizei): GLuint; inline; +procedure glGetFloatv(pname: GLenum; params: PGLfloat); inline; +function glGetString(name: GLenum): PChar; inline; + +procedure glHint(target, mode: GLenum); inline; + +procedure glIndexi(c: GLint); inline; + +procedure glLightf(light, pname: GLenum; param: GLfloat); inline; +procedure glLightfv(light, pname: GLenum; const params: PGLfloat); inline; +procedure glLineWidth(width: GLfloat); inline; +procedure glLoadIdentity; inline; +procedure glLightModelfv(pname: GLenum; const params: PGLfloat); inline; + +procedure glMaterialf(face, pname: GLenum; param: GLfloat); inline; +procedure glMaterialfv(face, pname: GLenum; const params: PGLfloat); inline; +procedure glMateriali(face, pname: GLenum; param: GLint); inline; +procedure glMaterialiv(face, pname: GLenum; const params: PGLint); inline; +procedure glMatrixMode(mode: GLenum); inline; + +procedure glNewList(list: GLuint; mode: GLenum); inline; +procedure glNormal3f(nx, ny, nz: GLfloat); inline; +procedure glNormalPointer(atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; + +procedure glVertex2f(x, y: GLfloat); inline; +procedure glVertex2i(x, y: GLint); inline; +procedure glVertex3f(x, y, z: GLfloat); inline; +procedure glVertex3fv(const v: PGLfloat); inline; + +procedure glPointSize(size: GLfloat); inline; +procedure glRasterPos3f(x, y, z: GLfloat); inline; +procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); inline; + +procedure glShadeModel(mode: GLenum); inline; + +procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint); inline; +procedure glStencilOp(fail, zfail, zpass: GLenum); inline; + +procedure glTexCoordPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; +procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat); inline; + +procedure glFrustum(left, right, bottom, top, zNear, zFar: GLdouble); inline; +procedure glTranslatef(x, y, z: GLfloat); inline; +procedure glScalef(x, y, z: GLfloat); inline; +procedure glRotatef(angle, x, y, z: GLfloat); inline; + +procedure glOrtho(left, right, bottom, top, zNear, zFar: GLdouble); inline; +procedure glPopMatrix; inline; +procedure glPushMatrix; inline; + +procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer); inline; +procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint); inline; +procedure glTexCoord2f(s, t: GLfloat); inline; +procedure glTexGeni(coord: GLenum; pname: GLenum; param: GLint); inline; +procedure glBindTexture(target: GLenum; texture: GLuint); inline; +procedure glGenTextures(n: GLsizei; textures: PGLuint); inline; + +procedure glBlendFunc(sfactor, dfactor: GLenum); inline; + +procedure glVertexPointer(size: GLint; atype: GLenum; stride: GLsizei; const pointer: Pointer); inline; + +procedure glViewport(x, y: GLint; width, height: GLsizei); inline; +{$ENDIF GL_UNIT} + +{ ****************************************************************************************************** } +{ ** GLU functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GLU_UNIT} +procedure gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); inline; +procedure gluOrtho2D(left,right, bottom, top: GLdouble); inline; +procedure gluPerspective(fovy, aspect, zNear, zFar: GLdouble); inline; +{$ENDIF GLU_UNIT} + +{ ****************************************************************************************************** } +{ ** GLUT functions ** } +{ ****************************************************************************************************** } + +{$IFDEF GLUT_UNIT} +procedure GLUTInit(argcp: PLongInt; argv: PPChar); inline; +procedure GLUTInitDisplayMode(mode: Word); inline; +procedure GLUTInitWindowPosition(x, y: Integer); inline; +procedure GLUTInitWindowSize(width, height: LongInt); inline; + +function GLUTCreateWindow(const title: PChar): LongInt; inline; +procedure GLUTDestroyWindow(win: LongInt); inline; +procedure GLUTDisplayFunc(f: TGlutVoidCallback); inline; +procedure GLUTIdleFunc(f: TGlutVoidCallback); inline; +procedure GLUTTimerFunc(millis: Word; f: TGlut1IntCallback; value: LongInt); inline; +function GLUTGetWindowHandle: pointer; inline; // MorphOS specific +procedure GLUTVisibilityFunc(f: TGlut1IntCallback); inline; +procedure GLUTKeyboardFunc(f: TGlut1Char2IntCallback); inline; +procedure GLUTMouseFunc(f: TGlut4IntCallback); inline; +procedure GLUTSpecialFunc(f: TGlut3IntCallback); inline; +procedure GLUTReshapeFunc(f: TGlut2IntCallback); inline; +procedure GLUTMotionFunc(f: TGlut2IntCallback); inline; +procedure GLUTPassiveMotionFunc(f: TGlut2IntCallback); inline; + +procedure GLUTSwapBuffers; inline; +procedure GLUTPostRedisplay; inline; + +function GLUTGet(t: GLenum): LongInt; inline; + +procedure GLUTMainLoop; inline; + +procedure GLUTFullScreen; inline; +procedure GLUTSetColor(cell: Integer; red, green, blue: GLfloat); inline; +{$ENDIF GLUT_UNIT} |