]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
Merge branch 'master' into divVerent/crypto2
authorRudolf Polzer <divverent@alientrap.org>
Thu, 5 Aug 2010 04:57:01 +0000 (06:57 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 5 Aug 2010 04:57:01 +0000 (06:57 +0200)
92 files changed:
all
misc/builddeps/dp.linux32/bin/cjpeg [new file with mode: 0755]
misc/builddeps/dp.linux32/bin/djpeg [new file with mode: 0755]
misc/builddeps/dp.linux32/bin/jpegtran [new file with mode: 0755]
misc/builddeps/dp.linux32/bin/rdjpgcom [new file with mode: 0755]
misc/builddeps/dp.linux32/bin/wrjpgcom [new file with mode: 0755]
misc/builddeps/dp.linux32/include/jconfig.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/jerror.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/jmorecfg.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/jpeglib.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/libmodplug/it_defs.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/libmodplug/modplug.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/libmodplug/sndfile.h [new file with mode: 0644]
misc/builddeps/dp.linux32/include/libmodplug/stdafx.h [new file with mode: 0644]
misc/builddeps/dp.linux32/lib/libjpeg.a [new file with mode: 0644]
misc/builddeps/dp.linux32/lib/libjpeg.la [new file with mode: 0755]
misc/builddeps/dp.linux32/lib/libmodplug.a [new file with mode: 0644]
misc/builddeps/dp.linux32/lib/libmodplug.la [new file with mode: 0755]
misc/builddeps/dp.linux32/lib/pkgconfig/libmodplug.pc [new file with mode: 0644]
misc/builddeps/dp.linux32/share/man/man1/cjpeg.1 [new file with mode: 0644]
misc/builddeps/dp.linux32/share/man/man1/djpeg.1 [new file with mode: 0644]
misc/builddeps/dp.linux32/share/man/man1/jpegtran.1 [new file with mode: 0644]
misc/builddeps/dp.linux32/share/man/man1/rdjpgcom.1 [new file with mode: 0644]
misc/builddeps/dp.linux32/share/man/man1/wrjpgcom.1 [new file with mode: 0644]
misc/builddeps/dp.linux64/bin/cjpeg [new file with mode: 0755]
misc/builddeps/dp.linux64/bin/djpeg [new file with mode: 0755]
misc/builddeps/dp.linux64/bin/jpegtran [new file with mode: 0755]
misc/builddeps/dp.linux64/bin/rdjpgcom [new file with mode: 0755]
misc/builddeps/dp.linux64/bin/wrjpgcom [new file with mode: 0755]
misc/builddeps/dp.linux64/include/jconfig.h [new file with mode: 0644]
misc/builddeps/dp.linux64/include/jerror.h [new file with mode: 0644]
misc/builddeps/dp.linux64/include/jmorecfg.h [new file with mode: 0644]
misc/builddeps/dp.linux64/include/jpeglib.h [new file with mode: 0644]
misc/builddeps/dp.linux64/lib/libjpeg.a [new file with mode: 0644]
misc/builddeps/dp.linux64/lib/libjpeg.la [new file with mode: 0755]
misc/builddeps/dp.linux64/lib/libmodplug.a [new file with mode: 0644]
misc/builddeps/dp.linux64/lib/libmodplug.la
misc/builddeps/dp.linux64/lib/libmodplug.so [deleted symlink]
misc/builddeps/dp.linux64/lib/libmodplug.so.1 [deleted symlink]
misc/builddeps/dp.linux64/lib/libmodplug.so.1.0.0 [deleted file]
misc/builddeps/dp.linux64/lib/pkgconfig/libmodplug.pc
misc/builddeps/dp.linux64/share/man/man1/cjpeg.1 [new file with mode: 0644]
misc/builddeps/dp.linux64/share/man/man1/djpeg.1 [new file with mode: 0644]
misc/builddeps/dp.linux64/share/man/man1/jpegtran.1 [new file with mode: 0644]
misc/builddeps/dp.linux64/share/man/man1/rdjpgcom.1 [new file with mode: 0644]
misc/builddeps/dp.linux64/share/man/man1/wrjpgcom.1 [new file with mode: 0644]
misc/builddeps/dp.win32/bin/SDL.dll [new file with mode: 0755]
misc/builddeps/dp.win32/bin/sdl-config [new file with mode: 0755]
misc/builddeps/dp.win32/include/SDL/SDL.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_active.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_audio.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_byteorder.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_cdrom.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_config.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_copying.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_cpuinfo.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_endian.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_error.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_events.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_getenv.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_joystick.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_keyboard.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_keysym.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_loadso.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_main.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_mouse.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_mutex.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_name.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_opengl.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_platform.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_quit.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_rwops.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_stdinc.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_syswm.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_thread.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_timer.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_types.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_version.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/SDL_video.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/begin_code.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/close_code.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/SDL/doxyfile [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dtypes.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/ddraw.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/dinput.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/dsound.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/wspiapi.h [new file with mode: 0644]
misc/builddeps/dp.win32/lib/libSDL.dll.a [new file with mode: 0755]
misc/builddeps/dp.win32/lib/libSDL.la [new file with mode: 0755]
misc/builddeps/dp.win32/lib/libSDLmain.a [new file with mode: 0644]
misc/builddeps/dp.win32/share/aclocal/sdl.m4 [new file with mode: 0644]
misc/buildfiles/win32/SDL.dll

diff --git a/all b/all
index 2f8a5382d1ccefb7ec762a13aafc245b4f12f698..9d718df320140c31545b74401dae8247fdaad09d 100755 (executable)
--- a/all
+++ b/all
@@ -16,7 +16,7 @@ while ! [ -f ./all ]; do
        fi
        cd ..
 done
-d0=`pwd`
+export d0=`pwd`
 SELF="$d0/all"
 
 # If we are on WINDOWS:
@@ -900,17 +900,17 @@ case "$cmd" in
                                rsync --delete -zvaSHPAX "$srcdir"/ "$buildpath/"
                                (
                                        cd $buildpath
-                                       eval make clean $maketargets $makeflags
+                                       verbose eval make clean $maketargets $makeflags
                                )
                                for f in $targetfiles; do
-                                       mv "$buildpath/${f%:*}" "${f##*:}"
+                                       verbose mv "$buildpath/${f%:*}" "${f##*:}"
                                done
                                ;;
                        *)
                                rsync --delete -zvaSHPAX "$srcdir"/ "$host:$buildpath/"
-                               ssh "$host" ". ~/.profile && cd $buildpath && make clean $maketargets $makeflags"
+                               verbose ssh "$host" ". ~/.profile && cd $buildpath && make clean $maketargets $makeflags"
                                for f in $targetfiles; do
-                                       rsync -zvaSHPAX "$host:$buildpath/${f%:*}" "${f##*:}"
+                                       verbose rsync -zvaSHPAX "$host:$buildpath/${f%:*}" "${f##*:}"
                                done
                                ;;
                esac
@@ -927,15 +927,15 @@ case "$cmd" in
                ;;
        release-engine-win32)
                "$SELF" release-compile win32 \
-                       '"DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -Wl,--dynamicbase -Wl,--nxcompat -g -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win32/include -L$HOME/dp.win32/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win32/bin/sdl-config"' \
+                       'DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -Wl,--dynamicbase -Wl,--nxcompat -g -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win32/include -L$HOME/dp.win32/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win32/bin/sdl-config"' \
                        win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
-                       debug 'darkplaces.exe:xonotic.exe darkplaces-sdl.exe:xonotic-sdl.exe darkplaces-dedicated.exe:xonotic-dedicated.exe'
+                       debug 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
                ;;
        release-engine-win64)
                "$SELF" release-compile win64 \
-                       '"DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -Wl,--dynamicbase -Wl,--nxcompat -g -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win64/include -L$HOME/dp.win64/lib" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win64/bin/sdl-config" LDFLAGS_WINCOMMON=""' \
+                       'DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -Wl,--dynamicbase -Wl,--nxcompat -g -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win64/include -L$HOME/dp.win64/lib" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win64/bin/sdl-config" LDFLAGS_WINCOMMON=""' \
                        win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-64.exe' \
-                       debug 'darkplaces.exe:xonotic-64.exe darkplaces-sdl.exe:xonotic-sdl-64.exe darkplaces-dedicated.exe:xonotic-dedicated-64.exe'
+                       debug 'darkplaces.exe:Xonotic/xonotic-64.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl-64.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated-64.exe'
                ;;
        release-engine-osx)
                "$SELF" release-compile osx \
diff --git a/misc/builddeps/dp.linux32/bin/cjpeg b/misc/builddeps/dp.linux32/bin/cjpeg
new file mode 100755 (executable)
index 0000000..9c13ac0
Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/cjpeg differ
diff --git a/misc/builddeps/dp.linux32/bin/djpeg b/misc/builddeps/dp.linux32/bin/djpeg
new file mode 100755 (executable)
index 0000000..6439c61
Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/djpeg differ
diff --git a/misc/builddeps/dp.linux32/bin/jpegtran b/misc/builddeps/dp.linux32/bin/jpegtran
new file mode 100755 (executable)
index 0000000..e4cc559
Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/jpegtran differ
diff --git a/misc/builddeps/dp.linux32/bin/rdjpgcom b/misc/builddeps/dp.linux32/bin/rdjpgcom
new file mode 100755 (executable)
index 0000000..4e28fcb
Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/rdjpgcom differ
diff --git a/misc/builddeps/dp.linux32/bin/wrjpgcom b/misc/builddeps/dp.linux32/bin/wrjpgcom
new file mode 100755 (executable)
index 0000000..3756633
Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/wrjpgcom differ
diff --git a/misc/builddeps/dp.linux32/include/jconfig.h b/misc/builddeps/dp.linux32/include/jconfig.h
new file mode 100644 (file)
index 0000000..966b1d5
--- /dev/null
@@ -0,0 +1,54 @@
+/* jconfig.h.  Generated from jconfig.cfg by configure.  */
+/* jconfig.cfg --- source file edited by configure script */
+/* see jconfig.txt for explanations */
+
+#define HAVE_PROTOTYPES 1
+#define HAVE_UNSIGNED_CHAR 1
+#define HAVE_UNSIGNED_SHORT 1
+/* #undef void */
+/* #undef const */
+/* #undef CHAR_IS_UNSIGNED */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_LOCALE_H 1
+/* #undef NEED_BSD_STRINGS */
+/* #undef NEED_SYS_TYPES_H */
+/* #undef NEED_FAR_POINTERS */
+/* #undef NEED_SHORT_EXTERNAL_NAMES */
+/* Define this if you get warnings about undefined structures. */
+/* #undef INCOMPLETE_TYPES_BROKEN */
+
+/* Define "boolean" as unsigned char, not int, on Windows systems. */
+#ifdef _WIN32
+#ifndef __RPCNDR_H__           /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN           /* prevent jmorecfg.h from redefining it */
+#endif
+
+#ifdef JPEG_INTERNALS
+
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
+#define INLINE __inline__
+/* These are for configuring the JPEG memory manager. */
+/* #undef DEFAULT_MAX_MEM */
+/* #undef NO_MKTEMP */
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED          /* BMP image file format */
+#define GIF_SUPPORTED          /* GIF image file format */
+#define PPM_SUPPORTED          /* PBMPLUS PPM/PGM image file format */
+/* #undef RLE_SUPPORTED */
+#define TARGA_SUPPORTED                /* Targa image file format */
+
+/* #undef TWO_FILE_COMMANDLINE */
+/* #undef NEED_SIGNAL_CATCHER */
+/* #undef DONT_USE_B_MODE */
+
+/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
+/* #undef PROGRESS_REPORT */
+
+#endif /* JPEG_CJPEG_DJPEG */
diff --git a/misc/builddeps/dp.linux32/include/jerror.h b/misc/builddeps/dp.linux32/include/jerror.h
new file mode 100644 (file)
index 0000000..1cfb2b1
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * jerror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * Modified 1997-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the JPEG library.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ * A set of error-reporting macros are defined too.  Some applications using
+ * the JPEG library may wish to include this file to get the error codes
+ * and/or the macros.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE.  To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef JERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* JERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string)  code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
+
+/* For maintenance convenience, list is alphabetical by message code name */
+JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
+JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
+JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
+JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
+JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
+JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
+JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported")
+JMESSAGE(JERR_BAD_DROP_SAMPLING,
+        "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
+JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
+JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
+JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
+JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
+JMESSAGE(JERR_BAD_LIB_VERSION,
+        "Wrong JPEG library version: library is %d, caller expects %d")
+JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
+JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
+JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
+JMESSAGE(JERR_BAD_PROGRESSION,
+        "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
+JMESSAGE(JERR_BAD_PROG_SCRIPT,
+        "Invalid progressive parameters at scan script entry %d")
+JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
+JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
+JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
+JMESSAGE(JERR_BAD_STRUCT_SIZE,
+        "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
+JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
+JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
+JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
+JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
+JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
+JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
+JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
+JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
+JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
+JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
+JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
+JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
+JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
+JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
+JMESSAGE(JERR_FILE_READ, "Input file read error")
+JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
+JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
+JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
+JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
+JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
+JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
+JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
+        "Cannot transcode due to multiple use of quantization table %d")
+JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
+JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
+JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
+JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
+JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
+JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
+JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
+JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
+JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
+JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
+JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
+JMESSAGE(JERR_QUANT_COMPONENTS,
+        "Cannot quantize more than %d color components")
+JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
+JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
+JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
+JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
+JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
+JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
+JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
+JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
+JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
+JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
+JMESSAGE(JERR_TFILE_WRITE,
+        "Write failed on temporary file --- out of disk space?")
+JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
+JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
+JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
+JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
+JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
+JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
+JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
+JMESSAGE(JMSG_VERSION, JVERSION)
+JMESSAGE(JTRC_16BIT_TABLES,
+        "Caution: quantization tables are too coarse for baseline JPEG")
+JMESSAGE(JTRC_ADOBE,
+        "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
+JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
+JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
+JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
+JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
+JMESSAGE(JTRC_DQT, "Define Quantization Table %d  precision %d")
+JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
+JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
+JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
+JMESSAGE(JTRC_EOI, "End Of Image")
+JMESSAGE(JTRC_HUFFBITS, "        %3d %3d %3d %3d %3d %3d %3d %3d")
+JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d  %d")
+JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
+        "Warning: thumbnail image size does not match data length %u")
+JMESSAGE(JTRC_JFIF_EXTENSION,
+        "JFIF extension marker: type 0x%02x, length %u")
+JMESSAGE(JTRC_JFIF_THUMBNAIL, "    with %d x %d thumbnail image")
+JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
+JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
+JMESSAGE(JTRC_QUANTVALS, "        %4u %4u %4u %4u %4u %4u %4u %4u")
+JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
+JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
+JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
+JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
+JMESSAGE(JTRC_RST, "RST%d")
+JMESSAGE(JTRC_SMOOTH_NOTIMPL,
+        "Smoothing not supported with nonstandard sampling ratios")
+JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
+JMESSAGE(JTRC_SOF_COMPONENT, "    Component %d: %dhx%dv q=%d")
+JMESSAGE(JTRC_SOI, "Start of Image")
+JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
+JMESSAGE(JTRC_SOS_COMPONENT, "    Component %d: dc=%d ac=%d")
+JMESSAGE(JTRC_SOS_PARAMS, "  Ss=%d, Se=%d, Ah=%d, Al=%d")
+JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
+JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
+JMESSAGE(JTRC_THUMB_JPEG,
+        "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_PALETTE,
+        "JFIF extension marker: palette thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_RGB,
+        "JFIF extension marker: RGB thumbnail image, length %u")
+JMESSAGE(JTRC_UNKNOWN_IDS,
+        "Unrecognized component IDs %d %d %d, assuming YCbCr")
+JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
+JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
+JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
+JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
+JMESSAGE(JWRN_BOGUS_PROGRESSION,
+        "Inconsistent progression sequence for component %d coefficient %d")
+JMESSAGE(JWRN_EXTRANEOUS_DATA,
+        "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
+JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
+JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
+JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
+JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
+JMESSAGE(JWRN_MUST_RESYNC,
+        "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
+JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
+JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
+
+#ifdef JMAKE_ENUM_LIST
+
+  JMSG_LASTMSGCODE
+} J_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
+
+
+#ifndef JERROR_H
+#define JERROR_H
+
+/* Macros to simplify using the error and trace message stuff */
+/* The first parameter is either type of cinfo pointer */
+
+/* Fatal errors (print message and exit) */
+#define ERREXIT(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT3(cinfo,code,p1,p2,p3)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (cinfo)->err->msg_parm.i[3] = (p4), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (cinfo)->err->msg_parm.i[3] = (p4), \
+   (cinfo)->err->msg_parm.i[4] = (p5), \
+   (cinfo)->err->msg_parm.i[5] = (p6), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXITS(cinfo,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+#define MAKESTMT(stuff)                do { stuff } while (0)
+
+/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
+#define WARNMS(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+
+/* Informational/debugging messages */
+#define TRACEMS(cinfo,lvl,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS1(cinfo,lvl,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS2(cinfo,lvl,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          _mp[4] = (p5); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMSS(cinfo,lvl,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+
+#endif /* JERROR_H */
diff --git a/misc/builddeps/dp.linux32/include/jmorecfg.h b/misc/builddeps/dp.linux32/include/jmorecfg.h
new file mode 100644 (file)
index 0000000..928d052
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * jmorecfg.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * Modified 1997-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains additional configuration options that customize the
+ * JPEG software for special applications or support machine-dependent
+ * optimizations.  Most users will not need to touch this file.
+ */
+
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ *   8   for 8-bit sample values (the usual setting)
+ *   12  for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE  8     /* use 8 or 12 */
+
+
+/*
+ * Maximum number of components (color channels) allowed in JPEG image.
+ * To meet the letter of the JPEG spec, set this to 255.  However, darn
+ * few applications need more than 4 channels (maybe 5 for CMYK + alpha
+ * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
+ * really short on memory.  (Each allowed component costs a hundred or so
+ * bytes of storage, whether actually used in an image or not.)
+ */
+
+#define MAX_COMPONENTS  10     /* maximum number of image components */
+
+
+/*
+ * Basic data types.
+ * You may need to change these if you have a machine with unusual data
+ * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+ * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
+ * but it had better be at least 16.
+ */
+
+/* Representation of a single sample (pixel element value).
+ * We frequently allocate large arrays of these, so it's important to keep
+ * them small.  But if you have memory to burn and access to char or short
+ * arrays is very slow on your hardware, you might want to change these.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+/* JSAMPLE should be the smallest type that will hold the values 0..255.
+ * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JSAMPLE;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJSAMPLE(value)  ((int) (value))
+#else
+#define GETJSAMPLE(value)  ((int) (value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+#define MAXJSAMPLE     255
+#define CENTERJSAMPLE  128
+
+#endif /* BITS_IN_JSAMPLE == 8 */
+
+
+#if BITS_IN_JSAMPLE == 12
+/* JSAMPLE should be the smallest type that will hold the values 0..4095.
+ * On nearly all machines "short" will do nicely.
+ */
+
+typedef short JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#define MAXJSAMPLE     4095
+#define CENTERJSAMPLE  2048
+
+#endif /* BITS_IN_JSAMPLE == 12 */
+
+
+/* Representation of a DCT frequency coefficient.
+ * This should be a signed value of at least 16 bits; "short" is usually OK.
+ * Again, we allocate large arrays of these, but you can change to int
+ * if you have memory to burn and "short" is really slow.
+ */
+
+typedef short JCOEF;
+
+
+/* Compressed datastreams are represented as arrays of JOCTET.
+ * These must be EXACTLY 8 bits wide, at least once they are written to
+ * external storage.  Note that when using the stdio data source/destination
+ * managers, this is also the data type passed to fread/fwrite.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JOCTET;
+#define GETJOCTET(value)  (value)
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JOCTET;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJOCTET(value)  (value)
+#else
+#define GETJOCTET(value)  ((value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* These typedefs are used for various table entries and so forth.
+ * They must be at least as wide as specified; but making them too big
+ * won't cost a huge amount of memory, so we don't provide special
+ * extraction code like we did for JSAMPLE.  (In other words, these
+ * typedefs live at a different point on the speed/space tradeoff curve.)
+ */
+
+/* UINT8 must hold at least the values 0..255. */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char UINT8;
+#else /* not HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char UINT8;
+#else /* not CHAR_IS_UNSIGNED */
+typedef short UINT8;
+#endif /* CHAR_IS_UNSIGNED */
+#endif /* HAVE_UNSIGNED_CHAR */
+
+/* UINT16 must hold at least the values 0..65535. */
+
+#ifdef HAVE_UNSIGNED_SHORT
+typedef unsigned short UINT16;
+#else /* not HAVE_UNSIGNED_SHORT */
+typedef unsigned int UINT16;
+#endif /* HAVE_UNSIGNED_SHORT */
+
+/* INT16 must hold at least the values -32768..32767. */
+
+#ifndef XMD_H                  /* X11/xmd.h correctly defines INT16 */
+typedef short INT16;
+#endif
+
+/* INT32 must hold at least signed 32-bit values. */
+
+#ifndef XMD_H                  /* X11/xmd.h correctly defines INT32 */
+#ifndef _BASETSD_H_            /* Microsoft defines it in basetsd.h */
+#ifndef _BASETSD_H             /* MinGW is slightly different */
+#ifndef QGLOBAL_H              /* Qt defines it in qglobal.h */
+typedef long INT32;
+#endif
+#endif
+#endif
+#endif
+
+/* Datatype used for image dimensions.  The JPEG standard only supports
+ * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
+ * "unsigned int" is sufficient on all machines.  However, if you need to
+ * handle larger images and you don't mind deviating from the spec, you
+ * can change this datatype.
+ */
+
+typedef unsigned int JDIMENSION;
+
+#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
+
+
+/* These macros are used in all function definitions and extern declarations.
+ * You could modify them if you need to change function linkage conventions;
+ * in particular, you'll need to do that to make the library a Windows DLL.
+ * Another application is to make all functions global for use with debuggers
+ * or code profilers that require it.
+ */
+
+/* a function called through method pointers: */
+#define METHODDEF(type)                static type
+/* a function used only in its module: */
+#define LOCAL(type)            static type
+/* a function referenced thru EXTERNs: */
+#define GLOBAL(type)           type
+/* a reference to a GLOBAL function: */
+#define EXTERN(type)           extern type
+
+
+/* This macro is used to declare a "method", that is, a function pointer.
+ * We want to supply prototype parameters if the compiler can cope.
+ * Note that the arglist parameter must be parenthesized!
+ * Again, you can customize this if you need special linkage keywords.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
+#else
+#define JMETHOD(type,methodname,arglist)  type (*methodname) ()
+#endif
+
+
+/* Here is the pseudo-keyword for declaring pointers that must be "far"
+ * on 80x86 machines.  Most of the specialized coding for 80x86 is handled
+ * by just saying "FAR *" where such a pointer is needed.  In a few places
+ * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
+ */
+
+#ifndef FAR
+#ifdef NEED_FAR_POINTERS
+#define FAR  far
+#else
+#define FAR
+#endif
+#endif
+
+
+/*
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
+ * in standard header files.  Or you may have conflicts with application-
+ * specific header files that you want to include together with these files.
+ * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+ */
+
+#ifndef HAVE_BOOLEAN
+typedef int boolean;
+#endif
+#ifndef FALSE                  /* in case these macros already exist */
+#define FALSE  0               /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE   1
+#endif
+
+
+/*
+ * The remaining options affect code selection within the JPEG library,
+ * but they don't need to be visible to most applications using the library.
+ * To minimize application namespace pollution, the symbols won't be
+ * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
+ */
+
+#ifdef JPEG_INTERNALS
+#define JPEG_INTERNAL_OPTIONS
+#endif
+
+#ifdef JPEG_INTERNAL_OPTIONS
+
+
+/*
+ * These defines indicate whether to include various optional functions.
+ * Undefining some of these symbols will produce a smaller but less capable
+ * library.  Note that you can leave certain source files out of the
+ * compilation/linking process if you've #undef'd the corresponding symbols.
+ * (You may HAVE to do that if your compiler doesn't like null source files.)
+ */
+
+/* Capability options common to encoder and decoder: */
+
+#define DCT_ISLOW_SUPPORTED    /* slow but accurate integer algorithm */
+#define DCT_IFAST_SUPPORTED    /* faster, less accurate integer method */
+#define DCT_FLOAT_SUPPORTED    /* floating-point: accurate, fast on fast HW */
+
+/* Encoder capability options: */
+
+#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define C_PROGRESSIVE_SUPPORTED            /* Progressive JPEG? (Requires MULTISCAN)*/
+#define DCT_SCALING_SUPPORTED      /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
+#define ENTROPY_OPT_SUPPORTED      /* Optimization of entropy coding parms? */
+/* Note: if you selected 12-bit data precision, it is dangerous to turn off
+ * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
+ * precision, so jchuff.c normally uses entropy optimization to compute
+ * usable tables for higher precision.  If you don't want to do optimization,
+ * you'll have to supply different default Huffman tables.
+ * The exact same statements apply for progressive JPEG: the default tables
+ * don't work for progressive mode.  (This may get fixed, however.)
+ */
+#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
+
+/* Decoder capability options: */
+
+#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define D_PROGRESSIVE_SUPPORTED            /* Progressive JPEG? (Requires MULTISCAN)*/
+#define IDCT_SCALING_SUPPORTED     /* Output rescaling via IDCT? */
+#define SAVE_MARKERS_SUPPORTED     /* jpeg_save_markers() needed? */
+#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
+#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
+#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
+#define QUANT_1PASS_SUPPORTED      /* 1-pass color quantization? */
+#define QUANT_2PASS_SUPPORTED      /* 2-pass color quantization? */
+
+/* more capability options later, no doubt */
+
+
+/*
+ * Ordering of RGB data in scanlines passed to or from the application.
+ * If your application wants to deal with data in the order B,G,R, just
+ * change these macros.  You can also deal with formats such as R,G,B,X
+ * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing
+ * the offsets will also change the order in which colormap data is organized.
+ * RESTRICTIONS:
+ * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
+ * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
+ *    useful if you are using JPEG color spaces other than YCbCr or grayscale.
+ * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
+ *    is not 3 (they don't understand about dummy color components!).  So you
+ *    can't use color quantization if you change that value.
+ */
+
+#define RGB_RED                0       /* Offset of Red in an RGB scanline element */
+#define RGB_GREEN      1       /* Offset of Green */
+#define RGB_BLUE       2       /* Offset of Blue */
+#define RGB_PIXELSIZE  3       /* JSAMPLEs per RGB scanline element */
+
+
+/* Definitions for speed-related optimizations. */
+
+
+/* If your compiler supports inline functions, define INLINE
+ * as the inline keyword; otherwise define it as empty.
+ */
+
+#ifndef INLINE
+#ifdef __GNUC__                        /* for instance, GNU C knows about inline */
+#define INLINE __inline__
+#endif
+#ifndef INLINE
+#define INLINE                 /* default is to define it as empty */
+#endif
+#endif
+
+
+/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
+ * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
+ * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
+ */
+
+#ifndef MULTIPLIER
+#define MULTIPLIER  int                /* type for fastest integer multiply */
+#endif
+
+
+/* FAST_FLOAT should be either float or double, whichever is done faster
+ * by your compiler.  (Note that this type is only used in the floating point
+ * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
+ * Typically, float is faster in ANSI C compilers, while double is faster in
+ * pre-ANSI compilers (because they insist on converting to double anyway).
+ * The code below therefore chooses float if we have ANSI-style prototypes.
+ */
+
+#ifndef FAST_FLOAT
+#ifdef HAVE_PROTOTYPES
+#define FAST_FLOAT  float
+#else
+#define FAST_FLOAT  double
+#endif
+#endif
+
+#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/misc/builddeps/dp.linux32/include/jpeglib.h b/misc/builddeps/dp.linux32/include/jpeglib.h
new file mode 100644 (file)
index 0000000..5039d4b
--- /dev/null
@@ -0,0 +1,1158 @@
+/*
+ * jpeglib.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * Modified 2002-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the application interface for the JPEG library.
+ * Most applications using the library need only include this file,
+ * and perhaps jerror.h if they want to know the exact error codes.
+ */
+
+#ifndef JPEGLIB_H
+#define JPEGLIB_H
+
+/*
+ * First we include the configuration files that record how this
+ * installation of the JPEG library is set up.  jconfig.h can be
+ * generated automatically for many systems.  jmorecfg.h contains
+ * manual configuration options that most people need not worry about.
+ */
+
+#ifndef JCONFIG_INCLUDED       /* in case jinclude.h already did */
+#include "jconfig.h"           /* widely used configuration options */
+#endif
+#include "jmorecfg.h"          /* seldom changed options */
+
+
+#ifdef __cplusplus
+#ifndef DONT_USE_EXTERN_C
+extern "C" {
+#endif
+#endif
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80".
+ */
+
+#define JPEG_LIB_VERSION  80   /* Version 8.0 */
+
+
+/* Various constants determining the sizes of things.
+ * All of these are specified by the JPEG standard, so don't change them
+ * if you want to be compatible.
+ */
+
+#define DCTSIZE                    8   /* The basic DCT block is 8x8 samples */
+#define DCTSIZE2           64  /* DCTSIZE squared; # of elements in a block */
+#define NUM_QUANT_TBLS      4  /* Quantization tables are numbered 0..3 */
+#define NUM_HUFF_TBLS       4  /* Huffman tables are numbered 0..3 */
+#define NUM_ARITH_TBLS      16 /* Arith-coding tables are numbered 0..15 */
+#define MAX_COMPS_IN_SCAN   4  /* JPEG limit on # of components in one scan */
+#define MAX_SAMP_FACTOR     4  /* JPEG limit on sampling factors */
+/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
+ * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
+ * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
+ * to handle it.  We even let you do this from the jconfig.h file.  However,
+ * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
+ * sometimes emits noncompliant files doesn't mean you should too.
+ */
+#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */
+#ifndef D_MAX_BLOCKS_IN_MCU
+#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
+#endif
+
+
+/* Data structures for images (arrays of samples and of DCT coefficients).
+ * On 80x86 machines, the image arrays are too big for near pointers,
+ * but the pointer arrays can fit in near memory.
+ */
+
+typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
+typedef JSAMPROW *JSAMPARRAY;  /* ptr to some rows (a 2-D sample array) */
+typedef JSAMPARRAY *JSAMPIMAGE;        /* a 3-D sample array: top index is color */
+
+typedef JCOEF JBLOCK[DCTSIZE2];        /* one block of coefficients */
+typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */
+typedef JBLOCKROW *JBLOCKARRAY;                /* a 2-D array of coefficient blocks */
+typedef JBLOCKARRAY *JBLOCKIMAGE;      /* a 3-D array of coefficient blocks */
+
+typedef JCOEF FAR *JCOEFPTR;   /* useful in a couple of places */
+
+
+/* Types for JPEG compression parameters and working tables. */
+
+
+/* DCT coefficient quantization tables. */
+
+typedef struct {
+  /* This array gives the coefficient quantizers in natural array order
+   * (not the zigzag order in which they are stored in a JPEG DQT marker).
+   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+   */
+  UINT16 quantval[DCTSIZE2];   /* quantization step for each coefficient */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;          /* TRUE when table has been output */
+} JQUANT_TBL;
+
+
+/* Huffman coding tables. */
+
+typedef struct {
+  /* These two fields directly represent the contents of a JPEG DHT marker */
+  UINT8 bits[17];              /* bits[k] = # of symbols with codes of */
+                               /* length k bits; bits[0] is unused */
+  UINT8 huffval[256];          /* The symbols, in order of incr code length */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;          /* TRUE when table has been output */
+} JHUFF_TBL;
+
+
+/* Basic info about one component (color channel). */
+
+typedef struct {
+  /* These values are fixed over the whole image. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOF marker. */
+  int component_id;            /* identifier for this component (0..255) */
+  int component_index;         /* its index in SOF or cinfo->comp_info[] */
+  int h_samp_factor;           /* horizontal sampling factor (1..4) */
+  int v_samp_factor;           /* vertical sampling factor (1..4) */
+  int quant_tbl_no;            /* quantization table selector (0..3) */
+  /* These values may vary between scans. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOS marker. */
+  /* The decompressor output side may not use these variables. */
+  int dc_tbl_no;               /* DC entropy table selector (0..3) */
+  int ac_tbl_no;               /* AC entropy table selector (0..3) */
+  
+  /* Remaining fields should be treated as private by applications. */
+  
+  /* These values are computed during compression or decompression startup: */
+  /* Component's size in DCT blocks.
+   * Any dummy blocks added to complete an MCU are not counted; therefore
+   * these values do not depend on whether a scan is interleaved or not.
+   */
+  JDIMENSION width_in_blocks;
+  JDIMENSION height_in_blocks;
+  /* Size of a DCT block in samples,
+   * reflecting any scaling we choose to apply during the DCT step.
+   * Values from 1 to 16 are supported.
+   * Note that different components may receive different DCT scalings.
+   */
+  int DCT_h_scaled_size;
+  int DCT_v_scaled_size;
+  /* The downsampled dimensions are the component's actual, unpadded number
+   * of samples at the main buffer (preprocessing/compression interface);
+   * DCT scaling is included, so
+   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)
+   * and similarly for height.
+   */
+  JDIMENSION downsampled_width;         /* actual width in samples */
+  JDIMENSION downsampled_height; /* actual height in samples */
+  /* This flag is used only for decompression.  In cases where some of the
+   * components will be ignored (eg grayscale output from YCbCr image),
+   * we can skip most computations for the unused components.
+   */
+  boolean component_needed;    /* do we need the value of this component? */
+
+  /* These values are computed before starting a scan of the component. */
+  /* The decompressor output side may not use these variables. */
+  int MCU_width;               /* number of blocks per MCU, horizontally */
+  int MCU_height;              /* number of blocks per MCU, vertically */
+  int MCU_blocks;              /* MCU_width * MCU_height */
+  int MCU_sample_width;        /* MCU width in samples: MCU_width * DCT_h_scaled_size */
+  int last_col_width;          /* # of non-dummy blocks across in last MCU */
+  int last_row_height;         /* # of non-dummy blocks down in last MCU */
+
+  /* Saved quantization table for component; NULL if none yet saved.
+   * See jdinput.c comments about the need for this information.
+   * This field is currently used only for decompression.
+   */
+  JQUANT_TBL * quant_table;
+
+  /* Private per-component storage for DCT or IDCT subsystem. */
+  void * dct_table;
+} jpeg_component_info;
+
+
+/* The script for encoding a multiple-scan file is an array of these: */
+
+typedef struct {
+  int comps_in_scan;           /* number of components encoded in this scan */
+  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
+  int Ss, Se;                  /* progressive JPEG spectral selection parms */
+  int Ah, Al;                  /* progressive JPEG successive approx. parms */
+} jpeg_scan_info;
+
+/* The decompressor can save APPn and COM markers in a list of these: */
+
+typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
+
+struct jpeg_marker_struct {
+  jpeg_saved_marker_ptr next;  /* next in list, or NULL */
+  UINT8 marker;                        /* marker code: JPEG_COM, or JPEG_APP0+n */
+  unsigned int original_length;        /* # bytes of data in the file */
+  unsigned int data_length;    /* # bytes of data saved at data[] */
+  JOCTET FAR * data;           /* the data contained in the marker */
+  /* the marker length word is not counted in data_length or original_length */
+};
+
+/* Known color spaces. */
+
+typedef enum {
+       JCS_UNKNOWN,            /* error/unspecified */
+       JCS_GRAYSCALE,          /* monochrome */
+       JCS_RGB,                /* red/green/blue */
+       JCS_YCbCr,              /* Y/Cb/Cr (also known as YUV) */
+       JCS_CMYK,               /* C/M/Y/K */
+       JCS_YCCK                /* Y/Cb/Cr/K */
+} J_COLOR_SPACE;
+
+/* DCT/IDCT algorithm options. */
+
+typedef enum {
+       JDCT_ISLOW,             /* slow but accurate integer algorithm */
+       JDCT_IFAST,             /* faster, less accurate integer method */
+       JDCT_FLOAT              /* floating-point: accurate, fast on fast HW */
+} J_DCT_METHOD;
+
+#ifndef JDCT_DEFAULT           /* may be overridden in jconfig.h */
+#define JDCT_DEFAULT  JDCT_ISLOW
+#endif
+#ifndef JDCT_FASTEST           /* may be overridden in jconfig.h */
+#define JDCT_FASTEST  JDCT_IFAST
+#endif
+
+/* Dithering options for decompression. */
+
+typedef enum {
+       JDITHER_NONE,           /* no dithering */
+       JDITHER_ORDERED,        /* simple ordered dither */
+       JDITHER_FS              /* Floyd-Steinberg error diffusion dither */
+} J_DITHER_MODE;
+
+
+/* Common fields between JPEG compression and decompression master structs. */
+
+#define jpeg_common_fields \
+  struct jpeg_error_mgr * err; /* Error handler module */\
+  struct jpeg_memory_mgr * mem;        /* Memory manager module */\
+  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
+  void * client_data;          /* Available for use by application */\
+  boolean is_decompressor;     /* So common code can tell which is which */\
+  int global_state             /* For checking call sequence validity */
+
+/* Routines that are to be used by both halves of the library are declared
+ * to receive a pointer to this structure.  There are no actual instances of
+ * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
+ */
+struct jpeg_common_struct {
+  jpeg_common_fields;          /* Fields common to both master struct types */
+  /* Additional fields follow in an actual jpeg_compress_struct or
+   * jpeg_decompress_struct.  All three structs must agree on these
+   * initial fields!  (This would be a lot cleaner in C++.)
+   */
+};
+
+typedef struct jpeg_common_struct * j_common_ptr;
+typedef struct jpeg_compress_struct * j_compress_ptr;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+
+
+/* Master record for a compression instance */
+
+struct jpeg_compress_struct {
+  jpeg_common_fields;          /* Fields shared with jpeg_decompress_struct */
+
+  /* Destination for compressed data */
+  struct jpeg_destination_mgr * dest;
+
+  /* Description of source image --- these fields must be filled in by
+   * outer application before starting compression.  in_color_space must
+   * be correct before you can even call jpeg_set_defaults().
+   */
+
+  JDIMENSION image_width;      /* input image width */
+  JDIMENSION image_height;     /* input image height */
+  int input_components;                /* # of color components in input image */
+  J_COLOR_SPACE in_color_space;        /* colorspace of input image */
+
+  double input_gamma;          /* image gamma of input image */
+
+  /* Compression parameters --- these fields must be set before calling
+   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to
+   * initialize everything to reasonable defaults, then changing anything
+   * the application specifically wants to change.  That way you won't get
+   * burnt when new parameters are added.  Also note that there are several
+   * helper routines to simplify changing parameters.
+   */
+
+  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+  JDIMENSION jpeg_width;       /* scaled JPEG image width */
+  JDIMENSION jpeg_height;      /* scaled JPEG image height */
+  /* Dimensions of actual JPEG image that will be written to file,
+   * derived from input dimensions by scaling factors above.
+   * These fields are computed by jpeg_start_compress().
+   * You can also use jpeg_calc_jpeg_dimensions() to determine these values
+   * in advance of calling jpeg_start_compress().
+   */
+
+  int data_precision;          /* bits of precision in image data */
+
+  int num_components;          /* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  int q_scale_factor[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined,
+   * and corresponding scale factors (percentage, initialized 100).
+   */
+
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  int num_scans;               /* # of entries in scan_info array */
+  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
+  /* The default value of scan_info is NULL, which causes a single-scan
+   * sequential JPEG file to be emitted.  To create a multi-scan file,
+   * set num_scans and scan_info to point to an array of scan definitions.
+   */
+
+  boolean raw_data_in;         /* TRUE=caller supplies downsampled data */
+  boolean arith_code;          /* TRUE=arithmetic coding, FALSE=Huffman */
+  boolean optimize_coding;     /* TRUE=optimize entropy encoding parms */
+  boolean CCIR601_sampling;    /* TRUE=first samples are cosited */
+  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */
+  int smoothing_factor;                /* 1..100, or 0 for no input smoothing */
+  J_DCT_METHOD dct_method;     /* DCT algorithm selector */
+
+  /* The restart interval can be specified in absolute MCUs by setting
+   * restart_interval, or in MCU rows by setting restart_in_rows
+   * (in which case the correct restart_interval will be figured
+   * for each scan).
+   */
+  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
+  int restart_in_rows;         /* if > 0, MCU rows per restart interval */
+
+  /* Parameters controlling emission of special markers. */
+
+  boolean write_JFIF_header;   /* should a JFIF marker be written? */
+  UINT8 JFIF_major_version;    /* What to write for the JFIF version number */
+  UINT8 JFIF_minor_version;
+  /* These three values are not used by the JPEG code, merely copied */
+  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */
+  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */
+  /* ratio is defined by X_density/Y_density even when density_unit=0. */
+  UINT8 density_unit;          /* JFIF code for pixel size units */
+  UINT16 X_density;            /* Horizontal pixel density */
+  UINT16 Y_density;            /* Vertical pixel density */
+  boolean write_Adobe_marker;  /* should an Adobe marker be written? */
+  
+  /* State variable: index of next scanline to be written to
+   * jpeg_write_scanlines().  Application may use this to control its
+   * processing loop, e.g., "while (next_scanline < image_height)".
+   */
+
+  JDIMENSION next_scanline;    /* 0 .. image_height-1  */
+
+  /* Remaining fields are known throughout compressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during compression startup
+   */
+  boolean progressive_mode;    /* TRUE if scan script uses progressive mode */
+  int max_h_samp_factor;       /* largest h_samp_factor */
+  int max_v_samp_factor;       /* largest v_samp_factor */
+
+  int min_DCT_h_scaled_size;   /* smallest DCT_h_scaled_size of any component */
+  int min_DCT_v_scaled_size;   /* smallest DCT_v_scaled_size of any component */
+
+  JDIMENSION total_iMCU_rows;  /* # of iMCU rows to be input to coef ctlr */
+  /* The coefficient controller receives data in units of MCU rows as defined
+   * for fully interleaved scans (whether the JPEG file is interleaved or not).
+   * There are v_samp_factor * DCTSIZE sample rows of each component in an
+   * "iMCU" (interleaved MCU) row.
+   */
+  
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   */
+  int comps_in_scan;           /* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+  
+  JDIMENSION MCUs_per_row;     /* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+  
+  int blocks_in_MCU;           /* # of DCT blocks per MCU */
+  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;          /* progressive JPEG parameters for scan */
+
+  int block_size;              /* the basic DCT block size: 1..16 */
+  const int * natural_order;   /* natural-order position array */
+  int lim_Se;                  /* min( Se, DCTSIZE2-1 ) */
+
+  /*
+   * Links to compression subobjects (methods and private variables of modules)
+   */
+  struct jpeg_comp_master * master;
+  struct jpeg_c_main_controller * main;
+  struct jpeg_c_prep_controller * prep;
+  struct jpeg_c_coef_controller * coef;
+  struct jpeg_marker_writer * marker;
+  struct jpeg_color_converter * cconvert;
+  struct jpeg_downsampler * downsample;
+  struct jpeg_forward_dct * fdct;
+  struct jpeg_entropy_encoder * entropy;
+  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
+  int script_space_size;
+};
+
+
+/* Master record for a decompression instance */
+
+struct jpeg_decompress_struct {
+  jpeg_common_fields;          /* Fields shared with jpeg_compress_struct */
+
+  /* Source of compressed data */
+  struct jpeg_source_mgr * src;
+
+  /* Basic description of image --- filled in by jpeg_read_header(). */
+  /* Application may inspect these values to decide how to process image. */
+
+  JDIMENSION image_width;      /* nominal image width (from SOF marker) */
+  JDIMENSION image_height;     /* nominal image height */
+  int num_components;          /* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  /* Decompression processing parameters --- these fields must be set before
+   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes
+   * them to default values.
+   */
+
+  J_COLOR_SPACE out_color_space; /* colorspace for output */
+
+  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+  double output_gamma;         /* image gamma wanted in output */
+
+  boolean buffered_image;      /* TRUE=multiple output passes */
+  boolean raw_data_out;                /* TRUE=downsampled data wanted */
+
+  J_DCT_METHOD dct_method;     /* IDCT algorithm selector */
+  boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
+  boolean do_block_smoothing;  /* TRUE=apply interblock smoothing */
+
+  boolean quantize_colors;     /* TRUE=colormapped output wanted */
+  /* the following are ignored if not quantize_colors: */
+  J_DITHER_MODE dither_mode;   /* type of color dithering to use */
+  boolean two_pass_quantize;   /* TRUE=use two-pass color quantization */
+  int desired_number_of_colors;        /* max # colors to use in created colormap */
+  /* these are significant only in buffered-image mode: */
+  boolean enable_1pass_quant;  /* enable future use of 1-pass quantizer */
+  boolean enable_external_quant;/* enable future use of external colormap */
+  boolean enable_2pass_quant;  /* enable future use of 2-pass quantizer */
+
+  /* Description of actual output image that will be returned to application.
+   * These fields are computed by jpeg_start_decompress().
+   * You can also use jpeg_calc_output_dimensions() to determine these values
+   * in advance of calling jpeg_start_decompress().
+   */
+
+  JDIMENSION output_width;     /* scaled image width */
+  JDIMENSION output_height;    /* scaled image height */
+  int out_color_components;    /* # of color components in out_color_space */
+  int output_components;       /* # of color components returned */
+  /* output_components is 1 (a colormap index) when quantizing colors;
+   * otherwise it equals out_color_components.
+   */
+  int rec_outbuf_height;       /* min recommended height of scanline buffer */
+  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+   * high, space and time will be wasted due to unnecessary data copying.
+   * Usually rec_outbuf_height will be 1 or 2, at most 4.
+   */
+
+  /* When quantizing colors, the output colormap is described by these fields.
+   * The application can supply a colormap by setting colormap non-NULL before
+   * calling jpeg_start_decompress; otherwise a colormap is created during
+   * jpeg_start_decompress or jpeg_start_output.
+   * The map has out_color_components rows and actual_number_of_colors columns.
+   */
+  int actual_number_of_colors; /* number of entries in use */
+  JSAMPARRAY colormap;         /* The color map as a 2-D pixel array */
+
+  /* State variables: these variables indicate the progress of decompression.
+   * The application may examine these but must not modify them.
+   */
+
+  /* Row index of next scanline to be read from jpeg_read_scanlines().
+   * Application may use this to control its processing loop, e.g.,
+   * "while (output_scanline < output_height)".
+   */
+  JDIMENSION output_scanline;  /* 0 .. output_height-1  */
+
+  /* Current input scan number and number of iMCU rows completed in scan.
+   * These indicate the progress of the decompressor input side.
+   */
+  int input_scan_number;       /* Number of SOS markers seen so far */
+  JDIMENSION input_iMCU_row;   /* Number of iMCU rows completed */
+
+  /* The "output scan number" is the notional scan being displayed by the
+   * output side.  The decompressor will not allow output scan/row number
+   * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+   */
+  int output_scan_number;      /* Nominal scan number being displayed */
+  JDIMENSION output_iMCU_row;  /* Number of iMCU rows read */
+
+  /* Current progression status.  coef_bits[c][i] indicates the precision
+   * with which component c's DCT coefficient i (in zigzag order) is known.
+   * It is -1 when no data has yet been received, otherwise it is the point
+   * transform (shift) value for the most recent scan of the coefficient
+   * (thus, 0 at completion of the progression).
+   * This pointer is NULL when reading a non-progressive file.
+   */
+  int (*coef_bits)[DCTSIZE2];  /* -1 or current Al value for each coef */
+
+  /* Internal JPEG parameters --- the application usually need not look at
+   * these fields.  Note that the decompressor output side may not use
+   * any parameters that can change between scans.
+   */
+
+  /* Quantization and Huffman tables are carried forward across input
+   * datastreams when processing abbreviated JPEG datastreams.
+   */
+
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+
+  /* These parameters are never carried across datastreams, since they
+   * are given in SOF/SOS markers or defined to be reset by SOI.
+   */
+
+  int data_precision;          /* bits of precision in image data */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+
+  boolean is_baseline;         /* TRUE if Baseline SOF0 encountered */
+  boolean progressive_mode;    /* TRUE if SOFn specifies progressive mode */
+  boolean arith_code;          /* TRUE=arithmetic coding, FALSE=Huffman */
+
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+  /* These fields record data obtained from optional markers recognized by
+   * the JPEG library.
+   */
+  boolean saw_JFIF_marker;     /* TRUE iff a JFIF APP0 marker was found */
+  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
+  UINT8 JFIF_major_version;    /* JFIF version number */
+  UINT8 JFIF_minor_version;
+  UINT8 density_unit;          /* JFIF code for pixel size units */
+  UINT16 X_density;            /* Horizontal pixel density */
+  UINT16 Y_density;            /* Vertical pixel density */
+  boolean saw_Adobe_marker;    /* TRUE iff an Adobe APP14 marker was found */
+  UINT8 Adobe_transform;       /* Color transform code from Adobe marker */
+
+  boolean CCIR601_sampling;    /* TRUE=first samples are cosited */
+
+  /* Aside from the specific data retained from APPn markers known to the
+   * library, the uninterpreted contents of any or all APPn and COM markers
+   * can be saved in a list for examination by the application.
+   */
+  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
+
+  /* Remaining fields are known throughout decompressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during decompression startup
+   */
+  int max_h_samp_factor;       /* largest h_samp_factor */
+  int max_v_samp_factor;       /* largest v_samp_factor */
+
+  int min_DCT_h_scaled_size;   /* smallest DCT_h_scaled_size of any component */
+  int min_DCT_v_scaled_size;   /* smallest DCT_v_scaled_size of any component */
+
+  JDIMENSION total_iMCU_rows;  /* # of iMCU rows in image */
+  /* The coefficient controller's input and output progress is measured in
+   * units of "iMCU" (interleaved MCU) rows.  These are the same as MCU rows
+   * in fully interleaved JPEG scans, but are used whether the scan is
+   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block
+   * rows of each component.  Therefore, the IDCT output contains
+   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
+   */
+
+  JSAMPLE * sample_range_limit; /* table for fast range-limiting */
+
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   * Note that the decompressor output side must not use these fields.
+   */
+  int comps_in_scan;           /* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+  JDIMENSION MCUs_per_row;     /* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+  int blocks_in_MCU;           /* # of DCT blocks per MCU */
+  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;          /* progressive JPEG parameters for scan */
+
+  /* These fields are derived from Se of first SOS marker.
+   */
+  int block_size;              /* the basic DCT block size: 1..16 */
+  const int * natural_order; /* natural-order position array for entropy decode */
+  int lim_Se;                  /* min( Se, DCTSIZE2-1 ) for entropy decode */
+
+  /* This field is shared between entropy decoder and marker parser.
+   * It is either zero or the code of a JPEG marker that has been
+   * read from the data source, but has not yet been processed.
+   */
+  int unread_marker;
+
+  /*
+   * Links to decompression subobjects (methods, private variables of modules)
+   */
+  struct jpeg_decomp_master * master;
+  struct jpeg_d_main_controller * main;
+  struct jpeg_d_coef_controller * coef;
+  struct jpeg_d_post_controller * post;
+  struct jpeg_input_controller * inputctl;
+  struct jpeg_marker_reader * marker;
+  struct jpeg_entropy_decoder * entropy;
+  struct jpeg_inverse_dct * idct;
+  struct jpeg_upsampler * upsample;
+  struct jpeg_color_deconverter * cconvert;
+  struct jpeg_color_quantizer * cquantize;
+};
+
+
+/* "Object" declarations for JPEG modules that may be supplied or called
+ * directly by the surrounding application.
+ * As with all objects in the JPEG library, these structs only define the
+ * publicly visible methods and state variables of a module.  Additional
+ * private fields may exist after the public ones.
+ */
+
+
+/* Error handler object */
+
+struct jpeg_error_mgr {
+  /* Error exit handler: does not return to caller */
+  JMETHOD(void, error_exit, (j_common_ptr cinfo));
+  /* Conditionally emit a trace or warning message */
+  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
+  /* Routine that actually outputs a trace or error message */
+  JMETHOD(void, output_message, (j_common_ptr cinfo));
+  /* Format a message string for the most recent JPEG error or message */
+  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
+#define JMSG_LENGTH_MAX  200   /* recommended size of format_message buffer */
+  /* Reset error state variables at start of a new image */
+  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
+  
+  /* The message ID code and any parameters are saved here.
+   * A message can have one string parameter or up to 8 int parameters.
+   */
+  int msg_code;
+#define JMSG_STR_PARM_MAX  80
+  union {
+    int i[8];
+    char s[JMSG_STR_PARM_MAX];
+  } msg_parm;
+  
+  /* Standard state variables for error facility */
+  
+  int trace_level;             /* max msg_level that will be displayed */
+  
+  /* For recoverable corrupt-data errors, we emit a warning message,
+   * but keep going unless emit_message chooses to abort.  emit_message
+   * should count warnings in num_warnings.  The surrounding application
+   * can check for bad data by seeing if num_warnings is nonzero at the
+   * end of processing.
+   */
+  long num_warnings;           /* number of corrupt-data warnings */
+
+  /* These fields point to the table(s) of error message strings.
+   * An application can change the table pointer to switch to a different
+   * message list (typically, to change the language in which errors are
+   * reported).  Some applications may wish to add additional error codes
+   * that will be handled by the JPEG library error mechanism; the second
+   * table pointer is used for this purpose.
+   *
+   * First table includes all errors generated by JPEG library itself.
+   * Error code 0 is reserved for a "no such error string" message.
+   */
+  const char * const * jpeg_message_table; /* Library errors */
+  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */
+  /* Second table can be added by application (see cjpeg/djpeg for example).
+   * It contains strings numbered first_addon_message..last_addon_message.
+   */
+  const char * const * addon_message_table; /* Non-library errors */
+  int first_addon_message;     /* code for first string in addon table */
+  int last_addon_message;      /* code for last string in addon table */
+};
+
+
+/* Progress monitor object */
+
+struct jpeg_progress_mgr {
+  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
+
+  long pass_counter;           /* work units completed in this pass */
+  long pass_limit;             /* total number of work units in this pass */
+  int completed_passes;                /* passes completed so far */
+  int total_passes;            /* total number of passes expected */
+};
+
+
+/* Data destination object for compression */
+
+struct jpeg_destination_mgr {
+  JOCTET * next_output_byte;   /* => next byte to write in buffer */
+  size_t free_in_buffer;       /* # of byte spaces remaining in buffer */
+
+  JMETHOD(void, init_destination, (j_compress_ptr cinfo));
+  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
+  JMETHOD(void, term_destination, (j_compress_ptr cinfo));
+};
+
+
+/* Data source object for decompression */
+
+struct jpeg_source_mgr {
+  const JOCTET * next_input_byte; /* => next byte to read from buffer */
+  size_t bytes_in_buffer;      /* # of bytes remaining in buffer */
+
+  JMETHOD(void, init_source, (j_decompress_ptr cinfo));
+  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
+  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
+  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
+  JMETHOD(void, term_source, (j_decompress_ptr cinfo));
+};
+
+
+/* Memory manager object.
+ * Allocates "small" objects (a few K total), "large" objects (tens of K),
+ * and "really big" objects (virtual arrays with backing store if needed).
+ * The memory manager does not allow individual objects to be freed; rather,
+ * each created object is assigned to a pool, and whole pools can be freed
+ * at once.  This is faster and more convenient than remembering exactly what
+ * to free, especially where malloc()/free() are not too speedy.
+ * NB: alloc routines never return NULL.  They exit to error_exit if not
+ * successful.
+ */
+
+#define JPOOL_PERMANENT        0       /* lasts until master record is destroyed */
+#define JPOOL_IMAGE    1       /* lasts until done with image/datastream */
+#define JPOOL_NUMPOOLS 2
+
+typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
+typedef struct jvirt_barray_control * jvirt_barray_ptr;
+
+
+struct jpeg_memory_mgr {
+  /* Method pointers */
+  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
+                               size_t sizeofobject));
+  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
+                                    size_t sizeofobject));
+  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
+                                    JDIMENSION samplesperrow,
+                                    JDIMENSION numrows));
+  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
+                                     JDIMENSION blocksperrow,
+                                     JDIMENSION numrows));
+  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
+                                                 int pool_id,
+                                                 boolean pre_zero,
+                                                 JDIMENSION samplesperrow,
+                                                 JDIMENSION numrows,
+                                                 JDIMENSION maxaccess));
+  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
+                                                 int pool_id,
+                                                 boolean pre_zero,
+                                                 JDIMENSION blocksperrow,
+                                                 JDIMENSION numrows,
+                                                 JDIMENSION maxaccess));
+  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
+  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
+                                          jvirt_sarray_ptr ptr,
+                                          JDIMENSION start_row,
+                                          JDIMENSION num_rows,
+                                          boolean writable));
+  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
+                                           jvirt_barray_ptr ptr,
+                                           JDIMENSION start_row,
+                                           JDIMENSION num_rows,
+                                           boolean writable));
+  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
+  JMETHOD(void, self_destruct, (j_common_ptr cinfo));
+
+  /* Limit on memory allocation for this JPEG object.  (Note that this is
+   * merely advisory, not a guaranteed maximum; it only affects the space
+   * used for virtual-array buffers.)  May be changed by outer application
+   * after creating the JPEG object.
+   */
+  long max_memory_to_use;
+
+  /* Maximum allocation request accepted by alloc_large. */
+  long max_alloc_chunk;
+};
+
+
+/* Routine signature for application-supplied marker processing methods.
+ * Need not pass marker code since it is stored in cinfo->unread_marker.
+ */
+typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
+
+
+/* Declarations for routines called by application.
+ * The JPP macro hides prototype parameters from compilers that can't cope.
+ * Note JPP requires double parentheses.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JPP(arglist)   arglist
+#else
+#define JPP(arglist)   ()
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers.
+ * We shorten external names to be unique in the first six letters, which
+ * is good enough for all known systems.
+ * (If your compiler itself needs names to be unique in less than 15 
+ * characters, you are out of luck.  Get a better compiler.)
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_error         jStdError
+#define jpeg_CreateCompress    jCreaCompress
+#define jpeg_CreateDecompress  jCreaDecompress
+#define jpeg_destroy_compress  jDestCompress
+#define jpeg_destroy_decompress        jDestDecompress
+#define jpeg_stdio_dest                jStdDest
+#define jpeg_stdio_src         jStdSrc
+#define jpeg_mem_dest          jMemDest
+#define jpeg_mem_src           jMemSrc
+#define jpeg_set_defaults      jSetDefaults
+#define jpeg_set_colorspace    jSetColorspace
+#define jpeg_default_colorspace        jDefColorspace
+#define jpeg_set_quality       jSetQuality
+#define jpeg_set_linear_quality        jSetLQuality
+#define jpeg_default_qtables   jDefQTables
+#define jpeg_add_quant_table   jAddQuantTable
+#define jpeg_quality_scaling   jQualityScaling
+#define jpeg_simple_progression        jSimProgress
+#define jpeg_suppress_tables   jSuppressTables
+#define jpeg_alloc_quant_table jAlcQTable
+#define jpeg_alloc_huff_table  jAlcHTable
+#define jpeg_start_compress    jStrtCompress
+#define jpeg_write_scanlines   jWrtScanlines
+#define jpeg_finish_compress   jFinCompress
+#define jpeg_calc_jpeg_dimensions      jCjpegDimensions
+#define jpeg_write_raw_data    jWrtRawData
+#define jpeg_write_marker      jWrtMarker
+#define jpeg_write_m_header    jWrtMHeader
+#define jpeg_write_m_byte      jWrtMByte
+#define jpeg_write_tables      jWrtTables
+#define jpeg_read_header       jReadHeader
+#define jpeg_start_decompress  jStrtDecompress
+#define jpeg_read_scanlines    jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
+#define jpeg_read_raw_data     jReadRawData
+#define jpeg_has_multiple_scans        jHasMultScn
+#define jpeg_start_output      jStrtOutput
+#define jpeg_finish_output     jFinOutput
+#define jpeg_input_complete    jInComplete
+#define jpeg_new_colormap      jNewCMap
+#define jpeg_consume_input     jConsumeInput
+#define jpeg_core_output_dimensions    jCoreDimensions
+#define jpeg_calc_output_dimensions    jCalcDimensions
+#define jpeg_save_markers      jSaveMarkers
+#define jpeg_set_marker_processor      jSetMarker
+#define jpeg_read_coefficients jReadCoefs
+#define jpeg_write_coefficients        jWrtCoefs
+#define jpeg_copy_critical_parameters  jCopyCrit
+#define jpeg_abort_compress    jAbrtCompress
+#define jpeg_abort_decompress  jAbrtDecompress
+#define jpeg_abort             jAbort
+#define jpeg_destroy           jDestroy
+#define jpeg_resync_to_restart jResyncRestart
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Default error-management setup */
+EXTERN(struct jpeg_error_mgr *) jpeg_std_error
+       JPP((struct jpeg_error_mgr * err));
+
+/* Initialization of JPEG compression objects.
+ * jpeg_create_compress() and jpeg_create_decompress() are the exported
+ * names that applications should call.  These expand to calls on
+ * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
+ * passed for version mismatch checking.
+ * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
+ */
+#define jpeg_create_compress(cinfo) \
+    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
+                       (size_t) sizeof(struct jpeg_compress_struct))
+#define jpeg_create_decompress(cinfo) \
+    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
+                         (size_t) sizeof(struct jpeg_decompress_struct))
+EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
+                                     int version, size_t structsize));
+EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
+                                       int version, size_t structsize));
+/* Destruction of JPEG compression objects */
+EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
+
+/* Standard data source and destination managers: stdio streams. */
+/* Caller is responsible for opening the file before and closing after. */
+EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
+EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
+
+/* Data source and destination managers: memory buffers. */
+EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+                              unsigned char ** outbuffer,
+                              unsigned long * outsize));
+EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
+                             unsigned char * inbuffer,
+                             unsigned long insize));
+
+/* Default parameter setup for compression */
+EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
+/* Compression parameter setup aids */
+EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
+                                     J_COLOR_SPACE colorspace));
+EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
+                                  boolean force_baseline));
+EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
+                                         int scale_factor,
+                                         boolean force_baseline));
+EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,
+                                      boolean force_baseline));
+EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
+                                      const unsigned int *basic_table,
+                                      int scale_factor,
+                                      boolean force_baseline));
+EXTERN(int) jpeg_quality_scaling JPP((int quality));
+EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
+                                      boolean suppress));
+EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
+EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
+
+/* Main entry points for compression */
+EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+                                     boolean write_all_tables));
+EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
+                                            JSAMPARRAY scanlines,
+                                            JDIMENSION num_lines));
+EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
+
+/* Precalculate JPEG dimensions for current compression parameters. */
+EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));
+
+/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
+                                           JSAMPIMAGE data,
+                                           JDIMENSION num_lines));
+
+/* Write a special marker.  See libjpeg.txt concerning safe usage. */
+EXTERN(void) jpeg_write_marker
+       JPP((j_compress_ptr cinfo, int marker,
+            const JOCTET * dataptr, unsigned int datalen));
+/* Same, but piecemeal. */
+EXTERN(void) jpeg_write_m_header
+       JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
+EXTERN(void) jpeg_write_m_byte
+       JPP((j_compress_ptr cinfo, int val));
+
+/* Alternate compression function: just write an abbreviated table file */
+EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
+
+/* Decompression startup: read start of JPEG datastream to see what's there */
+EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
+                                 boolean require_image));
+/* Return value is one of: */
+#define JPEG_SUSPENDED         0 /* Suspended due to lack of input data */
+#define JPEG_HEADER_OK         1 /* Found valid image datastream */
+#define JPEG_HEADER_TABLES_ONLY        2 /* Found valid table-specs-only datastream */
+/* If you pass require_image = TRUE (normal case), you need not check for
+ * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
+ * JPEG_SUSPENDED is only possible if you use a data source module that can
+ * give a suspension return (the stdio source module doesn't).
+ */
+
+/* Main entry points for decompression */
+EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
+                                           JSAMPARRAY scanlines,
+                                           JDIMENSION max_lines));
+EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
+
+/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
+                                          JSAMPIMAGE data,
+                                          JDIMENSION max_lines));
+
+/* Additional entry points for buffered-image mode. */
+EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
+                                      int scan_number));
+EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
+EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
+/* Return value is one of: */
+/* #define JPEG_SUSPENDED      0    Suspended due to lack of input data */
+#define JPEG_REACHED_SOS       1 /* Reached start of new scan */
+#define JPEG_REACHED_EOI       2 /* Reached end of image */
+#define JPEG_ROW_COMPLETED     3 /* Completed one iMCU row */
+#define JPEG_SCAN_COMPLETED    4 /* Completed last iMCU row of a scan */
+
+/* Precalculate output dimensions for current decompression parameters. */
+EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
+
+/* Control saving of COM and APPn markers into marker_list. */
+EXTERN(void) jpeg_save_markers
+       JPP((j_decompress_ptr cinfo, int marker_code,
+            unsigned int length_limit));
+
+/* Install a special processing method for COM or APPn markers. */
+EXTERN(void) jpeg_set_marker_processor
+       JPP((j_decompress_ptr cinfo, int marker_code,
+            jpeg_marker_parser_method routine));
+
+/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
+EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
+                                         jvirt_barray_ptr * coef_arrays));
+EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
+                                               j_compress_ptr dstinfo));
+
+/* If you choose to abort compression or decompression before completing
+ * jpeg_finish_(de)compress, then you need to clean up to release memory,
+ * temporary files, etc.  You can just call jpeg_destroy_(de)compress
+ * if you're done with the JPEG object, but if you want to clean it up and
+ * reuse it, call this:
+ */
+EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
+
+/* Generic versions of jpeg_abort and jpeg_destroy that work on either
+ * flavor of JPEG object.  These may be more convenient in some places.
+ */
+EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
+
+/* Default restart-marker-resync procedure for use by data source modules */
+EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
+                                           int desired));
+
+
+/* These marker codes are exported since applications and data source modules
+ * are likely to want to use them.
+ */
+
+#define JPEG_RST0      0xD0    /* RST0 marker code */
+#define JPEG_EOI       0xD9    /* EOI marker code */
+#define JPEG_APP0      0xE0    /* APP0 marker code */
+#define JPEG_COM       0xFE    /* COM marker code */
+
+
+/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
+ * for structure definitions that are never filled in, keep it quiet by
+ * supplying dummy definitions for the various substructures.
+ */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef JPEG_INTERNALS         /* will be defined in jpegint.h */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+struct jpeg_comp_master { long dummy; };
+struct jpeg_c_main_controller { long dummy; };
+struct jpeg_c_prep_controller { long dummy; };
+struct jpeg_c_coef_controller { long dummy; };
+struct jpeg_marker_writer { long dummy; };
+struct jpeg_color_converter { long dummy; };
+struct jpeg_downsampler { long dummy; };
+struct jpeg_forward_dct { long dummy; };
+struct jpeg_entropy_encoder { long dummy; };
+struct jpeg_decomp_master { long dummy; };
+struct jpeg_d_main_controller { long dummy; };
+struct jpeg_d_coef_controller { long dummy; };
+struct jpeg_d_post_controller { long dummy; };
+struct jpeg_input_controller { long dummy; };
+struct jpeg_marker_reader { long dummy; };
+struct jpeg_entropy_decoder { long dummy; };
+struct jpeg_inverse_dct { long dummy; };
+struct jpeg_upsampler { long dummy; };
+struct jpeg_color_deconverter { long dummy; };
+struct jpeg_color_quantizer { long dummy; };
+#endif /* JPEG_INTERNALS */
+#endif /* INCOMPLETE_TYPES_BROKEN */
+
+
+/*
+ * The JPEG library modules define JPEG_INTERNALS before including this file.
+ * The internal structure declarations are read only when that is true.
+ * Applications using the library should not include jpegint.h, but may wish
+ * to include jerror.h.
+ */
+
+#ifdef JPEG_INTERNALS
+#include "jpegint.h"           /* fetch private declarations */
+#include "jerror.h"            /* fetch error codes too */
+#endif
+
+#ifdef __cplusplus
+#ifndef DONT_USE_EXTERN_C
+}
+#endif
+#endif
+
+#endif /* JPEGLIB_H */
diff --git a/misc/builddeps/dp.linux32/include/libmodplug/it_defs.h b/misc/builddeps/dp.linux32/include/libmodplug/it_defs.h
new file mode 100644 (file)
index 0000000..89cb456
--- /dev/null
@@ -0,0 +1,134 @@
+#ifndef _ITDEFS_H_
+#define _ITDEFS_H_
+
+#pragma pack(1)
+
+typedef struct tagITFILEHEADER
+{
+       DWORD id;                       // 0x4D504D49
+       CHAR songname[26];
+       WORD reserved1;         // 0x1004
+       WORD ordnum;
+       WORD insnum;
+       WORD smpnum;
+       WORD patnum;
+       WORD cwtv;
+       WORD cmwt;
+       WORD flags;
+       WORD special;
+       BYTE globalvol;
+       BYTE mv;
+       BYTE speed;
+       BYTE tempo;
+       BYTE sep;
+       BYTE zero;
+       WORD msglength;
+       DWORD msgoffset;
+       DWORD reserved2;
+       BYTE chnpan[64];
+       BYTE chnvol[64];
+} ITFILEHEADER;
+
+
+typedef struct tagITENVELOPE
+{
+       BYTE flags;
+       BYTE num;
+       BYTE lpb;
+       BYTE lpe;
+       BYTE slb;
+       BYTE sle;
+       BYTE data[25*3];
+       BYTE reserved;
+} ITENVELOPE;
+
+// Old Impulse Instrument Format (cmwt < 0x200)
+typedef struct tagITOLDINSTRUMENT
+{
+       DWORD id;                       // IMPI = 0x49504D49
+       CHAR filename[12];      // DOS file name
+       BYTE zero;
+       BYTE flags;
+       BYTE vls;
+       BYTE vle;
+       BYTE sls;
+       BYTE sle;
+       WORD reserved1;
+       WORD fadeout;
+       BYTE nna;
+       BYTE dnc;
+       WORD trkvers;
+       BYTE nos;
+       BYTE reserved2;
+       CHAR name[26];
+       WORD reserved3[3];
+       BYTE keyboard[240];
+       BYTE volenv[200];
+       BYTE nodes[50];
+} ITOLDINSTRUMENT;
+
+
+// Impulse Instrument Format
+typedef struct tagITINSTRUMENT
+{
+       DWORD id;
+       CHAR filename[12];
+       BYTE zero;
+       BYTE nna;
+       BYTE dct;
+       BYTE dca;
+       WORD fadeout;
+       signed char pps;
+       BYTE ppc;
+       BYTE gbv;
+       BYTE dfp;
+       BYTE rv;
+       BYTE rp;
+       WORD trkvers;
+       BYTE nos;
+       BYTE reserved1;
+       CHAR name[26];
+       BYTE ifc;
+       BYTE ifr;
+       BYTE mch;
+       BYTE mpr;
+       WORD mbank;
+       BYTE keyboard[240];
+       ITENVELOPE volenv;
+       ITENVELOPE panenv;
+       ITENVELOPE pitchenv;
+       BYTE dummy[4]; // was 7, but IT v2.17 saves 554 bytes
+} ITINSTRUMENT;
+
+
+// IT Sample Format
+typedef struct ITSAMPLESTRUCT
+{
+       DWORD id;               // 0x53504D49
+       CHAR filename[12];
+       BYTE zero;
+       BYTE gvl;
+       BYTE flags;
+       BYTE vol;
+       CHAR name[26];
+       BYTE cvt;
+       BYTE dfp;
+       DWORD length;
+       DWORD loopbegin;
+       DWORD loopend;
+       DWORD C5Speed;
+       DWORD susloopbegin;
+       DWORD susloopend;
+       DWORD samplepointer;
+       BYTE vis;
+       BYTE vid;
+       BYTE vir;
+       BYTE vit;
+} ITSAMPLESTRUCT;
+
+#pragma pack()
+
+extern BYTE autovibit2xm[8];
+extern BYTE autovibxm2it[8];
+
+#endif
diff --git a/misc/builddeps/dp.linux32/include/libmodplug/modplug.h b/misc/builddeps/dp.linux32/include/libmodplug/modplug.h
new file mode 100644 (file)
index 0000000..46ea02c
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * This source code is public domain.
+ *
+ * Authors: Kenton Varda <temporal@gauge3d.org> (C interface wrapper)
+ */
+
+#ifndef MODPLUG_H__INCLUDED
+#define MODPLUG_H__INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct _ModPlugFile;
+typedef struct _ModPlugFile ModPlugFile;
+
+struct _ModPlugNote {
+       unsigned char Note;
+       unsigned char Instrument;
+       unsigned char VolumeEffect;
+       unsigned char Effect;
+       unsigned char Volume;
+       unsigned char Parameter;
+};
+typedef struct _ModPlugNote ModPlugNote;
+
+typedef void (*ModPlugMixerProc)(int*, unsigned long, unsigned long);
+
+/* Load a mod file.  [data] should point to a block of memory containing the complete
+ * file, and [size] should be the size of that block.
+ * Return the loaded mod file on success, or NULL on failure. */
+ModPlugFile* ModPlug_Load(const void* data, int size);
+/* Unload a mod file. */
+void ModPlug_Unload(ModPlugFile* file);
+
+/* Read sample data into the buffer.  Returns the number of bytes read.  If the end
+ * of the mod has been reached, zero is returned. */
+int  ModPlug_Read(ModPlugFile* file, void* buffer, int size);
+
+/* Get the name of the mod.  The returned buffer is stored within the ModPlugFile
+ * structure and will remain valid until you unload the file. */
+const char* ModPlug_GetName(ModPlugFile* file);
+
+/* Get the length of the mod, in milliseconds.  Note that this result is not always
+ * accurate, especially in the case of mods with loops. */
+int ModPlug_GetLength(ModPlugFile* file);
+
+/* Seek to a particular position in the song.  Note that seeking and MODs don't mix very
+ * well.  Some mods will be missing instruments for a short time after a seek, as ModPlug
+ * does not scan the sequence backwards to find out which instruments were supposed to be
+ * playing at that time.  (Doing so would be difficult and not very reliable.)  Also,
+ * note that seeking is not very exact in some mods -- especially those for which
+ * ModPlug_GetLength() does not report the full length. */
+void ModPlug_Seek(ModPlugFile* file, int millisecond);
+
+enum _ModPlug_Flags
+{
+       MODPLUG_ENABLE_OVERSAMPLING     = 1 << 0,  /* Enable oversampling (*highly* recommended) */
+       MODPLUG_ENABLE_NOISE_REDUCTION  = 1 << 1,  /* Enable noise reduction */
+       MODPLUG_ENABLE_REVERB           = 1 << 2,  /* Enable reverb */
+       MODPLUG_ENABLE_MEGABASS         = 1 << 3,  /* Enable megabass */
+       MODPLUG_ENABLE_SURROUND         = 1 << 4   /* Enable surround sound. */
+};
+
+enum _ModPlug_ResamplingMode
+{
+       MODPLUG_RESAMPLE_NEAREST = 0,  /* No interpolation (very fast, extremely bad sound quality) */
+       MODPLUG_RESAMPLE_LINEAR  = 1,  /* Linear interpolation (fast, good quality) */
+       MODPLUG_RESAMPLE_SPLINE  = 2,  /* Cubic spline interpolation (high quality) */
+       MODPLUG_RESAMPLE_FIR     = 3   /* 8-tap fir filter (extremely high quality) */
+};
+
+typedef struct _ModPlug_Settings
+{
+       int mFlags;  /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */
+       
+       /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then
+        * down-mixes to the settings you choose. */
+       int mChannels;       /* Number of channels - 1 for mono or 2 for stereo */
+       int mBits;           /* Bits per sample - 8, 16, or 32 */
+       int mFrequency;      /* Sampling rate - 11025, 22050, or 44100 */
+       int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */
+
+       int mStereoSeparation; /* Stereo separation, 1 - 256 */
+       int mMaxMixChannels; /* Maximum number of mixing channels (polyphony), 32 - 256 */
+       
+       int mReverbDepth;    /* Reverb level 0(quiet)-100(loud)      */
+       int mReverbDelay;    /* Reverb delay in ms, usually 40-200ms */
+       int mBassAmount;     /* XBass level 0(quiet)-100(loud)       */
+       int mBassRange;      /* XBass cutoff in Hz 10-100            */
+       int mSurroundDepth;  /* Surround level 0(quiet)-100(heavy)   */
+       int mSurroundDelay;  /* Surround delay in ms, usually 5-40ms */
+       int mLoopCount;      /* Number of times to loop.  Zero prevents looping.
+                               -1 loops forever. */
+} ModPlug_Settings;
+
+/* Get and set the mod decoder settings.  All options, except for channels, bits-per-sample,
+ * sampling rate, and loop count, will take effect immediately.  Those options which don't
+ * take effect immediately will take effect the next time you load a mod. */
+void ModPlug_GetSettings(ModPlug_Settings* settings);
+void ModPlug_SetSettings(const ModPlug_Settings* settings);
+
+/* New ModPlug API Functions */
+/* NOTE: Master Volume (1-512) */
+unsigned int ModPlug_GetMasterVolume(ModPlugFile* file) ;
+void ModPlug_SetMasterVolume(ModPlugFile* file,unsigned int cvol) ;
+
+int ModPlug_GetCurrentSpeed(ModPlugFile* file);
+int ModPlug_GetCurrentTempo(ModPlugFile* file);
+int ModPlug_GetCurrentOrder(ModPlugFile* file);
+int ModPlug_GetCurrentPattern(ModPlugFile* file);
+int ModPlug_GetCurrentRow(ModPlugFile* file);
+int ModPlug_GetPlayingChannels(ModPlugFile* file);
+
+void ModPlug_SeekOrder(ModPlugFile* file,int order);
+int ModPlug_GetModuleType(ModPlugFile* file);
+char* ModPlug_GetMessage(ModPlugFile* file);
+
+
+#ifndef MODPLUG_NO_FILESAVE
+/*
+ * EXPERIMENTAL Export Functions
+ */
+/*Export to a Scream Tracker 3 S3M module. EXPERIMENTAL (only works on Little-Endian platforms)*/
+char ModPlug_ExportS3M(ModPlugFile* file, const char* filepath);
+
+/*Export to a Extended Module (XM). EXPERIMENTAL (only works on Little-Endian platforms)*/
+char ModPlug_ExportXM(ModPlugFile* file, const char* filepath);
+
+/*Export to a Amiga MOD file. EXPERIMENTAL.*/
+char ModPlug_ExportMOD(ModPlugFile* file, const char* filepath);
+
+/*Export to a Impulse Tracker IT file. Should work OK in Little-Endian & Big-Endian platforms :-) */
+char ModPlug_ExportIT(ModPlugFile* file, const char* filepath);
+#endif // MODPLUG_NO_FILESAVE
+
+unsigned int ModPlug_NumInstruments(ModPlugFile* file);
+unsigned int ModPlug_NumSamples(ModPlugFile* file);
+unsigned int ModPlug_NumPatterns(ModPlugFile* file);
+unsigned int ModPlug_NumChannels(ModPlugFile* file);
+unsigned int ModPlug_SampleName(ModPlugFile* file, unsigned int qual, char* buff);
+unsigned int ModPlug_InstrumentName(ModPlugFile* file, unsigned int qual, char* buff);
+
+/*
+ * Retrieve pattern note-data
+ */
+ModPlugNote* ModPlug_GetPattern(ModPlugFile* file, int pattern, unsigned int* numrows);
+
+/*
+ * =================
+ * Mixer callback
+ * =================
+ *
+ * Use this callback if you want to 'modify' the mixed data of LibModPlug.
+ * 
+ * void proc(int* buffer,unsigned long channels,unsigned long nsamples) ;
+ *
+ * 'buffer': A buffer of mixed samples
+ * 'channels': N. of channels in the buffer
+ * 'nsamples': N. of samples in the buffeer (without taking care of n.channels)
+ *
+ * (Samples are signed 32-bit integers)
+ */
+void ModPlug_InitMixerCallback(ModPlugFile* file,ModPlugMixerProc proc) ;
+void ModPlug_UnloadMixerCallback(ModPlugFile* file) ;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
diff --git a/misc/builddeps/dp.linux32/include/libmodplug/sndfile.h b/misc/builddeps/dp.linux32/include/libmodplug/sndfile.h
new file mode 100644 (file)
index 0000000..ed7d47e
--- /dev/null
@@ -0,0 +1,1017 @@
+/*
+ * This source code is public domain.
+ *
+ * Authors: Olivier Lapicque <olivierl@jps.net>,
+ *          Adam Goode       <adam@evdebs.org> (endian and char fixes for PPC)
+*/
+
+#if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED)
+#include "config.h"
+#define CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef __SNDFILE_H
+#define __SNDFILE_H
+
+#ifdef UNDER_CE
+int _strnicmp(const char *str1,const char *str2, int n);
+#endif
+
+#ifndef LPCBYTE
+typedef const BYTE * LPCBYTE;
+#endif
+
+#define MOD_AMIGAC2                    0x1AB
+#define MAX_SAMPLE_LENGTH      16000000
+#define MAX_SAMPLE_RATE                192000
+#define MAX_ORDERS                     256
+#define MAX_PATTERNS           240
+#define MAX_SAMPLES                    240
+#define MAX_INSTRUMENTS                MAX_SAMPLES
+#ifdef MODPLUG_FASTSOUNDLIB
+#define MAX_CHANNELS           80
+#else
+#define MAX_CHANNELS           128
+#endif
+#define MAX_BASECHANNELS       64
+#define MAX_ENVPOINTS          32
+#define MIN_PERIOD                     0x0020
+#define MAX_PERIOD                     0xFFFF
+#define MAX_PATTERNNAME                32
+#define MAX_CHANNELNAME                20
+#define MAX_INFONAME           80
+#define MAX_EQ_BANDS           6
+#define MAX_MIXPLUGINS         8
+
+
+#define MOD_TYPE_NONE          0x00
+#define MOD_TYPE_MOD           0x01
+#define MOD_TYPE_S3M           0x02
+#define MOD_TYPE_XM                    0x04
+#define MOD_TYPE_MED           0x08
+#define MOD_TYPE_MTM           0x10
+#define MOD_TYPE_IT                    0x20
+#define MOD_TYPE_669           0x40
+#define MOD_TYPE_ULT           0x80
+#define MOD_TYPE_STM           0x100
+#define MOD_TYPE_FAR           0x200
+#define MOD_TYPE_WAV           0x400
+#define MOD_TYPE_AMF           0x800
+#define MOD_TYPE_AMS           0x1000
+#define MOD_TYPE_DSM           0x2000
+#define MOD_TYPE_MDL           0x4000
+#define MOD_TYPE_OKT           0x8000
+#define MOD_TYPE_MID           0x10000
+#define MOD_TYPE_DMF           0x20000
+#define MOD_TYPE_PTM           0x40000
+#define MOD_TYPE_DBM           0x80000
+#define MOD_TYPE_MT2           0x100000
+#define MOD_TYPE_AMF0          0x200000
+#define MOD_TYPE_PSM           0x400000
+#define MOD_TYPE_J2B           0x800000
+#define MOD_TYPE_ABC           0x1000000
+#define MOD_TYPE_PAT           0x2000000
+#define MOD_TYPE_UMX           0x80000000 // Fake type
+#define MAX_MODTYPE            24
+
+
+
+// Channel flags:
+// Bits 0-7:   Sample Flags
+#define CHN_16BIT               0x01
+#define CHN_LOOP                0x02
+#define CHN_PINGPONGLOOP        0x04
+#define CHN_SUSTAINLOOP         0x08
+#define CHN_PINGPONGSUSTAIN     0x10
+#define CHN_PANNING             0x20
+#define CHN_STEREO              0x40
+#define CHN_PINGPONGFLAG       0x80
+// Bits 8-31:  Channel Flags
+#define CHN_MUTE                0x100
+#define CHN_KEYOFF              0x200
+#define CHN_NOTEFADE           0x400
+#define CHN_SURROUND            0x800
+#define CHN_NOIDO               0x1000
+#define CHN_HQSRC               0x2000
+#define CHN_FILTER              0x4000
+#define CHN_VOLUMERAMP         0x8000
+#define CHN_VIBRATO             0x10000
+#define CHN_TREMOLO             0x20000
+#define CHN_PANBRELLO          0x40000
+#define CHN_PORTAMENTO         0x80000
+#define CHN_GLISSANDO          0x100000
+#define CHN_VOLENV              0x200000
+#define CHN_PANENV              0x400000
+#define CHN_PITCHENV           0x800000
+#define CHN_FASTVOLRAMP                0x1000000
+#define CHN_EXTRALOUD          0x2000000
+#define CHN_REVERB              0x4000000
+#define CHN_NOREVERB           0x8000000
+
+
+#define ENV_VOLUME              0x0001
+#define ENV_VOLSUSTAIN         0x0002
+#define ENV_VOLLOOP             0x0004
+#define ENV_PANNING             0x0008
+#define ENV_PANSUSTAIN         0x0010
+#define ENV_PANLOOP             0x0020
+#define ENV_PITCH               0x0040
+#define ENV_PITCHSUSTAIN       0x0080
+#define ENV_PITCHLOOP          0x0100
+#define ENV_SETPANNING         0x0200
+#define ENV_FILTER              0x0400
+#define ENV_VOLCARRY           0x0800
+#define ENV_PANCARRY           0x1000
+#define ENV_PITCHCARRY         0x2000
+
+#define CMD_NONE                        0
+#define CMD_ARPEGGIO                   1
+#define CMD_PORTAMENTOUP               2
+#define CMD_PORTAMENTODOWN             3
+#define CMD_TONEPORTAMENTO             4
+#define CMD_VIBRATO                     5
+#define CMD_TONEPORTAVOL               6
+#define CMD_VIBRATOVOL                 7
+#define CMD_TREMOLO                     8
+#define CMD_PANNING8                   9
+#define CMD_OFFSET                      10
+#define CMD_VOLUMESLIDE                        11
+#define CMD_POSITIONJUMP               12
+#define CMD_VOLUME                      13
+#define CMD_PATTERNBREAK               14
+#define CMD_RETRIG                      15
+#define CMD_SPEED                       16
+#define CMD_TEMPO                       17
+#define CMD_TREMOR                      18
+#define CMD_MODCMDEX                   19
+#define CMD_S3MCMDEX                   20
+#define CMD_CHANNELVOLUME              21
+#define CMD_CHANNELVOLSLIDE            22
+#define CMD_GLOBALVOLUME               23
+#define CMD_GLOBALVOLSLIDE             24
+#define CMD_KEYOFF                      25
+#define CMD_FINEVIBRATO                        26
+#define CMD_PANBRELLO                  27
+#define CMD_XFINEPORTAUPDOWN            28
+#define CMD_PANNINGSLIDE               29
+#define CMD_SETENVPOSITION             30
+#define CMD_MIDI                        31
+
+
+// Volume Column commands
+#define VOLCMD_VOLUME                  1
+#define VOLCMD_PANNING                 2
+#define VOLCMD_VOLSLIDEUP              3
+#define VOLCMD_VOLSLIDEDOWN            4
+#define VOLCMD_FINEVOLUP               5
+#define VOLCMD_FINEVOLDOWN             6
+#define VOLCMD_VIBRATOSPEED            7
+#define VOLCMD_VIBRATO                 8
+#define VOLCMD_PANSLIDELEFT            9
+#define VOLCMD_PANSLIDERIGHT           10
+#define VOLCMD_TONEPORTAMENTO          11
+#define VOLCMD_PORTAUP                 12
+#define VOLCMD_PORTADOWN               13
+
+#define RSF_16BIT              0x04
+#define RSF_STEREO             0x08
+
+#define RS_PCM8S               0       // 8-bit signed
+#define RS_PCM8U               1       // 8-bit unsigned
+#define RS_PCM8D               2       // 8-bit delta values
+#define RS_ADPCM4              3       // 4-bit ADPCM-packed
+#define RS_PCM16D              4       // 16-bit delta values
+#define RS_PCM16S              5       // 16-bit signed
+#define RS_PCM16U              6       // 16-bit unsigned
+#define RS_PCM16M              7       // 16-bit motorola order
+#define RS_STPCM8S             (RS_PCM8S|RSF_STEREO)  // stereo 8-bit signed
+#define RS_STPCM8U             (RS_PCM8U|RSF_STEREO)  // stereo 8-bit unsigned
+#define RS_STPCM8D             (RS_PCM8D|RSF_STEREO)  // stereo 8-bit delta values
+#define RS_STPCM16S            (RS_PCM16S|RSF_STEREO) // stereo 16-bit signed
+#define RS_STPCM16U            (RS_PCM16U|RSF_STEREO) // stereo 16-bit unsigned
+#define RS_STPCM16D            (RS_PCM16D|RSF_STEREO) // stereo 16-bit delta values
+#define RS_STPCM16M            (RS_PCM16M|RSF_STEREO) // stereo 16-bit signed big endian
+// IT 2.14 compressed samples
+#define RS_IT2148              0x10
+#define RS_IT21416             0x14
+#define RS_IT2158              0x12
+#define RS_IT21516             0x16
+// AMS Packed Samples
+#define RS_AMS8                        0x11
+#define RS_AMS16               0x15
+// DMF Huffman compression
+#define RS_DMF8                        0x13
+#define RS_DMF16               0x17
+// MDL Huffman compression
+#define RS_MDL8                        0x20
+#define RS_MDL16               0x24
+#define RS_PTM8DTO16   0x25
+// Stereo Interleaved Samples
+#define RS_STIPCM8S            (RS_PCM8S|0x40|RSF_STEREO)      // stereo 8-bit signed
+#define RS_STIPCM8U            (RS_PCM8U|0x40|RSF_STEREO)      // stereo 8-bit unsigned
+#define RS_STIPCM16S   (RS_PCM16S|0x40|RSF_STEREO)     // stereo 16-bit signed
+#define RS_STIPCM16U   (RS_PCM16U|0x40|RSF_STEREO)     // stereo 16-bit unsigned
+#define RS_STIPCM16M   (RS_PCM16M|0x40|RSF_STEREO)     // stereo 16-bit signed big endian
+// 24-bit signed
+#define RS_PCM24S              (RS_PCM16S|0x80)                        // mono 24-bit signed
+#define RS_STIPCM24S   (RS_PCM16S|0x80|RSF_STEREO)     // stereo 24-bit signed
+#define RS_PCM32S              (RS_PCM16S|0xC0)                        // mono 24-bit signed
+#define RS_STIPCM32S   (RS_PCM16S|0xC0|RSF_STEREO)     // stereo 24-bit signed
+
+// NNA types
+#define NNA_NOTECUT            0
+#define NNA_CONTINUE   1
+#define NNA_NOTEOFF            2
+#define NNA_NOTEFADE   3
+
+// DCT types
+#define DCT_NONE               0
+#define DCT_NOTE               1
+#define DCT_SAMPLE             2
+#define DCT_INSTRUMENT 3
+
+// DNA types
+#define DNA_NOTECUT            0
+#define DNA_NOTEOFF            1
+#define DNA_NOTEFADE   2
+
+// Mixer Hardware-Dependent features
+#define SYSMIX_ENABLEMMX       0x01
+#define SYSMIX_WINDOWSNT       0x02
+#define SYSMIX_SLOWCPU         0x04
+#define SYSMIX_FASTCPU         0x08
+
+// Module flags
+#define SONG_EMBEDMIDICFG      0x0001
+#define SONG_FASTVOLSLIDES     0x0002
+#define SONG_ITOLDEFFECTS      0x0004
+#define SONG_ITCOMPATMODE      0x0008
+#define SONG_LINEARSLIDES      0x0010
+#define SONG_PATTERNLOOP       0x0020
+#define SONG_STEP                      0x0040
+#define SONG_PAUSED                    0x0080
+#define SONG_FADINGSONG                0x0100
+#define SONG_ENDREACHED                0x0200
+#define SONG_GLOBALFADE                0x0400
+#define SONG_CPUVERYHIGH       0x0800
+#define SONG_FIRSTTICK         0x1000
+#define SONG_MPTFILTERMODE     0x2000
+#define SONG_SURROUNDPAN       0x4000
+#define SONG_EXFILTERRANGE     0x8000
+#define SONG_AMIGALIMITS       0x10000
+
+// Global Options (Renderer)
+#define SNDMIX_REVERSESTEREO   0x0001
+#define SNDMIX_NOISEREDUCTION  0x0002
+#define SNDMIX_AGC                             0x0004
+#define SNDMIX_NORESAMPLING            0x0008
+#define SNDMIX_HQRESAMPLER             0x0010
+#define SNDMIX_MEGABASS                        0x0020
+#define SNDMIX_SURROUND                        0x0040
+#define SNDMIX_REVERB                  0x0080
+#define SNDMIX_EQ                              0x0100
+#define SNDMIX_SOFTPANNING             0x0200
+#define SNDMIX_ULTRAHQSRCMODE  0x0400
+// Misc Flags (can safely be turned on or off)
+#define SNDMIX_DIRECTTODISK            0x10000
+#define SNDMIX_ENABLEMMX               0x20000
+#define SNDMIX_NOBACKWARDJUMPS 0x40000
+#define SNDMIX_MAXDEFAULTPAN   0x80000 // Used by the MOD loader
+
+
+// Reverb Types (GM2 Presets)
+enum {
+       REVERBTYPE_SMALLROOM,
+       REVERBTYPE_MEDIUMROOM,
+       REVERBTYPE_LARGEROOM,
+       REVERBTYPE_SMALLHALL,
+       REVERBTYPE_MEDIUMHALL,
+       REVERBTYPE_LARGEHALL,
+       NUM_REVERBTYPES
+};
+
+
+enum {
+       SRCMODE_NEAREST,
+       SRCMODE_LINEAR,
+       SRCMODE_SPLINE,
+       SRCMODE_POLYPHASE,
+       NUM_SRC_MODES
+};
+
+
+// Sample Struct
+typedef struct _MODINSTRUMENT
+{
+       UINT nLength,nLoopStart,nLoopEnd;
+       UINT nSustainStart, nSustainEnd;
+       signed char *pSample;
+       UINT nC4Speed;
+       WORD nPan;
+       WORD nVolume;
+       WORD nGlobalVol;
+       WORD uFlags;
+       signed char RelativeTone;
+       signed char nFineTune;
+       BYTE nVibType;
+       BYTE nVibSweep;
+       BYTE nVibDepth;
+       BYTE nVibRate;
+       CHAR name[22];
+} MODINSTRUMENT;
+
+
+// Instrument Struct
+typedef struct _INSTRUMENTHEADER
+{
+       UINT nFadeOut;
+       DWORD dwFlags;
+       WORD nGlobalVol;
+       WORD nPan;
+       WORD VolPoints[MAX_ENVPOINTS];
+       WORD PanPoints[MAX_ENVPOINTS];
+       WORD PitchPoints[MAX_ENVPOINTS];
+       BYTE VolEnv[MAX_ENVPOINTS];
+       BYTE PanEnv[MAX_ENVPOINTS];
+       BYTE PitchEnv[MAX_ENVPOINTS];
+       BYTE Keyboard[128];
+       BYTE NoteMap[128];
+
+       BYTE nVolEnv;
+       BYTE nPanEnv;
+       BYTE nPitchEnv;
+       BYTE nVolLoopStart;
+       BYTE nVolLoopEnd;
+       BYTE nVolSustainBegin;
+       BYTE nVolSustainEnd;
+       BYTE nPanLoopStart;
+       BYTE nPanLoopEnd;
+       BYTE nPanSustainBegin;
+       BYTE nPanSustainEnd;
+       BYTE nPitchLoopStart;
+       BYTE nPitchLoopEnd;
+       BYTE nPitchSustainBegin;
+       BYTE nPitchSustainEnd;
+       BYTE nNNA;
+       BYTE nDCT;
+       BYTE nDNA;
+       BYTE nPanSwing;
+       BYTE nVolSwing;
+       BYTE nIFC;
+       BYTE nIFR;
+       WORD wMidiBank;
+       BYTE nMidiProgram;
+       BYTE nMidiChannel;
+       BYTE nMidiDrumKey;
+       signed char nPPS;
+       unsigned char nPPC;
+       CHAR name[32];
+       CHAR filename[12];
+} INSTRUMENTHEADER;
+
+
+// Channel Struct
+typedef struct _MODCHANNEL
+{
+       // First 32-bytes: Most used mixing information: don't change it
+       signed char * pCurrentSample;
+       DWORD nPos;
+       DWORD nPosLo;   // actually 16-bit
+       LONG nInc;              // 16.16
+       LONG nRightVol;
+       LONG nLeftVol;
+       LONG nRightRamp;
+       LONG nLeftRamp;
+       // 2nd cache line
+       DWORD nLength;
+       DWORD dwFlags;
+       DWORD nLoopStart;
+       DWORD nLoopEnd;
+       LONG nRampRightVol;
+       LONG nRampLeftVol;
+       LONG nFilter_Y1, nFilter_Y2, nFilter_Y3, nFilter_Y4;
+       LONG nFilter_A0, nFilter_B0, nFilter_B1;
+       LONG nROfs, nLOfs;
+       LONG nRampLength;
+       // Information not used in the mixer
+       signed char * pSample;
+       LONG nNewRightVol, nNewLeftVol;
+       LONG nRealVolume, nRealPan;
+       LONG nVolume, nPan, nFadeOutVol;
+       LONG nPeriod, nC4Speed, nPortamentoDest;
+       INSTRUMENTHEADER *pHeader;
+       MODINSTRUMENT *pInstrument;
+       DWORD nVolEnvPosition, nPanEnvPosition, nPitchEnvPosition;
+       DWORD nMasterChn, nVUMeter;
+       LONG nGlobalVol, nInsVol;
+       LONG nFineTune, nTranspose;
+       LONG nPortamentoSlide, nAutoVibDepth;
+       UINT nAutoVibPos, nVibratoPos, nTremoloPos, nPanbrelloPos;
+       // 16-bit members
+       signed short nVolSwing, nPanSwing;
+       // 8-bit members
+       BYTE nNote, nNNA;
+       BYTE nNewNote, nNewIns, nCommand, nArpeggio;
+       BYTE nOldVolumeSlide, nOldFineVolUpDown;
+       BYTE nOldPortaUpDown, nOldFinePortaUpDown;
+       BYTE nOldPanSlide, nOldChnVolSlide;
+       BYTE nVibratoType, nVibratoSpeed, nVibratoDepth;
+       BYTE nTremoloType, nTremoloSpeed, nTremoloDepth;
+       BYTE nPanbrelloType, nPanbrelloSpeed, nPanbrelloDepth;
+       BYTE nOldCmdEx, nOldVolParam, nOldTempo;
+       BYTE nOldOffset, nOldHiOffset;
+       BYTE nCutOff, nResonance;
+       BYTE nRetrigCount, nRetrigParam;
+       BYTE nTremorCount, nTremorParam;
+       BYTE nPatternLoop, nPatternLoopCount;
+       BYTE nRowNote, nRowInstr;
+       BYTE nRowVolCmd, nRowVolume;
+       BYTE nRowCommand, nRowParam;
+       BYTE nLeftVU, nRightVU;
+       BYTE nActiveMacro, nPadding;
+} MODCHANNEL;
+
+
+typedef struct _MODCHANNELSETTINGS
+{
+       UINT nPan;
+       UINT nVolume;
+       DWORD dwFlags;
+       UINT nMixPlugin;
+        char szName[MAX_CHANNELNAME];        // changed from CHAR
+} MODCHANNELSETTINGS;
+
+
+typedef struct _MODCOMMAND
+{
+       BYTE note;
+       BYTE instr;
+       BYTE volcmd;
+       BYTE command;
+       BYTE vol;
+       BYTE param;
+} MODCOMMAND, *LPMODCOMMAND;
+
+////////////////////////////////////////////////////////////////////
+// Mix Plugins
+#define MIXPLUG_MIXREADY                       0x01    // Set when cleared
+
+class IMixPlugin
+{
+public:
+       virtual ~IMixPlugin();
+       virtual int AddRef() = 0;
+       virtual int Release() = 0;
+       virtual void SaveAllParameters() = 0;
+       virtual void RestoreAllParameters() = 0;
+       virtual void Process(float *pOutL, float *pOutR, unsigned long nSamples) = 0;
+       virtual void Init(unsigned long nFreq, int bReset) = 0;
+       virtual void MidiSend(DWORD dwMidiCode) = 0;
+       virtual void MidiCommand(UINT nMidiCh, UINT nMidiProg, UINT note, UINT vol) = 0;
+};
+
+
+#define MIXPLUG_INPUTF_MASTEREFFECT            0x01    // Apply to master mix
+#define MIXPLUG_INPUTF_BYPASS                  0x02    // Bypass effect
+#define MIXPLUG_INPUTF_WETMIX                  0x04    // Wet Mix (dry added)
+
+typedef struct _SNDMIXPLUGINSTATE
+{
+       DWORD dwFlags;                                  // MIXPLUG_XXXX
+       LONG nVolDecayL, nVolDecayR;    // Buffer click removal
+       int *pMixBuffer;                                // Stereo effect send buffer
+       float *pOutBufferL;                             // Temp storage for int -> float conversion
+       float *pOutBufferR;
+} SNDMIXPLUGINSTATE, *PSNDMIXPLUGINSTATE;
+
+typedef struct _SNDMIXPLUGININFO
+{
+       DWORD dwPluginId1;
+       DWORD dwPluginId2;
+       DWORD dwInputRouting;   // MIXPLUG_INPUTF_XXXX
+       DWORD dwOutputRouting;  // 0=mix 0x80+=fx
+       DWORD dwReserved[4];    // Reserved for routing info
+       CHAR szName[32];
+       CHAR szLibraryName[64]; // original DLL name
+} SNDMIXPLUGININFO, *PSNDMIXPLUGININFO; // Size should be 128
+
+typedef struct _SNDMIXPLUGIN
+{
+       IMixPlugin *pMixPlugin;
+       PSNDMIXPLUGINSTATE pMixState;
+       ULONG nPluginDataSize;
+       PVOID pPluginData;
+       SNDMIXPLUGININFO Info;
+} SNDMIXPLUGIN, *PSNDMIXPLUGIN;
+
+typedef        BOOL (*PMIXPLUGINCREATEPROC)(PSNDMIXPLUGIN);
+
+////////////////////////////////////////////////////////////////////
+
+enum {
+       MIDIOUT_START=0,
+       MIDIOUT_STOP,
+       MIDIOUT_TICK,
+       MIDIOUT_NOTEON,
+       MIDIOUT_NOTEOFF,
+       MIDIOUT_VOLUME,
+       MIDIOUT_PAN,
+       MIDIOUT_BANKSEL,
+       MIDIOUT_PROGRAM,
+};
+
+
+typedef struct MODMIDICFG
+{
+        char szMidiGlb[9*32];      // changed from CHAR
+        char szMidiSFXExt[16*32];  // changed from CHAR
+        char szMidiZXXExt[128*32]; // changed from CHAR
+} MODMIDICFG, *LPMODMIDICFG;
+
+#define NOTE_MAX                        120 //Defines maximum notevalue as well as maximum number of notes.
+
+typedef VOID (* LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); // buffer, samples, channels
+
+
+
+//==============
+class CSoundFile
+//==============
+{
+public:        // Static Members
+       static UINT m_nXBassDepth, m_nXBassRange;
+       static UINT m_nReverbDepth, m_nReverbDelay, gnReverbType;
+       static UINT m_nProLogicDepth, m_nProLogicDelay;
+       static UINT m_nStereoSeparation;
+       static UINT m_nMaxMixChannels;
+       static LONG m_nStreamVolume;
+       static DWORD gdwSysInfo, gdwSoundSetup, gdwMixingFreq, gnBitsPerSample, gnChannels;
+       static UINT gnAGC, gnVolumeRampSamples, gnVUMeter, gnCPUUsage;
+       static LPSNDMIXHOOKPROC gpSndMixHook;
+       static PMIXPLUGINCREATEPROC gpMixPluginCreateProc;
+
+public:        // for Editing
+       MODCHANNEL Chn[MAX_CHANNELS];                                   // Channels
+       UINT ChnMix[MAX_CHANNELS];                                              // Channels to be mixed
+       MODINSTRUMENT Ins[MAX_SAMPLES];                                 // Instruments
+       INSTRUMENTHEADER *Headers[MAX_INSTRUMENTS];             // Instrument Headers
+       MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Channels settings
+       MODCOMMAND *Patterns[MAX_PATTERNS];                             // Patterns
+       WORD PatternSize[MAX_PATTERNS];                                 // Patterns Lengths
+       BYTE Order[MAX_ORDERS];                                                 // Pattern Orders
+       MODMIDICFG m_MidiCfg;                                                   // Midi macro config table
+       SNDMIXPLUGIN m_MixPlugins[MAX_MIXPLUGINS];              // Mix plugins
+       UINT m_nDefaultSpeed, m_nDefaultTempo, m_nDefaultGlobalVolume;
+       DWORD m_dwSongFlags;                                                    // Song flags SONG_XXXX
+       UINT m_nChannels, m_nMixChannels, m_nMixStat, m_nBufferCount;
+       UINT m_nType, m_nSamples, m_nInstruments;
+       UINT m_nTickCount, m_nTotalCount, m_nPatternDelay, m_nFrameDelay;
+       UINT m_nMusicSpeed, m_nMusicTempo;
+       UINT m_nNextRow, m_nRow;
+       UINT m_nPattern,m_nCurrentPattern,m_nNextPattern,m_nRestartPos;
+       UINT m_nMasterVolume, m_nGlobalVolume, m_nSongPreAmp;
+       UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide;
+       LONG m_nMinPeriod, m_nMaxPeriod, m_nRepeatCount, m_nInitialRepeatCount;
+       DWORD m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples;
+       UINT m_nMaxOrderPosition;
+       UINT m_nPatternNames;
+       LPSTR m_lpszSongComments, m_lpszPatternNames;
+       char m_szNames[MAX_INSTRUMENTS][32];    // changed from CHAR
+       CHAR CompressionTable[16];
+
+public:
+       CSoundFile();
+       ~CSoundFile();
+
+public:
+       BOOL Create(LPCBYTE lpStream, DWORD dwMemLength=0);
+       BOOL Destroy();
+       UINT GetType() const { return m_nType; }
+       UINT GetNumChannels() const;
+       UINT GetLogicalChannels() const { return m_nChannels; }
+       BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE);
+       UINT GetMasterVolume() const { return m_nMasterVolume; }
+       UINT GetNumPatterns() const;
+       UINT GetNumInstruments() const;
+       UINT GetNumSamples() const { return m_nSamples; }
+       UINT GetCurrentPos() const;
+       UINT GetCurrentPattern() const { return m_nPattern; }
+       UINT GetCurrentOrder() const { return m_nCurrentPattern; }
+       UINT GetSongComments(LPSTR s, UINT cbsize, UINT linesize=32);
+       UINT GetRawSongComments(LPSTR s, UINT cbsize, UINT linesize=32);
+       UINT GetMaxPosition() const;
+       void SetCurrentPos(UINT nPos);
+       void SetCurrentOrder(UINT nOrder);
+       void GetTitle(LPSTR s) const { lstrcpyn(s,m_szNames[0],32); }
+       LPCSTR GetTitle() const { return m_szNames[0]; }
+       UINT GetSampleName(UINT nSample,LPSTR s=NULL) const;
+       UINT GetInstrumentName(UINT nInstr,LPSTR s=NULL) const;
+       UINT GetMusicSpeed() const { return m_nMusicSpeed; }
+       UINT GetMusicTempo() const { return m_nMusicTempo; }
+       DWORD GetLength(BOOL bAdjust, BOOL bTotal=FALSE);
+       DWORD GetSongTime() { return GetLength(FALSE, TRUE); }
+       void SetRepeatCount(int n) { m_nRepeatCount = n; m_nInitialRepeatCount = n; }
+       int GetRepeatCount() const { return m_nRepeatCount; }
+       BOOL IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; }
+       void LoopPattern(int nPat, int nRow=0);
+       void CheckCPUUsage(UINT nCPU);
+       BOOL SetPatternName(UINT nPat, LPCSTR lpszName);
+       BOOL GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const;
+       // Module Loaders
+       BOOL ReadXM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadS3M(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMod(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMed(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMTM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadSTM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadIT(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL Read669(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadUlt(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadWav(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadDSM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadFAR(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadAMS(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadAMS2(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMDL(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadOKT(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadDMF(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadPTM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadDBM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadAMF(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMT2(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadPSM(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadJ2B(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadUMX(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadABC(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL TestABC(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadMID(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL TestMID(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL ReadPAT(LPCBYTE lpStream, DWORD dwMemLength);
+       BOOL TestPAT(LPCBYTE lpStream, DWORD dwMemLength);
+       // Save Functions
+#ifndef MODPLUG_NO_FILESAVE
+       UINT WriteSample(FILE *f, MODINSTRUMENT *pins, UINT nFlags, UINT nMaxLen=0);
+       BOOL SaveXM(LPCSTR lpszFileName, UINT nPacking=0);
+       BOOL SaveS3M(LPCSTR lpszFileName, UINT nPacking=0);
+       BOOL SaveMod(LPCSTR lpszFileName, UINT nPacking=0);
+       BOOL SaveIT(LPCSTR lpszFileName, UINT nPacking=0);
+#endif // MODPLUG_NO_FILESAVE
+       // MOD Convert function
+       UINT GetBestSaveFormat() const;
+       UINT GetSaveFormats() const;
+       void ConvertModCommand(MODCOMMAND *) const;
+       void S3MConvert(MODCOMMAND *m, BOOL bIT) const;
+       void S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT) const;
+       WORD ModSaveCommand(const MODCOMMAND *m, BOOL bXM) const;
+
+public:
+       // Real-time sound functions
+       VOID ResetChannels();
+
+       UINT Read(LPVOID lpBuffer, UINT cbBuffer);
+       UINT CreateStereoMix(int count);
+       BOOL FadeSong(UINT msec);
+       BOOL GlobalFadeSong(UINT msec);
+       UINT GetTotalTickCount() const { return m_nTotalCount; }
+       VOID ResetTotalTickCount() { m_nTotalCount = 0; }
+
+public:
+       // Mixer Config
+       static BOOL InitPlayer(BOOL bReset=FALSE);
+       static BOOL SetMixConfig(UINT nStereoSeparation, UINT nMaxMixChannels);
+       static BOOL SetWaveConfig(UINT nRate,UINT nBits,UINT nChannels,BOOL bMMX=FALSE);
+       static BOOL SetResamplingMode(UINT nMode); // SRCMODE_XXXX
+       static BOOL IsStereo() { return (gnChannels > 1) ? TRUE : FALSE; }
+       static DWORD GetSampleRate() { return gdwMixingFreq; }
+       static DWORD GetBitsPerSample() { return gnBitsPerSample; }
+       static DWORD InitSysInfo();
+       static DWORD GetSysInfo() { return gdwSysInfo; }
+       // AGC
+       static BOOL GetAGC() { return (gdwSoundSetup & SNDMIX_AGC) ? TRUE : FALSE; }
+       static void SetAGC(BOOL b);
+       static void ResetAGC();
+       static void ProcessAGC(int count);
+
+       //GCCFIX -- added these functions back in!
+       static BOOL SetWaveConfigEx(BOOL bSurround,BOOL bNoOverSampling,BOOL bReverb,BOOL hqido,BOOL bMegaBass,BOOL bNR,BOOL bEQ);
+       // DSP Effects
+       static void InitializeDSP(BOOL bReset);
+       static void ProcessStereoDSP(int count);
+       static void ProcessMonoDSP(int count);
+       // [Reverb level 0(quiet)-100(loud)], [delay in ms, usually 40-200ms]
+       static BOOL SetReverbParameters(UINT nDepth, UINT nDelay);
+       // [XBass level 0(quiet)-100(loud)], [cutoff in Hz 10-100]
+       static BOOL SetXBassParameters(UINT nDepth, UINT nRange);
+       // [Surround level 0(quiet)-100(heavy)] [delay in ms, usually 5-40ms]
+       static BOOL SetSurroundParameters(UINT nDepth, UINT nDelay);
+public:
+       BOOL ReadNote();
+       BOOL ProcessRow();
+       BOOL ProcessEffects();
+       UINT GetNNAChannel(UINT nChn) const;
+       void CheckNNA(UINT nChn, UINT instr, int note, BOOL bForceCut);
+       void NoteChange(UINT nChn, int note, BOOL bPorta=FALSE, BOOL bResetEnv=TRUE);
+       void InstrumentChange(MODCHANNEL *pChn, UINT instr, BOOL bPorta=FALSE,BOOL bUpdVol=TRUE,BOOL bResetEnv=TRUE);
+       // Channel Effects
+       void PortamentoUp(MODCHANNEL *pChn, UINT param);
+       void PortamentoDown(MODCHANNEL *pChn, UINT param);
+       void FinePortamentoUp(MODCHANNEL *pChn, UINT param);
+       void FinePortamentoDown(MODCHANNEL *pChn, UINT param);
+       void ExtraFinePortamentoUp(MODCHANNEL *pChn, UINT param);
+       void ExtraFinePortamentoDown(MODCHANNEL *pChn, UINT param);
+       void TonePortamento(MODCHANNEL *pChn, UINT param);
+       void Vibrato(MODCHANNEL *pChn, UINT param);
+       void FineVibrato(MODCHANNEL *pChn, UINT param);
+       void VolumeSlide(MODCHANNEL *pChn, UINT param);
+       void PanningSlide(MODCHANNEL *pChn, UINT param);
+       void ChannelVolSlide(MODCHANNEL *pChn, UINT param);
+       void FineVolumeUp(MODCHANNEL *pChn, UINT param);
+       void FineVolumeDown(MODCHANNEL *pChn, UINT param);
+       void Tremolo(MODCHANNEL *pChn, UINT param);
+       void Panbrello(MODCHANNEL *pChn, UINT param);
+       void RetrigNote(UINT nChn, UINT param);
+       void NoteCut(UINT nChn, UINT nTick);
+       void KeyOff(UINT nChn);
+       int PatternLoop(MODCHANNEL *, UINT param);
+       void ExtendedMODCommands(UINT nChn, UINT param);
+       void ExtendedS3MCommands(UINT nChn, UINT param);
+       void ExtendedChannelEffect(MODCHANNEL *, UINT param);
+       void ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0);
+       void SetupChannelFilter(MODCHANNEL *pChn, BOOL bReset, int flt_modifier=256) const;
+       // Low-Level effect processing
+       void DoFreqSlide(MODCHANNEL *pChn, LONG nFreqSlide);
+       // Global Effects
+       void SetTempo(UINT param);
+       void SetSpeed(UINT param);
+       void GlobalVolSlide(UINT param);
+       DWORD IsSongFinished(UINT nOrder, UINT nRow) const;
+       BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const;
+       // Read/Write sample functions
+       signed char GetDeltaValue(signed char prev, UINT n) const { return (signed char)(prev + CompressionTable[n & 0x0F]); }
+       UINT PackSample(int &sample, int next);
+       BOOL CanPackSample(LPSTR pSample, UINT nLen, UINT nPacking, BYTE *result=NULL);
+       UINT ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR pMemFile, DWORD dwMemLength);
+       BOOL DestroySample(UINT nSample);
+       BOOL DestroyInstrument(UINT nInstr);
+       BOOL IsSampleUsed(UINT nSample);
+       BOOL IsInstrumentUsed(UINT nInstr);
+       BOOL RemoveInstrumentSamples(UINT nInstr);
+       UINT DetectUnusedSamples(BOOL *);
+       BOOL RemoveSelectedSamples(BOOL *);
+       void AdjustSampleLoop(MODINSTRUMENT *pIns);
+       // I/O from another sound file
+       BOOL ReadInstrumentFromSong(UINT nInstr, CSoundFile *, UINT nSrcInstrument);
+       BOOL ReadSampleFromSong(UINT nSample, CSoundFile *, UINT nSrcSample);
+       // Period/Note functions
+       UINT GetNoteFromPeriod(UINT period) const;
+       UINT GetPeriodFromNote(UINT note, int nFineTune, UINT nC4Speed) const;
+       UINT GetFreqFromPeriod(UINT period, UINT nC4Speed, int nPeriodFrac=0) const;
+       // Misc functions
+       MODINSTRUMENT *GetSample(UINT n) { return Ins+n; }
+       void ResetMidiCfg();
+       UINT MapMidiInstrument(DWORD dwProgram, UINT nChannel, UINT nNote);
+       BOOL ITInstrToMPT(const void *p, INSTRUMENTHEADER *penv, UINT trkvers);
+       UINT SaveMixPlugins(FILE *f=NULL, BOOL bUpdate=TRUE);
+       UINT LoadMixPlugins(const void *pData, UINT nLen);
+#ifndef NO_FILTER
+       DWORD CutOffToFrequency(UINT nCutOff, int flt_modifier=256) const; // [0-255] => [1-10KHz]
+#endif
+
+       // Static helper functions
+public:
+       static DWORD TransposeToFrequency(int transp, int ftune=0);
+       static int FrequencyToTranspose(DWORD freq);
+       static void FrequencyToTranspose(MODINSTRUMENT *psmp);
+
+       // System-Dependant functions
+public:
+       static MODCOMMAND *AllocatePattern(UINT rows, UINT nchns);
+       static signed char* AllocateSample(UINT nbytes);
+       static void FreePattern(LPVOID pat);
+       static void FreeSample(LPVOID p);
+       static UINT Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc);
+};
+
+
+// inline DWORD BigEndian(DWORD x) { return ((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); }
+// inline WORD BigEndianW(WORD x) { return (WORD)(((x >> 8) & 0xFF) | ((x << 8) & 0xFF00)); }
+
+
+//////////////////////////////////////////////////////////
+// WAVE format information
+
+#pragma pack(1)
+
+// Standard IFF chunks IDs
+#define IFFID_FORM             0x4d524f46
+#define IFFID_RIFF             0x46464952
+#define IFFID_WAVE             0x45564157
+#define IFFID_LIST             0x5453494C
+#define IFFID_INFO             0x4F464E49
+
+// IFF Info fields
+#define IFFID_ICOP             0x504F4349
+#define IFFID_IART             0x54524149
+#define IFFID_IPRD             0x44525049
+#define IFFID_INAM             0x4D414E49
+#define IFFID_ICMT             0x544D4349
+#define IFFID_IENG             0x474E4549
+#define IFFID_ISFT             0x54465349
+#define IFFID_ISBJ             0x4A425349
+#define IFFID_IGNR             0x524E4749
+#define IFFID_ICRD             0x44524349
+
+// Wave IFF chunks IDs
+#define IFFID_wave             0x65766177
+#define IFFID_fmt              0x20746D66
+#define IFFID_wsmp             0x706D7377
+#define IFFID_pcm              0x206d6370
+#define IFFID_data             0x61746164
+#define IFFID_smpl             0x6C706D73
+#define IFFID_xtra             0x61727478
+
+typedef struct WAVEFILEHEADER
+{
+       DWORD id_RIFF;          // "RIFF"
+       DWORD filesize;         // file length-8
+       DWORD id_WAVE;
+} WAVEFILEHEADER;
+
+
+typedef struct WAVEFORMATHEADER
+{
+       DWORD id_fmt;           // "fmt "
+       DWORD hdrlen;           // 16
+       WORD format;            // 1
+       WORD channels;          // 1:mono, 2:stereo
+       DWORD freqHz;           // sampling freq
+       DWORD bytessec;         // bytes/sec=freqHz*samplesize
+       WORD samplesize;        // sizeof(sample)
+       WORD bitspersample;     // bits per sample (8/16)
+} WAVEFORMATHEADER;
+
+
+typedef struct WAVEDATAHEADER
+{
+       DWORD id_data;          // "data"
+       DWORD length;           // length of data
+} WAVEDATAHEADER;
+
+
+typedef struct WAVESMPLHEADER
+{
+       // SMPL
+       DWORD smpl_id;          // "smpl"       -> 0x6C706D73
+       DWORD smpl_len;         // length of smpl: 3Ch  (54h with sustain loop)
+       DWORD dwManufacturer;
+       DWORD dwProduct;
+       DWORD dwSamplePeriod;   // 1000000000/freqHz
+       DWORD dwBaseNote;       // 3Ch = C-4 -> 60 + RelativeTone
+       DWORD dwPitchFraction;
+       DWORD dwSMPTEFormat;
+       DWORD dwSMPTEOffset;
+       DWORD dwSampleLoops;    // number of loops
+       DWORD cbSamplerData;
+} WAVESMPLHEADER;
+
+
+typedef struct SAMPLELOOPSTRUCT
+{
+       DWORD dwIdentifier;
+       DWORD dwLoopType;               // 0=normal, 1=bidi
+       DWORD dwLoopStart;
+       DWORD dwLoopEnd;                // Byte offset ?
+       DWORD dwFraction;
+       DWORD dwPlayCount;              // Loop Count, 0=infinite
+} SAMPLELOOPSTRUCT;
+
+
+typedef struct WAVESAMPLERINFO
+{
+       WAVESMPLHEADER wsiHdr;
+       SAMPLELOOPSTRUCT wsiLoops[2];
+} WAVESAMPLERINFO;
+
+
+typedef struct WAVELISTHEADER
+{
+       DWORD list_id;  // "LIST" -> 0x5453494C
+       DWORD list_len;
+       DWORD info;             // "INFO"
+} WAVELISTHEADER;
+
+
+typedef struct WAVEEXTRAHEADER
+{
+       DWORD xtra_id;  // "xtra"       -> 0x61727478
+       DWORD xtra_len;
+       DWORD dwFlags;
+       WORD  wPan;
+       WORD  wVolume;
+       WORD  wGlobalVol;
+       WORD  wReserved;
+       BYTE nVibType;
+       BYTE nVibSweep;
+       BYTE nVibDepth;
+       BYTE nVibRate;
+} WAVEEXTRAHEADER;
+
+#pragma pack()
+
+///////////////////////////////////////////////////////////
+// Low-level Mixing functions
+
+#define MIXBUFFERSIZE          512
+#define MIXING_ATTENUATION     4
+#define MIXING_CLIPMIN         (-0x08000000)
+#define MIXING_CLIPMAX         (0x07FFFFFF)
+#define VOLUMERAMPPRECISION    12
+#define FADESONGDELAY          100
+#define EQ_BUFFERSIZE          (MIXBUFFERSIZE)
+#define AGC_PRECISION          9
+#define AGC_UNITY                      (1 << AGC_PRECISION)
+
+// Calling conventions
+#ifdef MSC_VER
+#define MPPASMCALL     __cdecl
+#define MPPFASTCALL    __fastcall
+#else
+#define MPPASMCALL
+#define MPPFASTCALL
+#endif
+
+#define MOD2XMFineTune(k)      ((int)( (signed char)((k)<<4) ))
+#define XM2MODFineTune(k)      ((int)( (k>>4)&0x0f ))
+
+int _muldiv(long a, long b, long c);
+int _muldivr(long a, long b, long c);
+
+
+// Byte swapping functions from the GNU C Library and libsdl
+
+/* Swap bytes in 16 bit value.  */
+#ifdef __GNUC__
+# define bswap_16(x) \
+    (__extension__                                                           \
+     ({ unsigned short int __bsx = (x);                                              \
+        ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); }))
+#else
+static __inline unsigned short int
+bswap_16 (unsigned short int __bsx)
+{
+  return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
+}
+#endif
+
+/* Swap bytes in 32 bit value.  */
+#ifdef __GNUC__
+# define bswap_32(x) \
+    (__extension__                                                           \
+     ({ unsigned int __bsx = (x);                                            \
+        ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >>  8) |    \
+        (((__bsx) & 0x0000ff00) <<  8) | (((__bsx) & 0x000000ff) << 24)); }))
+#else
+static __inline unsigned int
+bswap_32 (unsigned int __bsx)
+{
+  return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >>  8) |
+         (((__bsx) & 0x0000ff00) <<  8) | (((__bsx) & 0x000000ff) << 24));
+}
+#endif
+
+#if (defined ARM) && (defined _WIN32_WCE)
+static __inline unsigned short int
+ARM_get16(const void *data)
+{
+       unsigned short int s;
+       memcpy(&s,data,sizeof(s));
+       return s;
+}
+
+static __inline unsigned int
+ARM_get32(const void *data)
+{
+       unsigned int s;
+       memcpy(&s,data,sizeof(s));
+       return s;
+}
+
+#define bswapLE16(X) ARM_get16(&X)
+#define bswapLE32(X) ARM_get32(&X)
+#define bswapBE16(X) bswap_16(ARM_get16(&X))
+#define bswapBE32(X) bswap_32(ARM_get32(&X))
+
+// From libsdl
+#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
+#define bswapLE16(X) bswap_16(X)
+#define bswapLE32(X) bswap_32(X)
+#define bswapBE16(X) (X)
+#define bswapBE32(X) (X)
+#else
+#define bswapLE16(X) (X)
+#define bswapLE32(X) (X)
+#define bswapBE16(X) bswap_16(X)
+#define bswapBE32(X) bswap_32(X)
+#endif
+
+#endif
diff --git a/misc/builddeps/dp.linux32/include/libmodplug/stdafx.h b/misc/builddeps/dp.linux32/include/libmodplug/stdafx.h
new file mode 100644 (file)
index 0000000..6631b8b
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * This source code is public domain.
+ *
+ * Authors: Rani Assaf <rani@magic.metawire.com>,
+ *          Olivier Lapicque <olivierl@jps.net>,
+ *          Adam Goode       <adam@evdebs.org> (endian and char fixes for PPC)
+ */
+
+#ifndef _STDAFX_H_
+#define _STDAFX_H_
+
+/* Autoconf detection of stdint/inttypes */
+#if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED)
+# include "config.h"
+# define CONFIG_H_INCLUDED 1
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+
+#ifdef _WIN32
+
+#ifdef MSC_VER
+#pragma warning (disable:4201)
+#pragma warning (disable:4514)
+#endif
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <windowsx.h>
+#include <mmsystem.h>
+#include <stdio.h>
+#include <malloc.h>
+
+#define srandom(_seed)  srand(_seed)
+#define random()        rand()
+#define sleep(_ms)      Sleep(_ms)
+
+inline void ProcessPlugins(int n) {}
+
+#else
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
+typedef int8_t CHAR;
+typedef uint8_t UCHAR;
+typedef uint8_t* PUCHAR;
+typedef uint16_t USHORT;
+typedef uint32_t ULONG;
+typedef uint32_t UINT;
+typedef uint32_t DWORD;
+typedef int32_t LONG;
+typedef int64_t LONGLONG;
+typedef int32_t* LPLONG;
+typedef uint32_t* LPDWORD;
+typedef uint16_t WORD;
+typedef uint8_t BYTE;
+typedef uint8_t* LPBYTE;
+typedef bool BOOL;
+typedef char* LPSTR;
+typedef void* LPVOID;
+typedef uint16_t* LPWORD;
+typedef const char* LPCSTR;
+typedef void* PVOID;
+typedef void VOID;
+
+inline LONG MulDiv (long a, long b, long c)
+{
+  // if (!c) return 0;
+  return ((uint64_t) a * (uint64_t) b ) / c;
+}
+
+#define MODPLUG_NO_FILESAVE
+#define NO_AGC
+#define LPCTSTR LPCSTR
+#define lstrcpyn strncpy
+#define lstrcpy strcpy
+#define lstrcmp strcmp
+#define WAVE_FORMAT_PCM 1
+//#define ENABLE_EQ
+
+#define  GHND   0
+
+inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
+{
+  int8_t * p = (int8_t *) malloc(size);
+
+  if (p != NULL) memset(p, 0, size);
+  return p;
+}
+
+inline void ProcessPlugins(int n) {}
+
+#define GlobalFreePtr(p) free((void *)(p))
+
+#define strnicmp(a,b,c)                strncasecmp(a,b,c)
+#define wsprintf                       sprintf
+
+#ifndef FALSE
+#define FALSE  false
+#endif
+
+#ifndef TRUE
+#define TRUE   true
+#endif
+
+#endif // _WIN32
+
+#endif
+
+
+
diff --git a/misc/builddeps/dp.linux32/lib/libjpeg.a b/misc/builddeps/dp.linux32/lib/libjpeg.a
new file mode 100644 (file)
index 0000000..d027d84
Binary files /dev/null and b/misc/builddeps/dp.linux32/lib/libjpeg.a differ
diff --git a/misc/builddeps/dp.linux32/lib/libjpeg.la b/misc/builddeps/dp.linux32/lib/libjpeg.la
new file mode 100755 (executable)
index 0000000..9d0de19
--- /dev/null
@@ -0,0 +1,41 @@
+# libjpeg.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6b
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libjpeg.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libjpeg.
+current=8
+age=0
+revision=2
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/home/xonotic/dp.linux32/lib'
diff --git a/misc/builddeps/dp.linux32/lib/libmodplug.a b/misc/builddeps/dp.linux32/lib/libmodplug.a
new file mode 100644 (file)
index 0000000..61a7d71
Binary files /dev/null and b/misc/builddeps/dp.linux32/lib/libmodplug.a differ
diff --git a/misc/builddeps/dp.linux32/lib/libmodplug.la b/misc/builddeps/dp.linux32/lib/libmodplug.la
new file mode 100755 (executable)
index 0000000..e646295
--- /dev/null
@@ -0,0 +1,41 @@
+# libmodplug.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6b
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libmodplug.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmodplug.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/home/xonotic/dp.linux32/lib'
diff --git a/misc/builddeps/dp.linux32/lib/pkgconfig/libmodplug.pc b/misc/builddeps/dp.linux32/lib/pkgconfig/libmodplug.pc
new file mode 100644 (file)
index 0000000..ae102fa
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=/home/xonotic/dp.linux32
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libmodplug
+Description: The ModPlug mod file playing library.
+Version: 0.8.8.1
+Requires: 
+Libs: -L${libdir} -lmodplug 
+Libs.private: -lstdc++ -lm
+Cflags: -I${includedir} -I${includedir}/libmodplug
diff --git a/misc/builddeps/dp.linux32/share/man/man1/cjpeg.1 b/misc/builddeps/dp.linux32/share/man/man1/cjpeg.1
new file mode 100644 (file)
index 0000000..01bfa25
--- /dev/null
@@ -0,0 +1,325 @@
+.TH CJPEG 1 "30 December 2009"
+.SH NAME
+cjpeg \- compress an image file to a JPEG file
+.SH SYNOPSIS
+.B cjpeg
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B cjpeg
+compresses the named image file, or the standard input if no file is
+named, and produces a JPEG/JFIF file on the standard output.
+The currently supported input file formats are: PPM (PBMPLUS color
+format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster
+Toolkit format).  (RLE is supported only if the URT library is available.)
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-grayscale
+may be written
+.B \-gray
+or
+.BR \-gr .
+Most of the "basic" switches can be abbreviated to as little as one letter.
+Upper and lower case are equivalent (thus
+.B \-BMP
+is the same as
+.BR \-bmp ).
+British spellings are also accepted (e.g.,
+.BR \-greyscale ),
+though for brevity these are not mentioned below.
+.PP
+The basic switches are:
+.TP
+.BI \-quality " N[,...]"
+Scale quantization tables to adjust image quality.  Quality is 0 (worst) to
+100 (best); default is 75.  (See below for more info.)
+.TP
+.B \-grayscale
+Create monochrome JPEG file from color input.  Be sure to use this switch when
+compressing a grayscale BMP file, because
+.B cjpeg
+isn't bright enough to notice whether a BMP file uses only shades of gray.
+By saying
+.BR \-grayscale ,
+you'll get a smaller JPEG file that takes less time to process.
+.TP
+.B \-optimize
+Perform optimization of entropy encoding parameters.  Without this, default
+encoding parameters are used.
+.B \-optimize
+usually makes the JPEG file a little smaller, but
+.B cjpeg
+runs somewhat slower and needs much more memory.  Image quality and speed of
+decompression are unaffected by
+.BR \-optimize .
+.TP
+.B \-progressive
+Create progressive JPEG file (see below).
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.  Currently supported scale factors are
+8/N with all N from 1 to 16.
+.TP
+.B \-targa
+Input file is Targa format.  Targa files that contain an "identification"
+field will not be automatically recognized by
+.BR cjpeg ;
+for such files you must specify
+.B \-targa
+to make
+.B cjpeg
+treat the input as Targa format.
+For most Targa files, you won't need this switch.
+.PP
+The
+.B \-quality
+switch lets you trade off compressed file size against quality of the
+reconstructed image: the higher the quality setting, the larger the JPEG file,
+and the closer the output image will be to the original input.  Normally you
+want to use the lowest quality setting (smallest file) that decompresses into
+something visually indistinguishable from the original image.  For this
+purpose the quality setting should be between 50 and 95; the default of 75 is
+often about right.  If you see defects at
+.B \-quality
+75, then go up 5 or 10 counts at a time until you are happy with the output
+image.  (The optimal setting will vary from one image to another.)
+.PP
+.B \-quality
+100 will generate a quantization table of all 1's, minimizing loss in the
+quantization step (but there is still information loss in subsampling, as well
+as roundoff error).  This setting is mainly of interest for experimental
+purposes.  Quality values above about 95 are
+.B not
+recommended for normal use; the compressed file size goes up dramatically for
+hardly any gain in output image quality.
+.PP
+In the other direction, quality values below 50 will produce very small files
+of low image quality.  Settings around 5 to 10 might be useful in preparing an
+index of a large image library, for example.  Try
+.B \-quality
+2 (or so) for some amusing Cubist effects.  (Note: quality
+values below about 25 generate 2-byte quantization tables, which are
+considered optional in the JPEG standard.
+.B cjpeg
+emits a warning message when you give such a quality value, because some
+other JPEG programs may be unable to decode the resulting file.  Use
+.B \-baseline
+if you need to ensure compatibility at low quality values.)
+.PP
+The
+.B \-quality
+option has been extended in IJG version 7 for support of separate quality
+settings for luminance and chrominance (or in general, for every provided
+quantization table slot).  This feature is useful for high-quality
+applications which cannot accept the damage of color data by coarse
+subsampling settings.  You can now easily reduce the color data amount more
+smoothly with finer control without separate subsampling.  The resulting file
+is fully compliant with standard JPEG decoders.
+Note that the
+.B \-quality
+ratings refer to the quantization table slots, and that the last value is
+replicated if there are more q-table slots than parameters.  The default
+q-table slots are 0 for luminance and 1 for chrominance with default tables as
+given in the JPEG standard.  This is compatible with the old behaviour in case
+that only one parameter is given, which is then used for both luminance and
+chrominance (slots 0 and 1).  More or custom quantization tables can be set
+with
+.B \-qtables
+and assigned to components with
+.B \-qslots
+parameter (see the "wizard" switches below).
+.B Caution:
+You must explicitly add
+.BI \-sample " 1x1"
+for efficient separate color
+quality selection, since the default value used by library is 2x2!
+.PP
+The
+.B \-progressive
+switch creates a "progressive JPEG" file.  In this type of JPEG file, the data
+is stored in multiple scans of increasing quality.  If the file is being
+transmitted over a slow communications link, the decoder can use the first
+scan to display a low-quality image very quickly, and can then improve the
+display with each subsequent scan.  The final image is exactly equivalent to a
+standard JPEG file of the same quality setting, and the total file size is
+about the same --- often a little smaller.
+.PP
+Switches for advanced users:
+.TP
+.B \-dct int
+Use integer DCT method (default).
+.TP
+.B \-dct fast
+Use fast integer DCT (less accurate).
+.TP
+.B \-dct float
+Use floating-point DCT method.
+The float method is very slightly more accurate than the int method, but is
+much slower unless your machine has very fast floating-point hardware.  Also
+note that results of the floating-point method may vary slightly across
+machines, while the integer methods should give the same results everywhere.
+The fast integer method is much less accurate than the other two.
+.TP
+.B \-nosmooth
+Don't use high-quality downsampling.
+.TP
+.BI \-restart " N"
+Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
+attached to the number.
+.B \-restart 0
+(the default) means no restart markers.
+.TP
+.BI \-smooth " N"
+Smooth the input image to eliminate dithering noise.  N, ranging from 1 to
+100, indicates the strength of smoothing.  0 (the default) means no smoothing.
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.PP
+The
+.B \-restart
+option inserts extra markers that allow a JPEG decoder to resynchronize after
+a transmission error.  Without restart markers, any damage to a compressed
+file will usually ruin the image from the point of the error to the end of the
+image; with restart markers, the damage is usually confined to the portion of
+the image up to the next restart marker.  Of course, the restart markers
+occupy extra space.  We recommend
+.B \-restart 1
+for images that will be transmitted across unreliable networks such as Usenet.
+.PP
+The
+.B \-smooth
+option filters the input to eliminate fine-scale noise.  This is often useful
+when converting dithered images to JPEG: a moderate smoothing factor of 10 to
+50 gets rid of dithering patterns in the input file, resulting in a smaller
+JPEG file and a better-looking image.  Too large a smoothing factor will
+visibly blur the image, however.
+.PP
+Switches for wizards:
+.TP
+.B \-arithmetic
+Use arithmetic coding.
+.B Caution:
+arithmetic coded JPEG is not yet widely implemented, so many decoders will be
+unable to view an arithmetic coded JPEG file at all.
+.TP
+.B \-baseline
+Force baseline-compatible quantization tables to be generated.  This clamps
+quantization values to 8 bits even at low quality settings.  (This switch is
+poorly named, since it does not ensure that the output is actually baseline
+JPEG.  For example, you can use
+.B \-baseline
+and
+.B \-progressive
+together.)
+.TP
+.BI \-qtables " file"
+Use the quantization tables given in the specified text file.
+.TP
+.BI \-qslots " N[,...]"
+Select which quantization table to use for each color component.
+.TP
+.BI \-sample " HxV[,...]"
+Set JPEG sampling factors for each color component.
+.TP
+.BI \-scans " file"
+Use the scan script given in the specified text file.
+.PP
+The "wizard" switches are intended for experimentation with JPEG.  If you
+don't know what you are doing, \fBdon't use them\fR.  These switches are
+documented further in the file wizard.txt.
+.SH EXAMPLES
+.LP
+This example compresses the PPM file foo.ppm with a quality factor of
+60 and saves the output as foo.jpg:
+.IP
+.B cjpeg \-quality
+.I 60 foo.ppm
+.B >
+.I foo.jpg
+.SH HINTS
+Color GIF files are not the ideal input for JPEG; JPEG is really intended for
+compressing full-color (24-bit) images.  In particular, don't try to convert
+cartoons, line drawings, and other images that have only a few distinct
+colors.  GIF works great on these, JPEG does not.  If you want to convert a
+GIF to JPEG, you should experiment with
+.BR cjpeg 's
+.B \-quality
+and
+.B \-smooth
+options to get a satisfactory conversion.
+.B \-smooth 10
+or so is often helpful.
+.PP
+Avoid running an image through a series of JPEG compression/decompression
+cycles.  Image quality loss will accumulate; after ten or so cycles the image
+may be noticeably worse than it was after one cycle.  It's best to use a
+lossless format while manipulating an image, then convert to JPEG format when
+you are ready to file the image away.
+.PP
+The
+.B \-optimize
+option to
+.B cjpeg
+is worth using when you are making a "final" version for posting or archiving.
+It's also a win when you are using low quality settings to make very small
+JPEG files; the percentage improvement is often a lot more than it is on
+larger files.  (At present,
+.B \-optimize
+mode is always selected when generating progressive JPEG files.)
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+.BR ppm (5),
+.BR pgm (5)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+GIF input files are no longer supported, to avoid the Unisys LZW patent.
+(Conversion of GIF files to JPEG is usually a bad idea anyway.)
+.PP
+Not all variants of BMP and Targa file formats are supported.
+.PP
+The
+.B \-targa
+switch is not a bug, it's a feature.  (It would be a bug if the Targa format
+designers had not been clueless.)
diff --git a/misc/builddeps/dp.linux32/share/man/man1/djpeg.1 b/misc/builddeps/dp.linux32/share/man/man1/djpeg.1
new file mode 100644 (file)
index 0000000..f3722d1
--- /dev/null
@@ -0,0 +1,252 @@
+.TH DJPEG 1 "3 October 2009"
+.SH NAME
+djpeg \- decompress a JPEG file to an image file
+.SH SYNOPSIS
+.B djpeg
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B djpeg
+decompresses the named JPEG file, or the standard input if no file is named,
+and produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,
+GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
+(RLE is supported only if the URT library is available.)
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-grayscale
+may be written
+.B \-gray
+or
+.BR \-gr .
+Most of the "basic" switches can be abbreviated to as little as one letter.
+Upper and lower case are equivalent (thus
+.B \-BMP
+is the same as
+.BR \-bmp ).
+British spellings are also accepted (e.g.,
+.BR \-greyscale ),
+though for brevity these are not mentioned below.
+.PP
+The basic switches are:
+.TP
+.BI \-colors " N"
+Reduce image to at most N colors.  This reduces the number of colors used in
+the output image, so that it can be displayed on a colormapped display or
+stored in a colormapped file format.  For example, if you have an 8-bit
+display, you'd need to reduce to 256 or fewer colors.
+.TP
+.BI \-quantize " N"
+Same as
+.BR \-colors .
+.B \-colors
+is the recommended name,
+.B \-quantize
+is provided only for backwards compatibility.
+.TP
+.B \-fast
+Select recommended processing options for fast, low quality output.  (The
+default options are chosen for highest quality output.)  Currently, this is
+equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
+.TP
+.B \-grayscale
+Force gray-scale output even if JPEG file is color.  Useful for viewing on
+monochrome displays; also,
+.B djpeg
+runs noticeably faster in this mode.
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.  Currently supported scale factors are
+M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
+baseline JPEG.  If the /N part is omitted, then M specifies the DCT scaled
+size to be applied on the given input.  For baseline JPEG this is equivalent
+to M/8 scaling, since the source DCT size for baseline JPEG is 8.
+Scaling is handy if the image is larger than your screen; also,
+.B djpeg
+runs much faster when scaling down the output.
+.TP
+.B \-bmp
+Select BMP output format (Windows flavor).  8-bit colormapped format is
+emitted if
+.B \-colors
+or
+.B \-grayscale
+is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
+format is emitted.
+.TP
+.B \-gif
+Select GIF output format.  Since GIF does not support more than 256 colors,
+.B \-colors 256
+is assumed (unless you specify a smaller number of colors).
+.TP
+.B \-os2
+Select BMP output format (OS/2 1.x flavor).  8-bit colormapped format is
+emitted if
+.B \-colors
+or
+.B \-grayscale
+is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
+format is emitted.
+.TP
+.B \-pnm
+Select PBMPLUS (PPM/PGM) output format (this is the default format).
+PGM is emitted if the JPEG file is gray-scale or if
+.B \-grayscale
+is specified; otherwise PPM is emitted.
+.TP
+.B \-rle
+Select RLE output format.  (Requires URT library.)
+.TP
+.B \-targa
+Select Targa output format.  Gray-scale format is emitted if the JPEG file is
+gray-scale or if
+.B \-grayscale
+is specified; otherwise, colormapped format is emitted if
+.B \-colors
+is specified; otherwise, 24-bit full-color format is emitted.
+.PP
+Switches for advanced users:
+.TP
+.B \-dct int
+Use integer DCT method (default).
+.TP
+.B \-dct fast
+Use fast integer DCT (less accurate).
+.TP
+.B \-dct float
+Use floating-point DCT method.
+The float method is very slightly more accurate than the int method, but is
+much slower unless your machine has very fast floating-point hardware.  Also
+note that results of the floating-point method may vary slightly across
+machines, while the integer methods should give the same results everywhere.
+The fast integer method is much less accurate than the other two.
+.TP
+.B \-dither fs
+Use Floyd-Steinberg dithering in color quantization.
+.TP
+.B \-dither ordered
+Use ordered dithering in color quantization.
+.TP
+.B \-dither none
+Do not use dithering in color quantization.
+By default, Floyd-Steinberg dithering is applied when quantizing colors; this
+is slow but usually produces the best results.  Ordered dither is a compromise
+between speed and quality; no dithering is fast but usually looks awful.  Note
+that these switches have no effect unless color quantization is being done.
+Ordered dither is only available in
+.B \-onepass
+mode.
+.TP
+.BI \-map " file"
+Quantize to the colors used in the specified image file.  This is useful for
+producing multiple files with identical color maps, or for forcing a
+predefined set of colors to be used.  The
+.I file
+must be a GIF or PPM file. This option overrides
+.B \-colors
+and
+.BR \-onepass .
+.TP
+.B \-nosmooth
+Don't use high-quality upsampling.
+.TP
+.B \-onepass
+Use one-pass instead of two-pass color quantization.  The one-pass method is
+faster and needs less memory, but it produces a lower-quality image.
+.B \-onepass
+is ignored unless you also say
+.B \-colors
+.IR N .
+Also, the one-pass method is always used for gray-scale output (the two-pass
+method is no improvement then).
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.SH EXAMPLES
+.LP
+This example decompresses the JPEG file foo.jpg, quantizes it to
+256 colors, and saves the output in 8-bit BMP format in foo.bmp:
+.IP
+.B djpeg \-colors 256 \-bmp
+.I foo.jpg
+.B >
+.I foo.bmp
+.SH HINTS
+To get a quick preview of an image, use the
+.B \-grayscale
+and/or
+.B \-scale
+switches.
+.B \-grayscale \-scale 1/8
+is the fastest case.
+.PP
+Several options are available that trade off image quality to gain speed.
+.B \-fast
+turns on the recommended settings.
+.PP
+.B \-dct fast
+and/or
+.B \-nosmooth
+gain speed at a small sacrifice in quality.
+When producing a color-quantized image,
+.B \-onepass \-dither ordered
+is fast but much lower quality than the default behavior.
+.B \-dither none
+may give acceptable results in two-pass mode, but is seldom tolerable in
+one-pass mode.
+.PP
+If you are fortunate enough to have very fast floating point hardware,
+\fB\-dct float\fR may be even faster than \fB\-dct fast\fR.  But on most
+machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
+not worth using, because its theoretical accuracy advantage is too small to be
+significant in practice.
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+.BR ppm (5),
+.BR pgm (5)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+To avoid the Unisys LZW patent,
+.B djpeg
+produces uncompressed GIF files.  These are larger than they should be, but
+are readable by standard GIF decoders.
diff --git a/misc/builddeps/dp.linux32/share/man/man1/jpegtran.1 b/misc/builddeps/dp.linux32/share/man/man1/jpegtran.1
new file mode 100644 (file)
index 0000000..0ad1bbc
--- /dev/null
@@ -0,0 +1,285 @@
+.TH JPEGTRAN 1 "28 December 2009"
+.SH NAME
+jpegtran \- lossless transformation of JPEG files
+.SH SYNOPSIS
+.B jpegtran
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B jpegtran
+performs various useful transformations of JPEG files.
+It can translate the coded representation from one variant of JPEG to another,
+for example from baseline JPEG to progressive JPEG or vice versa.  It can also
+perform some rearrangements of the image data, for example turning an image
+from landscape to portrait format by rotation.
+.PP
+.B jpegtran
+works by rearranging the compressed data (DCT coefficients), without
+ever fully decoding the image.  Therefore, its transformations are lossless:
+there is no image degradation at all, which would not be true if you used
+.B djpeg
+followed by
+.B cjpeg
+to accomplish the same conversion.  But by the same token,
+.B jpegtran
+cannot perform lossy operations such as changing the image quality.
+.PP
+.B jpegtran
+reads the named JPEG/JFIF file, or the standard input if no file is
+named, and produces a JPEG/JFIF file on the standard output.
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-optimize
+may be written
+.B \-opt
+or
+.BR \-o .
+Upper and lower case are equivalent.
+British spellings are also accepted (e.g.,
+.BR \-optimise ),
+though for brevity these are not mentioned below.
+.PP
+To specify the coded JPEG representation used in the output file,
+.B jpegtran
+accepts a subset of the switches recognized by
+.BR cjpeg :
+.TP
+.B \-optimize
+Perform optimization of entropy encoding parameters.
+.TP
+.B \-progressive
+Create progressive JPEG file.
+.TP
+.BI \-restart " N"
+Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
+attached to the number.
+.TP
+.B \-arithmetic
+Use arithmetic coding.
+.TP
+.BI \-scans " file"
+Use the scan script given in the specified text file.
+.PP
+See
+.BR cjpeg (1)
+for more details about these switches.
+If you specify none of these switches, you get a plain baseline-JPEG output
+file.  The quality setting and so forth are determined by the input file.
+.PP
+The image can be losslessly transformed by giving one of these switches:
+.TP
+.B \-flip horizontal
+Mirror image horizontally (left-right).
+.TP
+.B \-flip vertical
+Mirror image vertically (top-bottom).
+.TP
+.B \-rotate 90
+Rotate image 90 degrees clockwise.
+.TP
+.B \-rotate 180
+Rotate image 180 degrees.
+.TP
+.B \-rotate 270
+Rotate image 270 degrees clockwise (or 90 ccw).
+.TP
+.B \-transpose
+Transpose image (across UL-to-LR axis).
+.TP
+.B \-transverse
+Transverse transpose (across UR-to-LL axis).
+.IP
+The transpose transformation has no restrictions regarding image dimensions.
+The other transformations operate rather oddly if the image dimensions are not
+a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
+transform complete blocks of DCT coefficient data in the desired way.
+.IP
+.BR jpegtran 's
+default behavior when transforming an odd-size image is designed
+to preserve exact reversibility and mathematical consistency of the
+transformation set.  As stated, transpose is able to flip the entire image
+area.  Horizontal mirroring leaves any partial iMCU column at the right edge
+untouched, but is able to flip all rows of the image.  Similarly, vertical
+mirroring leaves any partial iMCU row at the bottom edge untouched, but is
+able to flip all columns.  The other transforms can be built up as sequences
+of transpose and flip operations; for consistency, their actions on edge
+pixels are defined to be the same as the end result of the corresponding
+transpose-and-flip sequence.
+.IP
+For practical use, you may prefer to discard any untransformable edge pixels
+rather than having a strange-looking strip along the right and/or bottom edges
+of a transformed image.  To do this, add the
+.B \-trim
+switch:
+.TP
+.B \-trim
+Drop non-transformable edge blocks.
+.IP
+Obviously, a transformation with
+.B \-trim
+is not reversible, so strictly speaking
+.B jpegtran
+with this switch is not lossless.  Also, the expected mathematical
+equivalences between the transformations no longer hold.  For example,
+.B \-rot 270 -trim
+trims only the bottom edge, but
+.B \-rot 90 -trim
+followed by
+.B \-rot 180 -trim
+trims both edges.
+.IP
+If you are only interested in perfect transformation, add the
+.B \-perfect
+switch:
+.TP
+.B \-perfect
+Fails with an error if the transformation is not perfect.
+.IP
+For example you may want to do
+.IP
+.B (jpegtran \-rot 90 -perfect
+.I foo.jpg
+.B || djpeg
+.I foo.jpg
+.B | pnmflip \-r90 | cjpeg)
+.IP
+to do a perfect rotation if available or an approximated one if not.
+.PP
+We also offer a lossless-crop option, which discards data outside a given
+image region but losslessly preserves what is inside.  Like the rotate and
+flip transforms, lossless crop is restricted by the current JPEG format: the
+upper left corner of the selected region must fall on an iMCU boundary.  If
+this does not hold for the given crop parameters, we silently move the upper
+left corner up and/or left to make it so, simultaneously increasing the region
+dimensions to keep the lower right crop corner unchanged.  (Thus, the output
+image covers at least the requested region, but may cover more.)
+
+The image can be losslessly cropped by giving the switch:
+.TP
+.B \-crop WxH+X+Y
+Crop to a rectangular subarea of width W, height H starting at point X,Y.
+.PP
+Other not-strictly-lossless transformation switches are:
+.TP
+.B \-grayscale
+Force grayscale output.
+.IP
+This option discards the chrominance channels if the input image is YCbCr
+(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The
+luminance channel is preserved exactly, so this is a better method of reducing
+to grayscale than decompression, conversion, and recompression.  This switch
+is particularly handy for fixing a monochrome picture that was mistakenly
+encoded as a color JPEG.  (In such a case, the space savings from getting rid
+of the near-empty chroma channels won't be large; but the decoding time for
+a grayscale JPEG is substantially less than that for a color JPEG.)
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.
+.IP
+Currently supported scale factors are M/N with all M from 1 to 16, where N is
+the source DCT size, which is 8 for baseline JPEG.  If the /N part is omitted,
+then M specifies the DCT scaled size to be applied on the given input.  For
+baseline JPEG this is equivalent to M/8 scaling, since the source DCT size
+for baseline JPEG is 8.
+.B Caution:
+An implementation of the JPEG SmartScale extension is required for this
+feature.  SmartScale enabled JPEG is not yet widely implemented, so many
+decoders will be unable to view a SmartScale extended JPEG file at all.
+.PP
+.B jpegtran
+also recognizes these switches that control what to do with "extra" markers,
+such as comment blocks:
+.TP
+.B \-copy none
+Copy no extra markers from source file.  This setting suppresses all
+comments and other excess baggage present in the source file.
+.TP
+.B \-copy comments
+Copy only comment markers.  This setting copies comments from the source file,
+but discards any other inessential (for image display) data.
+.TP
+.B \-copy all
+Copy all extra markers.  This setting preserves miscellaneous markers
+found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
+settings.  In some files these extra markers can be sizable.
+.IP
+The default behavior is
+.BR "\-copy comments" .
+(Note: in IJG releases v6 and v6a,
+.B jpegtran
+always did the equivalent of
+.BR "\-copy none" .)
+.PP
+Additional switches recognized by jpegtran are:
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.SH EXAMPLES
+.LP
+This example converts a baseline JPEG file to progressive form:
+.IP
+.B jpegtran \-progressive
+.I foo.jpg
+.B >
+.I fooprog.jpg
+.PP
+This example rotates an image 90 degrees clockwise, discarding any
+unrotatable edge pixels:
+.IP
+.B jpegtran \-rot 90 -trim
+.I foo.jpg
+.B >
+.I foo90.jpg
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+The transform options can't transform odd-size images perfectly.  Use
+.B \-trim
+or
+.B \-perfect
+if you don't like the results.
+.PP
+The entire image is read into memory and then written out again, even in
+cases where this isn't really necessary.  Expect swapping on large images,
+especially when using the more complex transform options.
diff --git a/misc/builddeps/dp.linux32/share/man/man1/rdjpgcom.1 b/misc/builddeps/dp.linux32/share/man/man1/rdjpgcom.1
new file mode 100644 (file)
index 0000000..97611df
--- /dev/null
@@ -0,0 +1,63 @@
+.TH RDJPGCOM 1 "02 April 2009"
+.SH NAME
+rdjpgcom \- display text comments from a JPEG file
+.SH SYNOPSIS
+.B rdjpgcom
+[
+.B \-raw
+]
+[
+.B \-verbose
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B rdjpgcom
+reads the named JPEG/JFIF file, or the standard input if no file is named,
+and prints any text comments found in the file on the standard output.
+.PP
+The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
+Although the standard doesn't actually define what COM blocks are for, they
+are widely used to hold user-supplied text strings.  This lets you add
+annotations, titles, index terms, etc to your JPEG files, and later retrieve
+them as text.  COM blocks do not interfere with the image stored in the JPEG
+file.  The maximum size of a COM block is 64K, but you can have as many of
+them as you like in one JPEG file.
+.SH OPTIONS
+.TP
+.B \-raw
+Normally
+.B rdjpgcom
+escapes non-printable characters in comments, for security reasons.
+This option avoids that.
+.PP
+.B \-verbose
+Causes
+.B rdjpgcom
+to also display the JPEG image dimensions.
+.PP
+Switch names may be abbreviated, and are not case sensitive.
+.SH HINTS
+.B rdjpgcom
+does not depend on the IJG JPEG library.  Its source code is intended as an
+illustration of the minimum amount of code required to parse a JPEG file
+header correctly.
+.PP
+In
+.B \-verbose
+mode,
+.B rdjpgcom
+will also attempt to print the contents of any "APP12" markers as text.
+Some digital cameras produce APP12 markers containing useful textual
+information.  If you like, you can modify the source code to print
+other APPn marker types as well.
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR wrjpgcom (1)
+.SH AUTHOR
+Independent JPEG Group
diff --git a/misc/builddeps/dp.linux32/share/man/man1/wrjpgcom.1 b/misc/builddeps/dp.linux32/share/man/man1/wrjpgcom.1
new file mode 100644 (file)
index 0000000..d419a99
--- /dev/null
@@ -0,0 +1,103 @@
+.TH WRJPGCOM 1 "15 June 1995"
+.SH NAME
+wrjpgcom \- insert text comments into a JPEG file
+.SH SYNOPSIS
+.B wrjpgcom
+[
+.B \-replace
+]
+[
+.BI \-comment " text"
+]
+[
+.BI \-cfile " name"
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B wrjpgcom
+reads the named JPEG/JFIF file, or the standard input if no file is named,
+and generates a new JPEG/JFIF file on standard output.  A comment block is
+added to the file.
+.PP
+The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
+Although the standard doesn't actually define what COM blocks are for, they
+are widely used to hold user-supplied text strings.  This lets you add
+annotations, titles, index terms, etc to your JPEG files, and later retrieve
+them as text.  COM blocks do not interfere with the image stored in the JPEG
+file.  The maximum size of a COM block is 64K, but you can have as many of
+them as you like in one JPEG file.
+.PP
+.B wrjpgcom
+adds a COM block, containing text you provide, to a JPEG file.
+Ordinarily, the COM block is added after any existing COM blocks; but you
+can delete the old COM blocks if you wish.
+.SH OPTIONS
+Switch names may be abbreviated, and are not case sensitive.
+.TP
+.B \-replace
+Delete any existing COM blocks from the file.
+.TP
+.BI \-comment " text"
+Supply text for new COM block on command line.
+.TP
+.BI \-cfile " name"
+Read text for new COM block from named file.
+.PP
+If you have only one line of comment text to add, you can provide it on the
+command line with
+.BR \-comment .
+The comment text must be surrounded with quotes so that it is treated as a
+single argument.  Longer comments can be read from a text file.
+.PP
+If you give neither
+.B \-comment
+nor
+.BR \-cfile ,
+then
+.B wrjpgcom
+will read the comment text from standard input.  (In this case an input image
+file name MUST be supplied, so that the source JPEG file comes from somewhere
+else.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file
+indicator (usually control-D) to terminate the comment text entry.
+.PP
+.B wrjpgcom
+will not add a COM block if the provided comment string is empty.  Therefore
+\fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file.
+.SH EXAMPLES
+.LP
+Add a short comment to in.jpg, producing out.jpg:
+.IP
+.B wrjpgcom \-c
+\fI"View of my back yard" in.jpg
+.B >
+.I out.jpg
+.PP
+Attach a long comment previously stored in comment.txt:
+.IP
+.B wrjpgcom
+.I in.jpg
+.B <
+.I comment.txt
+.B >
+.I out.jpg
+.PP
+or equivalently
+.IP
+.B wrjpgcom
+.B -cfile
+.I comment.txt
+.B <
+.I in.jpg
+.B >
+.I out.jpg
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1)
+.SH AUTHOR
+Independent JPEG Group
diff --git a/misc/builddeps/dp.linux64/bin/cjpeg b/misc/builddeps/dp.linux64/bin/cjpeg
new file mode 100755 (executable)
index 0000000..432369b
Binary files /dev/null and b/misc/builddeps/dp.linux64/bin/cjpeg differ
diff --git a/misc/builddeps/dp.linux64/bin/djpeg b/misc/builddeps/dp.linux64/bin/djpeg
new file mode 100755 (executable)
index 0000000..2cda87d
Binary files /dev/null and b/misc/builddeps/dp.linux64/bin/djpeg differ
diff --git a/misc/builddeps/dp.linux64/bin/jpegtran b/misc/builddeps/dp.linux64/bin/jpegtran
new file mode 100755 (executable)
index 0000000..a5cceb4
Binary files /dev/null and b/misc/builddeps/dp.linux64/bin/jpegtran differ
diff --git a/misc/builddeps/dp.linux64/bin/rdjpgcom b/misc/builddeps/dp.linux64/bin/rdjpgcom
new file mode 100755 (executable)
index 0000000..64ddad7
Binary files /dev/null and b/misc/builddeps/dp.linux64/bin/rdjpgcom differ
diff --git a/misc/builddeps/dp.linux64/bin/wrjpgcom b/misc/builddeps/dp.linux64/bin/wrjpgcom
new file mode 100755 (executable)
index 0000000..007890e
Binary files /dev/null and b/misc/builddeps/dp.linux64/bin/wrjpgcom differ
diff --git a/misc/builddeps/dp.linux64/include/jconfig.h b/misc/builddeps/dp.linux64/include/jconfig.h
new file mode 100644 (file)
index 0000000..966b1d5
--- /dev/null
@@ -0,0 +1,54 @@
+/* jconfig.h.  Generated from jconfig.cfg by configure.  */
+/* jconfig.cfg --- source file edited by configure script */
+/* see jconfig.txt for explanations */
+
+#define HAVE_PROTOTYPES 1
+#define HAVE_UNSIGNED_CHAR 1
+#define HAVE_UNSIGNED_SHORT 1
+/* #undef void */
+/* #undef const */
+/* #undef CHAR_IS_UNSIGNED */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_LOCALE_H 1
+/* #undef NEED_BSD_STRINGS */
+/* #undef NEED_SYS_TYPES_H */
+/* #undef NEED_FAR_POINTERS */
+/* #undef NEED_SHORT_EXTERNAL_NAMES */
+/* Define this if you get warnings about undefined structures. */
+/* #undef INCOMPLETE_TYPES_BROKEN */
+
+/* Define "boolean" as unsigned char, not int, on Windows systems. */
+#ifdef _WIN32
+#ifndef __RPCNDR_H__           /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN           /* prevent jmorecfg.h from redefining it */
+#endif
+
+#ifdef JPEG_INTERNALS
+
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
+#define INLINE __inline__
+/* These are for configuring the JPEG memory manager. */
+/* #undef DEFAULT_MAX_MEM */
+/* #undef NO_MKTEMP */
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED          /* BMP image file format */
+#define GIF_SUPPORTED          /* GIF image file format */
+#define PPM_SUPPORTED          /* PBMPLUS PPM/PGM image file format */
+/* #undef RLE_SUPPORTED */
+#define TARGA_SUPPORTED                /* Targa image file format */
+
+/* #undef TWO_FILE_COMMANDLINE */
+/* #undef NEED_SIGNAL_CATCHER */
+/* #undef DONT_USE_B_MODE */
+
+/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
+/* #undef PROGRESS_REPORT */
+
+#endif /* JPEG_CJPEG_DJPEG */
diff --git a/misc/builddeps/dp.linux64/include/jerror.h b/misc/builddeps/dp.linux64/include/jerror.h
new file mode 100644 (file)
index 0000000..1cfb2b1
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * jerror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * Modified 1997-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the JPEG library.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ * A set of error-reporting macros are defined too.  Some applications using
+ * the JPEG library may wish to include this file to get the error codes
+ * and/or the macros.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE.  To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef JERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* JERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string)  code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
+
+/* For maintenance convenience, list is alphabetical by message code name */
+JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
+JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
+JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
+JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
+JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
+JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
+JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported")
+JMESSAGE(JERR_BAD_DROP_SAMPLING,
+        "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
+JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
+JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
+JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
+JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
+JMESSAGE(JERR_BAD_LIB_VERSION,
+        "Wrong JPEG library version: library is %d, caller expects %d")
+JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
+JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
+JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
+JMESSAGE(JERR_BAD_PROGRESSION,
+        "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
+JMESSAGE(JERR_BAD_PROG_SCRIPT,
+        "Invalid progressive parameters at scan script entry %d")
+JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
+JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
+JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
+JMESSAGE(JERR_BAD_STRUCT_SIZE,
+        "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
+JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
+JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
+JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
+JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
+JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
+JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
+JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
+JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
+JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
+JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
+JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
+JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
+JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
+JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
+JMESSAGE(JERR_FILE_READ, "Input file read error")
+JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
+JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
+JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
+JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
+JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
+JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
+JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
+        "Cannot transcode due to multiple use of quantization table %d")
+JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
+JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
+JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
+JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
+JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
+JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
+JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
+JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
+JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
+JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
+JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
+JMESSAGE(JERR_QUANT_COMPONENTS,
+        "Cannot quantize more than %d color components")
+JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
+JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
+JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
+JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
+JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
+JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
+JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
+JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
+JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
+JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
+JMESSAGE(JERR_TFILE_WRITE,
+        "Write failed on temporary file --- out of disk space?")
+JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
+JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
+JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
+JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
+JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
+JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
+JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
+JMESSAGE(JMSG_VERSION, JVERSION)
+JMESSAGE(JTRC_16BIT_TABLES,
+        "Caution: quantization tables are too coarse for baseline JPEG")
+JMESSAGE(JTRC_ADOBE,
+        "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
+JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
+JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
+JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
+JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
+JMESSAGE(JTRC_DQT, "Define Quantization Table %d  precision %d")
+JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
+JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
+JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
+JMESSAGE(JTRC_EOI, "End Of Image")
+JMESSAGE(JTRC_HUFFBITS, "        %3d %3d %3d %3d %3d %3d %3d %3d")
+JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d  %d")
+JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
+        "Warning: thumbnail image size does not match data length %u")
+JMESSAGE(JTRC_JFIF_EXTENSION,
+        "JFIF extension marker: type 0x%02x, length %u")
+JMESSAGE(JTRC_JFIF_THUMBNAIL, "    with %d x %d thumbnail image")
+JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
+JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
+JMESSAGE(JTRC_QUANTVALS, "        %4u %4u %4u %4u %4u %4u %4u %4u")
+JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
+JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
+JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
+JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
+JMESSAGE(JTRC_RST, "RST%d")
+JMESSAGE(JTRC_SMOOTH_NOTIMPL,
+        "Smoothing not supported with nonstandard sampling ratios")
+JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
+JMESSAGE(JTRC_SOF_COMPONENT, "    Component %d: %dhx%dv q=%d")
+JMESSAGE(JTRC_SOI, "Start of Image")
+JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
+JMESSAGE(JTRC_SOS_COMPONENT, "    Component %d: dc=%d ac=%d")
+JMESSAGE(JTRC_SOS_PARAMS, "  Ss=%d, Se=%d, Ah=%d, Al=%d")
+JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
+JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
+JMESSAGE(JTRC_THUMB_JPEG,
+        "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_PALETTE,
+        "JFIF extension marker: palette thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_RGB,
+        "JFIF extension marker: RGB thumbnail image, length %u")
+JMESSAGE(JTRC_UNKNOWN_IDS,
+        "Unrecognized component IDs %d %d %d, assuming YCbCr")
+JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
+JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
+JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
+JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
+JMESSAGE(JWRN_BOGUS_PROGRESSION,
+        "Inconsistent progression sequence for component %d coefficient %d")
+JMESSAGE(JWRN_EXTRANEOUS_DATA,
+        "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
+JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
+JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
+JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
+JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
+JMESSAGE(JWRN_MUST_RESYNC,
+        "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
+JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
+JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
+
+#ifdef JMAKE_ENUM_LIST
+
+  JMSG_LASTMSGCODE
+} J_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
+
+
+#ifndef JERROR_H
+#define JERROR_H
+
+/* Macros to simplify using the error and trace message stuff */
+/* The first parameter is either type of cinfo pointer */
+
+/* Fatal errors (print message and exit) */
+#define ERREXIT(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT3(cinfo,code,p1,p2,p3)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (cinfo)->err->msg_parm.i[3] = (p4), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (cinfo)->err->msg_parm.i[3] = (p4), \
+   (cinfo)->err->msg_parm.i[4] = (p5), \
+   (cinfo)->err->msg_parm.i[5] = (p6), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXITS(cinfo,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+#define MAKESTMT(stuff)                do { stuff } while (0)
+
+/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
+#define WARNMS(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+
+/* Informational/debugging messages */
+#define TRACEMS(cinfo,lvl,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS1(cinfo,lvl,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS2(cinfo,lvl,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          _mp[4] = (p5); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+          _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+          _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
+          (cinfo)->err->msg_code = (code); \
+          (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMSS(cinfo,lvl,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+
+#endif /* JERROR_H */
diff --git a/misc/builddeps/dp.linux64/include/jmorecfg.h b/misc/builddeps/dp.linux64/include/jmorecfg.h
new file mode 100644 (file)
index 0000000..928d052
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * jmorecfg.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * Modified 1997-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains additional configuration options that customize the
+ * JPEG software for special applications or support machine-dependent
+ * optimizations.  Most users will not need to touch this file.
+ */
+
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ *   8   for 8-bit sample values (the usual setting)
+ *   12  for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE  8     /* use 8 or 12 */
+
+
+/*
+ * Maximum number of components (color channels) allowed in JPEG image.
+ * To meet the letter of the JPEG spec, set this to 255.  However, darn
+ * few applications need more than 4 channels (maybe 5 for CMYK + alpha
+ * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
+ * really short on memory.  (Each allowed component costs a hundred or so
+ * bytes of storage, whether actually used in an image or not.)
+ */
+
+#define MAX_COMPONENTS  10     /* maximum number of image components */
+
+
+/*
+ * Basic data types.
+ * You may need to change these if you have a machine with unusual data
+ * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+ * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
+ * but it had better be at least 16.
+ */
+
+/* Representation of a single sample (pixel element value).
+ * We frequently allocate large arrays of these, so it's important to keep
+ * them small.  But if you have memory to burn and access to char or short
+ * arrays is very slow on your hardware, you might want to change these.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+/* JSAMPLE should be the smallest type that will hold the values 0..255.
+ * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JSAMPLE;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJSAMPLE(value)  ((int) (value))
+#else
+#define GETJSAMPLE(value)  ((int) (value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+#define MAXJSAMPLE     255
+#define CENTERJSAMPLE  128
+
+#endif /* BITS_IN_JSAMPLE == 8 */
+
+
+#if BITS_IN_JSAMPLE == 12
+/* JSAMPLE should be the smallest type that will hold the values 0..4095.
+ * On nearly all machines "short" will do nicely.
+ */
+
+typedef short JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#define MAXJSAMPLE     4095
+#define CENTERJSAMPLE  2048
+
+#endif /* BITS_IN_JSAMPLE == 12 */
+
+
+/* Representation of a DCT frequency coefficient.
+ * This should be a signed value of at least 16 bits; "short" is usually OK.
+ * Again, we allocate large arrays of these, but you can change to int
+ * if you have memory to burn and "short" is really slow.
+ */
+
+typedef short JCOEF;
+
+
+/* Compressed datastreams are represented as arrays of JOCTET.
+ * These must be EXACTLY 8 bits wide, at least once they are written to
+ * external storage.  Note that when using the stdio data source/destination
+ * managers, this is also the data type passed to fread/fwrite.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JOCTET;
+#define GETJOCTET(value)  (value)
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JOCTET;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJOCTET(value)  (value)
+#else
+#define GETJOCTET(value)  ((value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* These typedefs are used for various table entries and so forth.
+ * They must be at least as wide as specified; but making them too big
+ * won't cost a huge amount of memory, so we don't provide special
+ * extraction code like we did for JSAMPLE.  (In other words, these
+ * typedefs live at a different point on the speed/space tradeoff curve.)
+ */
+
+/* UINT8 must hold at least the values 0..255. */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char UINT8;
+#else /* not HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char UINT8;
+#else /* not CHAR_IS_UNSIGNED */
+typedef short UINT8;
+#endif /* CHAR_IS_UNSIGNED */
+#endif /* HAVE_UNSIGNED_CHAR */
+
+/* UINT16 must hold at least the values 0..65535. */
+
+#ifdef HAVE_UNSIGNED_SHORT
+typedef unsigned short UINT16;
+#else /* not HAVE_UNSIGNED_SHORT */
+typedef unsigned int UINT16;
+#endif /* HAVE_UNSIGNED_SHORT */
+
+/* INT16 must hold at least the values -32768..32767. */
+
+#ifndef XMD_H                  /* X11/xmd.h correctly defines INT16 */
+typedef short INT16;
+#endif
+
+/* INT32 must hold at least signed 32-bit values. */
+
+#ifndef XMD_H                  /* X11/xmd.h correctly defines INT32 */
+#ifndef _BASETSD_H_            /* Microsoft defines it in basetsd.h */
+#ifndef _BASETSD_H             /* MinGW is slightly different */
+#ifndef QGLOBAL_H              /* Qt defines it in qglobal.h */
+typedef long INT32;
+#endif
+#endif
+#endif
+#endif
+
+/* Datatype used for image dimensions.  The JPEG standard only supports
+ * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
+ * "unsigned int" is sufficient on all machines.  However, if you need to
+ * handle larger images and you don't mind deviating from the spec, you
+ * can change this datatype.
+ */
+
+typedef unsigned int JDIMENSION;
+
+#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
+
+
+/* These macros are used in all function definitions and extern declarations.
+ * You could modify them if you need to change function linkage conventions;
+ * in particular, you'll need to do that to make the library a Windows DLL.
+ * Another application is to make all functions global for use with debuggers
+ * or code profilers that require it.
+ */
+
+/* a function called through method pointers: */
+#define METHODDEF(type)                static type
+/* a function used only in its module: */
+#define LOCAL(type)            static type
+/* a function referenced thru EXTERNs: */
+#define GLOBAL(type)           type
+/* a reference to a GLOBAL function: */
+#define EXTERN(type)           extern type
+
+
+/* This macro is used to declare a "method", that is, a function pointer.
+ * We want to supply prototype parameters if the compiler can cope.
+ * Note that the arglist parameter must be parenthesized!
+ * Again, you can customize this if you need special linkage keywords.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
+#else
+#define JMETHOD(type,methodname,arglist)  type (*methodname) ()
+#endif
+
+
+/* Here is the pseudo-keyword for declaring pointers that must be "far"
+ * on 80x86 machines.  Most of the specialized coding for 80x86 is handled
+ * by just saying "FAR *" where such a pointer is needed.  In a few places
+ * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
+ */
+
+#ifndef FAR
+#ifdef NEED_FAR_POINTERS
+#define FAR  far
+#else
+#define FAR
+#endif
+#endif
+
+
+/*
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
+ * in standard header files.  Or you may have conflicts with application-
+ * specific header files that you want to include together with these files.
+ * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+ */
+
+#ifndef HAVE_BOOLEAN
+typedef int boolean;
+#endif
+#ifndef FALSE                  /* in case these macros already exist */
+#define FALSE  0               /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE   1
+#endif
+
+
+/*
+ * The remaining options affect code selection within the JPEG library,
+ * but they don't need to be visible to most applications using the library.
+ * To minimize application namespace pollution, the symbols won't be
+ * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
+ */
+
+#ifdef JPEG_INTERNALS
+#define JPEG_INTERNAL_OPTIONS
+#endif
+
+#ifdef JPEG_INTERNAL_OPTIONS
+
+
+/*
+ * These defines indicate whether to include various optional functions.
+ * Undefining some of these symbols will produce a smaller but less capable
+ * library.  Note that you can leave certain source files out of the
+ * compilation/linking process if you've #undef'd the corresponding symbols.
+ * (You may HAVE to do that if your compiler doesn't like null source files.)
+ */
+
+/* Capability options common to encoder and decoder: */
+
+#define DCT_ISLOW_SUPPORTED    /* slow but accurate integer algorithm */
+#define DCT_IFAST_SUPPORTED    /* faster, less accurate integer method */
+#define DCT_FLOAT_SUPPORTED    /* floating-point: accurate, fast on fast HW */
+
+/* Encoder capability options: */
+
+#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define C_PROGRESSIVE_SUPPORTED            /* Progressive JPEG? (Requires MULTISCAN)*/
+#define DCT_SCALING_SUPPORTED      /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
+#define ENTROPY_OPT_SUPPORTED      /* Optimization of entropy coding parms? */
+/* Note: if you selected 12-bit data precision, it is dangerous to turn off
+ * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
+ * precision, so jchuff.c normally uses entropy optimization to compute
+ * usable tables for higher precision.  If you don't want to do optimization,
+ * you'll have to supply different default Huffman tables.
+ * The exact same statements apply for progressive JPEG: the default tables
+ * don't work for progressive mode.  (This may get fixed, however.)
+ */
+#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
+
+/* Decoder capability options: */
+
+#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define D_PROGRESSIVE_SUPPORTED            /* Progressive JPEG? (Requires MULTISCAN)*/
+#define IDCT_SCALING_SUPPORTED     /* Output rescaling via IDCT? */
+#define SAVE_MARKERS_SUPPORTED     /* jpeg_save_markers() needed? */
+#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
+#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
+#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
+#define QUANT_1PASS_SUPPORTED      /* 1-pass color quantization? */
+#define QUANT_2PASS_SUPPORTED      /* 2-pass color quantization? */
+
+/* more capability options later, no doubt */
+
+
+/*
+ * Ordering of RGB data in scanlines passed to or from the application.
+ * If your application wants to deal with data in the order B,G,R, just
+ * change these macros.  You can also deal with formats such as R,G,B,X
+ * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing
+ * the offsets will also change the order in which colormap data is organized.
+ * RESTRICTIONS:
+ * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
+ * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
+ *    useful if you are using JPEG color spaces other than YCbCr or grayscale.
+ * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
+ *    is not 3 (they don't understand about dummy color components!).  So you
+ *    can't use color quantization if you change that value.
+ */
+
+#define RGB_RED                0       /* Offset of Red in an RGB scanline element */
+#define RGB_GREEN      1       /* Offset of Green */
+#define RGB_BLUE       2       /* Offset of Blue */
+#define RGB_PIXELSIZE  3       /* JSAMPLEs per RGB scanline element */
+
+
+/* Definitions for speed-related optimizations. */
+
+
+/* If your compiler supports inline functions, define INLINE
+ * as the inline keyword; otherwise define it as empty.
+ */
+
+#ifndef INLINE
+#ifdef __GNUC__                        /* for instance, GNU C knows about inline */
+#define INLINE __inline__
+#endif
+#ifndef INLINE
+#define INLINE                 /* default is to define it as empty */
+#endif
+#endif
+
+
+/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
+ * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
+ * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
+ */
+
+#ifndef MULTIPLIER
+#define MULTIPLIER  int                /* type for fastest integer multiply */
+#endif
+
+
+/* FAST_FLOAT should be either float or double, whichever is done faster
+ * by your compiler.  (Note that this type is only used in the floating point
+ * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
+ * Typically, float is faster in ANSI C compilers, while double is faster in
+ * pre-ANSI compilers (because they insist on converting to double anyway).
+ * The code below therefore chooses float if we have ANSI-style prototypes.
+ */
+
+#ifndef FAST_FLOAT
+#ifdef HAVE_PROTOTYPES
+#define FAST_FLOAT  float
+#else
+#define FAST_FLOAT  double
+#endif
+#endif
+
+#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/misc/builddeps/dp.linux64/include/jpeglib.h b/misc/builddeps/dp.linux64/include/jpeglib.h
new file mode 100644 (file)
index 0000000..5039d4b
--- /dev/null
@@ -0,0 +1,1158 @@
+/*
+ * jpeglib.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * Modified 2002-2009 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the application interface for the JPEG library.
+ * Most applications using the library need only include this file,
+ * and perhaps jerror.h if they want to know the exact error codes.
+ */
+
+#ifndef JPEGLIB_H
+#define JPEGLIB_H
+
+/*
+ * First we include the configuration files that record how this
+ * installation of the JPEG library is set up.  jconfig.h can be
+ * generated automatically for many systems.  jmorecfg.h contains
+ * manual configuration options that most people need not worry about.
+ */
+
+#ifndef JCONFIG_INCLUDED       /* in case jinclude.h already did */
+#include "jconfig.h"           /* widely used configuration options */
+#endif
+#include "jmorecfg.h"          /* seldom changed options */
+
+
+#ifdef __cplusplus
+#ifndef DONT_USE_EXTERN_C
+extern "C" {
+#endif
+#endif
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80".
+ */
+
+#define JPEG_LIB_VERSION  80   /* Version 8.0 */
+
+
+/* Various constants determining the sizes of things.
+ * All of these are specified by the JPEG standard, so don't change them
+ * if you want to be compatible.
+ */
+
+#define DCTSIZE                    8   /* The basic DCT block is 8x8 samples */
+#define DCTSIZE2           64  /* DCTSIZE squared; # of elements in a block */
+#define NUM_QUANT_TBLS      4  /* Quantization tables are numbered 0..3 */
+#define NUM_HUFF_TBLS       4  /* Huffman tables are numbered 0..3 */
+#define NUM_ARITH_TBLS      16 /* Arith-coding tables are numbered 0..15 */
+#define MAX_COMPS_IN_SCAN   4  /* JPEG limit on # of components in one scan */
+#define MAX_SAMP_FACTOR     4  /* JPEG limit on sampling factors */
+/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
+ * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
+ * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
+ * to handle it.  We even let you do this from the jconfig.h file.  However,
+ * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
+ * sometimes emits noncompliant files doesn't mean you should too.
+ */
+#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */
+#ifndef D_MAX_BLOCKS_IN_MCU
+#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
+#endif
+
+
+/* Data structures for images (arrays of samples and of DCT coefficients).
+ * On 80x86 machines, the image arrays are too big for near pointers,
+ * but the pointer arrays can fit in near memory.
+ */
+
+typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
+typedef JSAMPROW *JSAMPARRAY;  /* ptr to some rows (a 2-D sample array) */
+typedef JSAMPARRAY *JSAMPIMAGE;        /* a 3-D sample array: top index is color */
+
+typedef JCOEF JBLOCK[DCTSIZE2];        /* one block of coefficients */
+typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */
+typedef JBLOCKROW *JBLOCKARRAY;                /* a 2-D array of coefficient blocks */
+typedef JBLOCKARRAY *JBLOCKIMAGE;      /* a 3-D array of coefficient blocks */
+
+typedef JCOEF FAR *JCOEFPTR;   /* useful in a couple of places */
+
+
+/* Types for JPEG compression parameters and working tables. */
+
+
+/* DCT coefficient quantization tables. */
+
+typedef struct {
+  /* This array gives the coefficient quantizers in natural array order
+   * (not the zigzag order in which they are stored in a JPEG DQT marker).
+   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+   */
+  UINT16 quantval[DCTSIZE2];   /* quantization step for each coefficient */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;          /* TRUE when table has been output */
+} JQUANT_TBL;
+
+
+/* Huffman coding tables. */
+
+typedef struct {
+  /* These two fields directly represent the contents of a JPEG DHT marker */
+  UINT8 bits[17];              /* bits[k] = # of symbols with codes of */
+                               /* length k bits; bits[0] is unused */
+  UINT8 huffval[256];          /* The symbols, in order of incr code length */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;          /* TRUE when table has been output */
+} JHUFF_TBL;
+
+
+/* Basic info about one component (color channel). */
+
+typedef struct {
+  /* These values are fixed over the whole image. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOF marker. */
+  int component_id;            /* identifier for this component (0..255) */
+  int component_index;         /* its index in SOF or cinfo->comp_info[] */
+  int h_samp_factor;           /* horizontal sampling factor (1..4) */
+  int v_samp_factor;           /* vertical sampling factor (1..4) */
+  int quant_tbl_no;            /* quantization table selector (0..3) */
+  /* These values may vary between scans. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOS marker. */
+  /* The decompressor output side may not use these variables. */
+  int dc_tbl_no;               /* DC entropy table selector (0..3) */
+  int ac_tbl_no;               /* AC entropy table selector (0..3) */
+  
+  /* Remaining fields should be treated as private by applications. */
+  
+  /* These values are computed during compression or decompression startup: */
+  /* Component's size in DCT blocks.
+   * Any dummy blocks added to complete an MCU are not counted; therefore
+   * these values do not depend on whether a scan is interleaved or not.
+   */
+  JDIMENSION width_in_blocks;
+  JDIMENSION height_in_blocks;
+  /* Size of a DCT block in samples,
+   * reflecting any scaling we choose to apply during the DCT step.
+   * Values from 1 to 16 are supported.
+   * Note that different components may receive different DCT scalings.
+   */
+  int DCT_h_scaled_size;
+  int DCT_v_scaled_size;
+  /* The downsampled dimensions are the component's actual, unpadded number
+   * of samples at the main buffer (preprocessing/compression interface);
+   * DCT scaling is included, so
+   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)
+   * and similarly for height.
+   */
+  JDIMENSION downsampled_width;         /* actual width in samples */
+  JDIMENSION downsampled_height; /* actual height in samples */
+  /* This flag is used only for decompression.  In cases where some of the
+   * components will be ignored (eg grayscale output from YCbCr image),
+   * we can skip most computations for the unused components.
+   */
+  boolean component_needed;    /* do we need the value of this component? */
+
+  /* These values are computed before starting a scan of the component. */
+  /* The decompressor output side may not use these variables. */
+  int MCU_width;               /* number of blocks per MCU, horizontally */
+  int MCU_height;              /* number of blocks per MCU, vertically */
+  int MCU_blocks;              /* MCU_width * MCU_height */
+  int MCU_sample_width;        /* MCU width in samples: MCU_width * DCT_h_scaled_size */
+  int last_col_width;          /* # of non-dummy blocks across in last MCU */
+  int last_row_height;         /* # of non-dummy blocks down in last MCU */
+
+  /* Saved quantization table for component; NULL if none yet saved.
+   * See jdinput.c comments about the need for this information.
+   * This field is currently used only for decompression.
+   */
+  JQUANT_TBL * quant_table;
+
+  /* Private per-component storage for DCT or IDCT subsystem. */
+  void * dct_table;
+} jpeg_component_info;
+
+
+/* The script for encoding a multiple-scan file is an array of these: */
+
+typedef struct {
+  int comps_in_scan;           /* number of components encoded in this scan */
+  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
+  int Ss, Se;                  /* progressive JPEG spectral selection parms */
+  int Ah, Al;                  /* progressive JPEG successive approx. parms */
+} jpeg_scan_info;
+
+/* The decompressor can save APPn and COM markers in a list of these: */
+
+typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
+
+struct jpeg_marker_struct {
+  jpeg_saved_marker_ptr next;  /* next in list, or NULL */
+  UINT8 marker;                        /* marker code: JPEG_COM, or JPEG_APP0+n */
+  unsigned int original_length;        /* # bytes of data in the file */
+  unsigned int data_length;    /* # bytes of data saved at data[] */
+  JOCTET FAR * data;           /* the data contained in the marker */
+  /* the marker length word is not counted in data_length or original_length */
+};
+
+/* Known color spaces. */
+
+typedef enum {
+       JCS_UNKNOWN,            /* error/unspecified */
+       JCS_GRAYSCALE,          /* monochrome */
+       JCS_RGB,                /* red/green/blue */
+       JCS_YCbCr,              /* Y/Cb/Cr (also known as YUV) */
+       JCS_CMYK,               /* C/M/Y/K */
+       JCS_YCCK                /* Y/Cb/Cr/K */
+} J_COLOR_SPACE;
+
+/* DCT/IDCT algorithm options. */
+
+typedef enum {
+       JDCT_ISLOW,             /* slow but accurate integer algorithm */
+       JDCT_IFAST,             /* faster, less accurate integer method */
+       JDCT_FLOAT              /* floating-point: accurate, fast on fast HW */
+} J_DCT_METHOD;
+
+#ifndef JDCT_DEFAULT           /* may be overridden in jconfig.h */
+#define JDCT_DEFAULT  JDCT_ISLOW
+#endif
+#ifndef JDCT_FASTEST           /* may be overridden in jconfig.h */
+#define JDCT_FASTEST  JDCT_IFAST
+#endif
+
+/* Dithering options for decompression. */
+
+typedef enum {
+       JDITHER_NONE,           /* no dithering */
+       JDITHER_ORDERED,        /* simple ordered dither */
+       JDITHER_FS              /* Floyd-Steinberg error diffusion dither */
+} J_DITHER_MODE;
+
+
+/* Common fields between JPEG compression and decompression master structs. */
+
+#define jpeg_common_fields \
+  struct jpeg_error_mgr * err; /* Error handler module */\
+  struct jpeg_memory_mgr * mem;        /* Memory manager module */\
+  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
+  void * client_data;          /* Available for use by application */\
+  boolean is_decompressor;     /* So common code can tell which is which */\
+  int global_state             /* For checking call sequence validity */
+
+/* Routines that are to be used by both halves of the library are declared
+ * to receive a pointer to this structure.  There are no actual instances of
+ * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
+ */
+struct jpeg_common_struct {
+  jpeg_common_fields;          /* Fields common to both master struct types */
+  /* Additional fields follow in an actual jpeg_compress_struct or
+   * jpeg_decompress_struct.  All three structs must agree on these
+   * initial fields!  (This would be a lot cleaner in C++.)
+   */
+};
+
+typedef struct jpeg_common_struct * j_common_ptr;
+typedef struct jpeg_compress_struct * j_compress_ptr;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+
+
+/* Master record for a compression instance */
+
+struct jpeg_compress_struct {
+  jpeg_common_fields;          /* Fields shared with jpeg_decompress_struct */
+
+  /* Destination for compressed data */
+  struct jpeg_destination_mgr * dest;
+
+  /* Description of source image --- these fields must be filled in by
+   * outer application before starting compression.  in_color_space must
+   * be correct before you can even call jpeg_set_defaults().
+   */
+
+  JDIMENSION image_width;      /* input image width */
+  JDIMENSION image_height;     /* input image height */
+  int input_components;                /* # of color components in input image */
+  J_COLOR_SPACE in_color_space;        /* colorspace of input image */
+
+  double input_gamma;          /* image gamma of input image */
+
+  /* Compression parameters --- these fields must be set before calling
+   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to
+   * initialize everything to reasonable defaults, then changing anything
+   * the application specifically wants to change.  That way you won't get
+   * burnt when new parameters are added.  Also note that there are several
+   * helper routines to simplify changing parameters.
+   */
+
+  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+  JDIMENSION jpeg_width;       /* scaled JPEG image width */
+  JDIMENSION jpeg_height;      /* scaled JPEG image height */
+  /* Dimensions of actual JPEG image that will be written to file,
+   * derived from input dimensions by scaling factors above.
+   * These fields are computed by jpeg_start_compress().
+   * You can also use jpeg_calc_jpeg_dimensions() to determine these values
+   * in advance of calling jpeg_start_compress().
+   */
+
+  int data_precision;          /* bits of precision in image data */
+
+  int num_components;          /* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  int q_scale_factor[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined,
+   * and corresponding scale factors (percentage, initialized 100).
+   */
+
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  int num_scans;               /* # of entries in scan_info array */
+  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
+  /* The default value of scan_info is NULL, which causes a single-scan
+   * sequential JPEG file to be emitted.  To create a multi-scan file,
+   * set num_scans and scan_info to point to an array of scan definitions.
+   */
+
+  boolean raw_data_in;         /* TRUE=caller supplies downsampled data */
+  boolean arith_code;          /* TRUE=arithmetic coding, FALSE=Huffman */
+  boolean optimize_coding;     /* TRUE=optimize entropy encoding parms */
+  boolean CCIR601_sampling;    /* TRUE=first samples are cosited */
+  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */
+  int smoothing_factor;                /* 1..100, or 0 for no input smoothing */
+  J_DCT_METHOD dct_method;     /* DCT algorithm selector */
+
+  /* The restart interval can be specified in absolute MCUs by setting
+   * restart_interval, or in MCU rows by setting restart_in_rows
+   * (in which case the correct restart_interval will be figured
+   * for each scan).
+   */
+  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
+  int restart_in_rows;         /* if > 0, MCU rows per restart interval */
+
+  /* Parameters controlling emission of special markers. */
+
+  boolean write_JFIF_header;   /* should a JFIF marker be written? */
+  UINT8 JFIF_major_version;    /* What to write for the JFIF version number */
+  UINT8 JFIF_minor_version;
+  /* These three values are not used by the JPEG code, merely copied */
+  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */
+  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */
+  /* ratio is defined by X_density/Y_density even when density_unit=0. */
+  UINT8 density_unit;          /* JFIF code for pixel size units */
+  UINT16 X_density;            /* Horizontal pixel density */
+  UINT16 Y_density;            /* Vertical pixel density */
+  boolean write_Adobe_marker;  /* should an Adobe marker be written? */
+  
+  /* State variable: index of next scanline to be written to
+   * jpeg_write_scanlines().  Application may use this to control its
+   * processing loop, e.g., "while (next_scanline < image_height)".
+   */
+
+  JDIMENSION next_scanline;    /* 0 .. image_height-1  */
+
+  /* Remaining fields are known throughout compressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during compression startup
+   */
+  boolean progressive_mode;    /* TRUE if scan script uses progressive mode */
+  int max_h_samp_factor;       /* largest h_samp_factor */
+  int max_v_samp_factor;       /* largest v_samp_factor */
+
+  int min_DCT_h_scaled_size;   /* smallest DCT_h_scaled_size of any component */
+  int min_DCT_v_scaled_size;   /* smallest DCT_v_scaled_size of any component */
+
+  JDIMENSION total_iMCU_rows;  /* # of iMCU rows to be input to coef ctlr */
+  /* The coefficient controller receives data in units of MCU rows as defined
+   * for fully interleaved scans (whether the JPEG file is interleaved or not).
+   * There are v_samp_factor * DCTSIZE sample rows of each component in an
+   * "iMCU" (interleaved MCU) row.
+   */
+  
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   */
+  int comps_in_scan;           /* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+  
+  JDIMENSION MCUs_per_row;     /* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+  
+  int blocks_in_MCU;           /* # of DCT blocks per MCU */
+  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;          /* progressive JPEG parameters for scan */
+
+  int block_size;              /* the basic DCT block size: 1..16 */
+  const int * natural_order;   /* natural-order position array */
+  int lim_Se;                  /* min( Se, DCTSIZE2-1 ) */
+
+  /*
+   * Links to compression subobjects (methods and private variables of modules)
+   */
+  struct jpeg_comp_master * master;
+  struct jpeg_c_main_controller * main;
+  struct jpeg_c_prep_controller * prep;
+  struct jpeg_c_coef_controller * coef;
+  struct jpeg_marker_writer * marker;
+  struct jpeg_color_converter * cconvert;
+  struct jpeg_downsampler * downsample;
+  struct jpeg_forward_dct * fdct;
+  struct jpeg_entropy_encoder * entropy;
+  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
+  int script_space_size;
+};
+
+
+/* Master record for a decompression instance */
+
+struct jpeg_decompress_struct {
+  jpeg_common_fields;          /* Fields shared with jpeg_compress_struct */
+
+  /* Source of compressed data */
+  struct jpeg_source_mgr * src;
+
+  /* Basic description of image --- filled in by jpeg_read_header(). */
+  /* Application may inspect these values to decide how to process image. */
+
+  JDIMENSION image_width;      /* nominal image width (from SOF marker) */
+  JDIMENSION image_height;     /* nominal image height */
+  int num_components;          /* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  /* Decompression processing parameters --- these fields must be set before
+   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes
+   * them to default values.
+   */
+
+  J_COLOR_SPACE out_color_space; /* colorspace for output */
+
+  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+  double output_gamma;         /* image gamma wanted in output */
+
+  boolean buffered_image;      /* TRUE=multiple output passes */
+  boolean raw_data_out;                /* TRUE=downsampled data wanted */
+
+  J_DCT_METHOD dct_method;     /* IDCT algorithm selector */
+  boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
+  boolean do_block_smoothing;  /* TRUE=apply interblock smoothing */
+
+  boolean quantize_colors;     /* TRUE=colormapped output wanted */
+  /* the following are ignored if not quantize_colors: */
+  J_DITHER_MODE dither_mode;   /* type of color dithering to use */
+  boolean two_pass_quantize;   /* TRUE=use two-pass color quantization */
+  int desired_number_of_colors;        /* max # colors to use in created colormap */
+  /* these are significant only in buffered-image mode: */
+  boolean enable_1pass_quant;  /* enable future use of 1-pass quantizer */
+  boolean enable_external_quant;/* enable future use of external colormap */
+  boolean enable_2pass_quant;  /* enable future use of 2-pass quantizer */
+
+  /* Description of actual output image that will be returned to application.
+   * These fields are computed by jpeg_start_decompress().
+   * You can also use jpeg_calc_output_dimensions() to determine these values
+   * in advance of calling jpeg_start_decompress().
+   */
+
+  JDIMENSION output_width;     /* scaled image width */
+  JDIMENSION output_height;    /* scaled image height */
+  int out_color_components;    /* # of color components in out_color_space */
+  int output_components;       /* # of color components returned */
+  /* output_components is 1 (a colormap index) when quantizing colors;
+   * otherwise it equals out_color_components.
+   */
+  int rec_outbuf_height;       /* min recommended height of scanline buffer */
+  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+   * high, space and time will be wasted due to unnecessary data copying.
+   * Usually rec_outbuf_height will be 1 or 2, at most 4.
+   */
+
+  /* When quantizing colors, the output colormap is described by these fields.
+   * The application can supply a colormap by setting colormap non-NULL before
+   * calling jpeg_start_decompress; otherwise a colormap is created during
+   * jpeg_start_decompress or jpeg_start_output.
+   * The map has out_color_components rows and actual_number_of_colors columns.
+   */
+  int actual_number_of_colors; /* number of entries in use */
+  JSAMPARRAY colormap;         /* The color map as a 2-D pixel array */
+
+  /* State variables: these variables indicate the progress of decompression.
+   * The application may examine these but must not modify them.
+   */
+
+  /* Row index of next scanline to be read from jpeg_read_scanlines().
+   * Application may use this to control its processing loop, e.g.,
+   * "while (output_scanline < output_height)".
+   */
+  JDIMENSION output_scanline;  /* 0 .. output_height-1  */
+
+  /* Current input scan number and number of iMCU rows completed in scan.
+   * These indicate the progress of the decompressor input side.
+   */
+  int input_scan_number;       /* Number of SOS markers seen so far */
+  JDIMENSION input_iMCU_row;   /* Number of iMCU rows completed */
+
+  /* The "output scan number" is the notional scan being displayed by the
+   * output side.  The decompressor will not allow output scan/row number
+   * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+   */
+  int output_scan_number;      /* Nominal scan number being displayed */
+  JDIMENSION output_iMCU_row;  /* Number of iMCU rows read */
+
+  /* Current progression status.  coef_bits[c][i] indicates the precision
+   * with which component c's DCT coefficient i (in zigzag order) is known.
+   * It is -1 when no data has yet been received, otherwise it is the point
+   * transform (shift) value for the most recent scan of the coefficient
+   * (thus, 0 at completion of the progression).
+   * This pointer is NULL when reading a non-progressive file.
+   */
+  int (*coef_bits)[DCTSIZE2];  /* -1 or current Al value for each coef */
+
+  /* Internal JPEG parameters --- the application usually need not look at
+   * these fields.  Note that the decompressor output side may not use
+   * any parameters that can change between scans.
+   */
+
+  /* Quantization and Huffman tables are carried forward across input
+   * datastreams when processing abbreviated JPEG datastreams.
+   */
+
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+
+  /* These parameters are never carried across datastreams, since they
+   * are given in SOF/SOS markers or defined to be reset by SOI.
+   */
+
+  int data_precision;          /* bits of precision in image data */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+
+  boolean is_baseline;         /* TRUE if Baseline SOF0 encountered */
+  boolean progressive_mode;    /* TRUE if SOFn specifies progressive mode */
+  boolean arith_code;          /* TRUE=arithmetic coding, FALSE=Huffman */
+
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+  /* These fields record data obtained from optional markers recognized by
+   * the JPEG library.
+   */
+  boolean saw_JFIF_marker;     /* TRUE iff a JFIF APP0 marker was found */
+  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
+  UINT8 JFIF_major_version;    /* JFIF version number */
+  UINT8 JFIF_minor_version;
+  UINT8 density_unit;          /* JFIF code for pixel size units */
+  UINT16 X_density;            /* Horizontal pixel density */
+  UINT16 Y_density;            /* Vertical pixel density */
+  boolean saw_Adobe_marker;    /* TRUE iff an Adobe APP14 marker was found */
+  UINT8 Adobe_transform;       /* Color transform code from Adobe marker */
+
+  boolean CCIR601_sampling;    /* TRUE=first samples are cosited */
+
+  /* Aside from the specific data retained from APPn markers known to the
+   * library, the uninterpreted contents of any or all APPn and COM markers
+   * can be saved in a list for examination by the application.
+   */
+  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
+
+  /* Remaining fields are known throughout decompressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during decompression startup
+   */
+  int max_h_samp_factor;       /* largest h_samp_factor */
+  int max_v_samp_factor;       /* largest v_samp_factor */
+
+  int min_DCT_h_scaled_size;   /* smallest DCT_h_scaled_size of any component */
+  int min_DCT_v_scaled_size;   /* smallest DCT_v_scaled_size of any component */
+
+  JDIMENSION total_iMCU_rows;  /* # of iMCU rows in image */
+  /* The coefficient controller's input and output progress is measured in
+   * units of "iMCU" (interleaved MCU) rows.  These are the same as MCU rows
+   * in fully interleaved JPEG scans, but are used whether the scan is
+   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block
+   * rows of each component.  Therefore, the IDCT output contains
+   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
+   */
+
+  JSAMPLE * sample_range_limit; /* table for fast range-limiting */
+
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   * Note that the decompressor output side must not use these fields.
+   */
+  int comps_in_scan;           /* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+  JDIMENSION MCUs_per_row;     /* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+  int blocks_in_MCU;           /* # of DCT blocks per MCU */
+  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;          /* progressive JPEG parameters for scan */
+
+  /* These fields are derived from Se of first SOS marker.
+   */
+  int block_size;              /* the basic DCT block size: 1..16 */
+  const int * natural_order; /* natural-order position array for entropy decode */
+  int lim_Se;                  /* min( Se, DCTSIZE2-1 ) for entropy decode */
+
+  /* This field is shared between entropy decoder and marker parser.
+   * It is either zero or the code of a JPEG marker that has been
+   * read from the data source, but has not yet been processed.
+   */
+  int unread_marker;
+
+  /*
+   * Links to decompression subobjects (methods, private variables of modules)
+   */
+  struct jpeg_decomp_master * master;
+  struct jpeg_d_main_controller * main;
+  struct jpeg_d_coef_controller * coef;
+  struct jpeg_d_post_controller * post;
+  struct jpeg_input_controller * inputctl;
+  struct jpeg_marker_reader * marker;
+  struct jpeg_entropy_decoder * entropy;
+  struct jpeg_inverse_dct * idct;
+  struct jpeg_upsampler * upsample;
+  struct jpeg_color_deconverter * cconvert;
+  struct jpeg_color_quantizer * cquantize;
+};
+
+
+/* "Object" declarations for JPEG modules that may be supplied or called
+ * directly by the surrounding application.
+ * As with all objects in the JPEG library, these structs only define the
+ * publicly visible methods and state variables of a module.  Additional
+ * private fields may exist after the public ones.
+ */
+
+
+/* Error handler object */
+
+struct jpeg_error_mgr {
+  /* Error exit handler: does not return to caller */
+  JMETHOD(void, error_exit, (j_common_ptr cinfo));
+  /* Conditionally emit a trace or warning message */
+  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
+  /* Routine that actually outputs a trace or error message */
+  JMETHOD(void, output_message, (j_common_ptr cinfo));
+  /* Format a message string for the most recent JPEG error or message */
+  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
+#define JMSG_LENGTH_MAX  200   /* recommended size of format_message buffer */
+  /* Reset error state variables at start of a new image */
+  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
+  
+  /* The message ID code and any parameters are saved here.
+   * A message can have one string parameter or up to 8 int parameters.
+   */
+  int msg_code;
+#define JMSG_STR_PARM_MAX  80
+  union {
+    int i[8];
+    char s[JMSG_STR_PARM_MAX];
+  } msg_parm;
+  
+  /* Standard state variables for error facility */
+  
+  int trace_level;             /* max msg_level that will be displayed */
+  
+  /* For recoverable corrupt-data errors, we emit a warning message,
+   * but keep going unless emit_message chooses to abort.  emit_message
+   * should count warnings in num_warnings.  The surrounding application
+   * can check for bad data by seeing if num_warnings is nonzero at the
+   * end of processing.
+   */
+  long num_warnings;           /* number of corrupt-data warnings */
+
+  /* These fields point to the table(s) of error message strings.
+   * An application can change the table pointer to switch to a different
+   * message list (typically, to change the language in which errors are
+   * reported).  Some applications may wish to add additional error codes
+   * that will be handled by the JPEG library error mechanism; the second
+   * table pointer is used for this purpose.
+   *
+   * First table includes all errors generated by JPEG library itself.
+   * Error code 0 is reserved for a "no such error string" message.
+   */
+  const char * const * jpeg_message_table; /* Library errors */
+  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */
+  /* Second table can be added by application (see cjpeg/djpeg for example).
+   * It contains strings numbered first_addon_message..last_addon_message.
+   */
+  const char * const * addon_message_table; /* Non-library errors */
+  int first_addon_message;     /* code for first string in addon table */
+  int last_addon_message;      /* code for last string in addon table */
+};
+
+
+/* Progress monitor object */
+
+struct jpeg_progress_mgr {
+  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
+
+  long pass_counter;           /* work units completed in this pass */
+  long pass_limit;             /* total number of work units in this pass */
+  int completed_passes;                /* passes completed so far */
+  int total_passes;            /* total number of passes expected */
+};
+
+
+/* Data destination object for compression */
+
+struct jpeg_destination_mgr {
+  JOCTET * next_output_byte;   /* => next byte to write in buffer */
+  size_t free_in_buffer;       /* # of byte spaces remaining in buffer */
+
+  JMETHOD(void, init_destination, (j_compress_ptr cinfo));
+  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
+  JMETHOD(void, term_destination, (j_compress_ptr cinfo));
+};
+
+
+/* Data source object for decompression */
+
+struct jpeg_source_mgr {
+  const JOCTET * next_input_byte; /* => next byte to read from buffer */
+  size_t bytes_in_buffer;      /* # of bytes remaining in buffer */
+
+  JMETHOD(void, init_source, (j_decompress_ptr cinfo));
+  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
+  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
+  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
+  JMETHOD(void, term_source, (j_decompress_ptr cinfo));
+};
+
+
+/* Memory manager object.
+ * Allocates "small" objects (a few K total), "large" objects (tens of K),
+ * and "really big" objects (virtual arrays with backing store if needed).
+ * The memory manager does not allow individual objects to be freed; rather,
+ * each created object is assigned to a pool, and whole pools can be freed
+ * at once.  This is faster and more convenient than remembering exactly what
+ * to free, especially where malloc()/free() are not too speedy.
+ * NB: alloc routines never return NULL.  They exit to error_exit if not
+ * successful.
+ */
+
+#define JPOOL_PERMANENT        0       /* lasts until master record is destroyed */
+#define JPOOL_IMAGE    1       /* lasts until done with image/datastream */
+#define JPOOL_NUMPOOLS 2
+
+typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
+typedef struct jvirt_barray_control * jvirt_barray_ptr;
+
+
+struct jpeg_memory_mgr {
+  /* Method pointers */
+  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
+                               size_t sizeofobject));
+  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
+                                    size_t sizeofobject));
+  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
+                                    JDIMENSION samplesperrow,
+                                    JDIMENSION numrows));
+  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
+                                     JDIMENSION blocksperrow,
+                                     JDIMENSION numrows));
+  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
+                                                 int pool_id,
+                                                 boolean pre_zero,
+                                                 JDIMENSION samplesperrow,
+                                                 JDIMENSION numrows,
+                                                 JDIMENSION maxaccess));
+  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
+                                                 int pool_id,
+                                                 boolean pre_zero,
+                                                 JDIMENSION blocksperrow,
+                                                 JDIMENSION numrows,
+                                                 JDIMENSION maxaccess));
+  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
+  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
+                                          jvirt_sarray_ptr ptr,
+                                          JDIMENSION start_row,
+                                          JDIMENSION num_rows,
+                                          boolean writable));
+  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
+                                           jvirt_barray_ptr ptr,
+                                           JDIMENSION start_row,
+                                           JDIMENSION num_rows,
+                                           boolean writable));
+  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
+  JMETHOD(void, self_destruct, (j_common_ptr cinfo));
+
+  /* Limit on memory allocation for this JPEG object.  (Note that this is
+   * merely advisory, not a guaranteed maximum; it only affects the space
+   * used for virtual-array buffers.)  May be changed by outer application
+   * after creating the JPEG object.
+   */
+  long max_memory_to_use;
+
+  /* Maximum allocation request accepted by alloc_large. */
+  long max_alloc_chunk;
+};
+
+
+/* Routine signature for application-supplied marker processing methods.
+ * Need not pass marker code since it is stored in cinfo->unread_marker.
+ */
+typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
+
+
+/* Declarations for routines called by application.
+ * The JPP macro hides prototype parameters from compilers that can't cope.
+ * Note JPP requires double parentheses.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JPP(arglist)   arglist
+#else
+#define JPP(arglist)   ()
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers.
+ * We shorten external names to be unique in the first six letters, which
+ * is good enough for all known systems.
+ * (If your compiler itself needs names to be unique in less than 15 
+ * characters, you are out of luck.  Get a better compiler.)
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_error         jStdError
+#define jpeg_CreateCompress    jCreaCompress
+#define jpeg_CreateDecompress  jCreaDecompress
+#define jpeg_destroy_compress  jDestCompress
+#define jpeg_destroy_decompress        jDestDecompress
+#define jpeg_stdio_dest                jStdDest
+#define jpeg_stdio_src         jStdSrc
+#define jpeg_mem_dest          jMemDest
+#define jpeg_mem_src           jMemSrc
+#define jpeg_set_defaults      jSetDefaults
+#define jpeg_set_colorspace    jSetColorspace
+#define jpeg_default_colorspace        jDefColorspace
+#define jpeg_set_quality       jSetQuality
+#define jpeg_set_linear_quality        jSetLQuality
+#define jpeg_default_qtables   jDefQTables
+#define jpeg_add_quant_table   jAddQuantTable
+#define jpeg_quality_scaling   jQualityScaling
+#define jpeg_simple_progression        jSimProgress
+#define jpeg_suppress_tables   jSuppressTables
+#define jpeg_alloc_quant_table jAlcQTable
+#define jpeg_alloc_huff_table  jAlcHTable
+#define jpeg_start_compress    jStrtCompress
+#define jpeg_write_scanlines   jWrtScanlines
+#define jpeg_finish_compress   jFinCompress
+#define jpeg_calc_jpeg_dimensions      jCjpegDimensions
+#define jpeg_write_raw_data    jWrtRawData
+#define jpeg_write_marker      jWrtMarker
+#define jpeg_write_m_header    jWrtMHeader
+#define jpeg_write_m_byte      jWrtMByte
+#define jpeg_write_tables      jWrtTables
+#define jpeg_read_header       jReadHeader
+#define jpeg_start_decompress  jStrtDecompress
+#define jpeg_read_scanlines    jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
+#define jpeg_read_raw_data     jReadRawData
+#define jpeg_has_multiple_scans        jHasMultScn
+#define jpeg_start_output      jStrtOutput
+#define jpeg_finish_output     jFinOutput
+#define jpeg_input_complete    jInComplete
+#define jpeg_new_colormap      jNewCMap
+#define jpeg_consume_input     jConsumeInput
+#define jpeg_core_output_dimensions    jCoreDimensions
+#define jpeg_calc_output_dimensions    jCalcDimensions
+#define jpeg_save_markers      jSaveMarkers
+#define jpeg_set_marker_processor      jSetMarker
+#define jpeg_read_coefficients jReadCoefs
+#define jpeg_write_coefficients        jWrtCoefs
+#define jpeg_copy_critical_parameters  jCopyCrit
+#define jpeg_abort_compress    jAbrtCompress
+#define jpeg_abort_decompress  jAbrtDecompress
+#define jpeg_abort             jAbort
+#define jpeg_destroy           jDestroy
+#define jpeg_resync_to_restart jResyncRestart
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Default error-management setup */
+EXTERN(struct jpeg_error_mgr *) jpeg_std_error
+       JPP((struct jpeg_error_mgr * err));
+
+/* Initialization of JPEG compression objects.
+ * jpeg_create_compress() and jpeg_create_decompress() are the exported
+ * names that applications should call.  These expand to calls on
+ * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
+ * passed for version mismatch checking.
+ * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
+ */
+#define jpeg_create_compress(cinfo) \
+    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
+                       (size_t) sizeof(struct jpeg_compress_struct))
+#define jpeg_create_decompress(cinfo) \
+    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
+                         (size_t) sizeof(struct jpeg_decompress_struct))
+EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
+                                     int version, size_t structsize));
+EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
+                                       int version, size_t structsize));
+/* Destruction of JPEG compression objects */
+EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
+
+/* Standard data source and destination managers: stdio streams. */
+/* Caller is responsible for opening the file before and closing after. */
+EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
+EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
+
+/* Data source and destination managers: memory buffers. */
+EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+                              unsigned char ** outbuffer,
+                              unsigned long * outsize));
+EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
+                             unsigned char * inbuffer,
+                             unsigned long insize));
+
+/* Default parameter setup for compression */
+EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
+/* Compression parameter setup aids */
+EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
+                                     J_COLOR_SPACE colorspace));
+EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
+                                  boolean force_baseline));
+EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
+                                         int scale_factor,
+                                         boolean force_baseline));
+EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,
+                                      boolean force_baseline));
+EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
+                                      const unsigned int *basic_table,
+                                      int scale_factor,
+                                      boolean force_baseline));
+EXTERN(int) jpeg_quality_scaling JPP((int quality));
+EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
+                                      boolean suppress));
+EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
+EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
+
+/* Main entry points for compression */
+EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+                                     boolean write_all_tables));
+EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
+                                            JSAMPARRAY scanlines,
+                                            JDIMENSION num_lines));
+EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
+
+/* Precalculate JPEG dimensions for current compression parameters. */
+EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));
+
+/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
+                                           JSAMPIMAGE data,
+                                           JDIMENSION num_lines));
+
+/* Write a special marker.  See libjpeg.txt concerning safe usage. */
+EXTERN(void) jpeg_write_marker
+       JPP((j_compress_ptr cinfo, int marker,
+            const JOCTET * dataptr, unsigned int datalen));
+/* Same, but piecemeal. */
+EXTERN(void) jpeg_write_m_header
+       JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
+EXTERN(void) jpeg_write_m_byte
+       JPP((j_compress_ptr cinfo, int val));
+
+/* Alternate compression function: just write an abbreviated table file */
+EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
+
+/* Decompression startup: read start of JPEG datastream to see what's there */
+EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
+                                 boolean require_image));
+/* Return value is one of: */
+#define JPEG_SUSPENDED         0 /* Suspended due to lack of input data */
+#define JPEG_HEADER_OK         1 /* Found valid image datastream */
+#define JPEG_HEADER_TABLES_ONLY        2 /* Found valid table-specs-only datastream */
+/* If you pass require_image = TRUE (normal case), you need not check for
+ * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
+ * JPEG_SUSPENDED is only possible if you use a data source module that can
+ * give a suspension return (the stdio source module doesn't).
+ */
+
+/* Main entry points for decompression */
+EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
+                                           JSAMPARRAY scanlines,
+                                           JDIMENSION max_lines));
+EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
+
+/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
+                                          JSAMPIMAGE data,
+                                          JDIMENSION max_lines));
+
+/* Additional entry points for buffered-image mode. */
+EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
+                                      int scan_number));
+EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
+EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
+/* Return value is one of: */
+/* #define JPEG_SUSPENDED      0    Suspended due to lack of input data */
+#define JPEG_REACHED_SOS       1 /* Reached start of new scan */
+#define JPEG_REACHED_EOI       2 /* Reached end of image */
+#define JPEG_ROW_COMPLETED     3 /* Completed one iMCU row */
+#define JPEG_SCAN_COMPLETED    4 /* Completed last iMCU row of a scan */
+
+/* Precalculate output dimensions for current decompression parameters. */
+EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
+
+/* Control saving of COM and APPn markers into marker_list. */
+EXTERN(void) jpeg_save_markers
+       JPP((j_decompress_ptr cinfo, int marker_code,
+            unsigned int length_limit));
+
+/* Install a special processing method for COM or APPn markers. */
+EXTERN(void) jpeg_set_marker_processor
+       JPP((j_decompress_ptr cinfo, int marker_code,
+            jpeg_marker_parser_method routine));
+
+/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
+EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
+                                         jvirt_barray_ptr * coef_arrays));
+EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
+                                               j_compress_ptr dstinfo));
+
+/* If you choose to abort compression or decompression before completing
+ * jpeg_finish_(de)compress, then you need to clean up to release memory,
+ * temporary files, etc.  You can just call jpeg_destroy_(de)compress
+ * if you're done with the JPEG object, but if you want to clean it up and
+ * reuse it, call this:
+ */
+EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
+
+/* Generic versions of jpeg_abort and jpeg_destroy that work on either
+ * flavor of JPEG object.  These may be more convenient in some places.
+ */
+EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
+
+/* Default restart-marker-resync procedure for use by data source modules */
+EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
+                                           int desired));
+
+
+/* These marker codes are exported since applications and data source modules
+ * are likely to want to use them.
+ */
+
+#define JPEG_RST0      0xD0    /* RST0 marker code */
+#define JPEG_EOI       0xD9    /* EOI marker code */
+#define JPEG_APP0      0xE0    /* APP0 marker code */
+#define JPEG_COM       0xFE    /* COM marker code */
+
+
+/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
+ * for structure definitions that are never filled in, keep it quiet by
+ * supplying dummy definitions for the various substructures.
+ */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef JPEG_INTERNALS         /* will be defined in jpegint.h */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+struct jpeg_comp_master { long dummy; };
+struct jpeg_c_main_controller { long dummy; };
+struct jpeg_c_prep_controller { long dummy; };
+struct jpeg_c_coef_controller { long dummy; };
+struct jpeg_marker_writer { long dummy; };
+struct jpeg_color_converter { long dummy; };
+struct jpeg_downsampler { long dummy; };
+struct jpeg_forward_dct { long dummy; };
+struct jpeg_entropy_encoder { long dummy; };
+struct jpeg_decomp_master { long dummy; };
+struct jpeg_d_main_controller { long dummy; };
+struct jpeg_d_coef_controller { long dummy; };
+struct jpeg_d_post_controller { long dummy; };
+struct jpeg_input_controller { long dummy; };
+struct jpeg_marker_reader { long dummy; };
+struct jpeg_entropy_decoder { long dummy; };
+struct jpeg_inverse_dct { long dummy; };
+struct jpeg_upsampler { long dummy; };
+struct jpeg_color_deconverter { long dummy; };
+struct jpeg_color_quantizer { long dummy; };
+#endif /* JPEG_INTERNALS */
+#endif /* INCOMPLETE_TYPES_BROKEN */
+
+
+/*
+ * The JPEG library modules define JPEG_INTERNALS before including this file.
+ * The internal structure declarations are read only when that is true.
+ * Applications using the library should not include jpegint.h, but may wish
+ * to include jerror.h.
+ */
+
+#ifdef JPEG_INTERNALS
+#include "jpegint.h"           /* fetch private declarations */
+#include "jerror.h"            /* fetch error codes too */
+#endif
+
+#ifdef __cplusplus
+#ifndef DONT_USE_EXTERN_C
+}
+#endif
+#endif
+
+#endif /* JPEGLIB_H */
diff --git a/misc/builddeps/dp.linux64/lib/libjpeg.a b/misc/builddeps/dp.linux64/lib/libjpeg.a
new file mode 100644 (file)
index 0000000..a1820f3
Binary files /dev/null and b/misc/builddeps/dp.linux64/lib/libjpeg.a differ
diff --git a/misc/builddeps/dp.linux64/lib/libjpeg.la b/misc/builddeps/dp.linux64/lib/libjpeg.la
new file mode 100755 (executable)
index 0000000..577cd45
--- /dev/null
@@ -0,0 +1,41 @@
+# libjpeg.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6b
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libjpeg.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libjpeg.
+current=8
+age=0
+revision=2
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/home/rpolzer/dp.linux64/lib'
diff --git a/misc/builddeps/dp.linux64/lib/libmodplug.a b/misc/builddeps/dp.linux64/lib/libmodplug.a
new file mode 100644 (file)
index 0000000..1d73502
Binary files /dev/null and b/misc/builddeps/dp.linux64/lib/libmodplug.a differ
index def35f40840af99ef6bf431a8ff71ac5f6d610dc..ad2ee9b462c34dd282d4999c58e8bd636f11f653 100755 (executable)
@@ -5,13 +5,13 @@
 # It is necessary for linking the library.
 
 # The name that we can dlopen(3).
-dlname='libmodplug.so.1'
+dlname=''
 
 # Names of this library.
-library_names='libmodplug.so.1.0.0 libmodplug.so.1 libmodplug.so'
+library_names=''
 
 # The name of the static archive.
-old_library=''
+old_library='libmodplug.a'
 
 # Linker flags that can not go in dependency_libs.
 inherited_linker_flags=''
@@ -38,4 +38,4 @@ dlopen=''
 dlpreopen=''
 
 # Directory that this library needs to be installed in:
-libdir='/home/rpolzer/Games/Xonotic/misc/builddeps/dp.linux64/lib'
+libdir='/home/rpolzer/dp.linux64/lib'
diff --git a/misc/builddeps/dp.linux64/lib/libmodplug.so b/misc/builddeps/dp.linux64/lib/libmodplug.so
deleted file mode 120000 (symlink)
index a123b08..0000000
+++ /dev/null
@@ -1 +0,0 @@
-libmodplug.so.1.0.0
\ No newline at end of file
diff --git a/misc/builddeps/dp.linux64/lib/libmodplug.so.1 b/misc/builddeps/dp.linux64/lib/libmodplug.so.1
deleted file mode 120000 (symlink)
index a123b08..0000000
+++ /dev/null
@@ -1 +0,0 @@
-libmodplug.so.1.0.0
\ No newline at end of file
diff --git a/misc/builddeps/dp.linux64/lib/libmodplug.so.1.0.0 b/misc/builddeps/dp.linux64/lib/libmodplug.so.1.0.0
deleted file mode 100755 (executable)
index 4f58de2..0000000
Binary files a/misc/builddeps/dp.linux64/lib/libmodplug.so.1.0.0 and /dev/null differ
index 50a2cd71b1c0172e7912b5626b4cc6d30d0ac9e2..6d3e967e5d0c8dc8bb0f00f526bef3c5ee35c1e6 100644 (file)
@@ -1,4 +1,4 @@
-prefix=/home/rpolzer/Games/Xonotic/misc/builddeps/dp.linux64
+prefix=/home/rpolzer/dp.linux64
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
 includedir=${prefix}/include
diff --git a/misc/builddeps/dp.linux64/share/man/man1/cjpeg.1 b/misc/builddeps/dp.linux64/share/man/man1/cjpeg.1
new file mode 100644 (file)
index 0000000..01bfa25
--- /dev/null
@@ -0,0 +1,325 @@
+.TH CJPEG 1 "30 December 2009"
+.SH NAME
+cjpeg \- compress an image file to a JPEG file
+.SH SYNOPSIS
+.B cjpeg
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B cjpeg
+compresses the named image file, or the standard input if no file is
+named, and produces a JPEG/JFIF file on the standard output.
+The currently supported input file formats are: PPM (PBMPLUS color
+format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster
+Toolkit format).  (RLE is supported only if the URT library is available.)
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-grayscale
+may be written
+.B \-gray
+or
+.BR \-gr .
+Most of the "basic" switches can be abbreviated to as little as one letter.
+Upper and lower case are equivalent (thus
+.B \-BMP
+is the same as
+.BR \-bmp ).
+British spellings are also accepted (e.g.,
+.BR \-greyscale ),
+though for brevity these are not mentioned below.
+.PP
+The basic switches are:
+.TP
+.BI \-quality " N[,...]"
+Scale quantization tables to adjust image quality.  Quality is 0 (worst) to
+100 (best); default is 75.  (See below for more info.)
+.TP
+.B \-grayscale
+Create monochrome JPEG file from color input.  Be sure to use this switch when
+compressing a grayscale BMP file, because
+.B cjpeg
+isn't bright enough to notice whether a BMP file uses only shades of gray.
+By saying
+.BR \-grayscale ,
+you'll get a smaller JPEG file that takes less time to process.
+.TP
+.B \-optimize
+Perform optimization of entropy encoding parameters.  Without this, default
+encoding parameters are used.
+.B \-optimize
+usually makes the JPEG file a little smaller, but
+.B cjpeg
+runs somewhat slower and needs much more memory.  Image quality and speed of
+decompression are unaffected by
+.BR \-optimize .
+.TP
+.B \-progressive
+Create progressive JPEG file (see below).
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.  Currently supported scale factors are
+8/N with all N from 1 to 16.
+.TP
+.B \-targa
+Input file is Targa format.  Targa files that contain an "identification"
+field will not be automatically recognized by
+.BR cjpeg ;
+for such files you must specify
+.B \-targa
+to make
+.B cjpeg
+treat the input as Targa format.
+For most Targa files, you won't need this switch.
+.PP
+The
+.B \-quality
+switch lets you trade off compressed file size against quality of the
+reconstructed image: the higher the quality setting, the larger the JPEG file,
+and the closer the output image will be to the original input.  Normally you
+want to use the lowest quality setting (smallest file) that decompresses into
+something visually indistinguishable from the original image.  For this
+purpose the quality setting should be between 50 and 95; the default of 75 is
+often about right.  If you see defects at
+.B \-quality
+75, then go up 5 or 10 counts at a time until you are happy with the output
+image.  (The optimal setting will vary from one image to another.)
+.PP
+.B \-quality
+100 will generate a quantization table of all 1's, minimizing loss in the
+quantization step (but there is still information loss in subsampling, as well
+as roundoff error).  This setting is mainly of interest for experimental
+purposes.  Quality values above about 95 are
+.B not
+recommended for normal use; the compressed file size goes up dramatically for
+hardly any gain in output image quality.
+.PP
+In the other direction, quality values below 50 will produce very small files
+of low image quality.  Settings around 5 to 10 might be useful in preparing an
+index of a large image library, for example.  Try
+.B \-quality
+2 (or so) for some amusing Cubist effects.  (Note: quality
+values below about 25 generate 2-byte quantization tables, which are
+considered optional in the JPEG standard.
+.B cjpeg
+emits a warning message when you give such a quality value, because some
+other JPEG programs may be unable to decode the resulting file.  Use
+.B \-baseline
+if you need to ensure compatibility at low quality values.)
+.PP
+The
+.B \-quality
+option has been extended in IJG version 7 for support of separate quality
+settings for luminance and chrominance (or in general, for every provided
+quantization table slot).  This feature is useful for high-quality
+applications which cannot accept the damage of color data by coarse
+subsampling settings.  You can now easily reduce the color data amount more
+smoothly with finer control without separate subsampling.  The resulting file
+is fully compliant with standard JPEG decoders.
+Note that the
+.B \-quality
+ratings refer to the quantization table slots, and that the last value is
+replicated if there are more q-table slots than parameters.  The default
+q-table slots are 0 for luminance and 1 for chrominance with default tables as
+given in the JPEG standard.  This is compatible with the old behaviour in case
+that only one parameter is given, which is then used for both luminance and
+chrominance (slots 0 and 1).  More or custom quantization tables can be set
+with
+.B \-qtables
+and assigned to components with
+.B \-qslots
+parameter (see the "wizard" switches below).
+.B Caution:
+You must explicitly add
+.BI \-sample " 1x1"
+for efficient separate color
+quality selection, since the default value used by library is 2x2!
+.PP
+The
+.B \-progressive
+switch creates a "progressive JPEG" file.  In this type of JPEG file, the data
+is stored in multiple scans of increasing quality.  If the file is being
+transmitted over a slow communications link, the decoder can use the first
+scan to display a low-quality image very quickly, and can then improve the
+display with each subsequent scan.  The final image is exactly equivalent to a
+standard JPEG file of the same quality setting, and the total file size is
+about the same --- often a little smaller.
+.PP
+Switches for advanced users:
+.TP
+.B \-dct int
+Use integer DCT method (default).
+.TP
+.B \-dct fast
+Use fast integer DCT (less accurate).
+.TP
+.B \-dct float
+Use floating-point DCT method.
+The float method is very slightly more accurate than the int method, but is
+much slower unless your machine has very fast floating-point hardware.  Also
+note that results of the floating-point method may vary slightly across
+machines, while the integer methods should give the same results everywhere.
+The fast integer method is much less accurate than the other two.
+.TP
+.B \-nosmooth
+Don't use high-quality downsampling.
+.TP
+.BI \-restart " N"
+Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
+attached to the number.
+.B \-restart 0
+(the default) means no restart markers.
+.TP
+.BI \-smooth " N"
+Smooth the input image to eliminate dithering noise.  N, ranging from 1 to
+100, indicates the strength of smoothing.  0 (the default) means no smoothing.
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.PP
+The
+.B \-restart
+option inserts extra markers that allow a JPEG decoder to resynchronize after
+a transmission error.  Without restart markers, any damage to a compressed
+file will usually ruin the image from the point of the error to the end of the
+image; with restart markers, the damage is usually confined to the portion of
+the image up to the next restart marker.  Of course, the restart markers
+occupy extra space.  We recommend
+.B \-restart 1
+for images that will be transmitted across unreliable networks such as Usenet.
+.PP
+The
+.B \-smooth
+option filters the input to eliminate fine-scale noise.  This is often useful
+when converting dithered images to JPEG: a moderate smoothing factor of 10 to
+50 gets rid of dithering patterns in the input file, resulting in a smaller
+JPEG file and a better-looking image.  Too large a smoothing factor will
+visibly blur the image, however.
+.PP
+Switches for wizards:
+.TP
+.B \-arithmetic
+Use arithmetic coding.
+.B Caution:
+arithmetic coded JPEG is not yet widely implemented, so many decoders will be
+unable to view an arithmetic coded JPEG file at all.
+.TP
+.B \-baseline
+Force baseline-compatible quantization tables to be generated.  This clamps
+quantization values to 8 bits even at low quality settings.  (This switch is
+poorly named, since it does not ensure that the output is actually baseline
+JPEG.  For example, you can use
+.B \-baseline
+and
+.B \-progressive
+together.)
+.TP
+.BI \-qtables " file"
+Use the quantization tables given in the specified text file.
+.TP
+.BI \-qslots " N[,...]"
+Select which quantization table to use for each color component.
+.TP
+.BI \-sample " HxV[,...]"
+Set JPEG sampling factors for each color component.
+.TP
+.BI \-scans " file"
+Use the scan script given in the specified text file.
+.PP
+The "wizard" switches are intended for experimentation with JPEG.  If you
+don't know what you are doing, \fBdon't use them\fR.  These switches are
+documented further in the file wizard.txt.
+.SH EXAMPLES
+.LP
+This example compresses the PPM file foo.ppm with a quality factor of
+60 and saves the output as foo.jpg:
+.IP
+.B cjpeg \-quality
+.I 60 foo.ppm
+.B >
+.I foo.jpg
+.SH HINTS
+Color GIF files are not the ideal input for JPEG; JPEG is really intended for
+compressing full-color (24-bit) images.  In particular, don't try to convert
+cartoons, line drawings, and other images that have only a few distinct
+colors.  GIF works great on these, JPEG does not.  If you want to convert a
+GIF to JPEG, you should experiment with
+.BR cjpeg 's
+.B \-quality
+and
+.B \-smooth
+options to get a satisfactory conversion.
+.B \-smooth 10
+or so is often helpful.
+.PP
+Avoid running an image through a series of JPEG compression/decompression
+cycles.  Image quality loss will accumulate; after ten or so cycles the image
+may be noticeably worse than it was after one cycle.  It's best to use a
+lossless format while manipulating an image, then convert to JPEG format when
+you are ready to file the image away.
+.PP
+The
+.B \-optimize
+option to
+.B cjpeg
+is worth using when you are making a "final" version for posting or archiving.
+It's also a win when you are using low quality settings to make very small
+JPEG files; the percentage improvement is often a lot more than it is on
+larger files.  (At present,
+.B \-optimize
+mode is always selected when generating progressive JPEG files.)
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+.BR ppm (5),
+.BR pgm (5)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+GIF input files are no longer supported, to avoid the Unisys LZW patent.
+(Conversion of GIF files to JPEG is usually a bad idea anyway.)
+.PP
+Not all variants of BMP and Targa file formats are supported.
+.PP
+The
+.B \-targa
+switch is not a bug, it's a feature.  (It would be a bug if the Targa format
+designers had not been clueless.)
diff --git a/misc/builddeps/dp.linux64/share/man/man1/djpeg.1 b/misc/builddeps/dp.linux64/share/man/man1/djpeg.1
new file mode 100644 (file)
index 0000000..f3722d1
--- /dev/null
@@ -0,0 +1,252 @@
+.TH DJPEG 1 "3 October 2009"
+.SH NAME
+djpeg \- decompress a JPEG file to an image file
+.SH SYNOPSIS
+.B djpeg
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B djpeg
+decompresses the named JPEG file, or the standard input if no file is named,
+and produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,
+GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
+(RLE is supported only if the URT library is available.)
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-grayscale
+may be written
+.B \-gray
+or
+.BR \-gr .
+Most of the "basic" switches can be abbreviated to as little as one letter.
+Upper and lower case are equivalent (thus
+.B \-BMP
+is the same as
+.BR \-bmp ).
+British spellings are also accepted (e.g.,
+.BR \-greyscale ),
+though for brevity these are not mentioned below.
+.PP
+The basic switches are:
+.TP
+.BI \-colors " N"
+Reduce image to at most N colors.  This reduces the number of colors used in
+the output image, so that it can be displayed on a colormapped display or
+stored in a colormapped file format.  For example, if you have an 8-bit
+display, you'd need to reduce to 256 or fewer colors.
+.TP
+.BI \-quantize " N"
+Same as
+.BR \-colors .
+.B \-colors
+is the recommended name,
+.B \-quantize
+is provided only for backwards compatibility.
+.TP
+.B \-fast
+Select recommended processing options for fast, low quality output.  (The
+default options are chosen for highest quality output.)  Currently, this is
+equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
+.TP
+.B \-grayscale
+Force gray-scale output even if JPEG file is color.  Useful for viewing on
+monochrome displays; also,
+.B djpeg
+runs noticeably faster in this mode.
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.  Currently supported scale factors are
+M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
+baseline JPEG.  If the /N part is omitted, then M specifies the DCT scaled
+size to be applied on the given input.  For baseline JPEG this is equivalent
+to M/8 scaling, since the source DCT size for baseline JPEG is 8.
+Scaling is handy if the image is larger than your screen; also,
+.B djpeg
+runs much faster when scaling down the output.
+.TP
+.B \-bmp
+Select BMP output format (Windows flavor).  8-bit colormapped format is
+emitted if
+.B \-colors
+or
+.B \-grayscale
+is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
+format is emitted.
+.TP
+.B \-gif
+Select GIF output format.  Since GIF does not support more than 256 colors,
+.B \-colors 256
+is assumed (unless you specify a smaller number of colors).
+.TP
+.B \-os2
+Select BMP output format (OS/2 1.x flavor).  8-bit colormapped format is
+emitted if
+.B \-colors
+or
+.B \-grayscale
+is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
+format is emitted.
+.TP
+.B \-pnm
+Select PBMPLUS (PPM/PGM) output format (this is the default format).
+PGM is emitted if the JPEG file is gray-scale or if
+.B \-grayscale
+is specified; otherwise PPM is emitted.
+.TP
+.B \-rle
+Select RLE output format.  (Requires URT library.)
+.TP
+.B \-targa
+Select Targa output format.  Gray-scale format is emitted if the JPEG file is
+gray-scale or if
+.B \-grayscale
+is specified; otherwise, colormapped format is emitted if
+.B \-colors
+is specified; otherwise, 24-bit full-color format is emitted.
+.PP
+Switches for advanced users:
+.TP
+.B \-dct int
+Use integer DCT method (default).
+.TP
+.B \-dct fast
+Use fast integer DCT (less accurate).
+.TP
+.B \-dct float
+Use floating-point DCT method.
+The float method is very slightly more accurate than the int method, but is
+much slower unless your machine has very fast floating-point hardware.  Also
+note that results of the floating-point method may vary slightly across
+machines, while the integer methods should give the same results everywhere.
+The fast integer method is much less accurate than the other two.
+.TP
+.B \-dither fs
+Use Floyd-Steinberg dithering in color quantization.
+.TP
+.B \-dither ordered
+Use ordered dithering in color quantization.
+.TP
+.B \-dither none
+Do not use dithering in color quantization.
+By default, Floyd-Steinberg dithering is applied when quantizing colors; this
+is slow but usually produces the best results.  Ordered dither is a compromise
+between speed and quality; no dithering is fast but usually looks awful.  Note
+that these switches have no effect unless color quantization is being done.
+Ordered dither is only available in
+.B \-onepass
+mode.
+.TP
+.BI \-map " file"
+Quantize to the colors used in the specified image file.  This is useful for
+producing multiple files with identical color maps, or for forcing a
+predefined set of colors to be used.  The
+.I file
+must be a GIF or PPM file. This option overrides
+.B \-colors
+and
+.BR \-onepass .
+.TP
+.B \-nosmooth
+Don't use high-quality upsampling.
+.TP
+.B \-onepass
+Use one-pass instead of two-pass color quantization.  The one-pass method is
+faster and needs less memory, but it produces a lower-quality image.
+.B \-onepass
+is ignored unless you also say
+.B \-colors
+.IR N .
+Also, the one-pass method is always used for gray-scale output (the two-pass
+method is no improvement then).
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.SH EXAMPLES
+.LP
+This example decompresses the JPEG file foo.jpg, quantizes it to
+256 colors, and saves the output in 8-bit BMP format in foo.bmp:
+.IP
+.B djpeg \-colors 256 \-bmp
+.I foo.jpg
+.B >
+.I foo.bmp
+.SH HINTS
+To get a quick preview of an image, use the
+.B \-grayscale
+and/or
+.B \-scale
+switches.
+.B \-grayscale \-scale 1/8
+is the fastest case.
+.PP
+Several options are available that trade off image quality to gain speed.
+.B \-fast
+turns on the recommended settings.
+.PP
+.B \-dct fast
+and/or
+.B \-nosmooth
+gain speed at a small sacrifice in quality.
+When producing a color-quantized image,
+.B \-onepass \-dither ordered
+is fast but much lower quality than the default behavior.
+.B \-dither none
+may give acceptable results in two-pass mode, but is seldom tolerable in
+one-pass mode.
+.PP
+If you are fortunate enough to have very fast floating point hardware,
+\fB\-dct float\fR may be even faster than \fB\-dct fast\fR.  But on most
+machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
+not worth using, because its theoretical accuracy advantage is too small to be
+significant in practice.
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+.BR ppm (5),
+.BR pgm (5)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+To avoid the Unisys LZW patent,
+.B djpeg
+produces uncompressed GIF files.  These are larger than they should be, but
+are readable by standard GIF decoders.
diff --git a/misc/builddeps/dp.linux64/share/man/man1/jpegtran.1 b/misc/builddeps/dp.linux64/share/man/man1/jpegtran.1
new file mode 100644 (file)
index 0000000..0ad1bbc
--- /dev/null
@@ -0,0 +1,285 @@
+.TH JPEGTRAN 1 "28 December 2009"
+.SH NAME
+jpegtran \- lossless transformation of JPEG files
+.SH SYNOPSIS
+.B jpegtran
+[
+.I options
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B jpegtran
+performs various useful transformations of JPEG files.
+It can translate the coded representation from one variant of JPEG to another,
+for example from baseline JPEG to progressive JPEG or vice versa.  It can also
+perform some rearrangements of the image data, for example turning an image
+from landscape to portrait format by rotation.
+.PP
+.B jpegtran
+works by rearranging the compressed data (DCT coefficients), without
+ever fully decoding the image.  Therefore, its transformations are lossless:
+there is no image degradation at all, which would not be true if you used
+.B djpeg
+followed by
+.B cjpeg
+to accomplish the same conversion.  But by the same token,
+.B jpegtran
+cannot perform lossy operations such as changing the image quality.
+.PP
+.B jpegtran
+reads the named JPEG/JFIF file, or the standard input if no file is
+named, and produces a JPEG/JFIF file on the standard output.
+.SH OPTIONS
+All switch names may be abbreviated; for example,
+.B \-optimize
+may be written
+.B \-opt
+or
+.BR \-o .
+Upper and lower case are equivalent.
+British spellings are also accepted (e.g.,
+.BR \-optimise ),
+though for brevity these are not mentioned below.
+.PP
+To specify the coded JPEG representation used in the output file,
+.B jpegtran
+accepts a subset of the switches recognized by
+.BR cjpeg :
+.TP
+.B \-optimize
+Perform optimization of entropy encoding parameters.
+.TP
+.B \-progressive
+Create progressive JPEG file.
+.TP
+.BI \-restart " N"
+Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
+attached to the number.
+.TP
+.B \-arithmetic
+Use arithmetic coding.
+.TP
+.BI \-scans " file"
+Use the scan script given in the specified text file.
+.PP
+See
+.BR cjpeg (1)
+for more details about these switches.
+If you specify none of these switches, you get a plain baseline-JPEG output
+file.  The quality setting and so forth are determined by the input file.
+.PP
+The image can be losslessly transformed by giving one of these switches:
+.TP
+.B \-flip horizontal
+Mirror image horizontally (left-right).
+.TP
+.B \-flip vertical
+Mirror image vertically (top-bottom).
+.TP
+.B \-rotate 90
+Rotate image 90 degrees clockwise.
+.TP
+.B \-rotate 180
+Rotate image 180 degrees.
+.TP
+.B \-rotate 270
+Rotate image 270 degrees clockwise (or 90 ccw).
+.TP
+.B \-transpose
+Transpose image (across UL-to-LR axis).
+.TP
+.B \-transverse
+Transverse transpose (across UR-to-LL axis).
+.IP
+The transpose transformation has no restrictions regarding image dimensions.
+The other transformations operate rather oddly if the image dimensions are not
+a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
+transform complete blocks of DCT coefficient data in the desired way.
+.IP
+.BR jpegtran 's
+default behavior when transforming an odd-size image is designed
+to preserve exact reversibility and mathematical consistency of the
+transformation set.  As stated, transpose is able to flip the entire image
+area.  Horizontal mirroring leaves any partial iMCU column at the right edge
+untouched, but is able to flip all rows of the image.  Similarly, vertical
+mirroring leaves any partial iMCU row at the bottom edge untouched, but is
+able to flip all columns.  The other transforms can be built up as sequences
+of transpose and flip operations; for consistency, their actions on edge
+pixels are defined to be the same as the end result of the corresponding
+transpose-and-flip sequence.
+.IP
+For practical use, you may prefer to discard any untransformable edge pixels
+rather than having a strange-looking strip along the right and/or bottom edges
+of a transformed image.  To do this, add the
+.B \-trim
+switch:
+.TP
+.B \-trim
+Drop non-transformable edge blocks.
+.IP
+Obviously, a transformation with
+.B \-trim
+is not reversible, so strictly speaking
+.B jpegtran
+with this switch is not lossless.  Also, the expected mathematical
+equivalences between the transformations no longer hold.  For example,
+.B \-rot 270 -trim
+trims only the bottom edge, but
+.B \-rot 90 -trim
+followed by
+.B \-rot 180 -trim
+trims both edges.
+.IP
+If you are only interested in perfect transformation, add the
+.B \-perfect
+switch:
+.TP
+.B \-perfect
+Fails with an error if the transformation is not perfect.
+.IP
+For example you may want to do
+.IP
+.B (jpegtran \-rot 90 -perfect
+.I foo.jpg
+.B || djpeg
+.I foo.jpg
+.B | pnmflip \-r90 | cjpeg)
+.IP
+to do a perfect rotation if available or an approximated one if not.
+.PP
+We also offer a lossless-crop option, which discards data outside a given
+image region but losslessly preserves what is inside.  Like the rotate and
+flip transforms, lossless crop is restricted by the current JPEG format: the
+upper left corner of the selected region must fall on an iMCU boundary.  If
+this does not hold for the given crop parameters, we silently move the upper
+left corner up and/or left to make it so, simultaneously increasing the region
+dimensions to keep the lower right crop corner unchanged.  (Thus, the output
+image covers at least the requested region, but may cover more.)
+
+The image can be losslessly cropped by giving the switch:
+.TP
+.B \-crop WxH+X+Y
+Crop to a rectangular subarea of width W, height H starting at point X,Y.
+.PP
+Other not-strictly-lossless transformation switches are:
+.TP
+.B \-grayscale
+Force grayscale output.
+.IP
+This option discards the chrominance channels if the input image is YCbCr
+(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The
+luminance channel is preserved exactly, so this is a better method of reducing
+to grayscale than decompression, conversion, and recompression.  This switch
+is particularly handy for fixing a monochrome picture that was mistakenly
+encoded as a color JPEG.  (In such a case, the space savings from getting rid
+of the near-empty chroma channels won't be large; but the decoding time for
+a grayscale JPEG is substantially less than that for a color JPEG.)
+.TP
+.BI \-scale " M/N"
+Scale the output image by a factor M/N.
+.IP
+Currently supported scale factors are M/N with all M from 1 to 16, where N is
+the source DCT size, which is 8 for baseline JPEG.  If the /N part is omitted,
+then M specifies the DCT scaled size to be applied on the given input.  For
+baseline JPEG this is equivalent to M/8 scaling, since the source DCT size
+for baseline JPEG is 8.
+.B Caution:
+An implementation of the JPEG SmartScale extension is required for this
+feature.  SmartScale enabled JPEG is not yet widely implemented, so many
+decoders will be unable to view a SmartScale extended JPEG file at all.
+.PP
+.B jpegtran
+also recognizes these switches that control what to do with "extra" markers,
+such as comment blocks:
+.TP
+.B \-copy none
+Copy no extra markers from source file.  This setting suppresses all
+comments and other excess baggage present in the source file.
+.TP
+.B \-copy comments
+Copy only comment markers.  This setting copies comments from the source file,
+but discards any other inessential (for image display) data.
+.TP
+.B \-copy all
+Copy all extra markers.  This setting preserves miscellaneous markers
+found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
+settings.  In some files these extra markers can be sizable.
+.IP
+The default behavior is
+.BR "\-copy comments" .
+(Note: in IJG releases v6 and v6a,
+.B jpegtran
+always did the equivalent of
+.BR "\-copy none" .)
+.PP
+Additional switches recognized by jpegtran are:
+.TP
+.BI \-maxmemory " N"
+Set limit for amount of memory to use in processing large images.  Value is
+in thousands of bytes, or millions of bytes if "M" is attached to the
+number.  For example,
+.B \-max 4m
+selects 4000000 bytes.  If more space is needed, temporary files will be used.
+.TP
+.BI \-outfile " name"
+Send output image to the named file, not to standard output.
+.TP
+.B \-verbose
+Enable debug printout.  More
+.BR \-v 's
+give more output.  Also, version information is printed at startup.
+.TP
+.B \-debug
+Same as
+.BR \-verbose .
+.SH EXAMPLES
+.LP
+This example converts a baseline JPEG file to progressive form:
+.IP
+.B jpegtran \-progressive
+.I foo.jpg
+.B >
+.I fooprog.jpg
+.PP
+This example rotates an image 90 degrees clockwise, discarding any
+unrotatable edge pixels:
+.IP
+.B jpegtran \-rot 90 -trim
+.I foo.jpg
+.B >
+.I foo90.jpg
+.SH ENVIRONMENT
+.TP
+.B JPEGMEM
+If this environment variable is set, its value is the default memory limit.
+The value is specified as described for the
+.B \-maxmemory
+switch.
+.B JPEGMEM
+overrides the default value specified when the program was compiled, and
+itself is overridden by an explicit
+.BR \-maxmemory .
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR rdjpgcom (1),
+.BR wrjpgcom (1)
+.br
+Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
+.SH AUTHOR
+Independent JPEG Group
+.SH BUGS
+The transform options can't transform odd-size images perfectly.  Use
+.B \-trim
+or
+.B \-perfect
+if you don't like the results.
+.PP
+The entire image is read into memory and then written out again, even in
+cases where this isn't really necessary.  Expect swapping on large images,
+especially when using the more complex transform options.
diff --git a/misc/builddeps/dp.linux64/share/man/man1/rdjpgcom.1 b/misc/builddeps/dp.linux64/share/man/man1/rdjpgcom.1
new file mode 100644 (file)
index 0000000..97611df
--- /dev/null
@@ -0,0 +1,63 @@
+.TH RDJPGCOM 1 "02 April 2009"
+.SH NAME
+rdjpgcom \- display text comments from a JPEG file
+.SH SYNOPSIS
+.B rdjpgcom
+[
+.B \-raw
+]
+[
+.B \-verbose
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B rdjpgcom
+reads the named JPEG/JFIF file, or the standard input if no file is named,
+and prints any text comments found in the file on the standard output.
+.PP
+The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
+Although the standard doesn't actually define what COM blocks are for, they
+are widely used to hold user-supplied text strings.  This lets you add
+annotations, titles, index terms, etc to your JPEG files, and later retrieve
+them as text.  COM blocks do not interfere with the image stored in the JPEG
+file.  The maximum size of a COM block is 64K, but you can have as many of
+them as you like in one JPEG file.
+.SH OPTIONS
+.TP
+.B \-raw
+Normally
+.B rdjpgcom
+escapes non-printable characters in comments, for security reasons.
+This option avoids that.
+.PP
+.B \-verbose
+Causes
+.B rdjpgcom
+to also display the JPEG image dimensions.
+.PP
+Switch names may be abbreviated, and are not case sensitive.
+.SH HINTS
+.B rdjpgcom
+does not depend on the IJG JPEG library.  Its source code is intended as an
+illustration of the minimum amount of code required to parse a JPEG file
+header correctly.
+.PP
+In
+.B \-verbose
+mode,
+.B rdjpgcom
+will also attempt to print the contents of any "APP12" markers as text.
+Some digital cameras produce APP12 markers containing useful textual
+information.  If you like, you can modify the source code to print
+other APPn marker types as well.
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR wrjpgcom (1)
+.SH AUTHOR
+Independent JPEG Group
diff --git a/misc/builddeps/dp.linux64/share/man/man1/wrjpgcom.1 b/misc/builddeps/dp.linux64/share/man/man1/wrjpgcom.1
new file mode 100644 (file)
index 0000000..d419a99
--- /dev/null
@@ -0,0 +1,103 @@
+.TH WRJPGCOM 1 "15 June 1995"
+.SH NAME
+wrjpgcom \- insert text comments into a JPEG file
+.SH SYNOPSIS
+.B wrjpgcom
+[
+.B \-replace
+]
+[
+.BI \-comment " text"
+]
+[
+.BI \-cfile " name"
+]
+[
+.I filename
+]
+.LP
+.SH DESCRIPTION
+.LP
+.B wrjpgcom
+reads the named JPEG/JFIF file, or the standard input if no file is named,
+and generates a new JPEG/JFIF file on standard output.  A comment block is
+added to the file.
+.PP
+The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
+Although the standard doesn't actually define what COM blocks are for, they
+are widely used to hold user-supplied text strings.  This lets you add
+annotations, titles, index terms, etc to your JPEG files, and later retrieve
+them as text.  COM blocks do not interfere with the image stored in the JPEG
+file.  The maximum size of a COM block is 64K, but you can have as many of
+them as you like in one JPEG file.
+.PP
+.B wrjpgcom
+adds a COM block, containing text you provide, to a JPEG file.
+Ordinarily, the COM block is added after any existing COM blocks; but you
+can delete the old COM blocks if you wish.
+.SH OPTIONS
+Switch names may be abbreviated, and are not case sensitive.
+.TP
+.B \-replace
+Delete any existing COM blocks from the file.
+.TP
+.BI \-comment " text"
+Supply text for new COM block on command line.
+.TP
+.BI \-cfile " name"
+Read text for new COM block from named file.
+.PP
+If you have only one line of comment text to add, you can provide it on the
+command line with
+.BR \-comment .
+The comment text must be surrounded with quotes so that it is treated as a
+single argument.  Longer comments can be read from a text file.
+.PP
+If you give neither
+.B \-comment
+nor
+.BR \-cfile ,
+then
+.B wrjpgcom
+will read the comment text from standard input.  (In this case an input image
+file name MUST be supplied, so that the source JPEG file comes from somewhere
+else.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file
+indicator (usually control-D) to terminate the comment text entry.
+.PP
+.B wrjpgcom
+will not add a COM block if the provided comment string is empty.  Therefore
+\fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file.
+.SH EXAMPLES
+.LP
+Add a short comment to in.jpg, producing out.jpg:
+.IP
+.B wrjpgcom \-c
+\fI"View of my back yard" in.jpg
+.B >
+.I out.jpg
+.PP
+Attach a long comment previously stored in comment.txt:
+.IP
+.B wrjpgcom
+.I in.jpg
+.B <
+.I comment.txt
+.B >
+.I out.jpg
+.PP
+or equivalently
+.IP
+.B wrjpgcom
+.B -cfile
+.I comment.txt
+.B <
+.I in.jpg
+.B >
+.I out.jpg
+.SH SEE ALSO
+.BR cjpeg (1),
+.BR djpeg (1),
+.BR jpegtran (1),
+.BR rdjpgcom (1)
+.SH AUTHOR
+Independent JPEG Group
diff --git a/misc/builddeps/dp.win32/bin/SDL.dll b/misc/builddeps/dp.win32/bin/SDL.dll
new file mode 100755 (executable)
index 0000000..49f8aa0
Binary files /dev/null and b/misc/builddeps/dp.win32/bin/SDL.dll differ
diff --git a/misc/builddeps/dp.win32/bin/sdl-config b/misc/builddeps/dp.win32/bin/sdl-config
new file mode 100755 (executable)
index 0000000..3144d44
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+prefix=${0%/bin/sdl-config}
+exec_prefix=${prefix}
+exec_prefix_set=no
+libdir=${exec_prefix}/lib
+
+#usage="\
+#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
+usage="\
+Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
+
+if test $# -eq 0; then
+      echo "${usage}" 1>&2
+      exit 1
+fi
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --prefix=*)
+      prefix=$optarg
+      if test $exec_prefix_set = no ; then
+        exec_prefix=$optarg
+      fi
+      ;;
+    --prefix)
+      echo $prefix
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      exec_prefix_set=yes
+      ;;
+    --exec-prefix)
+      echo $exec_prefix
+      ;;
+    --version)
+      echo 1.2.14
+      ;;
+    --cflags)
+      echo -I${prefix}/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main
+      ;;
+    --libs)
+      echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
+      ;;
+    --static-libs)
+#    --libs|--static-libs)
+      echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL  -mwindows  -lm -luser32 -lgdi32 -lwinmm -ldxguid -ldinput8
+      ;;
+    *)
+      echo "${usage}" 1>&2
+      exit 1
+      ;;
+  esac
+  shift
+done
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL.h b/misc/builddeps/dp.win32/include/SDL/SDL.h
new file mode 100644 (file)
index 0000000..119ed7f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL.h
+ *  Main include header for the SDL library
+ */
+
+#ifndef _SDL_H
+#define _SDL_H
+
+#include "SDL_main.h"
+#include "SDL_stdinc.h"
+#include "SDL_audio.h"
+#include "SDL_cdrom.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_endian.h"
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_loadso.h"
+#include "SDL_mutex.h"
+#include "SDL_rwops.h"
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL.h
+ *  @note As of version 0.5, SDL is loaded dynamically into the application
+ */
+
+/** @name SDL_INIT Flags
+ *  These are the flags which may be passed to SDL_Init() -- you should
+ *  specify the subsystems which you will be using in your application.
+ */
+/*@{*/
+#define        SDL_INIT_TIMER          0x00000001
+#define SDL_INIT_AUDIO         0x00000010
+#define SDL_INIT_VIDEO         0x00000020
+#define SDL_INIT_CDROM         0x00000100
+#define SDL_INIT_JOYSTICK      0x00000200
+#define SDL_INIT_NOPARACHUTE   0x00100000      /**< Don't catch fatal signals */
+#define SDL_INIT_EVENTTHREAD   0x01000000      /**< Not supported on all OS's */
+#define SDL_INIT_EVERYTHING    0x0000FFFF
+/*@}*/
+
+/** This function loads the SDL dynamically linked library and initializes 
+ *  the subsystems specified by 'flags' (and those satisfying dependencies)
+ *  Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
+ *  signal handlers for some commonly ignored fatal signals (like SIGSEGV)
+ */
+extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
+
+/** This function initializes specific SDL subsystems */
+extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
+
+/** This function cleans up specific SDL subsystems */
+extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
+
+/** This function returns mask of the specified subsystems which have
+ *  been initialized.
+ *  If 'flags' is 0, it returns a mask of all initialized subsystems.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
+
+/** This function cleans up all initialized subsystems and unloads the
+ *  dynamically linked library.  You should call it upon all exit conditions.
+ */
+extern DECLSPEC void SDLCALL SDL_Quit(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_H */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_active.h b/misc/builddeps/dp.win32/include/SDL/SDL_active.h
new file mode 100644 (file)
index 0000000..0ae92f2
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_active.h
+ *  Include file for SDL application focus event handling 
+ */
+
+#ifndef _SDL_active_h
+#define _SDL_active_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name The available application states */
+/*@{*/
+#define SDL_APPMOUSEFOCUS      0x01            /**< The app has mouse coverage */
+#define SDL_APPINPUTFOCUS      0x02            /**< The app has input focus */
+#define SDL_APPACTIVE          0x04            /**< The application is active */
+/*@}*/
+
+/* Function prototypes */
+/** 
+ * This function returns the current state of the application, which is a
+ * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
+ * SDL_APPACTIVE.  If SDL_APPACTIVE is set, then the user is able to
+ * see your application, otherwise it has been iconified or disabled.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_active_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_audio.h b/misc/builddeps/dp.win32/include/SDL/SDL_audio.h
new file mode 100644 (file)
index 0000000..3a8e7fa
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_audio.h
+ *  Access to the raw audio mixing buffer for the SDL library
+ */
+
+#ifndef _SDL_audio_h
+#define _SDL_audio_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_endian.h"
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * When filling in the desired audio spec structure,
+ * - 'desired->freq' should be the desired audio frequency in samples-per-second.
+ * - 'desired->format' should be the desired audio format.
+ * - 'desired->samples' is the desired size of the audio buffer, in samples.
+ *     This number should be a power of two, and may be adjusted by the audio
+ *     driver to a value more suitable for the hardware.  Good values seem to
+ *     range between 512 and 8096 inclusive, depending on the application and
+ *     CPU speed.  Smaller values yield faster response time, but can lead
+ *     to underflow if the application is doing heavy processing and cannot
+ *     fill the audio buffer in time.  A stereo sample consists of both right
+ *     and left channels in LR ordering.
+ *     Note that the number of samples is directly related to time by the
+ *     following formula:  ms = (samples*1000)/freq
+ * - 'desired->size' is the size in bytes of the audio buffer, and is
+ *     calculated by SDL_OpenAudio().
+ * - 'desired->silence' is the value used to set the buffer to silence,
+ *     and is calculated by SDL_OpenAudio().
+ * - 'desired->callback' should be set to a function that will be called
+ *     when the audio device is ready for more data.  It is passed a pointer
+ *     to the audio buffer, and the length in bytes of the audio buffer.
+ *     This function usually runs in a separate thread, and so you should
+ *     protect data structures that it accesses by calling SDL_LockAudio()
+ *     and SDL_UnlockAudio() in your code.
+ * - 'desired->userdata' is passed as the first parameter to your callback
+ *     function.
+ *
+ * @note The calculated values in this structure are calculated by SDL_OpenAudio()
+ *
+ */
+typedef struct SDL_AudioSpec {
+       int freq;               /**< DSP frequency -- samples per second */
+       Uint16 format;          /**< Audio data format */
+       Uint8  channels;        /**< Number of channels: 1 mono, 2 stereo */
+       Uint8  silence;         /**< Audio buffer silence value (calculated) */
+       Uint16 samples;         /**< Audio buffer size in samples (power of 2) */
+       Uint16 padding;         /**< Necessary for some compile environments */
+       Uint32 size;            /**< Audio buffer size in bytes (calculated) */
+       /**
+        *  This function is called when the audio device needs more data.
+        *
+        *  @param[out] stream  A pointer to the audio data buffer
+        *  @param[in]  len     The length of the audio buffer in bytes.
+        *
+        *  Once the callback returns, the buffer will no longer be valid.
+        *  Stereo samples are stored in a LRLRLR ordering.
+        */
+       void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
+       void  *userdata;
+} SDL_AudioSpec;
+
+/**
+ *  @name Audio format flags
+ *  defaults to LSB byte order
+ */
+/*@{*/
+#define AUDIO_U8       0x0008  /**< Unsigned 8-bit samples */
+#define AUDIO_S8       0x8008  /**< Signed 8-bit samples */
+#define AUDIO_U16LSB   0x0010  /**< Unsigned 16-bit samples */
+#define AUDIO_S16LSB   0x8010  /**< Signed 16-bit samples */
+#define AUDIO_U16MSB   0x1010  /**< As above, but big-endian byte order */
+#define AUDIO_S16MSB   0x9010  /**< As above, but big-endian byte order */
+#define AUDIO_U16      AUDIO_U16LSB
+#define AUDIO_S16      AUDIO_S16LSB
+
+/**
+ *  @name Native audio byte ordering
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define AUDIO_U16SYS   AUDIO_U16LSB
+#define AUDIO_S16SYS   AUDIO_S16LSB
+#else
+#define AUDIO_U16SYS   AUDIO_U16MSB
+#define AUDIO_S16SYS   AUDIO_S16MSB
+#endif
+/*@}*/
+
+/*@}*/
+
+
+/** A structure to hold a set of audio conversion filters and buffers */
+typedef struct SDL_AudioCVT {
+       int needed;                     /**< Set to 1 if conversion possible */
+       Uint16 src_format;              /**< Source audio format */
+       Uint16 dst_format;              /**< Target audio format */
+       double rate_incr;               /**< Rate conversion increment */
+       Uint8 *buf;                     /**< Buffer to hold entire audio data */
+       int    len;                     /**< Length of original audio buffer */
+       int    len_cvt;                 /**< Length of converted audio buffer */
+       int    len_mult;                /**< buffer must be len*len_mult big */
+       double len_ratio;       /**< Given len, final size is len*len_ratio */
+       void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+       int filter_index;               /**< Current audio conversion function */
+} SDL_AudioCVT;
+
+
+/* Function prototypes */
+
+/**
+ * @name Audio Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the audio driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
+extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * current audio driver, and returns a pointer to it if the audio driver has
+ * been initialized.  It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function opens the audio device with the desired parameters, and
+ * returns 0 if successful, placing the actual hardware parameters in the
+ * structure pointed to by 'obtained'.  If 'obtained' is NULL, the audio
+ * data passed to the callback function will be guaranteed to be in the
+ * requested format, and will be automatically converted to the hardware
+ * audio format if necessary.  This function returns -1 if it failed 
+ * to open the audio device, or couldn't set up the audio thread.
+ *
+ * The audio device starts out playing silence when it's opened, and should
+ * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
+ * for your audio callback function to be called.  Since the audio driver
+ * may modify the requested size of the audio buffer, you should allocate
+ * any local mixing buffers after you open the audio device.
+ *
+ * @sa SDL_AudioSpec
+ */
+extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
+
+typedef enum {
+       SDL_AUDIO_STOPPED = 0,
+       SDL_AUDIO_PLAYING,
+       SDL_AUDIO_PAUSED
+} SDL_audiostatus;
+
+/** Get the current audio state */
+extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
+
+/**
+ * This function pauses and unpauses the audio callback processing.
+ * It should be called with a parameter of 0 after opening the audio
+ * device to start playing sound.  This is so you can safely initialize
+ * data for your callback function after opening the audio device.
+ * Silence will be written to the audio device during the pause.
+ */
+extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
+
+/**
+ * This function loads a WAVE from the data source, automatically freeing
+ * that source if 'freesrc' is non-zero.  For example, to load a WAVE file,
+ * you could do:
+ *     @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
+ *
+ * If this function succeeds, it returns the given SDL_AudioSpec,
+ * filled with the audio data format of the wave data, and sets
+ * 'audio_buf' to a malloc()'d buffer containing the audio data,
+ * and sets 'audio_len' to the length of that audio buffer, in bytes.
+ * You need to free the audio buffer with SDL_FreeWAV() when you are 
+ * done with it.
+ *
+ * This function returns NULL and sets the SDL error message if the 
+ * wave file cannot be opened, uses an unknown data format, or is 
+ * corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
+ */
+extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
+
+/** Compatibility convenience function -- loads a WAV from a file */
+#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
+       SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
+
+/**
+ * This function frees data previously allocated with SDL_LoadWAV_RW()
+ */
+extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
+
+/**
+ * This function takes a source format and rate and a destination format
+ * and rate, and initializes the 'cvt' structure with information needed
+ * by SDL_ConvertAudio() to convert a buffer of audio data from one format
+ * to the other.
+ *
+ * @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
+               Uint16 src_format, Uint8 src_channels, int src_rate,
+               Uint16 dst_format, Uint8 dst_channels, int dst_rate);
+
+/**
+ * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
+ * created an audio buffer cvt->buf, and filled it with cvt->len bytes of
+ * audio data in the source format, this function will convert it in-place
+ * to the desired format.
+ * The data conversion may expand the size of the audio data, so the buffer
+ * cvt->buf should be allocated after the cvt structure is initialized by
+ * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
+ */
+extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
+
+
+#define SDL_MIX_MAXVOLUME 128
+/**
+ * This takes two audio buffers of the playing audio format and mixes
+ * them, performing addition, volume adjustment, and overflow clipping.
+ * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
+ * for full audio volume.  Note this does not change hardware volume.
+ * This is provided for convenience -- you can mix your own audio data.
+ */
+extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
+
+/**
+ * @name Audio Locks
+ * The lock manipulated by these functions protects the callback function.
+ * During a LockAudio/UnlockAudio pair, you can be guaranteed that the
+ * callback function is not running.  Do not call these from the callback
+ * function or you will cause deadlock.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_LockAudio(void);
+extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
+/*@}*/
+
+/**
+ * This function shuts down audio processing and closes the audio device.
+ */
+extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_audio_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_byteorder.h b/misc/builddeps/dp.win32/include/SDL/SDL_byteorder.h
new file mode 100644 (file)
index 0000000..9b93cd6
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_byteorder.h
+ *  @deprecated Use SDL_endian.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_endian.h"
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_cdrom.h b/misc/builddeps/dp.win32/include/SDL/SDL_cdrom.h
new file mode 100644 (file)
index 0000000..fff5cfa
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_cdrom.h
+ *  This is the CD-audio control API for Simple DirectMedia Layer
+ */
+
+#ifndef _SDL_cdrom_h
+#define _SDL_cdrom_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  @file SDL_cdrom.h
+ *  In order to use these functions, SDL_Init() must have been called
+ *  with the SDL_INIT_CDROM flag.  This causes SDL to scan the system
+ *  for CD-ROM drives, and load appropriate drivers.
+ */
+
+/** The maximum number of CD-ROM tracks on a disk */
+#define SDL_MAX_TRACKS 99
+
+/** @name Track Types
+ *  The types of CD-ROM track possible
+ */
+/*@{*/
+#define SDL_AUDIO_TRACK        0x00
+#define SDL_DATA_TRACK 0x04
+/*@}*/
+
+/** The possible states which a CD-ROM drive can be in. */
+typedef enum {
+       CD_TRAYEMPTY,
+       CD_STOPPED,
+       CD_PLAYING,
+       CD_PAUSED,
+       CD_ERROR = -1
+} CDstatus;
+
+/** Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status)     ((int)(status) > 0)
+
+typedef struct SDL_CDtrack {
+       Uint8 id;               /**< Track number */
+       Uint8 type;             /**< Data or audio track */
+       Uint16 unused;
+       Uint32 length;          /**< Length, in frames, of this track */
+       Uint32 offset;          /**< Offset, in frames, from start of disk */
+} SDL_CDtrack;
+
+/** This structure is only current as of the last call to SDL_CDStatus() */
+typedef struct SDL_CD {
+       int id;                 /**< Private drive identifier */
+       CDstatus status;        /**< Current drive status */
+
+       /** The rest of this structure is only valid if there's a CD in drive */
+        /*@{*/
+       int numtracks;          /**< Number of tracks on disk */
+       int cur_track;          /**< Current track position */
+       int cur_frame;          /**< Current frame offset within current track */
+       SDL_CDtrack track[SDL_MAX_TRACKS+1];
+        /*@}*/
+} SDL_CD;
+
+/** @name Frames / MSF Conversion Functions
+ *  Conversion functions from frames to Minute/Second/Frames and vice versa
+ */
+/*@{*/
+#define CD_FPS 75
+#define FRAMES_TO_MSF(f, M,S,F)        {                                       \
+       int value = f;                                                  \
+       *(F) = value%CD_FPS;                                            \
+       value /= CD_FPS;                                                \
+       *(S) = value%60;                                                \
+       value /= 60;                                                    \
+       *(M) = value;                                                   \
+}
+#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
+/*@}*/
+
+/* CD-audio API functions: */
+
+/**
+ *  Returns the number of CD-ROM drives on the system, or -1 if
+ *  SDL_Init() has not been called with the SDL_INIT_CDROM flag.
+ */
+extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
+
+/**
+ *  Returns a human-readable, system-dependent identifier for the CD-ROM.
+ *  Example:
+ *   - "/dev/cdrom"
+ *   - "E:"
+ *   - "/dev/disk/ide/1/master"
+ */
+extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
+
+/**
+ *  Opens a CD-ROM drive for access.  It returns a drive handle on success,
+ *  or NULL if the drive was invalid or busy.  This newly opened CD-ROM
+ *  becomes the default CD used when other CD functions are passed a NULL
+ *  CD-ROM handle.
+ *  Drives are numbered starting with 0.  Drive 0 is the system default CD-ROM.
+ */
+extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
+
+/**
+ *  This function returns the current status of the given drive.
+ *  If the drive has a CD in it, the table of contents of the CD and current
+ *  play position of the CD will be stored in the SDL_CD structure.
+ */
+extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
+
+/**
+ *  Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
+ *  tracks and 'nframes' frames.  If both 'ntrack' and 'nframe' are 0, play 
+ *  until the end of the CD.  This function will skip data tracks.
+ *  This function should only be called after calling SDL_CDStatus() to 
+ *  get track information about the CD.
+ *  For example:
+ *      @code
+ *     // Play entire CD:
+ *     if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ *             SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+ *     // Play last track:
+ *     if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ *             SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+ *     }
+ *     // Play first and second track and 10 seconds of third track:
+ *     if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ *             SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
+ *      @endcode
+ *
+ *  @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
+               int start_track, int start_frame, int ntracks, int nframes);
+
+/**
+ *  Play the given CD starting at 'start' frame for 'length' frames.
+ *  @return It returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
+
+/** Pause play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
+
+/** Resume play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
+
+/** Stop play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
+
+/** Eject CD-ROM
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
+
+/** Closes the handle for the CD-ROM drive */
+extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_config.h b/misc/builddeps/dp.win32/include/SDL/SDL_config.h
new file mode 100644 (file)
index 0000000..b1abcd3
--- /dev/null
@@ -0,0 +1,311 @@
+/* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_h
+#define _SDL_config_h
+
+/* This is a set of defines to configure the SDL features */
+
+/* General platform specific identifiers */
+#include "SDL_platform.h"
+
+/* Make sure that this isn't included by Visual C++ */
+#ifdef _MSC_VER
+#error You should copy include/SDL_config.h.default to include/SDL_config.h
+#endif
+
+/* C language features */
+/* #undef const */
+/* #undef inline */
+/* #undef volatile */
+
+/* C datatypes */
+/* #undef size_t */
+/* #undef int8_t */
+/* #undef uint8_t */
+/* #undef int16_t */
+/* #undef uint16_t */
+/* #undef int32_t */
+/* #undef uint32_t */
+/* #undef int64_t */
+/* #undef uint64_t */
+/* #undef uintptr_t */
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Endianness */
+#define SDL_BYTEORDER 1234
+
+/* Comment this if you want to build without any C library requirements */
+#define HAVE_LIBC 1
+#if HAVE_LIBC
+
+/* Useful headers */
+/* #undef HAVE_ALLOCA_H */
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+/* #undef HAVE_ICONV_H */
+#define HAVE_SIGNAL_H 1
+/* #undef HAVE_ALTIVEC_H */
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+/* #undef HAVE_ALLOCA */
+#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+/* #undef HAVE_UNSETENV */
+#endif
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+/* #undef HAVE_BCOPY */
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+/* #undef HAVE_MEMCMP */
+#define HAVE_STRLEN 1
+/* #undef HAVE_STRLCPY */
+/* #undef HAVE_STRLCAT */
+#define HAVE_STRDUP 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+/* #undef HAVE_INDEX */
+/* #undef HAVE_RINDEX */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+/* #undef HAVE__UITOA */
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE__I64TOA 1
+#define HAVE__UI64TOA 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+/* #undef HAVE_STRTOD */
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE__STRICMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE__STRNICMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+/* #undef HAVE_ICONV */
+/* #undef HAVE_SIGACTION */
+/* #undef HAVE_SETJMP */
+/* #undef HAVE_NANOSLEEP */
+/* #undef HAVE_CLOCK_GETTIME */
+/* #undef HAVE_GETPAGESIZE */
+/* #undef HAVE_MPROTECT */
+
+#else
+/* We may need some replacement for stdarg.h here */
+#include <stdarg.h>
+#endif /* HAVE_LIBC */
+
+/* Allow disabling of core subsystems */
+/* #undef SDL_AUDIO_DISABLED */
+/* #undef SDL_CDROM_DISABLED */
+/* #undef SDL_CPUINFO_DISABLED */
+/* #undef SDL_EVENTS_DISABLED */
+/* #undef SDL_FILE_DISABLED */
+/* #undef SDL_JOYSTICK_DISABLED */
+/* #undef SDL_LOADSO_DISABLED */
+/* #undef SDL_THREADS_DISABLED */
+/* #undef SDL_TIMERS_DISABLED */
+/* #undef SDL_VIDEO_DISABLED */
+
+/* Enable various audio drivers */
+/* #undef SDL_AUDIO_DRIVER_ALSA */
+/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_ARTS */
+/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_BAUDIO */
+/* #undef SDL_AUDIO_DRIVER_BSD */
+/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
+/* #undef SDL_AUDIO_DRIVER_DART */
+/* #undef SDL_AUDIO_DRIVER_DC */
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+/* #undef SDL_AUDIO_DRIVER_DMEDIA */
+#define SDL_AUDIO_DRIVER_DSOUND 1
+/* #undef SDL_AUDIO_DRIVER_PULSE */
+/* #undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_ESD */
+/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_MINT */
+/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
+/* #undef SDL_AUDIO_DRIVER_NAS */
+/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_OSS */
+/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
+/* #undef SDL_AUDIO_DRIVER_PAUD */
+/* #undef SDL_AUDIO_DRIVER_QNXNTO */
+/* #undef SDL_AUDIO_DRIVER_SNDMGR */
+/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
+#define SDL_AUDIO_DRIVER_WAVEOUT 1
+
+/* Enable various cdrom drivers */
+/* #undef SDL_CDROM_AIX */
+/* #undef SDL_CDROM_BEOS */
+/* #undef SDL_CDROM_BSDI */
+/* #undef SDL_CDROM_DC */
+/* #undef SDL_CDROM_DUMMY */
+/* #undef SDL_CDROM_FREEBSD */
+/* #undef SDL_CDROM_LINUX */
+/* #undef SDL_CDROM_MACOS */
+/* #undef SDL_CDROM_MACOSX */
+/* #undef SDL_CDROM_MINT */
+/* #undef SDL_CDROM_OPENBSD */
+/* #undef SDL_CDROM_OS2 */
+/* #undef SDL_CDROM_OSF */
+/* #undef SDL_CDROM_QNX */
+#define SDL_CDROM_WIN32 1
+
+/* Enable various input drivers */
+/* #undef SDL_INPUT_LINUXEV */
+/* #undef SDL_INPUT_TSLIB */
+/* #undef SDL_JOYSTICK_BEOS */
+/* #undef SDL_JOYSTICK_DC */
+/* #undef SDL_JOYSTICK_DUMMY */
+/* #undef SDL_JOYSTICK_IOKIT */
+/* #undef SDL_JOYSTICK_LINUX */
+/* #undef SDL_JOYSTICK_MACOS */
+/* #undef SDL_JOYSTICK_MINT */
+/* #undef SDL_JOYSTICK_OS2 */
+/* #undef SDL_JOYSTICK_RISCOS */
+#define SDL_JOYSTICK_WINMM 1
+/* #undef SDL_JOYSTICK_USBHID */
+/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
+
+/* Enable various shared object loading systems */
+/* #undef SDL_LOADSO_BEOS */
+/* #undef SDL_LOADSO_DLCOMPAT */
+/* #undef SDL_LOADSO_DLOPEN */
+/* #undef SDL_LOADSO_DUMMY */
+/* #undef SDL_LOADSO_LDG */
+/* #undef SDL_LOADSO_MACOS */
+/* #undef SDL_LOADSO_OS2 */
+#define SDL_LOADSO_WIN32 1
+
+/* Enable various threading systems */
+/* #undef SDL_THREAD_BEOS */
+/* #undef SDL_THREAD_DC */
+/* #undef SDL_THREAD_OS2 */
+/* #undef SDL_THREAD_PTH */
+/* #undef SDL_THREAD_PTHREAD */
+/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */
+/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
+/* #undef SDL_THREAD_SPROC */
+#define SDL_THREAD_WIN32 1
+
+/* Enable various timer systems */
+/* #undef SDL_TIMER_BEOS */
+/* #undef SDL_TIMER_DC */
+/* #undef SDL_TIMER_DUMMY */
+/* #undef SDL_TIMER_MACOS */
+/* #undef SDL_TIMER_MINT */
+/* #undef SDL_TIMER_OS2 */
+/* #undef SDL_TIMER_RISCOS */
+/* #undef SDL_TIMER_UNIX */
+#define SDL_TIMER_WIN32 1
+/* #undef SDL_TIMER_WINCE */
+
+/* Enable various video drivers */
+/* #undef SDL_VIDEO_DRIVER_AALIB */
+/* #undef SDL_VIDEO_DRIVER_BWINDOW */
+/* #undef SDL_VIDEO_DRIVER_CACA */
+/* #undef SDL_VIDEO_DRIVER_DC */
+#define SDL_VIDEO_DRIVER_DDRAW 1
+/* #undef SDL_VIDEO_DRIVER_DGA */
+/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
+/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+/* #undef SDL_VIDEO_DRIVER_FBCON */
+/* #undef SDL_VIDEO_DRIVER_GAPI */
+/* #undef SDL_VIDEO_DRIVER_GEM */
+/* #undef SDL_VIDEO_DRIVER_GGI */
+/* #undef SDL_VIDEO_DRIVER_IPOD */
+/* #undef SDL_VIDEO_DRIVER_NANOX */
+/* #undef SDL_VIDEO_DRIVER_OS2FS */
+/* #undef SDL_VIDEO_DRIVER_PHOTON */
+/* #undef SDL_VIDEO_DRIVER_PICOGUI */
+/* #undef SDL_VIDEO_DRIVER_PS2GS */
+/* #undef SDL_VIDEO_DRIVER_PS3 */
+/* #undef SDL_VIDEO_DRIVER_QTOPIA */
+/* #undef SDL_VIDEO_DRIVER_QUARTZ */
+/* #undef SDL_VIDEO_DRIVER_RISCOS */
+/* #undef SDL_VIDEO_DRIVER_SVGALIB */
+/* #undef SDL_VIDEO_DRIVER_TOOLBOX */
+/* #undef SDL_VIDEO_DRIVER_VGL */
+#define SDL_VIDEO_DRIVER_WINDIB 1
+/* #undef SDL_VIDEO_DRIVER_WSCONS */
+/* #undef SDL_VIDEO_DRIVER_X11 */
+/* #undef SDL_VIDEO_DRIVER_X11_DGAMOUSE */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER */
+/* #undef SDL_VIDEO_DRIVER_X11_VIDMODE */
+/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */
+/* #undef SDL_VIDEO_DRIVER_X11_XME */
+/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
+/* #undef SDL_VIDEO_DRIVER_X11_XV */
+/* #undef SDL_VIDEO_DRIVER_XBIOS */
+
+/* Enable OpenGL support */
+#define SDL_VIDEO_OPENGL 1
+/* #undef SDL_VIDEO_OPENGL_GLX */
+#define SDL_VIDEO_OPENGL_WGL 1
+/* #undef SDL_VIDEO_OPENGL_OSMESA */
+/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
+
+/* Disable screensaver */
+#define SDL_VIDEO_DISABLE_SCREENSAVER 1
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+#define SDL_HERMES_BLITTERS 1
+/* #undef SDL_ALTIVEC_BLITTERS */
+
+#endif /* _SDL_config_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_copying.h b/misc/builddeps/dp.win32/include/SDL/SDL_copying.h
new file mode 100644 (file)
index 0000000..1bd6b84
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_cpuinfo.h b/misc/builddeps/dp.win32/include/SDL/SDL_cpuinfo.h
new file mode 100644 (file)
index 0000000..f4be8e0
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_cpuinfo.h
+ *  CPU feature detection for SDL
+ */
+
+#ifndef _SDL_cpuinfo_h
+#define _SDL_cpuinfo_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This function returns true if the CPU has the RDTSC instruction */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
+
+/** This function returns true if the CPU has MMX features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
+
+/** This function returns true if the CPU has MMX Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
+
+/** This function returns true if the CPU has 3DNow features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
+
+/** This function returns true if the CPU has 3DNow! Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
+
+/** This function returns true if the CPU has SSE features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
+
+/** This function returns true if the CPU has SSE2 features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
+
+/** This function returns true if the CPU has AltiVec features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_cpuinfo_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_endian.h b/misc/builddeps/dp.win32/include/SDL/SDL_endian.h
new file mode 100644 (file)
index 0000000..f7a2e2f
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_endian.h
+ *  Functions for reading and writing endian-specific values
+ */
+
+#ifndef _SDL_endian_h
+#define _SDL_endian_h
+
+#include "SDL_stdinc.h"
+
+/** @name SDL_ENDIANs
+ *  The two types of endianness 
+ */
+/*@{*/
+#define SDL_LIL_ENDIAN 1234
+#define SDL_BIG_ENDIAN 4321
+/*@}*/
+
+#ifndef SDL_BYTEORDER  /* Not defined in SDL_config.h? */
+#if defined(__hppa__) || \
+    defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
+    (defined(__MIPS__) && defined(__MISPEB__)) || \
+    defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
+    defined(__sparc__)
+#define SDL_BYTEORDER  SDL_BIG_ENDIAN
+#else
+#define SDL_BYTEORDER  SDL_LIL_ENDIAN
+#endif
+#endif /* !SDL_BYTEORDER */
+
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  @name SDL_Swap Functions
+ *  Use inline functions for compilers that support them, and static
+ *  functions for those that do not.  Because these functions become
+ *  static for compilers that do not support inline functions, this
+ *  header should only be included in files that actually use them.
+ */
+/*@{*/
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+       __asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
+       return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+       __asm__("xchgb %b0,%h0" : "=Q" (x) :  "0" (x));
+       return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+       Uint16 result;
+
+       __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
+       return result;
+}
+#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+       __asm__("rorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
+       return x;
+}
+#else
+static __inline__ Uint16 SDL_Swap16(Uint16 x) {
+       return((x<<8)|(x>>8));
+}
+#endif
+
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+       __asm__("bswap %0" : "=r" (x) : "0" (x));
+       return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+       __asm__("bswapl %0" : "=r" (x) : "0" (x));
+       return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+       Uint32 result;
+
+       __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
+       __asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
+       __asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
+       return result;
+}
+#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+       __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
+       return x;
+}
+#else
+static __inline__ Uint32 SDL_Swap32(Uint32 x) {
+       return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
+}
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+       union { 
+               struct { Uint32 a,b; } s;
+               Uint64 u;
+       } v;
+       v.u = x;
+       __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 
+               : "=r" (v.s.a), "=r" (v.s.b) 
+               : "0" (v.s.a), "1" (v.s.b)); 
+       return v.u;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+       __asm__("bswapq %0" : "=r" (x) : "0" (x));
+       return x;
+}
+#else
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+       Uint32 hi, lo;
+
+       /* Separate into high and low 32-bit values and swap them */
+       lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+       x >>= 32;
+       hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+       x = SDL_Swap32(lo);
+       x <<= 32;
+       x |= SDL_Swap32(hi);
+       return(x);
+}
+#endif
+#else
+/* This is mainly to keep compilers from complaining in SDL code.
+ * If there is no real 64-bit datatype, then compilers will complain about
+ * the fake 64-bit datatype that SDL provides when it compiles user code.
+ */
+#define SDL_Swap64(X)  (X)
+#endif /* SDL_HAS_64BIT_TYPE */
+/*@}*/
+
+/**
+ *  @name SDL_SwapLE and SDL_SwapBE Functions
+ *  Byteswap item from the specified endianness to the native endianness
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define SDL_SwapLE16(X)        (X)
+#define SDL_SwapLE32(X)        (X)
+#define SDL_SwapLE64(X)        (X)
+#define SDL_SwapBE16(X)        SDL_Swap16(X)
+#define SDL_SwapBE32(X)        SDL_Swap32(X)
+#define SDL_SwapBE64(X)        SDL_Swap64(X)
+#else
+#define SDL_SwapLE16(X)        SDL_Swap16(X)
+#define SDL_SwapLE32(X)        SDL_Swap32(X)
+#define SDL_SwapLE64(X)        SDL_Swap64(X)
+#define SDL_SwapBE16(X)        (X)
+#define SDL_SwapBE32(X)        (X)
+#define SDL_SwapBE64(X)        (X)
+#endif
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_endian_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_error.h b/misc/builddeps/dp.win32/include/SDL/SDL_error.h
new file mode 100644 (file)
index 0000000..b103703
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_error.h
+ *  Simple error message routines for SDL
+ */
+
+#ifndef _SDL_error_h
+#define _SDL_error_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** 
+ *  @name Public functions
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
+extern DECLSPEC char * SDLCALL SDL_GetError(void);
+extern DECLSPEC void SDLCALL SDL_ClearError(void);
+/*@}*/
+
+/**
+ *  @name Private functions
+ *  @internal Private error message function - used internally
+ */
+/*@{*/
+#define SDL_OutOfMemory()      SDL_Error(SDL_ENOMEM)
+#define SDL_Unsupported()      SDL_Error(SDL_UNSUPPORTED)
+typedef enum {
+       SDL_ENOMEM,
+       SDL_EFREAD,
+       SDL_EFWRITE,
+       SDL_EFSEEK,
+       SDL_UNSUPPORTED,
+       SDL_LASTERROR
+} SDL_errorcode;
+extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_error_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_events.h b/misc/builddeps/dp.win32/include/SDL/SDL_events.h
new file mode 100644 (file)
index 0000000..c94a30c
--- /dev/null
@@ -0,0 +1,356 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file SDL_events.h
+ *  Include file for SDL event handling
+ */
+
+#ifndef _SDL_events_h
+#define _SDL_events_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_active.h"
+#include "SDL_keyboard.h"
+#include "SDL_mouse.h"
+#include "SDL_joystick.h"
+#include "SDL_quit.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name General keyboard/mouse state definitions */
+/*@{*/
+#define SDL_RELEASED   0
+#define SDL_PRESSED    1
+/*@}*/
+
+/** Event enumerations */
+typedef enum {
+       SDL_NOEVENT = 0,                        /**< Unused (do not remove) */
+       SDL_ACTIVEEVENT,                        /**< Application loses/gains visibility */
+       SDL_KEYDOWN,                    /**< Keys pressed */
+       SDL_KEYUP,                      /**< Keys released */
+       SDL_MOUSEMOTION,                        /**< Mouse moved */
+       SDL_MOUSEBUTTONDOWN,            /**< Mouse button pressed */
+       SDL_MOUSEBUTTONUP,              /**< Mouse button released */
+       SDL_JOYAXISMOTION,              /**< Joystick axis motion */
+       SDL_JOYBALLMOTION,              /**< Joystick trackball motion */
+       SDL_JOYHATMOTION,               /**< Joystick hat position change */
+       SDL_JOYBUTTONDOWN,              /**< Joystick button pressed */
+       SDL_JOYBUTTONUP,                        /**< Joystick button released */
+       SDL_QUIT,                       /**< User-requested quit */
+       SDL_SYSWMEVENT,                 /**< System specific event */
+       SDL_EVENT_RESERVEDA,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVEDB,            /**< Reserved for future use.. */
+       SDL_VIDEORESIZE,                        /**< User resized video mode */
+       SDL_VIDEOEXPOSE,                        /**< Screen needs to be redrawn */
+       SDL_EVENT_RESERVED2,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVED3,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVED4,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVED5,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVED6,            /**< Reserved for future use.. */
+       SDL_EVENT_RESERVED7,            /**< Reserved for future use.. */
+       /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
+       SDL_USEREVENT = 24,
+       /** This last event is only for bounding internal arrays
+       *  It is the number of bits in the event mask datatype -- Uint32
+        */
+       SDL_NUMEVENTS = 32
+} SDL_EventType;
+
+/** @name Predefined event masks */
+/*@{*/
+#define SDL_EVENTMASK(X)       (1<<(X))
+typedef enum {
+       SDL_ACTIVEEVENTMASK     = SDL_EVENTMASK(SDL_ACTIVEEVENT),
+       SDL_KEYDOWNMASK         = SDL_EVENTMASK(SDL_KEYDOWN),
+       SDL_KEYUPMASK           = SDL_EVENTMASK(SDL_KEYUP),
+       SDL_KEYEVENTMASK        = SDL_EVENTMASK(SDL_KEYDOWN)|
+                                 SDL_EVENTMASK(SDL_KEYUP),
+       SDL_MOUSEMOTIONMASK     = SDL_EVENTMASK(SDL_MOUSEMOTION),
+       SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
+       SDL_MOUSEBUTTONUPMASK   = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+       SDL_MOUSEEVENTMASK      = SDL_EVENTMASK(SDL_MOUSEMOTION)|
+                                 SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
+                                 SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+       SDL_JOYAXISMOTIONMASK   = SDL_EVENTMASK(SDL_JOYAXISMOTION),
+       SDL_JOYBALLMOTIONMASK   = SDL_EVENTMASK(SDL_JOYBALLMOTION),
+       SDL_JOYHATMOTIONMASK    = SDL_EVENTMASK(SDL_JOYHATMOTION),
+       SDL_JOYBUTTONDOWNMASK   = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
+       SDL_JOYBUTTONUPMASK     = SDL_EVENTMASK(SDL_JOYBUTTONUP),
+       SDL_JOYEVENTMASK        = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
+                                 SDL_EVENTMASK(SDL_JOYBALLMOTION)|
+                                 SDL_EVENTMASK(SDL_JOYHATMOTION)|
+                                 SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
+                                 SDL_EVENTMASK(SDL_JOYBUTTONUP),
+       SDL_VIDEORESIZEMASK     = SDL_EVENTMASK(SDL_VIDEORESIZE),
+       SDL_VIDEOEXPOSEMASK     = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
+       SDL_QUITMASK            = SDL_EVENTMASK(SDL_QUIT),
+       SDL_SYSWMEVENTMASK      = SDL_EVENTMASK(SDL_SYSWMEVENT)
+} SDL_EventMask ;
+#define SDL_ALLEVENTS          0xFFFFFFFF
+/*@}*/
+
+/** Application visibility event structure */
+typedef struct SDL_ActiveEvent {
+       Uint8 type;     /**< SDL_ACTIVEEVENT */
+       Uint8 gain;     /**< Whether given states were gained or lost (1/0) */
+       Uint8 state;    /**< A mask of the focus states */
+} SDL_ActiveEvent;
+
+/** Keyboard event structure */
+typedef struct SDL_KeyboardEvent {
+       Uint8 type;     /**< SDL_KEYDOWN or SDL_KEYUP */
+       Uint8 which;    /**< The keyboard device index */
+       Uint8 state;    /**< SDL_PRESSED or SDL_RELEASED */
+       SDL_keysym keysym;
+} SDL_KeyboardEvent;
+
+/** Mouse motion event structure */
+typedef struct SDL_MouseMotionEvent {
+       Uint8 type;     /**< SDL_MOUSEMOTION */
+       Uint8 which;    /**< The mouse device index */
+       Uint8 state;    /**< The current button state */
+       Uint16 x, y;    /**< The X/Y coordinates of the mouse */
+       Sint16 xrel;    /**< The relative motion in the X direction */
+       Sint16 yrel;    /**< The relative motion in the Y direction */
+} SDL_MouseMotionEvent;
+
+/** Mouse button event structure */
+typedef struct SDL_MouseButtonEvent {
+       Uint8 type;     /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
+       Uint8 which;    /**< The mouse device index */
+       Uint8 button;   /**< The mouse button index */
+       Uint8 state;    /**< SDL_PRESSED or SDL_RELEASED */
+       Uint16 x, y;    /**< The X/Y coordinates of the mouse at press time */
+} SDL_MouseButtonEvent;
+
+/** Joystick axis motion event structure */
+typedef struct SDL_JoyAxisEvent {
+       Uint8 type;     /**< SDL_JOYAXISMOTION */
+       Uint8 which;    /**< The joystick device index */
+       Uint8 axis;     /**< The joystick axis index */
+       Sint16 value;   /**< The axis value (range: -32768 to 32767) */
+} SDL_JoyAxisEvent;
+
+/** Joystick trackball motion event structure */
+typedef struct SDL_JoyBallEvent {
+       Uint8 type;     /**< SDL_JOYBALLMOTION */
+       Uint8 which;    /**< The joystick device index */
+       Uint8 ball;     /**< The joystick trackball index */
+       Sint16 xrel;    /**< The relative motion in the X direction */
+       Sint16 yrel;    /**< The relative motion in the Y direction */
+} SDL_JoyBallEvent;
+
+/** Joystick hat position change event structure */
+typedef struct SDL_JoyHatEvent {
+       Uint8 type;     /**< SDL_JOYHATMOTION */
+       Uint8 which;    /**< The joystick device index */
+       Uint8 hat;      /**< The joystick hat index */
+       Uint8 value;    /**< The hat position value:
+                        *   SDL_HAT_LEFTUP   SDL_HAT_UP       SDL_HAT_RIGHTUP
+                        *   SDL_HAT_LEFT     SDL_HAT_CENTERED SDL_HAT_RIGHT
+                        *   SDL_HAT_LEFTDOWN SDL_HAT_DOWN     SDL_HAT_RIGHTDOWN
+                        *  Note that zero means the POV is centered.
+                        */
+} SDL_JoyHatEvent;
+
+/** Joystick button event structure */
+typedef struct SDL_JoyButtonEvent {
+       Uint8 type;     /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
+       Uint8 which;    /**< The joystick device index */
+       Uint8 button;   /**< The joystick button index */
+       Uint8 state;    /**< SDL_PRESSED or SDL_RELEASED */
+} SDL_JoyButtonEvent;
+
+/** The "window resized" event
+ *  When you get this event, you are responsible for setting a new video
+ *  mode with the new width and height.
+ */
+typedef struct SDL_ResizeEvent {
+       Uint8 type;     /**< SDL_VIDEORESIZE */
+       int w;          /**< New width */
+       int h;          /**< New height */
+} SDL_ResizeEvent;
+
+/** The "screen redraw" event */
+typedef struct SDL_ExposeEvent {
+       Uint8 type;     /**< SDL_VIDEOEXPOSE */
+} SDL_ExposeEvent;
+
+/** The "quit requested" event */
+typedef struct SDL_QuitEvent {
+       Uint8 type;     /**< SDL_QUIT */
+} SDL_QuitEvent;
+
+/** A user-defined event type */
+typedef struct SDL_UserEvent {
+       Uint8 type;     /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
+       int code;       /**< User defined event code */
+       void *data1;    /**< User defined data pointer */
+       void *data2;    /**< User defined data pointer */
+} SDL_UserEvent;
+
+/** If you want to use this event, you should include SDL_syswm.h */
+struct SDL_SysWMmsg;
+typedef struct SDL_SysWMmsg SDL_SysWMmsg;
+typedef struct SDL_SysWMEvent {
+       Uint8 type;
+       SDL_SysWMmsg *msg;
+} SDL_SysWMEvent;
+
+/** General event structure */
+typedef union SDL_Event {
+       Uint8 type;
+       SDL_ActiveEvent active;
+       SDL_KeyboardEvent key;
+       SDL_MouseMotionEvent motion;
+       SDL_MouseButtonEvent button;
+       SDL_JoyAxisEvent jaxis;
+       SDL_JoyBallEvent jball;
+       SDL_JoyHatEvent jhat;
+       SDL_JoyButtonEvent jbutton;
+       SDL_ResizeEvent resize;
+       SDL_ExposeEvent expose;
+       SDL_QuitEvent quit;
+       SDL_UserEvent user;
+       SDL_SysWMEvent syswm;
+} SDL_Event;
+
+
+/* Function prototypes */
+
+/** Pumps the event loop, gathering events from the input devices.
+ *  This function updates the event queue and internal input device state.
+ *  This should only be run in the thread that sets the video mode.
+ */
+extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
+
+typedef enum {
+       SDL_ADDEVENT,
+       SDL_PEEKEVENT,
+       SDL_GETEVENT
+} SDL_eventaction;
+
+/**
+ *  Checks the event queue for messages and optionally returns them.
+ *
+ *  If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
+ *  the back of the event queue.
+ *  If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
+ *  of the event queue, matching 'mask', will be returned and will not
+ *  be removed from the queue.
+ *  If 'action' is SDL_GETEVENT, up to 'numevents' events at the front 
+ *  of the event queue, matching 'mask', will be returned and will be
+ *  removed from the queue.
+ *
+ *  @return
+ *  This function returns the number of events actually stored, or -1
+ *  if there was an error.
+ *
+ *  This function is thread-safe.
+ */
+extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
+                               SDL_eventaction action, Uint32 mask);
+
+/** Polls for currently pending events, and returns 1 if there are any pending
+ *  events, or 0 if there are none available.  If 'event' is not NULL, the next
+ *  event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
+
+/** Waits indefinitely for the next available event, returning 1, or 0 if there
+ *  was an error while waiting for events.  If 'event' is not NULL, the next
+ *  event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
+
+/** Add an event to the event queue.
+ *  This function returns 0 on success, or -1 if the event queue was full
+ *  or there was some other error.
+ */
+extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
+
+/** @name Event Filtering */
+/*@{*/
+typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
+/**
+ *  This function sets up a filter to process all events before they
+ *  change internal state and are posted to the internal event queue.
+ *
+ *  The filter is protypted as:
+ *      @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode
+ *
+ * If the filter returns 1, then the event will be added to the internal queue.
+ * If it returns 0, then the event will be dropped from the queue, but the 
+ * internal state will still be updated.  This allows selective filtering of
+ * dynamically arriving events.
+ *
+ * @warning  Be very careful of what you do in the event filter function, as 
+ *           it may run in a different thread!
+ *
+ * There is one caveat when dealing with the SDL_QUITEVENT event type.  The
+ * event filter is only called when the window manager desires to close the
+ * application window.  If the event filter returns 1, then the window will
+ * be closed, otherwise the window will remain open if possible.
+ * If the quit event is generated by an interrupt signal, it will bypass the
+ * internal queue and be delivered to the application at the next event poll.
+ */
+extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
+
+/**
+ *  Return the current event filter - can be used to "chain" filters.
+ *  If there is no event filter set, this function returns NULL.
+ */
+extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
+/*@}*/
+
+/** @name Event State */
+/*@{*/
+#define SDL_QUERY      -1
+#define SDL_IGNORE      0
+#define SDL_DISABLE     0
+#define SDL_ENABLE      1
+/*@}*/
+
+/**
+* This function allows you to set the state of processing certain events.
+* If 'state' is set to SDL_IGNORE, that event will be automatically dropped
+* from the event queue and will not event be filtered.
+* If 'state' is set to SDL_ENABLE, that event will be processed normally.
+* If 'state' is set to SDL_QUERY, SDL_EventState() will return the 
+* current processing state of the specified event.
+*/
+extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_events_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_getenv.h b/misc/builddeps/dp.win32/include/SDL/SDL_getenv.h
new file mode 100644 (file)
index 0000000..253ad88
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_getenv.h
+ *  @deprecated Use SDL_stdinc.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_joystick.h b/misc/builddeps/dp.win32/include/SDL/SDL_joystick.h
new file mode 100644 (file)
index 0000000..d5135c3
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_joystick.h
+ *  Include file for SDL joystick event handling
+ */
+
+#ifndef _SDL_joystick_h
+#define _SDL_joystick_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL_joystick.h
+ *  @note In order to use these functions, SDL_Init() must have been called
+ *        with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
+ *        for joysticks, and load appropriate drivers.
+ */
+
+/** The joystick structure used to identify an SDL joystick */
+struct _SDL_Joystick;
+typedef struct _SDL_Joystick SDL_Joystick;
+
+/* Function prototypes */
+/**
+ * Count the number of joysticks attached to the system
+ */
+extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
+
+/**
+ * Get the implementation dependent name of a joystick.
+ *
+ * This can be called before any joysticks are opened.
+ * If no name can be found, this function returns NULL.
+ */
+extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
+
+/**
+ * Open a joystick for use.
+ *
+ * @param[in] device_index
+ * The index passed as an argument refers to
+ * the N'th joystick on the system.  This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * @return This function returns a joystick identifier, or NULL if an error occurred.
+ */
+extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
+
+/**
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
+
+/**
+ * Get the device index of an opened joystick.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
+
+/**
+ * Get the number of general axis controls on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
+
+/**
+ * Get the number of trackballs on a joystick
+ *
+ * Joystick trackballs have only relative motion events associated
+ * with them and their state cannot be polled.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
+
+/**
+ * Get the number of POV hats on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
+
+/**
+ * Get the number of buttons on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
+
+/**
+ * Update the current state of the open joysticks.
+ *
+ * This is called automatically by the event loop if any joystick
+ * events are enabled.
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
+
+/**
+ * Enable/disable joystick event polling.
+ *
+ * If joystick events are disabled, you must call SDL_JoystickUpdate()
+ * yourself and check the state of the joystick when you want joystick
+ * information.
+ *
+ * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
+
+/**
+ * Get the current state of an axis control on a joystick
+ *
+ * @param[in] axis The axis indices start at index 0.
+ *
+ * @return The state is a value ranging from -32768 to 32767.
+ */
+extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
+
+/**
+ *  @name Hat Positions
+ *  The return value of SDL_JoystickGetHat() is one of the following positions:
+ */
+/*@{*/
+#define SDL_HAT_CENTERED       0x00
+#define SDL_HAT_UP             0x01
+#define SDL_HAT_RIGHT          0x02
+#define SDL_HAT_DOWN           0x04
+#define SDL_HAT_LEFT           0x08
+#define SDL_HAT_RIGHTUP                (SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN      (SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP         (SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN       (SDL_HAT_LEFT|SDL_HAT_DOWN)
+/*@}*/
+
+/** 
+ *  Get the current state of a POV hat on a joystick
+ *
+ *  @param[in] hat The hat indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
+
+/**
+ * Get the ball axis change since the last poll
+ *
+ * @param[in] ball The ball indices start at index 0.
+ *
+ * @return This returns 0, or -1 if you passed it invalid parameters.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
+
+/**
+ * Get the current state of a button on a joystick
+ *
+ * @param[in] button The button indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
+
+/**
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_joystick_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_keyboard.h b/misc/builddeps/dp.win32/include/SDL/SDL_keyboard.h
new file mode 100644 (file)
index 0000000..7b59d24
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_keyboard.h
+ *  Include file for SDL keyboard event handling
+ */
+
+#ifndef _SDL_keyboard_h
+#define _SDL_keyboard_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_keysym.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Keysym structure
+ *
+ *  - The scancode is hardware dependent, and should not be used by general
+ *    applications.  If no hardware scancode is available, it will be 0.
+ *
+ *  - The 'unicode' translated character is only available when character
+ *    translation is enabled by the SDL_EnableUNICODE() API.  If non-zero,
+ *    this is a UNICODE character corresponding to the keypress.  If the
+ *    high 9 bits of the character are 0, then this maps to the equivalent
+ *    ASCII character:
+ *      @code
+ *     char ch;
+ *     if ( (keysym.unicode & 0xFF80) == 0 ) {
+ *             ch = keysym.unicode & 0x7F;
+ *     } else {
+ *             An international character..
+ *     }
+ *      @endcode
+ */
+typedef struct SDL_keysym {
+       Uint8 scancode;                 /**< hardware specific scancode */
+       SDLKey sym;                     /**< SDL virtual keysym */
+       SDLMod mod;                     /**< current key modifiers */
+       Uint16 unicode;                 /**< translated character */
+} SDL_keysym;
+
+/** This is the mask which refers to all hotkey bindings */
+#define SDL_ALL_HOTKEYS                0xFFFFFFFF
+
+/* Function prototypes */
+/**
+ * Enable/Disable UNICODE translation of keyboard input.
+ *
+ * This translation has some overhead, so translation defaults off.
+ *
+ * @param[in] enable
+ * If 'enable' is 1, translation is enabled.
+ * If 'enable' is 0, translation is disabled.
+ * If 'enable' is -1, the translation state is not changed.
+ *
+ * @return It returns the previous state of keyboard translation.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
+
+#define SDL_DEFAULT_REPEAT_DELAY       500
+#define SDL_DEFAULT_REPEAT_INTERVAL    30
+/**
+ * Enable/Disable keyboard repeat.  Keyboard repeat defaults to off.
+ *
+ *  @param[in] delay
+ *  'delay' is the initial delay in ms between the time when a key is
+ *  pressed, and keyboard repeat begins.
+ *
+ *  @param[in] interval
+ *  'interval' is the time in ms between keyboard repeat events.
+ *
+ *  If 'delay' is set to 0, keyboard repeat is disabled.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
+extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
+
+/**
+ * Get a snapshot of the current state of the keyboard.
+ * Returns an array of keystates, indexed by the SDLK_* syms.
+ * Usage:
+ *     @code
+ *     Uint8 *keystate = SDL_GetKeyState(NULL);
+ *     if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed.
+ *     @endcode
+ */
+extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
+
+/**
+ * Get the current key modifier state
+ */
+extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
+
+/**
+ * Set the current key modifier state.
+ * This does not change the keyboard state, only the key modifier flags.
+ */
+extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
+
+/**
+ * Get the name of an SDL virtual keysym
+ */
+extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_keyboard_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_keysym.h b/misc/builddeps/dp.win32/include/SDL/SDL_keysym.h
new file mode 100644 (file)
index 0000000..9010128
--- /dev/null
@@ -0,0 +1,326 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_keysym_h
+#define _SDL_keysym_h
+
+/** What we really want is a mapping of every raw key on the keyboard.
+ *  To support international keyboards, we use the range 0xA1 - 0xFF
+ *  as international virtual keycodes.  We'll follow in the footsteps of X11...
+ *  @brief The names of the keys
+ */
+typedef enum {
+        /** @name ASCII mapped keysyms
+         *  The keyboard syms have been cleverly chosen to map to ASCII
+         */
+        /*@{*/
+       SDLK_UNKNOWN            = 0,
+       SDLK_FIRST              = 0,
+       SDLK_BACKSPACE          = 8,
+       SDLK_TAB                = 9,
+       SDLK_CLEAR              = 12,
+       SDLK_RETURN             = 13,
+       SDLK_PAUSE              = 19,
+       SDLK_ESCAPE             = 27,
+       SDLK_SPACE              = 32,
+       SDLK_EXCLAIM            = 33,
+       SDLK_QUOTEDBL           = 34,
+       SDLK_HASH               = 35,
+       SDLK_DOLLAR             = 36,
+       SDLK_AMPERSAND          = 38,
+       SDLK_QUOTE              = 39,
+       SDLK_LEFTPAREN          = 40,
+       SDLK_RIGHTPAREN         = 41,
+       SDLK_ASTERISK           = 42,
+       SDLK_PLUS               = 43,
+       SDLK_COMMA              = 44,
+       SDLK_MINUS              = 45,
+       SDLK_PERIOD             = 46,
+       SDLK_SLASH              = 47,
+       SDLK_0                  = 48,
+       SDLK_1                  = 49,
+       SDLK_2                  = 50,
+       SDLK_3                  = 51,
+       SDLK_4                  = 52,
+       SDLK_5                  = 53,
+       SDLK_6                  = 54,
+       SDLK_7                  = 55,
+       SDLK_8                  = 56,
+       SDLK_9                  = 57,
+       SDLK_COLON              = 58,
+       SDLK_SEMICOLON          = 59,
+       SDLK_LESS               = 60,
+       SDLK_EQUALS             = 61,
+       SDLK_GREATER            = 62,
+       SDLK_QUESTION           = 63,
+       SDLK_AT                 = 64,
+       /* 
+          Skip uppercase letters
+        */
+       SDLK_LEFTBRACKET        = 91,
+       SDLK_BACKSLASH          = 92,
+       SDLK_RIGHTBRACKET       = 93,
+       SDLK_CARET              = 94,
+       SDLK_UNDERSCORE         = 95,
+       SDLK_BACKQUOTE          = 96,
+       SDLK_a                  = 97,
+       SDLK_b                  = 98,
+       SDLK_c                  = 99,
+       SDLK_d                  = 100,
+       SDLK_e                  = 101,
+       SDLK_f                  = 102,
+       SDLK_g                  = 103,
+       SDLK_h                  = 104,
+       SDLK_i                  = 105,
+       SDLK_j                  = 106,
+       SDLK_k                  = 107,
+       SDLK_l                  = 108,
+       SDLK_m                  = 109,
+       SDLK_n                  = 110,
+       SDLK_o                  = 111,
+       SDLK_p                  = 112,
+       SDLK_q                  = 113,
+       SDLK_r                  = 114,
+       SDLK_s                  = 115,
+       SDLK_t                  = 116,
+       SDLK_u                  = 117,
+       SDLK_v                  = 118,
+       SDLK_w                  = 119,
+       SDLK_x                  = 120,
+       SDLK_y                  = 121,
+       SDLK_z                  = 122,
+       SDLK_DELETE             = 127,
+       /* End of ASCII mapped keysyms */
+        /*@}*/
+
+       /** @name International keyboard syms */
+        /*@{*/
+       SDLK_WORLD_0            = 160,          /* 0xA0 */
+       SDLK_WORLD_1            = 161,
+       SDLK_WORLD_2            = 162,
+       SDLK_WORLD_3            = 163,
+       SDLK_WORLD_4            = 164,
+       SDLK_WORLD_5            = 165,
+       SDLK_WORLD_6            = 166,
+       SDLK_WORLD_7            = 167,
+       SDLK_WORLD_8            = 168,
+       SDLK_WORLD_9            = 169,
+       SDLK_WORLD_10           = 170,
+       SDLK_WORLD_11           = 171,
+       SDLK_WORLD_12           = 172,
+       SDLK_WORLD_13           = 173,
+       SDLK_WORLD_14           = 174,
+       SDLK_WORLD_15           = 175,
+       SDLK_WORLD_16           = 176,
+       SDLK_WORLD_17           = 177,
+       SDLK_WORLD_18           = 178,
+       SDLK_WORLD_19           = 179,
+       SDLK_WORLD_20           = 180,
+       SDLK_WORLD_21           = 181,
+       SDLK_WORLD_22           = 182,
+       SDLK_WORLD_23           = 183,
+       SDLK_WORLD_24           = 184,
+       SDLK_WORLD_25           = 185,
+       SDLK_WORLD_26           = 186,
+       SDLK_WORLD_27           = 187,
+       SDLK_WORLD_28           = 188,
+       SDLK_WORLD_29           = 189,
+       SDLK_WORLD_30           = 190,
+       SDLK_WORLD_31           = 191,
+       SDLK_WORLD_32           = 192,
+       SDLK_WORLD_33           = 193,
+       SDLK_WORLD_34           = 194,
+       SDLK_WORLD_35           = 195,
+       SDLK_WORLD_36           = 196,
+       SDLK_WORLD_37           = 197,
+       SDLK_WORLD_38           = 198,
+       SDLK_WORLD_39           = 199,
+       SDLK_WORLD_40           = 200,
+       SDLK_WORLD_41           = 201,
+       SDLK_WORLD_42           = 202,
+       SDLK_WORLD_43           = 203,
+       SDLK_WORLD_44           = 204,
+       SDLK_WORLD_45           = 205,
+       SDLK_WORLD_46           = 206,
+       SDLK_WORLD_47           = 207,
+       SDLK_WORLD_48           = 208,
+       SDLK_WORLD_49           = 209,
+       SDLK_WORLD_50           = 210,
+       SDLK_WORLD_51           = 211,
+       SDLK_WORLD_52           = 212,
+       SDLK_WORLD_53           = 213,
+       SDLK_WORLD_54           = 214,
+       SDLK_WORLD_55           = 215,
+       SDLK_WORLD_56           = 216,
+       SDLK_WORLD_57           = 217,
+       SDLK_WORLD_58           = 218,
+       SDLK_WORLD_59           = 219,
+       SDLK_WORLD_60           = 220,
+       SDLK_WORLD_61           = 221,
+       SDLK_WORLD_62           = 222,
+       SDLK_WORLD_63           = 223,
+       SDLK_WORLD_64           = 224,
+       SDLK_WORLD_65           = 225,
+       SDLK_WORLD_66           = 226,
+       SDLK_WORLD_67           = 227,
+       SDLK_WORLD_68           = 228,
+       SDLK_WORLD_69           = 229,
+       SDLK_WORLD_70           = 230,
+       SDLK_WORLD_71           = 231,
+       SDLK_WORLD_72           = 232,
+       SDLK_WORLD_73           = 233,
+       SDLK_WORLD_74           = 234,
+       SDLK_WORLD_75           = 235,
+       SDLK_WORLD_76           = 236,
+       SDLK_WORLD_77           = 237,
+       SDLK_WORLD_78           = 238,
+       SDLK_WORLD_79           = 239,
+       SDLK_WORLD_80           = 240,
+       SDLK_WORLD_81           = 241,
+       SDLK_WORLD_82           = 242,
+       SDLK_WORLD_83           = 243,
+       SDLK_WORLD_84           = 244,
+       SDLK_WORLD_85           = 245,
+       SDLK_WORLD_86           = 246,
+       SDLK_WORLD_87           = 247,
+       SDLK_WORLD_88           = 248,
+       SDLK_WORLD_89           = 249,
+       SDLK_WORLD_90           = 250,
+       SDLK_WORLD_91           = 251,
+       SDLK_WORLD_92           = 252,
+       SDLK_WORLD_93           = 253,
+       SDLK_WORLD_94           = 254,
+       SDLK_WORLD_95           = 255,          /* 0xFF */
+        /*@}*/
+
+       /** @name Numeric keypad */
+        /*@{*/
+       SDLK_KP0                = 256,
+       SDLK_KP1                = 257,
+       SDLK_KP2                = 258,
+       SDLK_KP3                = 259,
+       SDLK_KP4                = 260,
+       SDLK_KP5                = 261,
+       SDLK_KP6                = 262,
+       SDLK_KP7                = 263,
+       SDLK_KP8                = 264,
+       SDLK_KP9                = 265,
+       SDLK_KP_PERIOD          = 266,
+       SDLK_KP_DIVIDE          = 267,
+       SDLK_KP_MULTIPLY        = 268,
+       SDLK_KP_MINUS           = 269,
+       SDLK_KP_PLUS            = 270,
+       SDLK_KP_ENTER           = 271,
+       SDLK_KP_EQUALS          = 272,
+        /*@}*/
+
+       /** @name Arrows + Home/End pad */
+        /*@{*/
+       SDLK_UP                 = 273,
+       SDLK_DOWN               = 274,
+       SDLK_RIGHT              = 275,
+       SDLK_LEFT               = 276,
+       SDLK_INSERT             = 277,
+       SDLK_HOME               = 278,
+       SDLK_END                = 279,
+       SDLK_PAGEUP             = 280,
+       SDLK_PAGEDOWN           = 281,
+        /*@}*/
+
+       /** @name Function keys */
+        /*@{*/
+       SDLK_F1                 = 282,
+       SDLK_F2                 = 283,
+       SDLK_F3                 = 284,
+       SDLK_F4                 = 285,
+       SDLK_F5                 = 286,
+       SDLK_F6                 = 287,
+       SDLK_F7                 = 288,
+       SDLK_F8                 = 289,
+       SDLK_F9                 = 290,
+       SDLK_F10                = 291,
+       SDLK_F11                = 292,
+       SDLK_F12                = 293,
+       SDLK_F13                = 294,
+       SDLK_F14                = 295,
+       SDLK_F15                = 296,
+        /*@}*/
+
+       /** @name Key state modifier keys */
+        /*@{*/
+       SDLK_NUMLOCK            = 300,
+       SDLK_CAPSLOCK           = 301,
+       SDLK_SCROLLOCK          = 302,
+       SDLK_RSHIFT             = 303,
+       SDLK_LSHIFT             = 304,
+       SDLK_RCTRL              = 305,
+       SDLK_LCTRL              = 306,
+       SDLK_RALT               = 307,
+       SDLK_LALT               = 308,
+       SDLK_RMETA              = 309,
+       SDLK_LMETA              = 310,
+       SDLK_LSUPER             = 311,          /**< Left "Windows" key */
+       SDLK_RSUPER             = 312,          /**< Right "Windows" key */
+       SDLK_MODE               = 313,          /**< "Alt Gr" key */
+       SDLK_COMPOSE            = 314,          /**< Multi-key compose key */
+        /*@}*/
+
+       /** @name Miscellaneous function keys */
+        /*@{*/
+       SDLK_HELP               = 315,
+       SDLK_PRINT              = 316,
+       SDLK_SYSREQ             = 317,
+       SDLK_BREAK              = 318,
+       SDLK_MENU               = 319,
+       SDLK_POWER              = 320,          /**< Power Macintosh power key */
+       SDLK_EURO               = 321,          /**< Some european keyboards */
+       SDLK_UNDO               = 322,          /**< Atari keyboard has Undo */
+        /*@}*/
+
+       /* Add any other keys here */
+
+       SDLK_LAST
+} SDLKey;
+
+/** Enumeration of valid key mods (possibly OR'd together) */
+typedef enum {
+       KMOD_NONE  = 0x0000,
+       KMOD_LSHIFT= 0x0001,
+       KMOD_RSHIFT= 0x0002,
+       KMOD_LCTRL = 0x0040,
+       KMOD_RCTRL = 0x0080,
+       KMOD_LALT  = 0x0100,
+       KMOD_RALT  = 0x0200,
+       KMOD_LMETA = 0x0400,
+       KMOD_RMETA = 0x0800,
+       KMOD_NUM   = 0x1000,
+       KMOD_CAPS  = 0x2000,
+       KMOD_MODE  = 0x4000,
+       KMOD_RESERVED = 0x8000
+} SDLMod;
+
+#define KMOD_CTRL      (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT     (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT       (KMOD_LALT|KMOD_RALT)
+#define KMOD_META      (KMOD_LMETA|KMOD_RMETA)
+
+#endif /* _SDL_keysym_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_loadso.h b/misc/builddeps/dp.win32/include/SDL/SDL_loadso.h
new file mode 100644 (file)
index 0000000..45a17f9
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_loadso.h
+ *  System dependent library loading routines
+ */
+
+/** @file SDL_loadso.h
+ *  Some things to keep in mind:                                        
+ *  - These functions only work on C function names.  Other languages may
+ *    have name mangling and intrinsic language support that varies from
+ *    compiler to compiler.
+ *  - Make sure you declare your function pointers with the same calling
+ *    convention as the actual library function.  Your code will crash
+ *    mysteriously if you do not do this.
+ *  - Avoid namespace collisions.  If you load a symbol from the library,
+ *    it is not defined whether or not it goes into the global symbol
+ *    namespace for the application.  If it does and it conflicts with
+ *    symbols in your code or other shared libraries, you will not get
+ *    the results you expect. :)
+ */
+
+
+#ifndef _SDL_loadso_h
+#define _SDL_loadso_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * This function dynamically loads a shared object and returns a pointer
+ * to the object handle (or NULL if there was an error).
+ * The 'sofile' parameter is a system dependent name of the object file.
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
+
+/**
+ * Given an object handle, this function looks up the address of the
+ * named function in the shared object and returns it.  This address
+ * is no longer valid after calling SDL_UnloadObject().
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
+
+/** Unload a shared object from memory */
+extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_loadso_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_main.h b/misc/builddeps/dp.win32/include/SDL/SDL_main.h
new file mode 100644 (file)
index 0000000..b7f6b2c
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_main_h
+#define _SDL_main_h
+
+#include "SDL_stdinc.h"
+
+/** @file SDL_main.h
+ *  Redefine main() on Win32 and MacOS so that it is called by winmain.c
+ */
+
+#if defined(__WIN32__) || \
+    (defined(__MWERKS__) && !defined(__BEOS__)) || \
+    defined(__MACOS__) || defined(__MACOSX__) || \
+    defined(__SYMBIAN32__) || defined(QWS)
+
+#ifdef __cplusplus
+#define C_LINKAGE      "C"
+#else
+#define C_LINKAGE
+#endif /* __cplusplus */
+
+/** The application's main() function must be called with C linkage,
+ *  and should be declared like this:
+ *      @code
+ *      #ifdef __cplusplus
+ *      extern "C"
+ *      #endif
+ *     int main(int argc, char *argv[])
+ *     {
+ *     }
+ *      @endcode
+ */
+#define main   SDL_main
+
+/** The prototype for the application's main() function */
+extern C_LINKAGE int SDL_main(int argc, char *argv[]);
+
+
+/** @name From the SDL library code -- needed for registering the app on Win32 */
+/*@{*/
+#ifdef __WIN32__
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This should be called from your WinMain() function, if any */
+extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
+/** This can also be called, but is no longer necessary */
+extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
+/** This can also be called, but is no longer necessary (SDL_Quit calls it) */
+extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
+/*@{*/
+#if defined(__MACOS__)
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Forward declaration so we don't need to include QuickDraw.h */
+struct QDGlobals;
+
+/** This should be called from your main() function, if any */
+extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
+
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+#endif /* Need to redefine main()? */
+
+#endif /* _SDL_main_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_mouse.h b/misc/builddeps/dp.win32/include/SDL/SDL_mouse.h
new file mode 100644 (file)
index 0000000..a573f04
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_mouse.h
+ *  Include file for SDL mouse event handling
+ */
+
+#ifndef _SDL_mouse_h
+#define _SDL_mouse_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct WMcursor WMcursor;      /**< Implementation dependent */
+typedef struct SDL_Cursor {
+       SDL_Rect area;                  /**< The area of the mouse cursor */
+       Sint16 hot_x, hot_y;            /**< The "tip" of the cursor */
+       Uint8 *data;                    /**< B/W cursor data */
+       Uint8 *mask;                    /**< B/W cursor mask */
+       Uint8 *save[2];                 /**< Place to save cursor area */
+       WMcursor *wm_cursor;            /**< Window-manager cursor */
+} SDL_Cursor;
+
+/* Function prototypes */
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * current mouse cursor position.  You can pass NULL for either x or y.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
+
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * mouse deltas since the last call to SDL_GetRelativeMouseState().
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
+
+/**
+ * Set the position of the mouse cursor (generates a mouse motion event)
+ */
+extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
+
+/**
+ * Create a cursor using the specified data and mask (in MSB format).
+ * The cursor width must be a multiple of 8 bits.
+ *
+ * The cursor is created in black and white according to the following:
+ * data  mask    resulting pixel on screen
+ *  0     1       White
+ *  1     1       Black
+ *  0     0       Transparent
+ *  1     0       Inverted color if possible, black if not.
+ *
+ * Cursors created with this function must be freed with SDL_FreeCursor().
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
+               (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+
+/**
+ * Set the currently active cursor to the specified one.
+ * If the cursor is currently visible, the change will be immediately 
+ * represented on the display.
+ */
+extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
+
+/**
+ * Returns the currently active cursor.
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
+
+/**
+ * Deallocates a cursor created with SDL_CreateCursor().
+ */
+extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
+
+/**
+ * Toggle whether or not the cursor is shown on the screen.
+ * The cursor start off displayed, but can be turned off.
+ * SDL_ShowCursor() returns 1 if the cursor was being displayed
+ * before the call, or 0 if it was not.  You can query the current
+ * state by passing a 'toggle' value of -1.
+ */
+extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
+
+/*@{*/
+/** Used as a mask when testing buttons in buttonstate
+ *  Button 1:  Left mouse button
+ *  Button 2:  Middle mouse button
+ *  Button 3:  Right mouse button
+ *  Button 4:  Mouse wheel up   (may also be a real button)
+ *  Button 5:  Mouse wheel down (may also be a real button)
+ */
+#define SDL_BUTTON(X)          (1 << ((X)-1))
+#define SDL_BUTTON_LEFT                1
+#define SDL_BUTTON_MIDDLE      2
+#define SDL_BUTTON_RIGHT       3
+#define SDL_BUTTON_WHEELUP     4
+#define SDL_BUTTON_WHEELDOWN   5
+#define SDL_BUTTON_X1          6
+#define SDL_BUTTON_X2          7
+#define SDL_BUTTON_LMASK       SDL_BUTTON(SDL_BUTTON_LEFT)
+#define SDL_BUTTON_MMASK       SDL_BUTTON(SDL_BUTTON_MIDDLE)
+#define SDL_BUTTON_RMASK       SDL_BUTTON(SDL_BUTTON_RIGHT)
+#define SDL_BUTTON_X1MASK      SDL_BUTTON(SDL_BUTTON_X1)
+#define SDL_BUTTON_X2MASK      SDL_BUTTON(SDL_BUTTON_X2)
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mouse_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_mutex.h b/misc/builddeps/dp.win32/include/SDL/SDL_mutex.h
new file mode 100644 (file)
index 0000000..920971d
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_mutex_h
+#define _SDL_mutex_h
+
+/** @file SDL_mutex.h
+ *  Functions to provide thread synchronization primitives
+ *
+ *  @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Synchronization functions which can time out return this value
+ *  if they time out.
+ */
+#define SDL_MUTEX_TIMEDOUT     1
+
+/** This is the timeout value which corresponds to never time out */
+#define SDL_MUTEX_MAXWAIT      (~(Uint32)0)
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Mutex functions                                        */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL mutex structure, defined in SDL_mutex.c */
+struct SDL_mutex;
+typedef struct SDL_mutex SDL_mutex;
+
+/** Create a mutex, initialized unlocked */
+extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
+
+#define SDL_LockMutex(m)       SDL_mutexP(m)
+/** Lock the mutex
+ *  @return 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
+
+#define SDL_UnlockMutex(m)     SDL_mutexV(m)
+/** Unlock the mutex
+ *  @return 0, or -1 on error
+ *
+ *  It is an error to unlock a mutex that has not been locked by
+ *  the current thread, and doing so results in undefined behavior.
+ */
+extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
+
+/** Destroy a mutex */
+extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Semaphore functions                                    */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL semaphore structure, defined in SDL_sem.c */
+struct SDL_semaphore;
+typedef struct SDL_semaphore SDL_sem;
+
+/** Create a semaphore, initialized with value, returns NULL on failure. */
+extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
+
+/** Destroy a semaphore */
+extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
+
+/**
+ * This function suspends the calling thread until the semaphore pointed 
+ * to by sem has a positive count. It then atomically decreases the semaphore
+ * count.
+ */
+extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
+
+/** Non-blocking variant of SDL_SemWait().
+ *  @return 0 if the wait succeeds,
+ *  SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
+
+/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
+ *  the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
+ *  the allotted time, and -1 on error.
+ *
+ *  On some platforms this function is implemented by looping with a delay
+ *  of 1 ms, and so should be avoided if possible.
+ */
+extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
+
+/** Atomically increases the semaphore's count (not blocking).
+ *  @return 0, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
+
+/** Returns the current count of the semaphore */
+extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Condition_variable_functions                           */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*@{*/
+/** The SDL condition variable structure, defined in SDL_cond.c */
+struct SDL_cond;
+typedef struct SDL_cond SDL_cond;
+/*@}*/
+
+/** Create a condition variable */
+extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
+
+/** Destroy a condition variable */
+extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
+
+/** Restart one of the threads that are waiting on the condition variable,
+ *  @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
+
+/** Restart all threads that are waiting on the condition variable,
+ *  @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
+
+/** Wait on the condition variable, unlocking the provided mutex.
+ *  The mutex must be locked before entering this function!
+ *  The mutex is re-locked once the condition variable is signaled.
+ *  @return 0 when it is signaled, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
+
+/** Waits for at most 'ms' milliseconds, and returns 0 if the condition
+ *  variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
+ *  signaled in the allotted time, and -1 on error.
+ *  On some platforms this function is implemented by looping with a delay
+ *  of 1 ms, and so should be avoided if possible.
+ */
+extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mutex_h */
+
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_name.h b/misc/builddeps/dp.win32/include/SDL/SDL_name.h
new file mode 100644 (file)
index 0000000..511619a
--- /dev/null
@@ -0,0 +1,11 @@
+
+#ifndef _SDLname_h_
+#define _SDLname_h_
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define NeedFunctionPrototypes 1
+#endif
+
+#define SDL_NAME(X)    SDL_##X
+
+#endif /* _SDLname_h_ */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_opengl.h b/misc/builddeps/dp.win32/include/SDL/SDL_opengl.h
new file mode 100644 (file)
index 0000000..c479a3a
--- /dev/null
@@ -0,0 +1,6556 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_opengl.h
+ *  This is a simple file to encapsulate the OpenGL API headers
+ */
+
+#include "SDL_config.h"
+
+#ifdef __WIN32__
+#define WIN32_LEAN_AND_MEAN
+#ifndef NOMINMAX
+#define NOMINMAX       /* Don't defined min() and max() */
+#endif
+#include <windows.h>
+#endif
+#ifndef NO_SDL_GLEXT
+#define __glext_h_  /* Don't let gl.h include glext.h */
+#endif
+#if defined(__MACOSX__)
+#include <OpenGL/gl.h> /* Header File For The OpenGL Library */
+#include <OpenGL/glu.h>        /* Header File For The GLU Library */
+#elif defined(__MACOS__)
+#include <gl.h>                /* Header File For The OpenGL Library */
+#include <glu.h>       /* Header File For The GLU Library */
+#else
+#include <GL/gl.h>     /* Header File For The OpenGL Library */
+#include <GL/glu.h>    /* Header File For The GLU Library */
+#endif
+#ifndef NO_SDL_GLEXT
+#undef __glext_h_
+#endif
+
+/** @name GLext.h
+ *  This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
+ *  It is included here because glext.h is not available on some systems.
+ *  If you don't want this version included, simply define "NO_SDL_GLEXT"
+ */
+/*@{*/
+#ifndef NO_SDL_GLEXT
+#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2005/06/20 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GL_GLEXT_VERSION 29
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2            0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_INT_8_8_8_8           0x8035
+#define GL_UNSIGNED_INT_10_10_10_2        0x8036
+#define GL_RESCALE_NORMAL                 0x803A
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_PACK_SKIP_IMAGES               0x806B
+#define GL_PACK_IMAGE_HEIGHT              0x806C
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_PROXY_TEXTURE_3D               0x8070
+#define GL_TEXTURE_DEPTH                  0x8071
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_BGR                            0x80E0
+#define GL_BGRA                           0x80E1
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8
+#define GL_SINGLE_COLOR                   0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR        0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY  0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_FUNC_ADD                       0x8006
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_CONVOLUTION_1D                 0x8010
+#define GL_CONVOLUTION_2D                 0x8011
+#define GL_SEPARABLE_2D                   0x8012
+#define GL_CONVOLUTION_BORDER_MODE        0x8013
+#define GL_CONVOLUTION_FILTER_SCALE       0x8014
+#define GL_CONVOLUTION_FILTER_BIAS        0x8015
+#define GL_REDUCE                         0x8016
+#define GL_CONVOLUTION_FORMAT             0x8017
+#define GL_CONVOLUTION_WIDTH              0x8018
+#define GL_CONVOLUTION_HEIGHT             0x8019
+#define GL_MAX_CONVOLUTION_WIDTH          0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT         0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE     0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS      0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023
+#define GL_HISTOGRAM                      0x8024
+#define GL_PROXY_HISTOGRAM                0x8025
+#define GL_HISTOGRAM_WIDTH                0x8026
+#define GL_HISTOGRAM_FORMAT               0x8027
+#define GL_HISTOGRAM_RED_SIZE             0x8028
+#define GL_HISTOGRAM_GREEN_SIZE           0x8029
+#define GL_HISTOGRAM_BLUE_SIZE            0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE           0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C
+#define GL_HISTOGRAM_SINK                 0x802D
+#define GL_MINMAX                         0x802E
+#define GL_MINMAX_FORMAT                  0x802F
+#define GL_MINMAX_SINK                    0x8030
+#define GL_TABLE_TOO_LARGE                0x8031
+#define GL_COLOR_MATRIX                   0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   0x80BB
+#define GL_COLOR_TABLE                    0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2
+#define GL_PROXY_COLOR_TABLE              0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE              0x80D6
+#define GL_COLOR_TABLE_BIAS               0x80D7
+#define GL_COLOR_TABLE_FORMAT             0x80D8
+#define GL_COLOR_TABLE_WIDTH              0x80D9
+#define GL_COLOR_TABLE_RED_SIZE           0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF
+#define GL_CONSTANT_BORDER                0x8151
+#define GL_REPLICATE_BORDER               0x8153
+#define GL_CONVOLUTION_BORDER_COLOR       0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
+#define GL_MAX_TEXTURE_UNITS              0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX     0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX    0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX       0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX         0x84E6
+#define GL_MULTISAMPLE                    0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_MULTISAMPLE_BIT                0x20000000
+#define GL_NORMAL_MAP                     0x8511
+#define GL_REFLECTION_MAP                 0x8512
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP         0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_COMPRESSED_ALPHA               0x84E9
+#define GL_COMPRESSED_LUMINANCE           0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA     0x84EB
+#define GL_COMPRESSED_INTENSITY           0x84EC
+#define GL_COMPRESSED_RGB                 0x84ED
+#define GL_COMPRESSED_RGBA                0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT       0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  0x86A0
+#define GL_TEXTURE_COMPRESSED             0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_CLAMP_TO_BORDER                0x812D
+#define GL_COMBINE                        0x8570
+#define GL_COMBINE_RGB                    0x8571
+#define GL_COMBINE_ALPHA                  0x8572
+#define GL_SOURCE0_RGB                    0x8580
+#define GL_SOURCE1_RGB                    0x8581
+#define GL_SOURCE2_RGB                    0x8582
+#define GL_SOURCE0_ALPHA                  0x8588
+#define GL_SOURCE1_ALPHA                  0x8589
+#define GL_SOURCE2_ALPHA                  0x858A
+#define GL_OPERAND0_RGB                   0x8590
+#define GL_OPERAND1_RGB                   0x8591
+#define GL_OPERAND2_RGB                   0x8592
+#define GL_OPERAND0_ALPHA                 0x8598
+#define GL_OPERAND1_ALPHA                 0x8599
+#define GL_OPERAND2_ALPHA                 0x859A
+#define GL_RGB_SCALE                      0x8573
+#define GL_ADD_SIGNED                     0x8574
+#define GL_INTERPOLATE                    0x8575
+#define GL_SUBTRACT                       0x84E7
+#define GL_CONSTANT                       0x8576
+#define GL_PRIMARY_COLOR                  0x8577
+#define GL_PREVIOUS                       0x8578
+#define GL_DOT3_RGB                       0x86AE
+#define GL_DOT3_RGBA                      0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_POINT_SIZE_MIN                 0x8126
+#define GL_POINT_SIZE_MAX                 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
+#define GL_POINT_DISTANCE_ATTENUATION     0x8129
+#define GL_GENERATE_MIPMAP                0x8191
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_DEPTH_COMPONENT32              0x81A7
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FOG_COORDINATE_SOURCE          0x8450
+#define GL_FOG_COORDINATE                 0x8451
+#define GL_FRAGMENT_DEPTH                 0x8452
+#define GL_CURRENT_FOG_COORDINATE         0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE      0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE    0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER   0x8456
+#define GL_FOG_COORDINATE_ARRAY           0x8457
+#define GL_COLOR_SUM                      0x8458
+#define GL_CURRENT_SECONDARY_COLOR        0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE     0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE     0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE   0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER  0x845D
+#define GL_SECONDARY_COLOR_ARRAY          0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_FILTER_CONTROL         0x8500
+#define GL_TEXTURE_LOD_BIAS               0x8501
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_TEXTURE_DEPTH_SIZE             0x884A
+#define GL_DEPTH_TEXTURE_MODE             0x884B
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_COMPARE_R_TO_TEXTURE           0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_QUERY_COUNTER_BITS             0x8864
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING    0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING    0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING     0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING     0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING    0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY                      0x88B8
+#define GL_WRITE_ONLY                     0x88B9
+#define GL_READ_WRITE                     0x88BA
+#define GL_BUFFER_ACCESS                  0x88BB
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_SAMPLES_PASSED                 0x8914
+#define GL_FOG_COORD_SRC                  GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD                      GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD              GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE           GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE         GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER        GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY                GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB                       GL_SOURCE0_RGB
+#define GL_SRC1_RGB                       GL_SOURCE1_RGB
+#define GL_SRC2_RGB                       GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA                     GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA                     GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA                     GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB             GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE      0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE        0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_POINT_SPRITE                   0x8861
+#define GL_COORD_REPLACE                  0x8862
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS             0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_MAX_VARYING_FLOATS             0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_1D                     0x8B5D
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_SAMPLER_1D_SHADOW              0x8B61
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN      0x8CA0
+#define GL_LOWER_LEFT                     0x8CA1
+#define GL_UPPER_LEFT                     0x8CA2
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB                   0x84C0
+#define GL_TEXTURE1_ARB                   0x84C1
+#define GL_TEXTURE2_ARB                   0x84C2
+#define GL_TEXTURE3_ARB                   0x84C3
+#define GL_TEXTURE4_ARB                   0x84C4
+#define GL_TEXTURE5_ARB                   0x84C5
+#define GL_TEXTURE6_ARB                   0x84C6
+#define GL_TEXTURE7_ARB                   0x84C7
+#define GL_TEXTURE8_ARB                   0x84C8
+#define GL_TEXTURE9_ARB                   0x84C9
+#define GL_TEXTURE10_ARB                  0x84CA
+#define GL_TEXTURE11_ARB                  0x84CB
+#define GL_TEXTURE12_ARB                  0x84CC
+#define GL_TEXTURE13_ARB                  0x84CD
+#define GL_TEXTURE14_ARB                  0x84CE
+#define GL_TEXTURE15_ARB                  0x84CF
+#define GL_TEXTURE16_ARB                  0x84D0
+#define GL_TEXTURE17_ARB                  0x84D1
+#define GL_TEXTURE18_ARB                  0x84D2
+#define GL_TEXTURE19_ARB                  0x84D3
+#define GL_TEXTURE20_ARB                  0x84D4
+#define GL_TEXTURE21_ARB                  0x84D5
+#define GL_TEXTURE22_ARB                  0x84D6
+#define GL_TEXTURE23_ARB                  0x84D7
+#define GL_TEXTURE24_ARB                  0x84D8
+#define GL_TEXTURE25_ARB                  0x84D9
+#define GL_TEXTURE26_ARB                  0x84DA
+#define GL_TEXTURE27_ARB                  0x84DB
+#define GL_TEXTURE28_ARB                  0x84DC
+#define GL_TEXTURE29_ARB                  0x84DD
+#define GL_TEXTURE30_ARB                  0x84DE
+#define GL_TEXTURE31_ARB                  0x84DF
+#define GL_ACTIVE_TEXTURE_ARB             0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB                0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F
+#define GL_SAMPLE_COVERAGE_ARB            0x80A0
+#define GL_SAMPLE_BUFFERS_ARB             0x80A8
+#define GL_SAMPLES_ARB                    0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB
+#define GL_MULTISAMPLE_BIT_ARB            0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB                 0x8511
+#define GL_REFLECTION_MAP_ARB             0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB           0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB       0x84EC
+#define GL_COMPRESSED_RGB_ARB             0x84ED
+#define GL_COMPRESSED_RGBA_ARB            0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB         0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB            0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB             0x8126
+#define GL_POINT_SIZE_MAX_ARB             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB  0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB           0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB        0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB           0x86A6
+#define GL_VERTEX_BLEND_ARB               0x86A7
+#define GL_CURRENT_WEIGHT_ARB             0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB          0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB        0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB          0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB       0x86AC
+#define GL_WEIGHT_ARRAY_ARB               0x86AD
+#define GL_MODELVIEW0_ARB                 0x1700
+#define GL_MODELVIEW1_ARB                 0x850A
+#define GL_MODELVIEW2_ARB                 0x8722
+#define GL_MODELVIEW3_ARB                 0x8723
+#define GL_MODELVIEW4_ARB                 0x8724
+#define GL_MODELVIEW5_ARB                 0x8725
+#define GL_MODELVIEW6_ARB                 0x8726
+#define GL_MODELVIEW7_ARB                 0x8727
+#define GL_MODELVIEW8_ARB                 0x8728
+#define GL_MODELVIEW9_ARB                 0x8729
+#define GL_MODELVIEW10_ARB                0x872A
+#define GL_MODELVIEW11_ARB                0x872B
+#define GL_MODELVIEW12_ARB                0x872C
+#define GL_MODELVIEW13_ARB                0x872D
+#define GL_MODELVIEW14_ARB                0x872E
+#define GL_MODELVIEW15_ARB                0x872F
+#define GL_MODELVIEW16_ARB                0x8730
+#define GL_MODELVIEW17_ARB                0x8731
+#define GL_MODELVIEW18_ARB                0x8732
+#define GL_MODELVIEW19_ARB                0x8733
+#define GL_MODELVIEW20_ARB                0x8734
+#define GL_MODELVIEW21_ARB                0x8735
+#define GL_MODELVIEW22_ARB                0x8736
+#define GL_MODELVIEW23_ARB                0x8737
+#define GL_MODELVIEW24_ARB                0x8738
+#define GL_MODELVIEW25_ARB                0x8739
+#define GL_MODELVIEW26_ARB                0x873A
+#define GL_MODELVIEW27_ARB                0x873B
+#define GL_MODELVIEW28_ARB                0x873C
+#define GL_MODELVIEW29_ARB                0x873D
+#define GL_MODELVIEW30_ARB                0x873E
+#define GL_MODELVIEW31_ARB                0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB             0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB       0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB     0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB         0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB       0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB    0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB    0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB  0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB                    0x8570
+#define GL_COMBINE_RGB_ARB                0x8571
+#define GL_COMBINE_ALPHA_ARB              0x8572
+#define GL_SOURCE0_RGB_ARB                0x8580
+#define GL_SOURCE1_RGB_ARB                0x8581
+#define GL_SOURCE2_RGB_ARB                0x8582
+#define GL_SOURCE0_ALPHA_ARB              0x8588
+#define GL_SOURCE1_ALPHA_ARB              0x8589
+#define GL_SOURCE2_ALPHA_ARB              0x858A
+#define GL_OPERAND0_RGB_ARB               0x8590
+#define GL_OPERAND1_RGB_ARB               0x8591
+#define GL_OPERAND2_RGB_ARB               0x8592
+#define GL_OPERAND0_ALPHA_ARB             0x8598
+#define GL_OPERAND1_ALPHA_ARB             0x8599
+#define GL_OPERAND2_ALPHA_ARB             0x859A
+#define GL_RGB_SCALE_ARB                  0x8573
+#define GL_ADD_SIGNED_ARB                 0x8574
+#define GL_INTERPOLATE_ARB                0x8575
+#define GL_SUBTRACT_ARB                   0x84E7
+#define GL_CONSTANT_ARB                   0x8576
+#define GL_PRIMARY_COLOR_ARB              0x8577
+#define GL_PREVIOUS_ARB                   0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB                   0x86AE
+#define GL_DOT3_RGBA_ARB                  0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB            0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB          0x81A5
+#define GL_DEPTH_COMPONENT24_ARB          0x81A6
+#define GL_DEPTH_COMPONENT32_ARB          0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB                  0x8458
+#define GL_VERTEX_PROGRAM_ARB             0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB   0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB   0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB      0x8626
+#define GL_PROGRAM_LENGTH_ARB             0x8627
+#define GL_PROGRAM_STRING_ARB             0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB       0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB             0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB  0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB    0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB     0x864B
+#define GL_PROGRAM_BINDING_ARB            0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB         0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB       0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB       0x8875
+#define GL_PROGRAM_FORMAT_ARB             0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB       0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB   0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB        0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB    0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB         0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB     0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB  0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB            0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB        0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB     0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB  0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB   0x88B7
+#define GL_MATRIX0_ARB                    0x88C0
+#define GL_MATRIX1_ARB                    0x88C1
+#define GL_MATRIX2_ARB                    0x88C2
+#define GL_MATRIX3_ARB                    0x88C3
+#define GL_MATRIX4_ARB                    0x88C4
+#define GL_MATRIX5_ARB                    0x88C5
+#define GL_MATRIX6_ARB                    0x88C6
+#define GL_MATRIX7_ARB                    0x88C7
+#define GL_MATRIX8_ARB                    0x88C8
+#define GL_MATRIX9_ARB                    0x88C9
+#define GL_MATRIX10_ARB                   0x88CA
+#define GL_MATRIX11_ARB                   0x88CB
+#define GL_MATRIX12_ARB                   0x88CC
+#define GL_MATRIX13_ARB                   0x88CD
+#define GL_MATRIX14_ARB                   0x88CE
+#define GL_MATRIX15_ARB                   0x88CF
+#define GL_MATRIX16_ARB                   0x88D0
+#define GL_MATRIX17_ARB                   0x88D1
+#define GL_MATRIX18_ARB                   0x88D2
+#define GL_MATRIX19_ARB                   0x88D3
+#define GL_MATRIX20_ARB                   0x88D4
+#define GL_MATRIX21_ARB                   0x88D5
+#define GL_MATRIX22_ARB                   0x88D6
+#define GL_MATRIX23_ARB                   0x88D7
+#define GL_MATRIX24_ARB                   0x88D8
+#define GL_MATRIX25_ARB                   0x88D9
+#define GL_MATRIX26_ARB                   0x88DA
+#define GL_MATRIX27_ARB                   0x88DB
+#define GL_MATRIX28_ARB                   0x88DC
+#define GL_MATRIX29_ARB                   0x88DD
+#define GL_MATRIX30_ARB                   0x88DE
+#define GL_MATRIX31_ARB                   0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB           0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB   0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB   0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB   0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB         0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB    0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB                0x8764
+#define GL_BUFFER_USAGE_ARB               0x8765
+#define GL_ARRAY_BUFFER_ARB               0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB                  0x88B8
+#define GL_WRITE_ONLY_ARB                 0x88B9
+#define GL_READ_WRITE_ARB                 0x88BA
+#define GL_BUFFER_ACCESS_ARB              0x88BB
+#define GL_BUFFER_MAPPED_ARB              0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB         0x88BD
+#define GL_STREAM_DRAW_ARB                0x88E0
+#define GL_STREAM_READ_ARB                0x88E1
+#define GL_STREAM_COPY_ARB                0x88E2
+#define GL_STATIC_DRAW_ARB                0x88E4
+#define GL_STATIC_READ_ARB                0x88E5
+#define GL_STATIC_COPY_ARB                0x88E6
+#define GL_DYNAMIC_DRAW_ARB               0x88E8
+#define GL_DYNAMIC_READ_ARB               0x88E9
+#define GL_DYNAMIC_COPY_ARB               0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB         0x8864
+#define GL_CURRENT_QUERY_ARB              0x8865
+#define GL_QUERY_RESULT_ARB               0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB     0x8867
+#define GL_SAMPLES_PASSED_ARB             0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB             0x8B40
+#define GL_SHADER_OBJECT_ARB              0x8B48
+#define GL_OBJECT_TYPE_ARB                0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB             0x8B4F
+#define GL_FLOAT_VEC2_ARB                 0x8B50
+#define GL_FLOAT_VEC3_ARB                 0x8B51
+#define GL_FLOAT_VEC4_ARB                 0x8B52
+#define GL_INT_VEC2_ARB                   0x8B53
+#define GL_INT_VEC3_ARB                   0x8B54
+#define GL_INT_VEC4_ARB                   0x8B55
+#define GL_BOOL_ARB                       0x8B56
+#define GL_BOOL_VEC2_ARB                  0x8B57
+#define GL_BOOL_VEC3_ARB                  0x8B58
+#define GL_BOOL_VEC4_ARB                  0x8B59
+#define GL_FLOAT_MAT2_ARB                 0x8B5A
+#define GL_FLOAT_MAT3_ARB                 0x8B5B
+#define GL_FLOAT_MAT4_ARB                 0x8B5C
+#define GL_SAMPLER_1D_ARB                 0x8B5D
+#define GL_SAMPLER_2D_ARB                 0x8B5E
+#define GL_SAMPLER_3D_ARB                 0x8B5F
+#define GL_SAMPLER_CUBE_ARB               0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB          0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB          0x8B62
+#define GL_SAMPLER_2D_RECT_ARB            0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB     0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB       0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB      0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB         0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB     0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB     0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB    0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB     0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB              0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB         0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB   0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB            0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB   0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB               0x8861
+#define GL_COORD_REPLACE_ARB              0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB           0x8824
+#define GL_DRAW_BUFFER0_ARB               0x8825
+#define GL_DRAW_BUFFER1_ARB               0x8826
+#define GL_DRAW_BUFFER2_ARB               0x8827
+#define GL_DRAW_BUFFER3_ARB               0x8828
+#define GL_DRAW_BUFFER4_ARB               0x8829
+#define GL_DRAW_BUFFER5_ARB               0x882A
+#define GL_DRAW_BUFFER6_ARB               0x882B
+#define GL_DRAW_BUFFER7_ARB               0x882C
+#define GL_DRAW_BUFFER8_ARB               0x882D
+#define GL_DRAW_BUFFER9_ARB               0x882E
+#define GL_DRAW_BUFFER10_ARB              0x882F
+#define GL_DRAW_BUFFER11_ARB              0x8830
+#define GL_DRAW_BUFFER12_ARB              0x8831
+#define GL_DRAW_BUFFER13_ARB              0x8832
+#define GL_DRAW_BUFFER14_ARB              0x8833
+#define GL_DRAW_BUFFER15_ARB              0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB          0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB            0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB         0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB       0x891B
+#define GL_CLAMP_READ_COLOR_ARB           0x891C
+#define GL_FIXED_ONLY_ARB                 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB                 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB           0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB         0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB          0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB         0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB     0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB     0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB         0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB        0x8C17
+#define GL_RGBA32F_ARB                    0x8814
+#define GL_RGB32F_ARB                     0x8815
+#define GL_ALPHA32F_ARB                   0x8816
+#define GL_INTENSITY32F_ARB               0x8817
+#define GL_LUMINANCE32F_ARB               0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB         0x8819
+#define GL_RGBA16F_ARB                    0x881A
+#define GL_RGB16F_ARB                     0x881B
+#define GL_ALPHA16F_ARB                   0x881C
+#define GL_INTENSITY16F_ARB               0x881D
+#define GL_LUMINANCE16F_ARB               0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB         0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT                       0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT             0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002
+#define GL_CONSTANT_ALPHA_EXT             0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004
+#define GL_BLEND_COLOR_EXT                0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT             0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT                     0x803B
+#define GL_ALPHA8_EXT                     0x803C
+#define GL_ALPHA12_EXT                    0x803D
+#define GL_ALPHA16_EXT                    0x803E
+#define GL_LUMINANCE4_EXT                 0x803F
+#define GL_LUMINANCE8_EXT                 0x8040
+#define GL_LUMINANCE12_EXT                0x8041
+#define GL_LUMINANCE16_EXT                0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT          0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT          0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT         0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT        0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT        0x8048
+#define GL_INTENSITY_EXT                  0x8049
+#define GL_INTENSITY4_EXT                 0x804A
+#define GL_INTENSITY8_EXT                 0x804B
+#define GL_INTENSITY12_EXT                0x804C
+#define GL_INTENSITY16_EXT                0x804D
+#define GL_RGB2_EXT                       0x804E
+#define GL_RGB4_EXT                       0x804F
+#define GL_RGB5_EXT                       0x8050
+#define GL_RGB8_EXT                       0x8051
+#define GL_RGB10_EXT                      0x8052
+#define GL_RGB12_EXT                      0x8053
+#define GL_RGB16_EXT                      0x8054
+#define GL_RGBA2_EXT                      0x8055
+#define GL_RGBA4_EXT                      0x8056
+#define GL_RGB5_A1_EXT                    0x8057
+#define GL_RGBA8_EXT                      0x8058
+#define GL_RGB10_A2_EXT                   0x8059
+#define GL_RGBA12_EXT                     0x805A
+#define GL_RGBA16_EXT                     0x805B
+#define GL_TEXTURE_RED_SIZE_EXT           0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061
+#define GL_REPLACE_EXT                    0x8062
+#define GL_PROXY_TEXTURE_1D_EXT           0x8063
+#define GL_PROXY_TEXTURE_2D_EXT           0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT          0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT           0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E
+#define GL_TEXTURE_3D_EXT                 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT           0x8070
+#define GL_TEXTURE_DEPTH_EXT              0x8071
+#define GL_TEXTURE_WRAP_R_EXT             0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS                   0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT                  0x8024
+#define GL_PROXY_HISTOGRAM_EXT            0x8025
+#define GL_HISTOGRAM_WIDTH_EXT            0x8026
+#define GL_HISTOGRAM_FORMAT_EXT           0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C
+#define GL_HISTOGRAM_SINK_EXT             0x802D
+#define GL_MINMAX_EXT                     0x802E
+#define GL_MINMAX_FORMAT_EXT              0x802F
+#define GL_MINMAX_SINK_EXT                0x8030
+#define GL_TABLE_TOO_LARGE_EXT            0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT             0x8010
+#define GL_CONVOLUTION_2D_EXT             0x8011
+#define GL_SEPARABLE_2D_EXT               0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015
+#define GL_REDUCE_EXT                     0x8016
+#define GL_CONVOLUTION_FORMAT_EXT         0x8017
+#define GL_CONVOLUTION_WIDTH_EXT          0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT         0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI               0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI                0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI          0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI          0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI           0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS             0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX             0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133
+#define GL_TEXTURE_4D_SGIS                0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS          0x8135
+#define GL_TEXTURE_4DSIZE_SGIS            0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS            0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS        0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT                       0x800C
+#define GL_CMYKA_EXT                      0x800D
+#define GL_PACK_CMYK_HINT_EXT             0x800E
+#define GL_UNPACK_CMYK_HINT_EXT           0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT           0x8066
+#define GL_TEXTURE_RESIDENT_EXT           0x8067
+#define GL_TEXTURE_1D_BINDING_EXT         0x8068
+#define GL_TEXTURE_2D_BINDING_EXT         0x8069
+#define GL_TEXTURE_3D_BINDING_EXT         0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS             0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS            0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS           0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS           0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS               0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F
+#define GL_SAMPLE_MASK_SGIS               0x80A0
+#define GL_1PASS_SGIS                     0x80A1
+#define GL_2PASS_0_SGIS                   0x80A2
+#define GL_2PASS_1_SGIS                   0x80A3
+#define GL_4PASS_0_SGIS                   0x80A4
+#define GL_4PASS_1_SGIS                   0x80A5
+#define GL_4PASS_2_SGIS                   0x80A6
+#define GL_4PASS_3_SGIS                   0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS            0x80A8
+#define GL_SAMPLES_SGIS                   0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB
+#define GL_SAMPLE_PATTERN_SGIS            0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT             0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT               0x8074
+#define GL_NORMAL_ARRAY_EXT               0x8075
+#define GL_COLOR_ARRAY_EXT                0x8076
+#define GL_INDEX_ARRAY_EXT                0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS           0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX           0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS             0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS           0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT                   0x8006
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#define GL_BLEND_EQUATION_EXT             0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT              0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX                 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS               0x8110
+#define GL_DUAL_ALPHA8_SGIS               0x8111
+#define GL_DUAL_ALPHA12_SGIS              0x8112
+#define GL_DUAL_ALPHA16_SGIS              0x8113
+#define GL_DUAL_LUMINANCE4_SGIS           0x8114
+#define GL_DUAL_LUMINANCE8_SGIS           0x8115
+#define GL_DUAL_LUMINANCE12_SGIS          0x8116
+#define GL_DUAL_LUMINANCE16_SGIS          0x8117
+#define GL_DUAL_INTENSITY4_SGIS           0x8118
+#define GL_DUAL_INTENSITY8_SGIS           0x8119
+#define GL_DUAL_INTENSITY12_SGIS          0x811A
+#define GL_DUAL_INTENSITY16_SGIS          0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D
+#define GL_QUAD_ALPHA4_SGIS               0x811E
+#define GL_QUAD_ALPHA8_SGIS               0x811F
+#define GL_QUAD_LUMINANCE4_SGIS           0x8120
+#define GL_QUAD_LUMINANCE8_SGIS           0x8121
+#define GL_QUAD_INTENSITY4_SGIS           0x8122
+#define GL_QUAD_INTENSITY8_SGIS           0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX                    0x8148
+#define GL_SPRITE_MODE_SGIX               0x8149
+#define GL_SPRITE_AXIS_SGIX               0x814A
+#define GL_SPRITE_TRANSLATION_SGIX        0x814B
+#define GL_SPRITE_AXIAL_SGIX              0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT             0x8126
+#define GL_POINT_SIZE_MAX_EXT             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
+#define GL_DISTANCE_ATTENUATION_EXT       0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS            0x8126
+#define GL_POINT_SIZE_MAX_SGIS            0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS      0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX                 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX   0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX  0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX      0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX       0x8195
+#define GL_DEFORMATIONS_MASK_SGIX         0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX     0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX           0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX         0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX         0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX         0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS                  0x812A
+#define GL_FOG_FUNC_POINTS_SGIS           0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX                0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX          0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP               0x8155
+#define GL_IMAGE_SCALE_Y_HP               0x8156
+#define GL_IMAGE_TRANSLATE_X_HP           0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP           0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B
+#define GL_IMAGE_MAG_FILTER_HP            0x815C
+#define GL_IMAGE_MIN_FILTER_HP            0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E
+#define GL_CUBIC_HP                       0x815F
+#define GL_AVERAGE_HP                     0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP          0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP               0x8150
+#define GL_CONSTANT_BORDER_HP             0x8151
+#define GL_REPLICATE_BORDER_HP            0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI           0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI            0x1A22D
+#define GL_COLOR3_BIT_PGI                 0x00010000
+#define GL_COLOR4_BIT_PGI                 0x00020000
+#define GL_EDGEFLAG_BIT_PGI               0x00040000
+#define GL_INDEX_BIT_PGI                  0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI            0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000
+#define GL_MAT_EMISSION_BIT_PGI           0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000
+#define GL_MAT_SHININESS_BIT_PGI          0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI           0x04000000
+#define GL_NORMAL_BIT_PGI                 0x08000000
+#define GL_TEXCOORD1_BIT_PGI              0x10000000
+#define GL_TEXCOORD2_BIT_PGI              0x20000000
+#define GL_TEXCOORD3_BIT_PGI              0x40000000
+#define GL_TEXCOORD4_BIT_PGI              0x80000000
+#define GL_VERTEX23_BIT_PGI               0x00000004
+#define GL_VERTEX4_BIT_PGI                0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI          0x1A219
+#define GL_CLIP_NEAR_HINT_PGI             0x1A220
+#define GL_CLIP_FAR_HINT_PGI              0x1A221
+#define GL_WIDE_LINE_HINT_PGI             0x1A222
+#define GL_BACK_NORMALS_HINT_PGI          0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT               0x80E2
+#define GL_COLOR_INDEX2_EXT               0x80E3
+#define GL_COLOR_INDEX4_EXT               0x80E4
+#define GL_COLOR_INDEX8_EXT               0x80E5
+#define GL_COLOR_INDEX12_EXT              0x80E6
+#define GL_COLOR_INDEX16_EXT              0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX             0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX            0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX            0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT             0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT                 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT            0x81B6
+#define GL_INDEX_TEST_REF_EXT             0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT                    0x81AD
+#define GL_IUI_V3F_EXT                    0x81AE
+#define GL_IUI_N3F_V2F_EXT                0x81AF
+#define GL_IUI_N3F_V3F_EXT                0x81B0
+#define GL_T2F_IUI_V2F_EXT                0x81B1
+#define GL_T2F_IUI_V3F_EXT                0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT                0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX                 0x81BB
+#define GL_YCRCB_444_SGIX                 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406
+#define GL_LIGHT_ENV_MODE_SGIX            0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX           0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX           0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX           0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX           0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX           0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX           0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX           0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX           0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP       0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN                      0x80EA
+#define GL_PHONG_HINT_WIN                 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT          0x8349
+#define GL_FRAGMENT_NORMAL_EXT            0x834A
+#define GL_FRAGMENT_COLOR_EXT             0x834C
+#define GL_ATTENUATION_EXT                0x834D
+#define GL_SHADOW_ATTENUATION_EXT         0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F
+#define GL_TEXTURE_LIGHT_EXT              0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX                 0x8320
+#define GL_ALPHA_MAX_SGIX                 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX   0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX     0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX     0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX    0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX    0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT                        0x80E0
+#define GL_BGRA_EXT                       0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX              0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX           0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX         0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX         0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX       0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX     0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX     0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX           0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX       0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL          0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP              0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP       0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330
+#define GL_PIXEL_MAG_FILTER_EXT           0x8331
+#define GL_PIXEL_MIN_FILTER_EXT           0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333
+#define GL_CUBIC_EXT                      0x8334
+#define GL_AVERAGE_EXT                    0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
+#define GL_SINGLE_COLOR_EXT               0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT                  0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT                    0x85AE
+#define GL_TEXTURE_NORMAL_EXT             0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450
+#define GL_FOG_COORDINATE_EXT             0x8451
+#define GL_FRAGMENT_DEPTH_EXT             0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND        0x8490
+#define GL_INVERTED_SCREEN_W_REND         0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT              0x8439
+#define GL_BINORMAL_ARRAY_EXT             0x843A
+#define GL_CURRENT_TANGENT_EXT            0x843B
+#define GL_CURRENT_BINORMAL_EXT           0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443
+#define GL_MAP1_TANGENT_EXT               0x8444
+#define GL_MAP2_TANGENT_EXT               0x8445
+#define GL_MAP1_BINORMAL_EXT              0x8446
+#define GL_MAP2_BINORMAL_EXT              0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT                    0x8570
+#define GL_COMBINE_RGB_EXT                0x8571
+#define GL_COMBINE_ALPHA_EXT              0x8572
+#define GL_RGB_SCALE_EXT                  0x8573
+#define GL_ADD_SIGNED_EXT                 0x8574
+#define GL_INTERPOLATE_EXT                0x8575
+#define GL_CONSTANT_EXT                   0x8576
+#define GL_PRIMARY_COLOR_EXT              0x8577
+#define GL_PREVIOUS_EXT                   0x8578
+#define GL_SOURCE0_RGB_EXT                0x8580
+#define GL_SOURCE1_RGB_EXT                0x8581
+#define GL_SOURCE2_RGB_EXT                0x8582
+#define GL_SOURCE0_ALPHA_EXT              0x8588
+#define GL_SOURCE1_ALPHA_EXT              0x8589
+#define GL_SOURCE2_ALPHA_EXT              0x858A
+#define GL_OPERAND0_RGB_EXT               0x8590
+#define GL_OPERAND1_RGB_EXT               0x8591
+#define GL_OPERAND2_RGB_EXT               0x8592
+#define GL_OPERAND0_ALPHA_EXT             0x8598
+#define GL_OPERAND1_ALPHA_EXT             0x8599
+#define GL_OPERAND2_ALPHA_EXT             0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE           0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX                 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX           0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN               0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN                    0x0001
+#define GL_REPLACE_MIDDLE_SUN             0x0002
+#define GL_REPLACE_OLDEST_SUN             0x0003
+#define GL_TRIANGLE_LIST_SUN              0x81D7
+#define GL_REPLACEMENT_CODE_SUN           0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN                   0x85C4
+#define GL_R1UI_C4UB_V3F_SUN              0x85C5
+#define GL_R1UI_C3F_V3F_SUN               0x85C6
+#define GL_R1UI_N3F_V3F_SUN               0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8
+#define GL_R1UI_T2F_V3F_SUN               0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT              0x80C8
+#define GL_BLEND_SRC_RGB_EXT              0x80C9
+#define GL_BLEND_DST_ALPHA_EXT            0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT            0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR             0x8560
+#define GL_GREEN_MIN_CLAMP_INGR           0x8561
+#define GL_BLUE_MIN_CLAMP_INGR            0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR           0x8563
+#define GL_RED_MAX_CLAMP_INGR             0x8564
+#define GL_GREEN_MAX_CLAMP_INGR           0x8565
+#define GL_BLUE_MAX_CLAMP_INGR            0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR           0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR            0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT                  0x8507
+#define GL_DECR_WRAP_EXT                  0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT                        0x80CC
+#define GL_422_REV_EXT                    0x80CD
+#define GL_422_AVERAGE_EXT                0x80CE
+#define GL_422_REV_AVERAGE_EXT            0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV                  0x8511
+#define GL_REFLECTION_MAP_NV              0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT                 0x8511
+#define GL_REFLECTION_MAP_EXT             0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN                0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502
+#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT          0x8506
+#define GL_VERTEX_WEIGHTING_EXT           0x8509
+#define GL_MODELVIEW0_EXT                 GL_MODELVIEW
+#define GL_MODELVIEW1_EXT                 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV               0x8504
+#define GL_MAX_SPOT_EXPONENT_NV           0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV          0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV          0x8522
+#define GL_VARIABLE_A_NV                  0x8523
+#define GL_VARIABLE_B_NV                  0x8524
+#define GL_VARIABLE_C_NV                  0x8525
+#define GL_VARIABLE_D_NV                  0x8526
+#define GL_VARIABLE_E_NV                  0x8527
+#define GL_VARIABLE_F_NV                  0x8528
+#define GL_VARIABLE_G_NV                  0x8529
+#define GL_CONSTANT_COLOR0_NV             0x852A
+#define GL_CONSTANT_COLOR1_NV             0x852B
+#define GL_PRIMARY_COLOR_NV               0x852C
+#define GL_SECONDARY_COLOR_NV             0x852D
+#define GL_SPARE0_NV                      0x852E
+#define GL_SPARE1_NV                      0x852F
+#define GL_DISCARD_NV                     0x8530
+#define GL_E_TIMES_F_NV                   0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV           0x8536
+#define GL_UNSIGNED_INVERT_NV             0x8537
+#define GL_EXPAND_NORMAL_NV               0x8538
+#define GL_EXPAND_NEGATE_NV               0x8539
+#define GL_HALF_BIAS_NORMAL_NV            0x853A
+#define GL_HALF_BIAS_NEGATE_NV            0x853B
+#define GL_SIGNED_IDENTITY_NV             0x853C
+#define GL_SIGNED_NEGATE_NV               0x853D
+#define GL_SCALE_BY_TWO_NV                0x853E
+#define GL_SCALE_BY_FOUR_NV               0x853F
+#define GL_SCALE_BY_ONE_HALF_NV           0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541
+#define GL_COMBINER_INPUT_NV              0x8542
+#define GL_COMBINER_MAPPING_NV            0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546
+#define GL_COMBINER_MUX_SUM_NV            0x8547
+#define GL_COMBINER_SCALE_NV              0x8548
+#define GL_COMBINER_BIAS_NV               0x8549
+#define GL_COMBINER_AB_OUTPUT_NV          0x854A
+#define GL_COMBINER_CD_OUTPUT_NV          0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV         0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV       0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV       0x854E
+#define GL_COLOR_SUM_CLAMP_NV             0x854F
+#define GL_COMBINER0_NV                   0x8550
+#define GL_COMBINER1_NV                   0x8551
+#define GL_COMBINER2_NV                   0x8552
+#define GL_COMBINER3_NV                   0x8553
+#define GL_COMBINER4_NV                   0x8554
+#define GL_COMBINER5_NV                   0x8555
+#define GL_COMBINER6_NV                   0x8556
+#define GL_COMBINER7_NV                   0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV           0x855A
+#define GL_EYE_RADIAL_NV                  0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV                0x855D
+#define GL_EMBOSS_CONSTANT_NV             0x855E
+#define GL_EMBOSS_MAP_NV                  0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV                    0x8503
+#define GL_SOURCE3_RGB_NV                 0x8583
+#define GL_SOURCE3_ALPHA_NV               0x858B
+#define GL_OPERAND3_RGB_NV                0x8593
+#define GL_OPERAND3_ALPHA_NV              0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM                103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM          103070
+#define GL_NORMAL_ARRAY_LIST_IBM          103071
+#define GL_COLOR_ARRAY_LIST_IBM           103072
+#define GL_INDEX_ARRAY_LIST_IBM           103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX                     0x8318
+#define GL_YCRCBA_SGIX                    0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX               0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX            0x86B3
+#define GL_SAMPLES_3DFX                   0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX           0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT                0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
+#define GL_SAMPLE_MASK_EXT                0x80A0
+#define GL_1PASS_EXT                      0x80A1
+#define GL_2PASS_0_EXT                    0x80A2
+#define GL_2PASS_1_EXT                    0x80A3
+#define GL_4PASS_0_EXT                    0x80A4
+#define GL_4PASS_1_EXT                    0x80A5
+#define GL_4PASS_2_EXT                    0x80A6
+#define GL_4PASS_3_EXT                    0x80A7
+#define GL_SAMPLE_BUFFERS_EXT             0x80A8
+#define GL_SAMPLES_EXT                    0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB
+#define GL_SAMPLE_PATTERN_EXT             0x80AC
+#define GL_MULTISAMPLE_BIT_EXT            0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX            0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX          0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX             0x842C
+#define GL_UNPACK_RESAMPLE_SGIX           0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX        0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX         0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3
+#define GL_EYE_POINT_SGIS                 0x81F4
+#define GL_OBJECT_POINT_SGIS              0x81F5
+#define GL_EYE_LINE_SGIS                  0x81F6
+#define GL_OBJECT_LINE_SGIS               0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT                   0x8740
+#define GL_DOT3_RGBA_EXT                  0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI       0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV               0x84F2
+#define GL_FENCE_STATUS_NV                0x84F3
+#define GL_FENCE_CONDITION_NV             0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM            0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV                     0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1
+#define GL_MAP_TESSELLATION_NV            0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV        0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV               0x84F9
+#define GL_UNSIGNED_INT_24_8_NV           0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV         0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV           0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV          0x86DC
+#define GL_SHADER_CONSISTENT_NV           0x86DD
+#define GL_TEXTURE_SHADER_NV              0x86DE
+#define GL_SHADER_OPERATION_NV            0x86DF
+#define GL_CULL_MODES_NV                  0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4
+#define GL_CONST_EYE_NV                   0x86E5
+#define GL_PASS_THROUGH_NV                0x86E6
+#define GL_CULL_FRAGMENT_NV               0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV           0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA
+#define GL_DOT_PRODUCT_NV                 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV                        0x86F4
+#define GL_DSDT_NV                        0x86F5
+#define GL_DSDT_MAG_NV                    0x86F6
+#define GL_DSDT_MAG_VIB_NV                0x86F7
+#define GL_HILO16_NV                      0x86F8
+#define GL_SIGNED_HILO_NV                 0x86F9
+#define GL_SIGNED_HILO16_NV               0x86FA
+#define GL_SIGNED_RGBA_NV                 0x86FB
+#define GL_SIGNED_RGBA8_NV                0x86FC
+#define GL_SIGNED_RGB_NV                  0x86FE
+#define GL_SIGNED_RGB8_NV                 0x86FF
+#define GL_SIGNED_LUMINANCE_NV            0x8701
+#define GL_SIGNED_LUMINANCE8_NV           0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704
+#define GL_SIGNED_ALPHA_NV                0x8705
+#define GL_SIGNED_ALPHA8_NV               0x8706
+#define GL_SIGNED_INTENSITY_NV            0x8707
+#define GL_SIGNED_INTENSITY8_NV           0x8708
+#define GL_DSDT8_NV                       0x8709
+#define GL_DSDT8_MAG8_NV                  0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV                    0x870E
+#define GL_LO_SCALE_NV                    0x870F
+#define GL_DS_SCALE_NV                    0x8710
+#define GL_DT_SCALE_NV                    0x8711
+#define GL_MAGNITUDE_SCALE_NV             0x8712
+#define GL_VIBRANCE_SCALE_NV              0x8713
+#define GL_HI_BIAS_NV                     0x8714
+#define GL_LO_BIAS_NV                     0x8715
+#define GL_DS_BIAS_NV                     0x8716
+#define GL_DT_BIAS_NV                     0x8717
+#define GL_MAGNITUDE_BIAS_NV              0x8718
+#define GL_VIBRANCE_BIAS_NV               0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV       0x871A
+#define GL_TEXTURE_HI_SIZE_NV             0x871B
+#define GL_TEXTURE_LO_SIZE_NV             0x871C
+#define GL_TEXTURE_DS_SIZE_NV             0x871D
+#define GL_TEXTURE_DT_SIZE_NV             0x871E
+#define GL_TEXTURE_MAG_SIZE_NV            0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV              0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV        0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625
+#define GL_CURRENT_ATTRIB_NV              0x8626
+#define GL_PROGRAM_LENGTH_NV              0x8627
+#define GL_PROGRAM_STRING_NV              0x8628
+#define GL_MODELVIEW_PROJECTION_NV        0x8629
+#define GL_IDENTITY_NV                    0x862A
+#define GL_INVERSE_NV                     0x862B
+#define GL_TRANSPOSE_NV                   0x862C
+#define GL_INVERSE_TRANSPOSE_NV           0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV          0x862F
+#define GL_MATRIX0_NV                     0x8630
+#define GL_MATRIX1_NV                     0x8631
+#define GL_MATRIX2_NV                     0x8632
+#define GL_MATRIX3_NV                     0x8633
+#define GL_MATRIX4_NV                     0x8634
+#define GL_MATRIX5_NV                     0x8635
+#define GL_MATRIX6_NV                     0x8636
+#define GL_MATRIX7_NV                     0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640
+#define GL_CURRENT_MATRIX_NV              0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643
+#define GL_PROGRAM_PARAMETER_NV           0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645
+#define GL_PROGRAM_TARGET_NV              0x8646
+#define GL_PROGRAM_RESIDENT_NV            0x8647
+#define GL_TRACK_MATRIX_NV                0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV      0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX       0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX       0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX       0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX            0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML                  0x8980
+#define GL_INTERLACE_READ_OML             0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML     0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML   0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML              0x8984
+#define GL_UNPACK_RESAMPLE_OML            0x8985
+#define GL_RESAMPLE_REPLICATE_OML         0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML         0x8987
+#define GL_RESAMPLE_AVERAGE_OML           0x8988
+#define GL_RESAMPLE_DECIMATE_OML          0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV       0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV       0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI            0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI       0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI         0x8777
+#define GL_BUMP_TEX_UNITS_ATI             0x8778
+#define GL_DUDV_ATI                       0x8779
+#define GL_DU8DV8_ATI                     0x877A
+#define GL_BUMP_ENVMAP_ATI                0x877B
+#define GL_BUMP_TARGET_ATI                0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI            0x8920
+#define GL_REG_0_ATI                      0x8921
+#define GL_REG_1_ATI                      0x8922
+#define GL_REG_2_ATI                      0x8923
+#define GL_REG_3_ATI                      0x8924
+#define GL_REG_4_ATI                      0x8925
+#define GL_REG_5_ATI                      0x8926
+#define GL_REG_6_ATI                      0x8927
+#define GL_REG_7_ATI                      0x8928
+#define GL_REG_8_ATI                      0x8929
+#define GL_REG_9_ATI                      0x892A
+#define GL_REG_10_ATI                     0x892B
+#define GL_REG_11_ATI                     0x892C
+#define GL_REG_12_ATI                     0x892D
+#define GL_REG_13_ATI                     0x892E
+#define GL_REG_14_ATI                     0x892F
+#define GL_REG_15_ATI                     0x8930
+#define GL_REG_16_ATI                     0x8931
+#define GL_REG_17_ATI                     0x8932
+#define GL_REG_18_ATI                     0x8933
+#define GL_REG_19_ATI                     0x8934
+#define GL_REG_20_ATI                     0x8935
+#define GL_REG_21_ATI                     0x8936
+#define GL_REG_22_ATI                     0x8937
+#define GL_REG_23_ATI                     0x8938
+#define GL_REG_24_ATI                     0x8939
+#define GL_REG_25_ATI                     0x893A
+#define GL_REG_26_ATI                     0x893B
+#define GL_REG_27_ATI                     0x893C
+#define GL_REG_28_ATI                     0x893D
+#define GL_REG_29_ATI                     0x893E
+#define GL_REG_30_ATI                     0x893F
+#define GL_REG_31_ATI                     0x8940
+#define GL_CON_0_ATI                      0x8941
+#define GL_CON_1_ATI                      0x8942
+#define GL_CON_2_ATI                      0x8943
+#define GL_CON_3_ATI                      0x8944
+#define GL_CON_4_ATI                      0x8945
+#define GL_CON_5_ATI                      0x8946
+#define GL_CON_6_ATI                      0x8947
+#define GL_CON_7_ATI                      0x8948
+#define GL_CON_8_ATI                      0x8949
+#define GL_CON_9_ATI                      0x894A
+#define GL_CON_10_ATI                     0x894B
+#define GL_CON_11_ATI                     0x894C
+#define GL_CON_12_ATI                     0x894D
+#define GL_CON_13_ATI                     0x894E
+#define GL_CON_14_ATI                     0x894F
+#define GL_CON_15_ATI                     0x8950
+#define GL_CON_16_ATI                     0x8951
+#define GL_CON_17_ATI                     0x8952
+#define GL_CON_18_ATI                     0x8953
+#define GL_CON_19_ATI                     0x8954
+#define GL_CON_20_ATI                     0x8955
+#define GL_CON_21_ATI                     0x8956
+#define GL_CON_22_ATI                     0x8957
+#define GL_CON_23_ATI                     0x8958
+#define GL_CON_24_ATI                     0x8959
+#define GL_CON_25_ATI                     0x895A
+#define GL_CON_26_ATI                     0x895B
+#define GL_CON_27_ATI                     0x895C
+#define GL_CON_28_ATI                     0x895D
+#define GL_CON_29_ATI                     0x895E
+#define GL_CON_30_ATI                     0x895F
+#define GL_CON_31_ATI                     0x8960
+#define GL_MOV_ATI                        0x8961
+#define GL_ADD_ATI                        0x8963
+#define GL_MUL_ATI                        0x8964
+#define GL_SUB_ATI                        0x8965
+#define GL_DOT3_ATI                       0x8966
+#define GL_DOT4_ATI                       0x8967
+#define GL_MAD_ATI                        0x8968
+#define GL_LERP_ATI                       0x8969
+#define GL_CND_ATI                        0x896A
+#define GL_CND0_ATI                       0x896B
+#define GL_DOT2_ADD_ATI                   0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI     0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI     0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI     0x896F
+#define GL_NUM_PASSES_ATI                 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI  0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI     0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI    0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI        0x8975
+#define GL_SWIZZLE_STR_ATI                0x8976
+#define GL_SWIZZLE_STQ_ATI                0x8977
+#define GL_SWIZZLE_STR_DR_ATI             0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI             0x8979
+#define GL_SWIZZLE_STRQ_ATI               0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI            0x897B
+#define GL_RED_BIT_ATI                    0x00000001
+#define GL_GREEN_BIT_ATI                  0x00000002
+#define GL_BLUE_BIT_ATI                   0x00000004
+#define GL_2X_BIT_ATI                     0x00000001
+#define GL_4X_BIT_ATI                     0x00000002
+#define GL_8X_BIT_ATI                     0x00000004
+#define GL_HALF_BIT_ATI                   0x00000008
+#define GL_QUARTER_BIT_ATI                0x00000010
+#define GL_EIGHTH_BIT_ATI                 0x00000020
+#define GL_SATURATE_BIT_ATI               0x00000040
+#define GL_COMP_BIT_ATI                   0x00000002
+#define GL_NEGATE_BIT_ATI                 0x00000004
+#define GL_BIAS_BIT_ATI                   0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI               0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI    0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI   0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI                     0x8760
+#define GL_DYNAMIC_ATI                    0x8761
+#define GL_PRESERVE_ATI                   0x8762
+#define GL_DISCARD_ATI                    0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI         0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI        0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI        0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI        0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT              0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT      0x8781
+#define GL_OP_INDEX_EXT                   0x8782
+#define GL_OP_NEGATE_EXT                  0x8783
+#define GL_OP_DOT3_EXT                    0x8784
+#define GL_OP_DOT4_EXT                    0x8785
+#define GL_OP_MUL_EXT                     0x8786
+#define GL_OP_ADD_EXT                     0x8787
+#define GL_OP_MADD_EXT                    0x8788
+#define GL_OP_FRAC_EXT                    0x8789
+#define GL_OP_MAX_EXT                     0x878A
+#define GL_OP_MIN_EXT                     0x878B
+#define GL_OP_SET_GE_EXT                  0x878C
+#define GL_OP_SET_LT_EXT                  0x878D
+#define GL_OP_CLAMP_EXT                   0x878E
+#define GL_OP_FLOOR_EXT                   0x878F
+#define GL_OP_ROUND_EXT                   0x8790
+#define GL_OP_EXP_BASE_2_EXT              0x8791
+#define GL_OP_LOG_BASE_2_EXT              0x8792
+#define GL_OP_POWER_EXT                   0x8793
+#define GL_OP_RECIP_EXT                   0x8794
+#define GL_OP_RECIP_SQRT_EXT              0x8795
+#define GL_OP_SUB_EXT                     0x8796
+#define GL_OP_CROSS_PRODUCT_EXT           0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT         0x8798
+#define GL_OP_MOV_EXT                     0x8799
+#define GL_OUTPUT_VERTEX_EXT              0x879A
+#define GL_OUTPUT_COLOR0_EXT              0x879B
+#define GL_OUTPUT_COLOR1_EXT              0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT      0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT      0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT      0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT      0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT      0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT      0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT      0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT      0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT      0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT      0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT     0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT     0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT     0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT     0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT     0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT     0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT     0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT     0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT     0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT     0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT     0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT     0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT     0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT     0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT     0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT     0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT     0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT     0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT     0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT     0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT     0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT     0x87BC
+#define GL_OUTPUT_FOG_EXT                 0x87BD
+#define GL_SCALAR_EXT                     0x87BE
+#define GL_VECTOR_EXT                     0x87BF
+#define GL_MATRIX_EXT                     0x87C0
+#define GL_VARIANT_EXT                    0x87C1
+#define GL_INVARIANT_EXT                  0x87C2
+#define GL_LOCAL_CONSTANT_EXT             0x87C3
+#define GL_LOCAL_EXT                      0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT   0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT     0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT   0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT       0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT    0x87D4
+#define GL_X_EXT                          0x87D5
+#define GL_Y_EXT                          0x87D6
+#define GL_Z_EXT                          0x87D7
+#define GL_W_EXT                          0x87D8
+#define GL_NEGATIVE_X_EXT                 0x87D9
+#define GL_NEGATIVE_Y_EXT                 0x87DA
+#define GL_NEGATIVE_Z_EXT                 0x87DB
+#define GL_NEGATIVE_W_EXT                 0x87DC
+#define GL_ZERO_EXT                       0x87DD
+#define GL_ONE_EXT                        0x87DE
+#define GL_NEGATIVE_ONE_EXT               0x87DF
+#define GL_NORMALIZED_RANGE_EXT           0x87E0
+#define GL_FULL_RANGE_EXT                 0x87E1
+#define GL_CURRENT_VERTEX_EXT             0x87E2
+#define GL_MVP_MATRIX_EXT                 0x87E3
+#define GL_VARIANT_VALUE_EXT              0x87E4
+#define GL_VARIANT_DATATYPE_EXT           0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT       0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT         0x87E7
+#define GL_VARIANT_ARRAY_EXT              0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT      0x87E9
+#define GL_INVARIANT_VALUE_EXT            0x87EA
+#define GL_INVARIANT_DATATYPE_EXT         0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT       0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT    0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI         0x876B
+#define GL_VERTEX_STREAM0_ATI             0x876C
+#define GL_VERTEX_STREAM1_ATI             0x876D
+#define GL_VERTEX_STREAM2_ATI             0x876E
+#define GL_VERTEX_STREAM3_ATI             0x876F
+#define GL_VERTEX_STREAM4_ATI             0x8770
+#define GL_VERTEX_STREAM5_ATI             0x8771
+#define GL_VERTEX_STREAM6_ATI             0x8772
+#define GL_VERTEX_STREAM7_ATI             0x8773
+#define GL_VERTEX_SOURCE_ATI              0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI              0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI         0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI      0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN                  0x8614
+#define GL_TRIANGLE_MESH_SUN              0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN                0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV                 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV          0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV  0x8865
+#define GL_PIXEL_COUNT_NV                 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV       0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV                0x8861
+#define GL_COORD_REPLACE_NV               0x8862
+#define GL_POINT_SPRITE_R_MODE_NV         0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV      0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV   0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV    0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV    0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV      0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV                       0x885E
+#define GL_SIGNED_HILO8_NV                0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV           0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI       0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE    0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE            0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE              0x8A0A
+#define GL_FENCE_APPLE                    0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE     0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE       0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CACHED_APPLE           0x85BE
+#define GL_STORAGE_SHARED_APPLE           0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE                0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC                       0x83A0
+#define GL_RGB4_S3TC                      0x83A1
+#define GL_RGBA_S3TC                      0x83A2
+#define GL_RGBA4_S3TC                     0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI           0x8824
+#define GL_DRAW_BUFFER0_ATI               0x8825
+#define GL_DRAW_BUFFER1_ATI               0x8826
+#define GL_DRAW_BUFFER2_ATI               0x8827
+#define GL_DRAW_BUFFER3_ATI               0x8828
+#define GL_DRAW_BUFFER4_ATI               0x8829
+#define GL_DRAW_BUFFER5_ATI               0x882A
+#define GL_DRAW_BUFFER6_ATI               0x882B
+#define GL_DRAW_BUFFER7_ATI               0x882C
+#define GL_DRAW_BUFFER8_ATI               0x882D
+#define GL_DRAW_BUFFER9_ATI               0x882E
+#define GL_DRAW_BUFFER10_ATI              0x882F
+#define GL_DRAW_BUFFER11_ATI              0x8830
+#define GL_DRAW_BUFFER12_ATI              0x8831
+#define GL_DRAW_BUFFER13_ATI              0x8832
+#define GL_DRAW_BUFFER14_ATI              0x8833
+#define GL_DRAW_BUFFER15_ATI              0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI            0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI               0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI        0x8745
+#define GL_MODULATE_SUBTRACT_ATI          0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI               0x8814
+#define GL_RGB_FLOAT32_ATI                0x8815
+#define GL_ALPHA_FLOAT32_ATI              0x8816
+#define GL_INTENSITY_FLOAT32_ATI          0x8817
+#define GL_LUMINANCE_FLOAT32_ATI          0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI    0x8819
+#define GL_RGBA_FLOAT16_ATI               0x881A
+#define GL_RGB_FLOAT16_ATI                0x881B
+#define GL_ALPHA_FLOAT16_ATI              0x881C
+#define GL_INTENSITY_FLOAT16_ATI          0x881D
+#define GL_LUMINANCE_FLOAT16_ATI          0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI    0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV                     0x8880
+#define GL_FLOAT_RG_NV                    0x8881
+#define GL_FLOAT_RGB_NV                   0x8882
+#define GL_FLOAT_RGBA_NV                  0x8883
+#define GL_FLOAT_R16_NV                   0x8884
+#define GL_FLOAT_R32_NV                   0x8885
+#define GL_FLOAT_RG16_NV                  0x8886
+#define GL_FLOAT_RG32_NV                  0x8887
+#define GL_FLOAT_RGB16_NV                 0x8888
+#define GL_FLOAT_RGB32_NV                 0x8889
+#define GL_FLOAT_RGBA16_NV                0x888A
+#define GL_FLOAT_RGBA32_NV                0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV    0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV     0x888D
+#define GL_FLOAT_RGBA_MODE_NV             0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV            0x8870
+#define GL_MAX_TEXTURE_COORDS_NV          0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV     0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV    0x8873
+#define GL_PROGRAM_ERROR_STRING_NV        0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV                  0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV      0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV       0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV           0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV     0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI          0x8800
+#define GL_STENCIL_BACK_FAIL_ATI          0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT          0x8890
+#define GL_DEPTH_BOUNDS_EXT               0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT     0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT         GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT       0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA               0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA        0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA    0x85BB
+#define GL_YCBCR_MESA                     0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV      0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV        0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV      0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV      0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT      0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT        0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT       0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT    0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT           0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT         0x8D20
+#define GL_FRAMEBUFFER_EXT                0x8D40
+#define GL_RENDERBUFFER_EXT               0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT         0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT        0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT             0x8D46
+#define GL_STENCIL_INDEX4_EXT             0x8D47
+#define GL_STENCIL_INDEX8_EXT             0x8D48
+#define GL_STENCIL_INDEX16_EXT            0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT      0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT    0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT     0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT    0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT    0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT  0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;                   /* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB;                /* native character */
+typedef unsigned int GLhandleARB;      /* shader object handle */
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_EXT_color_matrix
+#define GL_EXT_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+#endif /* NO_SDL_GLEXT */
+/*@}*/
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_platform.h b/misc/builddeps/dp.win32/include/SDL/SDL_platform.h
new file mode 100644 (file)
index 0000000..11d8673
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_platform.h
+ *  Try to get a standard set of platform defines
+ */
+
+#ifndef _SDL_platform_h
+#define _SDL_platform_h
+
+#if defined(_AIX)
+#undef __AIX__
+#define __AIX__                1
+#endif
+#if defined(__BEOS__)
+#undef __BEOS__
+#define __BEOS__       1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__ 1
+#endif
+#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
+#undef __BSDI__
+#define __BSDI__       1
+#endif
+#if defined(_arch_dreamcast)
+#undef __DREAMCAST__
+#define __DREAMCAST__  1
+#endif
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#undef __FREEBSD__
+#define __FREEBSD__    1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__      1
+#endif
+#if defined(hpux) || defined(__hpux) || defined(__hpux__)
+#undef __HPUX__
+#define __HPUX__       1
+#endif
+#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
+#undef __IRIX__
+#define __IRIX__       1
+#endif
+#if defined(linux) || defined(__linux) || defined(__linux__)
+#undef __LINUX__
+#define __LINUX__      1
+#endif
+#if defined(__APPLE__)
+#undef __MACOSX__
+#define __MACOSX__     1
+#elif defined(macintosh)
+#undef __MACOS__
+#define __MACOS__      1
+#endif
+#if defined(__NetBSD__)
+#undef __NETBSD__
+#define __NETBSD__     1
+#endif
+#if defined(__OpenBSD__)
+#undef __OPENBSD__
+#define __OPENBSD__    1
+#endif
+#if defined(__OS2__)
+#undef __OS2__
+#define __OS2__                1
+#endif
+#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
+#undef __OSF__
+#define __OSF__                1
+#endif
+#if defined(__QNXNTO__)
+#undef __QNXNTO__
+#define __QNXNTO__     1
+#endif
+#if defined(riscos) || defined(__riscos) || defined(__riscos__)
+#undef __RISCOS__
+#define __RISCOS__     1
+#endif
+#if defined(__SVR4)
+#undef __SOLARIS__
+#define __SOLARIS__    1
+#endif
+#if defined(WIN32) || defined(_WIN32)
+#undef __WIN32__
+#define __WIN32__      1
+#endif
+
+#endif /* _SDL_platform_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_quit.h b/misc/builddeps/dp.win32/include/SDL/SDL_quit.h
new file mode 100644 (file)
index 0000000..6d82e7e
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_quit.h
+ *  Include file for SDL quit event handling
+ */
+
+#ifndef _SDL_quit_h
+#define _SDL_quit_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/** @file SDL_quit.h
+ *  An SDL_QUITEVENT is generated when the user tries to close the application
+ *  window.  If it is ignored or filtered out, the window will remain open.
+ *  If it is not ignored or filtered, it is queued normally and the window
+ *  is allowed to close.  When the window is closed, screen updates will 
+ *  complete, but have no effect.
+ *
+ *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
+ *  and SIGTERM (system termination request), if handlers do not already
+ *  exist, that generate SDL_QUITEVENT events as well.  There is no way
+ *  to determine the cause of an SDL_QUITEVENT, but setting a signal
+ *  handler in your application will override the default generation of
+ *  quit events for that signal.
+ */
+
+/** @file SDL_quit.h
+ *  There are no functions directly affecting the quit event 
+ */
+
+#define SDL_QuitRequested() \
+        (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
+
+#endif /* _SDL_quit_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_rwops.h b/misc/builddeps/dp.win32/include/SDL/SDL_rwops.h
new file mode 100644 (file)
index 0000000..a450119
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_rwops.h
+ *  This file provides a general interface for SDL to read and write
+ *  data sources.  It can easily be extended to files, memory, etc.
+ */
+
+#ifndef _SDL_rwops_h
+#define _SDL_rwops_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the read/write operation structure -- very basic */
+
+typedef struct SDL_RWops {
+       /** Seek to 'offset' relative to whence, one of stdio's whence values:
+        *      SEEK_SET, SEEK_CUR, SEEK_END
+        *  Returns the final offset in the data source.
+        */
+       int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
+
+       /** Read up to 'maxnum' objects each of size 'size' from the data
+        *  source to the area pointed at by 'ptr'.
+        *  Returns the number of objects read, or -1 if the read failed.
+        */
+       int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
+
+       /** Write exactly 'num' objects each of size 'objsize' from the area
+        *  pointed at by 'ptr' to data source.
+        *  Returns 'num', or -1 if the write failed.
+        */
+       int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
+
+       /** Close and free an allocated SDL_FSops structure */
+       int (SDLCALL *close)(struct SDL_RWops *context);
+
+       Uint32 type;
+       union {
+#if defined(__WIN32__) && !defined(__SYMBIAN32__)
+           struct {
+               int   append;
+               void *h;
+               struct {
+                   void *data;
+                   int size;
+                   int left;
+               } buffer;
+           } win32io;
+#endif
+#ifdef HAVE_STDIO_H 
+           struct {
+               int autoclose;
+               FILE *fp;
+           } stdio;
+#endif
+           struct {
+               Uint8 *base;
+               Uint8 *here;
+               Uint8 *stop;
+           } mem;
+           struct {
+               void *data1;
+           } unknown;
+       } hidden;
+
+} SDL_RWops;
+
+
+/** @name Functions to create SDL_RWops structures from various data sources */
+/*@{*/
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
+
+#ifdef HAVE_STDIO_H
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
+#endif
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
+extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
+
+/*@}*/
+
+/** @name Seek Reference Points */
+/*@{*/
+#define RW_SEEK_SET    0       /**< Seek from the beginning of data */
+#define RW_SEEK_CUR    1       /**< Seek relative to current read point */
+#define RW_SEEK_END    2       /**< Seek relative to the end of data */
+/*@}*/
+
+/** @name Macros to easily read and write from an SDL_RWops structure */
+/*@{*/
+#define SDL_RWseek(ctx, offset, whence)        (ctx)->seek(ctx, offset, whence)
+#define SDL_RWtell(ctx)                        (ctx)->seek(ctx, 0, RW_SEEK_CUR)
+#define SDL_RWread(ctx, ptr, size, n)  (ctx)->read(ctx, ptr, size, n)
+#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
+#define SDL_RWclose(ctx)               (ctx)->close(ctx)
+/*@}*/
+
+/** @name Read an item of the specified endianness and return in native format */
+/*@{*/
+extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
+extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
+/*@}*/
+
+/** @name Write an item of native format to the specified endianness */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_rwops_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_stdinc.h b/misc/builddeps/dp.win32/include/SDL/SDL_stdinc.h
new file mode 100644 (file)
index 0000000..e1f85fb
--- /dev/null
@@ -0,0 +1,620 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_stdinc.h
+ *  This is a general header that includes C language support
+ */
+
+#ifndef _SDL_stdinc_h
+#define _SDL_stdinc_h
+
+#include "SDL_config.h"
+
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if defined(STDC_HEADERS)
+# include <stdlib.h>
+# include <stddef.h>
+# include <stdarg.h>
+#else
+# if defined(HAVE_STDLIB_H)
+#  include <stdlib.h>
+# elif defined(HAVE_MALLOC_H)
+#  include <malloc.h>
+# endif
+# if defined(HAVE_STDDEF_H)
+#  include <stddef.h>
+# endif
+# if defined(HAVE_STDARG_H)
+#  include <stdarg.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+#endif
+#ifdef HAVE_CTYPE_H
+# include <ctype.h>
+#endif
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+# include <iconv.h>
+#endif
+
+/** The number of elements in an array */
+#define SDL_arraysize(array)   (sizeof(array)/sizeof(array[0]))
+#define SDL_TABLESIZE(table)   SDL_arraysize(table)
+
+/* Use proper C++ casts when compiled as C++ to be compatible with the option
+ -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
+#ifdef __cplusplus
+#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
+#define SDL_static_cast(type, expression) static_cast<type>(expression)
+#else
+#define SDL_reinterpret_cast(type, expression) ((type)(expression))
+#define SDL_static_cast(type, expression) ((type)(expression))
+#endif
+
+/** @name Basic data types */
+/*@{*/
+typedef enum {
+       SDL_FALSE = 0,
+       SDL_TRUE  = 1
+} SDL_bool;
+
+typedef int8_t         Sint8;
+typedef uint8_t                Uint8;
+typedef int16_t                Sint16;
+typedef uint16_t       Uint16;
+typedef int32_t                Sint32;
+typedef uint32_t       Uint32;
+
+#ifdef SDL_HAS_64BIT_TYPE
+typedef int64_t                Sint64;
+#ifndef SYMBIAN32_GCCE
+typedef uint64_t       Uint64;
+#endif
+#else
+/* This is really just a hack to prevent the compiler from complaining */
+typedef struct {
+       Uint32 hi;
+       Uint32 lo;
+} Uint64, Sint64;
+#endif
+
+/*@}*/
+
+/** @name Make sure the types really have the right sizes */
+/*@{*/
+#define SDL_COMPILE_TIME_ASSERT(name, x)               \
+       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
+
+SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
+SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
+SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
+SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
+SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
+SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
+SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
+SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
+/*@}*/
+
+/** @name Enum Size Check
+ *  Check to make sure enums are the size of ints, for structure packing.
+ *  For both Watcom C/C++ and Borland C/C++ the compiler option that makes
+ *  enums having the size of an int must be enabled.
+ *  This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
+ */
+/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
+#ifdef __MWERKS__
+#pragma enumsalwaysint on
+#endif
+
+typedef enum {
+       DUMMY_ENUM_VALUE
+} SDL_DUMMY_ENUM;
+
+#ifndef __NDS__
+SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
+#endif
+/*@}*/
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_MALLOC
+#define SDL_malloc     malloc
+#else
+extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
+#endif
+
+#ifdef HAVE_CALLOC
+#define SDL_calloc     calloc
+#else
+extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
+#endif
+
+#ifdef HAVE_REALLOC
+#define SDL_realloc    realloc
+#else
+extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
+#endif
+
+#ifdef HAVE_FREE
+#define SDL_free       free
+#else
+extern DECLSPEC void SDLCALL SDL_free(void *mem);
+#endif
+
+#if defined(HAVE_ALLOCA) && !defined(alloca)
+# if defined(HAVE_ALLOCA_H)
+#  include <alloca.h>
+# elif defined(__GNUC__)
+#  define alloca __builtin_alloca
+# elif defined(_MSC_VER)
+#  include <malloc.h>
+#  define alloca _alloca
+# elif defined(__WATCOMC__)
+#  include <malloc.h>
+# elif defined(__BORLANDC__)
+#  include <malloc.h>
+# elif defined(__DMC__)
+#  include <stdlib.h>
+# elif defined(__AIX__)
+  #pragma alloca
+# elif defined(__MRC__)
+   void *alloca (unsigned);
+# else
+   char *alloca ();
+# endif
+#endif
+#ifdef HAVE_ALLOCA
+#define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
+#define SDL_stack_free(data)
+#else
+#define SDL_stack_alloc(type, count)    (type*)SDL_malloc(sizeof(type)*(count))
+#define SDL_stack_free(data)            SDL_free(data)
+#endif
+
+#ifdef HAVE_GETENV
+#define SDL_getenv     getenv
+#else
+extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
+#endif
+
+#ifdef HAVE_PUTENV
+#define SDL_putenv     putenv
+#else
+extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
+#endif
+
+#ifdef HAVE_QSORT
+#define SDL_qsort      qsort
+#else
+extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
+           int (*compare)(const void *, const void *));
+#endif
+
+#ifdef HAVE_ABS
+#define SDL_abs                abs
+#else
+#define SDL_abs(X)     ((X) < 0 ? -(X) : (X))
+#endif
+
+#define SDL_min(x, y)  (((x) < (y)) ? (x) : (y))
+#define SDL_max(x, y)  (((x) > (y)) ? (x) : (y))
+
+#ifdef HAVE_CTYPE_H
+#define SDL_isdigit(X)  isdigit(X)
+#define SDL_isspace(X)  isspace(X)
+#define SDL_toupper(X)  toupper(X)
+#define SDL_tolower(X)  tolower(X)
+#else
+#define SDL_isdigit(X)  (((X) >= '0') && ((X) <= '9'))
+#define SDL_isspace(X)  (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
+#define SDL_toupper(X)  (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
+#define SDL_tolower(X)  (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
+#endif
+
+#ifdef HAVE_MEMSET
+#define SDL_memset      memset
+#else
+extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_memset4(dst, val, len)                             \
+do {                                                           \
+       int u0, u1, u2;                                         \
+       __asm__ __volatile__ (                                  \
+               "cld\n\t"                                       \
+               "rep ; stosl\n\t"                               \
+               : "=&D" (u0), "=&a" (u1), "=&c" (u2)            \
+               : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len))      \
+               : "memory" );                                   \
+} while(0)
+#endif
+#ifndef SDL_memset4
+#define SDL_memset4(dst, val, len)             \
+do {                                           \
+       unsigned _count = (len);                \
+       unsigned _n = (_count + 3) / 4;         \
+       Uint32 *_p = SDL_static_cast(Uint32 *, dst);    \
+       Uint32 _val = (val);                    \
+       if (len == 0) break;                    \
+        switch (_count % 4) {                  \
+        case 0: do {    *_p++ = _val;          \
+        case 3:         *_p++ = _val;          \
+        case 2:         *_p++ = _val;          \
+        case 1:         *_p++ = _val;          \
+               } while ( --_n );               \
+       }                                       \
+} while(0)
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy(dst, src, len)                                        \
+do {                                                                     \
+       int u0, u1, u2;                                                   \
+       __asm__ __volatile__ (                                            \
+               "cld\n\t"                                                 \
+               "rep ; movsl\n\t"                                         \
+               "testb $2,%b4\n\t"                                        \
+               "je 1f\n\t"                                               \
+               "movsw\n"                                                 \
+               "1:\ttestb $1,%b4\n\t"                                    \
+               "je 2f\n\t"                                               \
+               "movsb\n"                                                 \
+               "2:"                                                      \
+               : "=&c" (u0), "=&D" (u1), "=&S" (u2)                      \
+               : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
+               : "memory" );                                             \
+} while(0)
+#endif
+#ifndef SDL_memcpy
+#ifdef HAVE_MEMCPY
+#define SDL_memcpy      memcpy
+#elif defined(HAVE_BCOPY)
+#define SDL_memcpy(d, s, n)    bcopy((s), (d), (n))
+#else
+extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
+#endif
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy4(dst, src, len)                             \
+do {                                                           \
+       int ecx, edi, esi;                                      \
+       __asm__ __volatile__ (                                  \
+               "cld\n\t"                                       \
+               "rep ; movsl"                                   \
+               : "=&c" (ecx), "=&D" (edi), "=&S" (esi)         \
+               : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src)    \
+               : "memory" );                                   \
+} while(0)
+#endif
+#ifndef SDL_memcpy4
+#define SDL_memcpy4(dst, src, len)     SDL_memcpy(dst, src, (len) << 2)
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_revcpy(dst, src, len)                      \
+do {                                                   \
+       int u0, u1, u2;                                 \
+       char *dstp = SDL_static_cast(char *, dst);      \
+       char *srcp = SDL_static_cast(char *, src);      \
+       int n = (len);                                  \
+       if ( n >= 4 ) {                                 \
+       __asm__ __volatile__ (                          \
+               "std\n\t"                               \
+               "rep ; movsl\n\t"                       \
+               "cld\n\t"                               \
+               : "=&c" (u0), "=&D" (u1), "=&S" (u2)    \
+               : "0" (n >> 2),                         \
+                 "1" (dstp+(n-4)), "2" (srcp+(n-4))    \
+               : "memory" );                           \
+       }                                               \
+       switch (n & 3) {                                \
+               case 3: dstp[2] = srcp[2];              \
+               case 2: dstp[1] = srcp[1];              \
+               case 1: dstp[0] = srcp[0];              \
+                       break;                          \
+               default:                                \
+                       break;                          \
+       }                                               \
+} while(0)
+#endif
+#ifndef SDL_revcpy
+extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
+#endif
+
+#ifdef HAVE_MEMMOVE
+#define SDL_memmove     memmove
+#elif defined(HAVE_BCOPY)
+#define SDL_memmove(d, s, n)   bcopy((s), (d), (n))
+#else
+#define SDL_memmove(dst, src, len)                     \
+do {                                                   \
+       if ( dst < src ) {                              \
+               SDL_memcpy(dst, src, len);              \
+       } else {                                        \
+               SDL_revcpy(dst, src, len);              \
+       }                                               \
+} while(0)
+#endif
+
+#ifdef HAVE_MEMCMP
+#define SDL_memcmp      memcmp
+#else
+extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
+#endif
+
+#ifdef HAVE_STRLEN
+#define SDL_strlen      strlen
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
+#endif
+
+#ifdef HAVE_STRLCPY
+#define SDL_strlcpy     strlcpy
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRLCAT
+#define SDL_strlcat    strlcat
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRDUP
+#define SDL_strdup     strdup
+#else
+extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
+#endif
+
+#ifdef HAVE__STRREV
+#define SDL_strrev      _strrev
+#else
+extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
+#endif
+
+#ifdef HAVE__STRUPR
+#define SDL_strupr      _strupr
+#else
+extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
+#endif
+
+#ifdef HAVE__STRLWR
+#define SDL_strlwr      _strlwr
+#else
+extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
+#endif
+
+#ifdef HAVE_STRCHR
+#define SDL_strchr      strchr
+#elif defined(HAVE_INDEX)
+#define SDL_strchr      index
+#else
+extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRRCHR
+#define SDL_strrchr     strrchr
+#elif defined(HAVE_RINDEX)
+#define SDL_strrchr     rindex
+#else
+extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRSTR
+#define SDL_strstr      strstr
+#else
+extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
+#endif
+
+#ifdef HAVE_ITOA
+#define SDL_itoa        itoa
+#else
+#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__LTOA
+#define SDL_ltoa        _ltoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UITOA
+#define SDL_uitoa       _uitoa
+#else
+#define SDL_uitoa(value, string, radix)        SDL_ultoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__ULTOA
+#define SDL_ultoa       _ultoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOL
+#define SDL_strtol      strtol
+#else
+extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOUL
+#define SDL_strtoul      strtoul
+#else
+extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+
+#ifdef HAVE__I64TOA
+#define SDL_lltoa       _i64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UI64TOA
+#define SDL_ulltoa      _ui64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOLL
+#define SDL_strtoll     strtoll
+#else
+extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOULL
+#define SDL_strtoull     strtoull
+#else
+extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
+#endif
+
+#endif /* SDL_HAS_64BIT_TYPE */
+
+#ifdef HAVE_STRTOD
+#define SDL_strtod      strtod
+#else
+extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
+#endif
+
+#ifdef HAVE_ATOI
+#define SDL_atoi        atoi
+#else
+#define SDL_atoi(X)     SDL_strtol(X, NULL, 0)
+#endif
+
+#ifdef HAVE_ATOF
+#define SDL_atof        atof
+#else
+#define SDL_atof(X)     SDL_strtod(X, NULL)
+#endif
+
+#ifdef HAVE_STRCMP
+#define SDL_strcmp      strcmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCMP
+#define SDL_strncmp     strncmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRCASECMP
+#define SDL_strcasecmp  strcasecmp
+#elif defined(HAVE__STRICMP)
+#define SDL_strcasecmp  _stricmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCASECMP
+#define SDL_strncasecmp strncasecmp
+#elif defined(HAVE__STRNICMP)
+#define SDL_strncasecmp _strnicmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_SSCANF
+#define SDL_sscanf      sscanf
+#else
+extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_SNPRINTF
+#define SDL_snprintf    snprintf
+#else
+extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_VSNPRINTF
+#define SDL_vsnprintf   vsnprintf
+#else
+extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
+#endif
+
+/** @name SDL_ICONV Error Codes
+ *  The SDL implementation of iconv() returns these error codes 
+ */
+/*@{*/
+#define SDL_ICONV_ERROR                (size_t)-1
+#define SDL_ICONV_E2BIG                (size_t)-2
+#define SDL_ICONV_EILSEQ       (size_t)-3
+#define SDL_ICONV_EINVAL       (size_t)-4
+/*@}*/
+
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+#define SDL_iconv_t     iconv_t
+#define SDL_iconv_open  iconv_open
+#define SDL_iconv_close iconv_close
+#else
+typedef struct _SDL_iconv_t *SDL_iconv_t;
+extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
+extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
+#endif
+extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+/** This function converts a string between encodings in one pass, returning a
+ *  string that must be freed with SDL_free() or NULL on error.
+ */
+extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
+#define SDL_iconv_utf8_locale(S)       SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs2(S)         (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs4(S)         (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_stdinc_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_syswm.h b/misc/builddeps/dp.win32/include/SDL/SDL_syswm.h
new file mode 100644 (file)
index 0000000..716dddc
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_syswm.h
+ *  Include file for SDL custom system window manager hooks
+ */
+
+#ifndef _SDL_syswm_h
+#define _SDL_syswm_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL_syswm.h
+ *  Your application has access to a special type of event 'SDL_SYSWMEVENT',
+ *  which contains window-manager specific information and arrives whenever
+ *  an unhandled window event occurs.  This event is ignored by default, but
+ *  you can enable it with SDL_EventState()
+ */
+#ifdef SDL_PROTOTYPES_ONLY
+struct SDL_SysWMinfo;
+typedef struct SDL_SysWMinfo SDL_SysWMinfo;
+#else
+
+/* This is the structure for custom window manager events */
+#if defined(SDL_VIDEO_DRIVER_X11)
+#if defined(__APPLE__) && defined(__MACH__)
+/* conflicts with Quickdraw.h */
+#define Cursor X11Cursor
+#endif
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#if defined(__APPLE__) && defined(__MACH__)
+/* matches the re-define above */
+#undef Cursor
+#endif
+
+/** These are the various supported subsystems under UNIX */
+typedef enum {
+       SDL_SYSWM_X11
+} SDL_SYSWM_TYPE;
+
+/** The UNIX custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       SDL_SYSWM_TYPE subsystem;
+       union {
+           XEvent xevent;
+       } event;
+};
+
+/** The UNIX custom window manager information structure.
+ *  When this structure is returned, it holds information about which
+ *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
+ */
+typedef struct SDL_SysWMinfo {
+       SDL_version version;
+       SDL_SYSWM_TYPE subsystem;
+       union {
+           struct {
+               Display *display;       /**< The X11 display */
+               Window window;          /**< The X11 display window */
+               /** These locking functions should be called around
+                 *  any X11 functions using the display variable, 
+                 *  but not the gfxdisplay variable.
+                 *  They lock the event thread, so should not be
+                *  called around event functions or from event filters.
+                */
+                /*@{*/
+               void (*lock_func)(void);
+               void (*unlock_func)(void);
+                /*@}*/
+
+               /** @name Introduced in SDL 1.0.2 */
+                /*@{*/
+               Window fswindow;        /**< The X11 fullscreen window */
+               Window wmwindow;        /**< The X11 managed input window */
+                /*@}*/
+
+               /** @name Introduced in SDL 1.2.12 */
+                /*@{*/
+               Display *gfxdisplay;    /**< The X11 display to which rendering is done */
+                /*@}*/
+           } x11;
+       } info;
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_NANOX)
+#include <microwin/nano-X.h>
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       int data;
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+       SDL_version version ;
+       GR_WINDOW_ID window ;   /* The display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/** The windows custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       HWND hwnd;                      /**< The window for the message */
+       UINT msg;                       /**< The type of message */
+       WPARAM wParam;                  /**< WORD message parameter */
+       LPARAM lParam;                  /**< LONG message parameter */
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+       SDL_version version;
+       HWND window;                    /**< The Win32 display window */
+       HGLRC hglrc;                    /**< The OpenGL context, if any */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_RISCOS)
+
+/** RISC OS custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       int eventCode;          /**< The window for the message */
+       int pollBlock[64];
+};
+
+/** The RISC OS custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+       SDL_version version;
+       int wimpVersion;    /**< Wimp version running under */
+       int taskHandle;     /**< The RISC OS task handle */
+       int window;             /**< The RISC OS display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_PHOTON)
+#include <sys/neutrino.h>
+#include <Ph.h>
+
+/** The QNX custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       int data;
+};
+
+/** The QNX custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+       SDL_version version;
+       int data;
+} SDL_SysWMinfo;
+
+#else
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+       SDL_version version;
+       int data;
+};
+
+/** The generic custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+       SDL_version version;
+       int data;
+} SDL_SysWMinfo;
+
+#endif /* video driver type */
+
+#endif /* SDL_PROTOTYPES_ONLY */
+
+/* Function prototypes */
+/**
+ * This function gives you custom hooks into the window manager information.
+ * It fills the structure pointed to by 'info' with custom information and
+ * returns 1 if the function is implemented.  If it's not implemented, or
+ * the version member of the 'info' structure is invalid, it returns 0. 
+ *
+ * You typically use this function like this:
+ * @code
+ * SDL_SysWMInfo info;
+ * SDL_VERSION(&info.version);
+ * if ( SDL_GetWMInfo(&info) ) { ... }
+ * @endcode
+ */
+extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_syswm_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_thread.h b/misc/builddeps/dp.win32/include/SDL/SDL_thread.h
new file mode 100644 (file)
index 0000000..1ca9a1b
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_thread_h
+#define _SDL_thread_h
+
+/** @file SDL_thread.h
+ *  Header for the SDL thread management routines 
+ *
+ *  @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/* Thread synchronization primitives */
+#include "SDL_mutex.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** The SDL thread structure, defined in SDL_thread.c */
+struct SDL_Thread;
+typedef struct SDL_Thread SDL_Thread;
+
+/** Create a thread */
+#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) &&  !defined(__SYMBIAN32__)
+/**
+ *  We compile SDL into a DLL on OS/2. This means, that it's the DLL which
+ *  creates a new thread for the calling process with the SDL_CreateThread()
+ *  API. There is a problem with this, that only the RTL of the SDL.DLL will
+ *  be initialized for those threads, and not the RTL of the calling application!
+ *  To solve this, we make a little hack here.
+ *  We'll always use the caller's _beginthread() and _endthread() APIs to
+ *  start a new thread. This way, if it's the SDL.DLL which uses this API,
+ *  then the RTL of SDL.DLL will be used to create the new thread, and if it's
+ *  the application, then the RTL of the application will be used.
+ *  So, in short:
+ *  Always use the _beginthread() and _endthread() of the calling runtime library!
+ */
+#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
+#ifndef _WIN32_WCE
+#include <process.h> /* This has _beginthread() and _endthread() defined! */
+#endif
+
+#ifdef __OS2__
+typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
+typedef void (*pfnSDL_CurrentEndThread)(void);
+#elif __GNUC__
+typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+        unsigned (__stdcall *func)(void *), void *arg, 
+        unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#else
+typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+        unsigned (__stdcall *func)(void *), void *arg, 
+        unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#endif
+
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
+
+#ifdef __OS2__
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
+#elif defined(_WIN32_WCE)
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
+#else
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
+#endif
+#else
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
+#endif
+
+/** Get the 32-bit thread identifier for the current thread */
+extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
+
+/** Get the 32-bit thread identifier for the specified thread,
+ *  equivalent to SDL_ThreadID() if the specified thread is NULL.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
+
+/** Wait for a thread to finish.
+ *  The return code for the thread function is placed in the area
+ *  pointed to by 'status', if 'status' is not NULL.
+ */
+extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
+
+/** Forcefully kill a thread without worrying about its state */
+extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_thread_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_timer.h b/misc/builddeps/dp.win32/include/SDL/SDL_timer.h
new file mode 100644 (file)
index 0000000..d7cd024
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifndef _SDL_timer_h
+#define _SDL_timer_h
+
+/** @file SDL_timer.h
+ *  Header for the SDL time management routines
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the OS scheduler timeslice, in milliseconds */
+#define SDL_TIMESLICE          10
+
+/** This is the maximum resolution of the SDL timer on all platforms */
+#define TIMER_RESOLUTION       10      /**< Experimentally determined */
+
+/**
+ * Get the number of milliseconds since the SDL library initialization.
+ * Note that this value wraps if the program runs for more than ~49 days.
+ */ 
+extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
+
+/** Wait a specified number of milliseconds before returning */
+extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
+
+/** Function prototype for the timer callback function */
+typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
+
+/**
+ * Set a callback to run after the specified number of milliseconds has
+ * elapsed. The callback function is passed the current timer interval
+ * and returns the next timer interval.  If the returned value is the 
+ * same as the one passed in, the periodic alarm continues, otherwise a
+ * new alarm is scheduled.  If the callback returns 0, the periodic alarm
+ * is cancelled.
+ *
+ * To cancel a currently running timer, call SDL_SetTimer(0, NULL);
+ *
+ * The timer callback function may run in a different thread than your
+ * main code, and so shouldn't call any functions from within itself.
+ *
+ * The maximum resolution of this timer is 10 ms, which means that if
+ * you request a 16 ms timer, your callback will run approximately 20 ms
+ * later on an unloaded system.  If you wanted to set a flag signaling
+ * a frame update at 30 frames per second (every 33 ms), you might set a 
+ * timer for 30 ms:
+ *   @code SDL_SetTimer((33/10)*10, flag_update); @endcode
+ *
+ * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
+ *
+ * Under UNIX, you should not use raise or use SIGALRM and this function
+ * in the same program, as it is implemented using setitimer().  You also
+ * should not use this function in multi-threaded applications as signals
+ * to multi-threaded apps have undefined behavior in some implementations.
+ *
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
+
+/** @name New timer API
+ * New timer API, supports multiple timers
+ * Written by Stephane Peter <megastep@lokigames.com>
+ */
+/*@{*/
+
+/**
+ * Function prototype for the new timer callback function.
+ * The callback function is passed the current timer interval and returns
+ * the next timer interval.  If the returned value is the same as the one
+ * passed in, the periodic alarm continues, otherwise a new alarm is
+ * scheduled.  If the callback returns 0, the periodic alarm is cancelled.
+ */
+typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
+
+/** Definition of the timer ID type */
+typedef struct _SDL_TimerID *SDL_TimerID;
+
+/** Add a new timer to the pool of timers already running.
+ *  Returns a timer ID, or NULL when an error occurs.
+ */
+extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
+
+/**
+ * Remove one of the multiple timers knowing its ID.
+ * Returns a boolean value indicating success.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_timer_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_types.h b/misc/builddeps/dp.win32/include/SDL/SDL_types.h
new file mode 100644 (file)
index 0000000..cfa3523
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_types.h
+ *  @deprecated Use SDL_stdinc.h instead.
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_version.h b/misc/builddeps/dp.win32/include/SDL/SDL_version.h
new file mode 100644 (file)
index 0000000..fa02c3f
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_version.h
+ *  This header defines the current SDL version
+ */
+
+#ifndef _SDL_version_h
+#define _SDL_version_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Version Number
+ *  Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+ */
+/*@{*/
+#define SDL_MAJOR_VERSION      1
+#define SDL_MINOR_VERSION      2
+#define SDL_PATCHLEVEL         14
+/*@}*/
+
+typedef struct SDL_version {
+       Uint8 major;
+       Uint8 minor;
+       Uint8 patch;
+} SDL_version;
+
+/**
+ * This macro can be used to fill a version structure with the compile-time
+ * version of the SDL library.
+ */
+#define SDL_VERSION(X)                                                 \
+{                                                                      \
+       (X)->major = SDL_MAJOR_VERSION;                                 \
+       (X)->minor = SDL_MINOR_VERSION;                                 \
+       (X)->patch = SDL_PATCHLEVEL;                                    \
+}
+
+/** This macro turns the version numbers into a numeric value:
+ *  (1,2,3) -> (1203)
+ *  This assumes that there will never be more than 100 patchlevels
+ */
+#define SDL_VERSIONNUM(X, Y, Z)                                                \
+       ((X)*1000 + (Y)*100 + (Z))
+
+/** This is the version number macro for the current SDL version */
+#define SDL_COMPILEDVERSION \
+       SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
+
+/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */
+#define SDL_VERSION_ATLEAST(X, Y, Z) \
+       (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
+
+/** This function gets the version of the dynamically linked SDL library.
+ *  it should NOT be used to fill a version structure, instead you should
+ *  use the SDL_Version() macro.
+ */
+extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_version_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/SDL_video.h b/misc/builddeps/dp.win32/include/SDL/SDL_video.h
new file mode 100644 (file)
index 0000000..8f7f305
--- /dev/null
@@ -0,0 +1,951 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** @file SDL_video.h
+ *  Header file for access to the SDL raw framebuffer window
+ */
+
+#ifndef _SDL_video_h
+#define _SDL_video_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Transparency definitions
+ *  These define alpha as the opacity of a surface
+ */
+/*@{*/
+#define SDL_ALPHA_OPAQUE 255
+#define SDL_ALPHA_TRANSPARENT 0
+/*@}*/
+
+/** @name Useful data types */
+/*@{*/
+typedef struct SDL_Rect {
+       Sint16 x, y;
+       Uint16 w, h;
+} SDL_Rect;
+
+typedef struct SDL_Color {
+       Uint8 r;
+       Uint8 g;
+       Uint8 b;
+       Uint8 unused;
+} SDL_Color;
+#define SDL_Colour SDL_Color
+
+typedef struct SDL_Palette {
+       int       ncolors;
+       SDL_Color *colors;
+} SDL_Palette;
+/*@}*/
+
+/** Everything in the pixel format structure is read-only */
+typedef struct SDL_PixelFormat {
+       SDL_Palette *palette;
+       Uint8  BitsPerPixel;
+       Uint8  BytesPerPixel;
+       Uint8  Rloss;
+       Uint8  Gloss;
+       Uint8  Bloss;
+       Uint8  Aloss;
+       Uint8  Rshift;
+       Uint8  Gshift;
+       Uint8  Bshift;
+       Uint8  Ashift;
+       Uint32 Rmask;
+       Uint32 Gmask;
+       Uint32 Bmask;
+       Uint32 Amask;
+
+       /** RGB color key information */
+       Uint32 colorkey;
+       /** Alpha value information (per-surface alpha) */
+       Uint8  alpha;
+} SDL_PixelFormat;
+
+/** This structure should be treated as read-only, except for 'pixels',
+ *  which, if not NULL, contains the raw pixel data for the surface.
+ */
+typedef struct SDL_Surface {
+       Uint32 flags;                           /**< Read-only */
+       SDL_PixelFormat *format;                /**< Read-only */
+       int w, h;                               /**< Read-only */
+       Uint16 pitch;                           /**< Read-only */
+       void *pixels;                           /**< Read-write */
+       int offset;                             /**< Private */
+
+       /** Hardware-specific surface info */
+       struct private_hwdata *hwdata;
+
+       /** clipping information */
+       SDL_Rect clip_rect;                     /**< Read-only */
+       Uint32 unused1;                         /**< for binary compatibility */
+
+       /** Allow recursive locks */
+       Uint32 locked;                          /**< Private */
+
+       /** info for fast blit mapping to other surfaces */
+       struct SDL_BlitMap *map;                /**< Private */
+
+       /** format version, bumped at every change to invalidate blit maps */
+       unsigned int format_version;            /**< Private */
+
+       /** Reference count -- used when freeing surface */
+       int refcount;                           /**< Read-mostly */
+} SDL_Surface;
+
+/** @name SDL_Surface Flags
+ *  These are the currently supported flags for the SDL_surface
+ */
+/*@{*/
+
+/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
+/*@{*/
+#define SDL_SWSURFACE  0x00000000      /**< Surface is in system memory */
+#define SDL_HWSURFACE  0x00000001      /**< Surface is in video memory */
+#define SDL_ASYNCBLIT  0x00000004      /**< Use asynchronous blits if possible */
+/*@}*/
+
+/** Available for SDL_SetVideoMode() */
+/*@{*/
+#define SDL_ANYFORMAT  0x10000000      /**< Allow any video depth/pixel-format */
+#define SDL_HWPALETTE  0x20000000      /**< Surface has exclusive palette */
+#define SDL_DOUBLEBUF  0x40000000      /**< Set up double-buffered video mode */
+#define SDL_FULLSCREEN 0x80000000      /**< Surface is a full screen display */
+#define SDL_OPENGL      0x00000002      /**< Create an OpenGL rendering context */
+#define SDL_OPENGLBLIT 0x0000000A      /**< Create an OpenGL rendering context and use it for blitting */
+#define SDL_RESIZABLE  0x00000010      /**< This video mode may be resized */
+#define SDL_NOFRAME    0x00000020      /**< No window caption or edge frame */
+/*@}*/
+
+/** Used internally (read-only) */
+/*@{*/
+#define SDL_HWACCEL    0x00000100      /**< Blit uses hardware acceleration */
+#define SDL_SRCCOLORKEY        0x00001000      /**< Blit uses a source color key */
+#define SDL_RLEACCELOK 0x00002000      /**< Private flag */
+#define SDL_RLEACCEL   0x00004000      /**< Surface is RLE encoded */
+#define SDL_SRCALPHA   0x00010000      /**< Blit uses source alpha blending */
+#define SDL_PREALLOC   0x01000000      /**< Surface uses preallocated memory */
+/*@}*/
+
+/*@}*/
+
+/** Evaluates to true if the surface needs to be locked before access */
+#define SDL_MUSTLOCK(surface)  \
+  (surface->offset ||          \
+  ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
+
+/** typedef for private surface blitting functions */
+typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
+                       struct SDL_Surface *dst, SDL_Rect *dstrect);
+
+
+/** Useful for determining the video hardware capabilities */
+typedef struct SDL_VideoInfo {
+       Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */
+       Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */
+       Uint32 UnusedBits1  :6;
+       Uint32 UnusedBits2  :1;
+       Uint32 blit_hw      :1; /**< Flag: Accelerated blits HW --> HW */
+       Uint32 blit_hw_CC   :1; /**< Flag: Accelerated blits with Colorkey */
+       Uint32 blit_hw_A    :1; /**< Flag: Accelerated blits with Alpha */
+       Uint32 blit_sw      :1; /**< Flag: Accelerated blits SW --> HW */
+       Uint32 blit_sw_CC   :1; /**< Flag: Accelerated blits with Colorkey */
+       Uint32 blit_sw_A    :1; /**< Flag: Accelerated blits with Alpha */
+       Uint32 blit_fill    :1; /**< Flag: Accelerated color fill */
+       Uint32 UnusedBits3  :16;
+       Uint32 video_mem;       /**< The total amount of video memory (in K) */
+       SDL_PixelFormat *vfmt;  /**< Value: The format of the video surface */
+       int    current_w;       /**< Value: The current video mode width */
+       int    current_h;       /**< Value: The current video mode height */
+} SDL_VideoInfo;
+
+
+/** @name Overlay Formats
+ *  The most common video overlay formats.
+ *  For an explanation of these pixel formats, see:
+ *     http://www.webartz.com/fourcc/indexyuv.htm
+ *
+ *  For information on the relationship between color spaces, see:
+ *  http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
+ */
+/*@{*/
+#define SDL_YV12_OVERLAY  0x32315659   /**< Planar mode: Y + V + U  (3 planes) */
+#define SDL_IYUV_OVERLAY  0x56555949   /**< Planar mode: Y + U + V  (3 planes) */
+#define SDL_YUY2_OVERLAY  0x32595559   /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
+#define SDL_UYVY_OVERLAY  0x59565955   /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
+#define SDL_YVYU_OVERLAY  0x55595659   /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
+/*@}*/
+
+/** The YUV hardware video overlay */
+typedef struct SDL_Overlay {
+       Uint32 format;                          /**< Read-only */
+       int w, h;                               /**< Read-only */
+       int planes;                             /**< Read-only */
+       Uint16 *pitches;                        /**< Read-only */
+       Uint8 **pixels;                         /**< Read-write */
+
+       /** @name Hardware-specific surface info */
+        /*@{*/
+       struct private_yuvhwfuncs *hwfuncs;
+       struct private_yuvhwdata *hwdata;
+        /*@{*/
+
+       /** @name Special flags */
+        /*@{*/
+       Uint32 hw_overlay :1;   /**< Flag: This overlay hardware accelerated? */
+       Uint32 UnusedBits :31;
+        /*@}*/
+} SDL_Overlay;
+
+
+/** Public enumeration for setting the OpenGL window attributes. */
+typedef enum {
+    SDL_GL_RED_SIZE,
+    SDL_GL_GREEN_SIZE,
+    SDL_GL_BLUE_SIZE,
+    SDL_GL_ALPHA_SIZE,
+    SDL_GL_BUFFER_SIZE,
+    SDL_GL_DOUBLEBUFFER,
+    SDL_GL_DEPTH_SIZE,
+    SDL_GL_STENCIL_SIZE,
+    SDL_GL_ACCUM_RED_SIZE,
+    SDL_GL_ACCUM_GREEN_SIZE,
+    SDL_GL_ACCUM_BLUE_SIZE,
+    SDL_GL_ACCUM_ALPHA_SIZE,
+    SDL_GL_STEREO,
+    SDL_GL_MULTISAMPLEBUFFERS,
+    SDL_GL_MULTISAMPLESAMPLES,
+    SDL_GL_ACCELERATED_VISUAL,
+    SDL_GL_SWAP_CONTROL
+} SDL_GLattr;
+
+/** @name flags for SDL_SetPalette() */
+/*@{*/
+#define SDL_LOGPAL 0x01
+#define SDL_PHYSPAL 0x02
+/*@}*/
+
+/* Function prototypes */
+
+/**
+ * @name Video Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the video driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+/**
+ * Initializes the video subsystem. Sets up a connection
+ * to the window manager, etc, and determines the current video mode and
+ * pixel format, but does not initialize a window or graphics mode.
+ * Note that event handling is activated by this routine.
+ *
+ * If you use both sound and video in your application, you need to call
+ * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
+ * you won't be able to set full-screen display modes.
+ */
+extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
+extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * video driver, and returns a pointer to it if the video driver has
+ * been initialized.  It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function returns a pointer to the current display surface.
+ * If SDL is doing format conversion on the display surface, this
+ * function returns the publicly visible surface, not the real video
+ * surface.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
+
+/**
+ * This function returns a read-only pointer to information about the
+ * video hardware.  If this is called before SDL_SetVideoMode(), the 'vfmt'
+ * member of the returned structure will contain the pixel format of the
+ * "best" video mode.
+ */
+extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
+
+/**
+ * Check to see if a particular video mode is supported.
+ * It returns 0 if the requested mode is not supported under any bit depth,
+ * or returns the bits-per-pixel of the closest available mode with the
+ * given width and height.  If this bits-per-pixel is different from the
+ * one used when setting the video mode, SDL_SetVideoMode() will succeed,
+ * but will emulate the requested bits-per-pixel with a shadow surface.
+ *
+ * The arguments to SDL_VideoModeOK() are the same ones you would pass to
+ * SDL_SetVideoMode()
+ */
+extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
+
+/**
+ * Return a pointer to an array of available screen dimensions for the
+ * given format and video flags, sorted largest to smallest.  Returns 
+ * NULL if there are no dimensions available for a particular format, 
+ * or (SDL_Rect **)-1 if any dimension is okay for the given format.
+ *
+ * If 'format' is NULL, the mode list will be for the format given 
+ * by SDL_GetVideoInfo()->vfmt
+ */
+extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
+
+/**
+ * Set up a video mode with the specified width, height and bits-per-pixel.
+ *
+ * If 'bpp' is 0, it is treated as the current display bits per pixel.
+ *
+ * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
+ * requested bits-per-pixel, but will return whatever video pixel format is
+ * available.  The default is to emulate the requested pixel format if it
+ * is not natively available.
+ *
+ * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
+ * video memory, if possible, and you may have to call SDL_LockSurface()
+ * in order to access the raw framebuffer.  Otherwise, the video surface
+ * will be created in system memory.
+ *
+ * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
+ * updates asynchronously, but you must always lock before accessing pixels.
+ * SDL will wait for updates to complete before returning from the lock.
+ *
+ * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
+ * that the colors set by SDL_SetColors() will be the colors you get.
+ * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
+ * of the colors exactly the way they are requested, and you should look
+ * at the video surface structure to determine the actual palette.
+ * If SDL cannot guarantee that the colors you request can be set, 
+ * i.e. if the colormap is shared, then the video surface may be created
+ * under emulation in system memory, overriding the SDL_HWSURFACE flag.
+ *
+ * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
+ * a fullscreen video mode.  The default is to create a windowed mode
+ * if the current graphics system has a window manager.
+ * If the SDL library is able to set a fullscreen video mode, this flag 
+ * will be set in the surface that is returned.
+ *
+ * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
+ * two surfaces in video memory and swap between them when you call 
+ * SDL_Flip().  This is usually slower than the normal single-buffering
+ * scheme, but prevents "tearing" artifacts caused by modifying video 
+ * memory while the monitor is refreshing.  It should only be used by 
+ * applications that redraw the entire screen on every update.
+ *
+ * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
+ * window manager, if any, to resize the window at runtime.  When this
+ * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
+ * and you must respond to the event by re-calling SDL_SetVideoMode()
+ * with the requested size (or another size that suits the application).
+ *
+ * If SDL_NOFRAME is set in 'flags', the SDL library will create a window
+ * without any title bar or frame decoration.  Fullscreen video modes have
+ * this flag set automatically.
+ *
+ * This function returns the video framebuffer surface, or NULL if it fails.
+ *
+ * If you rely on functionality provided by certain video flags, check the
+ * flags of the returned surface to make sure that functionality is available.
+ * SDL will fall back to reduced functionality if the exact flags you wanted
+ * are not available.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
+                       (int width, int height, int bpp, Uint32 flags);
+
+/** @name SDL_Update Functions
+ * These functions should not be called while 'screen' is locked.
+ */
+/*@{*/
+/**
+ * Makes sure the given list of rectangles is updated on the given screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRects
+               (SDL_Surface *screen, int numrects, SDL_Rect *rects);
+/**
+ * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
+ * screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRect
+               (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
+/*@}*/
+
+/**
+ * On hardware that supports double-buffering, this function sets up a flip
+ * and returns.  The hardware will wait for vertical retrace, and then swap
+ * video buffers before the next video surface blit or lock will return.
+ * On hardware that doesn not support double-buffering, this is equivalent
+ * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
+ * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
+ * setting the video mode for this function to perform hardware flipping.
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
+
+/**
+ * Set the gamma correction for each of the color channels.
+ * The gamma values range (approximately) between 0.1 and 10.0
+ * 
+ * If this function isn't supported directly by the hardware, it will
+ * be emulated using gamma ramps, if available.  If successful, this
+ * function returns 0, otherwise it returns -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
+
+/**
+ * Set the gamma translation table for the red, green, and blue channels
+ * of the video hardware.  Each table is an array of 256 16-bit quantities,
+ * representing a mapping between the input and output for that channel.
+ * The input is the index into the array, and the output is the 16-bit
+ * gamma value at that index, scaled to the output color precision.
+ * 
+ * You may pass NULL for any of the channels to leave it unchanged.
+ * If the call succeeds, it will return 0.  If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
+
+/**
+ * Retrieve the current values of the gamma translation tables.
+ * 
+ * You must pass in valid pointers to arrays of 256 16-bit quantities.
+ * Any of the pointers may be NULL to ignore that channel.
+ * If the call succeeds, it will return 0.  If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
+
+/**
+ * Sets a portion of the colormap for the given 8-bit surface.  If 'surface'
+ * is not a palettized surface, this function does nothing, returning 0.
+ * If all of the colors were set as passed to SDL_SetColors(), it will
+ * return 1.  If not all the color entries were set exactly as given,
+ * it will return 0, and you should look at the surface palette to
+ * determine the actual color palette.
+ *
+ * When 'surface' is the surface associated with the current display, the
+ * display colormap will be updated with the requested colors.  If 
+ * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
+ * will always return 1, and the palette is guaranteed to be set the way
+ * you desire, even if the window colormap has to be warped or run under
+ * emulation.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, 
+                       SDL_Color *colors, int firstcolor, int ncolors);
+
+/**
+ * Sets a portion of the colormap for a given 8-bit surface.
+ * 'flags' is one or both of:
+ * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
+ *                to/from the surface,
+ * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
+ *                the screen
+ * Only screens have physical palettes. Separate change of physical/logical
+ * palettes is only possible if the screen has SDL_HWPALETTE set.
+ *
+ * The return value is 1 if all colours could be set as requested, and 0
+ * otherwise.
+ *
+ * SDL_SetColors() is equivalent to calling this function with
+ *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
+ */
+extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
+                                  SDL_Color *colors, int firstcolor,
+                                  int ncolors);
+
+/**
+ * Maps an RGB triple to an opaque pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b);
+
+/**
+ * Maps an RGBA quadruple to a pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
+
+/**
+ * Maps a pixel value into the RGB components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
+                               const SDL_PixelFormat * const fmt,
+                               Uint8 *r, Uint8 *g, Uint8 *b);
+
+/**
+ * Maps a pixel value into the RGBA components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
+                               const SDL_PixelFormat * const fmt,
+                               Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
+
+/** @sa SDL_CreateRGBSurface */
+#define SDL_AllocSurface    SDL_CreateRGBSurface
+/**
+ * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
+ * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
+ * If the depth is greater than 8 bits, the pixel format is set using the
+ * flags '[RGB]mask'.
+ * If the function runs out of memory, it will return NULL.
+ *
+ * The 'flags' tell what kind of surface to create.
+ * SDL_SWSURFACE means that the surface should be created in system memory.
+ * SDL_HWSURFACE means that the surface should be created in video memory,
+ * with the same format as the display surface.  This is useful for surfaces
+ * that will not change much, to take advantage of hardware acceleration
+ * when being blitted to the display surface.
+ * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
+ * this surface, but you must always lock it before accessing the pixels.
+ * SDL will wait for current blits to finish before returning from the lock.
+ * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
+ * If the hardware supports acceleration of colorkey blits between
+ * two surfaces in video memory, SDL will try to place the surface in
+ * video memory. If this isn't possible or if there is no hardware
+ * acceleration available, the surface will be placed in system memory.
+ * SDL_SRCALPHA means that the surface will be used for alpha blits and 
+ * if the hardware supports hardware acceleration of alpha blits between
+ * two surfaces in video memory, to place the surface in video memory
+ * if possible, otherwise it will be placed in system memory.
+ * If the surface is created in video memory, blits will be _much_ faster,
+ * but the surface format must be identical to the video surface format,
+ * and the only way to access the pixels member of the surface is to use
+ * the SDL_LockSurface() and SDL_UnlockSurface() calls.
+ * If the requested surface actually resides in video memory, SDL_HWSURFACE
+ * will be set in the flags member of the returned surface.  If for some
+ * reason the surface could not be placed in video memory, it will not have
+ * the SDL_HWSURFACE flag set, and will be created in system memory instead.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
+                       (Uint32 flags, int width, int height, int depth, 
+                       Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+/** @sa SDL_CreateRGBSurface */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
+                       int width, int height, int depth, int pitch,
+                       Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
+
+/**
+ * SDL_LockSurface() sets up a surface for directly accessing the pixels.
+ * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
+ * to and read from 'surface->pixels', using the pixel format stored in 
+ * 'surface->format'.  Once you are done accessing the surface, you should 
+ * use SDL_UnlockSurface() to release it.
+ *
+ * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
+ * to 0, then you can read and write to the surface at any time, and the
+ * pixel format of the surface will not change.  In particular, if the
+ * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
+ * will not need to lock the display surface before accessing it.
+ * 
+ * No operating system or library calls should be made between lock/unlock
+ * pairs, as critical system locks may be held during this time.
+ *
+ * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
+ */
+extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
+extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
+
+/**
+ * Load a surface from a seekable SDL data source (memory or file.)
+ * If 'freesrc' is non-zero, the source will be closed after being read.
+ * Returns the new surface, or NULL if there was an error.
+ * The new surface should be freed with SDL_FreeSurface().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
+
+/** Convenience macro -- load a surface from a file */
+#define SDL_LoadBMP(file)      SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
+
+/**
+ * Save a surface to a seekable SDL data source (memory or file.)
+ * If 'freedst' is non-zero, the source will be closed after being written.
+ * Returns 0 if successful or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
+               (SDL_Surface *surface, SDL_RWops *dst, int freedst);
+
+/** Convenience macro -- save a surface to a file */
+#define SDL_SaveBMP(surface, file) \
+               SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
+
+/**
+ * Sets the color key (transparent pixel) in a blittable surface.
+ * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
+ * 'key' will be the transparent pixel in the source image of a blit.
+ * SDL_RLEACCEL requests RLE acceleration for the surface if present,
+ * and removes RLE acceleration if absent.
+ * If 'flag' is 0, this function clears any current color key.
+ * This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColorKey
+                       (SDL_Surface *surface, Uint32 flag, Uint32 key);
+
+/**
+ * This function sets the alpha value for the entire surface, as opposed to
+ * using the alpha component of each pixel. This value measures the range
+ * of transparency of the surface, 0 being completely transparent to 255
+ * being completely opaque. An 'alpha' value of 255 causes blits to be
+ * opaque, the source pixels copied to the destination (the default). Note
+ * that per-surface alpha can be combined with colorkey transparency.
+ *
+ * If 'flag' is 0, alpha blending is disabled for the surface.
+ * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
+ * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
+ * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
+ *
+ * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
+ */
+extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
+
+/**
+ * Sets the clipping rectangle for the destination surface in a blit.
+ *
+ * If the clip rectangle is NULL, clipping will be disabled.
+ * If the clip rectangle doesn't intersect the surface, the function will
+ * return SDL_FALSE and blits will be completely clipped.  Otherwise the
+ * function returns SDL_TRUE and blits to the surface will be clipped to
+ * the intersection of the surface area and the clipping rectangle.
+ *
+ * Note that blits are automatically clipped to the edges of the source
+ * and destination surfaces.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
+
+/**
+ * Gets the clipping rectangle for the destination surface in a blit.
+ * 'rect' must be a pointer to a valid rectangle which will be filled
+ * with the correct values.
+ */
+extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
+
+/**
+ * Creates a new surface of the specified format, and then copies and maps 
+ * the given surface to it so the blit of the converted surface will be as 
+ * fast as possible.  If this function fails, it returns NULL.
+ *
+ * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
+ * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
+ * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
+ * surface.
+ *
+ * This function is used internally by SDL_DisplayFormat().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
+                       (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
+
+/**
+ * This performs a fast blit from the source surface to the destination
+ * surface.  It assumes that the source and destination rectangles are
+ * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
+ * surface (src or dst) is copied.  The final blit rectangles are saved
+ * in 'srcrect' and 'dstrect' after all clipping is performed.
+ * If the blit is successful, it returns 0, otherwise it returns -1.
+ *
+ * The blit function should not be called on a locked surface.
+ *
+ * The blit semantics for surfaces with and without alpha and colorkey
+ * are defined as follows:
+ *
+ * RGBA->RGB:
+ *     SDL_SRCALPHA set:
+ *     alpha-blend (using alpha-channel).
+ *     SDL_SRCCOLORKEY ignored.
+ *     SDL_SRCALPHA not set:
+ *     copy RGB.
+ *     if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *     RGB values of the source colour key, ignoring alpha in the
+ *     comparison.
+ * 
+ * RGB->RGBA:
+ *     SDL_SRCALPHA set:
+ *     alpha-blend (using the source per-surface alpha value);
+ *     set destination alpha to opaque.
+ *     SDL_SRCALPHA not set:
+ *     copy RGB, set destination alpha to source per-surface alpha value.
+ *     both:
+ *     if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *     source colour key.
+ * 
+ * RGBA->RGBA:
+ *     SDL_SRCALPHA set:
+ *     alpha-blend (using the source alpha channel) the RGB values;
+ *     leave destination alpha untouched. [Note: is this correct?]
+ *     SDL_SRCCOLORKEY ignored.
+ *     SDL_SRCALPHA not set:
+ *     copy all of RGBA to the destination.
+ *     if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *     RGB values of the source colour key, ignoring alpha in the
+ *     comparison.
+ * 
+ * RGB->RGB: 
+ *     SDL_SRCALPHA set:
+ *     alpha-blend (using the source per-surface alpha value).
+ *     SDL_SRCALPHA not set:
+ *     copy RGB.
+ *     both:
+ *     if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *     source colour key.
+ *
+ * If either of the surfaces were in video memory, and the blit returns -2,
+ * the video memory was lost, so it should be reloaded with artwork and 
+ * re-blitted:
+ * @code
+ *     while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ *             while ( SDL_LockSurface(image) < 0 )
+ *                     Sleep(10);
+ *             -- Write image pixels to image->pixels --
+ *             SDL_UnlockSurface(image);
+ *     }
+ * @endcode
+ *
+ * This happens under DirectX 5.0 when the system switches away from your
+ * fullscreen application.  The lock will also fail until you have access
+ * to the video memory again.
+ *
+ * You should call SDL_BlitSurface() unless you know exactly how SDL
+ * blitting works internally and how to use the other blit functions.
+ */
+#define SDL_BlitSurface SDL_UpperBlit
+
+/** This is the public blit function, SDL_BlitSurface(), and it performs
+ *  rectangle validation and clipping before passing it to SDL_LowerBlit()
+ */
+extern DECLSPEC int SDLCALL SDL_UpperBlit
+                       (SDL_Surface *src, SDL_Rect *srcrect,
+                        SDL_Surface *dst, SDL_Rect *dstrect);
+/** This is a semi-private blit function and it performs low-level surface
+ *  blitting only.
+ */
+extern DECLSPEC int SDLCALL SDL_LowerBlit
+                       (SDL_Surface *src, SDL_Rect *srcrect,
+                        SDL_Surface *dst, SDL_Rect *dstrect);
+
+/**
+ * This function performs a fast fill of the given rectangle with 'color'
+ * The given rectangle is clipped to the destination surface clip area
+ * and the final fill rectangle is saved in the passed in pointer.
+ * If 'dstrect' is NULL, the whole surface will be filled with 'color'
+ * The color should be a pixel of the format used by the surface, and 
+ * can be generated by the SDL_MapRGB() function.
+ * This function returns 0 on success, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_FillRect
+               (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer, suitable for fast
+ * blitting onto the display surface.  It calls SDL_ConvertSurface()
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer (if possible),
+ * suitable for fast alpha blitting onto the display surface.
+ * The new surface will always have an alpha channel.
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name YUV video surface overlay functions                                */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** This function creates a video output overlay
+ *  Calling the returned surface an overlay is something of a misnomer because
+ *  the contents of the display surface underneath the area where the overlay
+ *  is shown is undefined - it may be overwritten with the converted YUV data.
+ */
+extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
+                               Uint32 format, SDL_Surface *display);
+
+/** Lock an overlay for direct access, and unlock it when you are done */
+extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
+extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
+
+/** Blit a video overlay to the display surface.
+ *  The contents of the video surface underneath the blit destination are
+ *  not defined.  
+ *  The width and height of the destination rectangle may be different from
+ *  that of the overlay, but currently only 2x scaling is supported.
+ */
+extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
+
+/** Free a video overlay */
+extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name OpenGL support functions.                                          */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Dynamically load an OpenGL library, or the default one if path is NULL
+ *
+ * If you do this, you need to retrieve all of the GL functions used in
+ * your program from the dynamic library using SDL_GL_GetProcAddress().
+ */
+extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
+
+/**
+ * Get the address of a GL function
+ */
+extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
+
+/**
+ * Set an attribute of the OpenGL subsystem before intialization.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
+
+/**
+ * Get an attribute of the OpenGL subsystem from the windowing
+ * interface, such as glX. This is of course different from getting
+ * the values from SDL's internal OpenGL subsystem, which only
+ * stores the values you request before initialization.
+ *
+ * Developers should track the values they pass into SDL_GL_SetAttribute
+ * themselves if they want to retrieve these values.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
+
+/**
+ * Swap the OpenGL buffers, if double-buffering is supported.
+ */
+extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
+
+/** @name OpenGL Internal Functions
+ * Internal functions that should not be called unless you have read
+ * and understood the source code for these functions.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
+extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
+extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
+/*@}*/
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Window Manager Functions                                           */
+/** These functions allow interaction with the window manager, if any.       */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Sets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
+/**
+ * Gets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
+
+/**
+ * Sets the icon for the display window.
+ * This function must be called before the first call to SDL_SetVideoMode().
+ * It takes an icon surface, and a mask in MSB format.
+ * If 'mask' is NULL, the entire icon surface will be used as the icon.
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
+
+/**
+ * This function iconifies the window, and returns 1 if it succeeded.
+ * If the function succeeds, it generates an SDL_APPACTIVE loss event.
+ * This function is a noop and returns 0 in non-windowed environments.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
+
+/**
+ * Toggle fullscreen mode without changing the contents of the screen.
+ * If the display surface does not require locking before accessing
+ * the pixel information, then the memory pointers will not change.
+ *
+ * If this function was able to toggle fullscreen mode (change from 
+ * running in a window to fullscreen, or vice-versa), it will return 1.
+ * If it is not implemented, or fails, it returns 0.
+ *
+ * The next call to SDL_SetVideoMode() will set the mode fullscreen
+ * attribute based on the flags parameter - if SDL_FULLSCREEN is not
+ * set, then the display will be windowed by default where supported.
+ *
+ * This is currently only implemented in the X11 video driver.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
+
+typedef enum {
+       SDL_GRAB_QUERY = -1,
+       SDL_GRAB_OFF = 0,
+       SDL_GRAB_ON = 1,
+       SDL_GRAB_FULLSCREEN     /**< Used internally */
+} SDL_GrabMode;
+/**
+ * This function allows you to set and query the input grab state of
+ * the application.  It returns the new input grab state.
+ *
+ * Grabbing means that the mouse is confined to the application window,
+ * and nearly all keyboard input is passed directly to the application,
+ * and not interpreted by a window manager, if any.
+ */
+extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
+
+/*@}*/
+
+/** @internal Not in public API at the moment - do not use! */
+extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
+                                    SDL_Surface *dst, SDL_Rect *dstrect);
+                    
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/misc/builddeps/dp.win32/include/SDL/begin_code.h b/misc/builddeps/dp.win32/include/SDL/begin_code.h
new file mode 100644 (file)
index 0000000..2274809
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    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
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/** 
+ *  @file begin_code.h
+ *  This file sets things up for C dynamic library function definitions,
+ *  static inlined functions, and structures aligned at 4-byte alignment.
+ *  If you don't like ugly C preprocessor code, don't look at this file. :)
+ */
+
+/** 
+ *  @file begin_code.h
+ *  This shouldn't be nested -- included it around code only.
+ */
+#ifdef _begin_code_h
+#error Nested inclusion of begin_code.h
+#endif
+#define _begin_code_h
+
+/** 
+ *  @def DECLSPEC
+ *  Some compilers use a special export keyword
+ */
+#ifndef DECLSPEC
+# if defined(__BEOS__) || defined(__HAIKU__)
+#  if defined(__GNUC__)
+#   define DECLSPEC    __declspec(dllexport)
+#  else
+#   define DECLSPEC    __declspec(export)
+#  endif
+# elif defined(__WIN32__)
+#  ifdef __BORLANDC__
+#   ifdef BUILD_SDL
+#    define DECLSPEC 
+#   else
+#    define DECLSPEC   __declspec(dllimport)
+#   endif
+#  else
+#   define DECLSPEC    __declspec(dllexport)
+#  endif
+# elif defined(__OS2__)
+#  ifdef __WATCOMC__
+#   ifdef BUILD_SDL
+#    define DECLSPEC   __declspec(dllexport)
+#   else
+#    define DECLSPEC
+#   endif
+#  elif defined (__GNUC__) && __GNUC__ < 4
+#   /* Added support for GCC-EMX <v4.x */
+#   /* this is needed for XFree86/OS2 developement */
+#   /* F. Ambacher(anakor@snafu.de) 05.2008 */
+#   ifdef BUILD_SDL
+#    define DECLSPEC    __declspec(dllexport)
+#   else
+#    define DECLSPEC
+#   endif
+#  else
+#   define DECLSPEC
+#  endif
+# else
+#  if defined(__GNUC__) && __GNUC__ >= 4
+#   define DECLSPEC    __attribute__ ((visibility("default")))
+#  else
+#   define DECLSPEC
+#  endif
+# endif
+#endif
+
+/** 
+ *  @def SDLCALL
+ *  By default SDL uses the C calling convention
+ */
+#ifndef SDLCALL
+# if defined(__WIN32__) && !defined(__GNUC__)
+#  define SDLCALL __cdecl
+# elif defined(__OS2__)
+#  if defined (__GNUC__) && __GNUC__ < 4
+#   /* Added support for GCC-EMX <v4.x */
+#   /* this is needed for XFree86/OS2 developement */
+#   /* F. Ambacher(anakor@snafu.de) 05.2008 */
+#   define SDLCALL _cdecl
+#  else
+#   /* On other compilers on OS/2, we use the _System calling convention */
+#   /* to be compatible with every compiler */
+#   define SDLCALL _System
+#  endif
+# else
+#  define SDLCALL
+# endif
+#endif /* SDLCALL */
+
+#ifdef __SYMBIAN32__ 
+#ifndef EKA2 
+#undef DECLSPEC
+#define DECLSPEC
+#elif !defined(__WINS__)
+#undef DECLSPEC
+#define DECLSPEC __declspec(dllexport)
+#endif /* !EKA2 */
+#endif /* __SYMBIAN32__ */
+
+/**
+ *  @file begin_code.h
+ *  Force structure packing at 4 byte alignment.
+ *  This is necessary if the header is included in code which has structure
+ *  packing set to an alternate value, say for loading structures from disk.
+ *  The packing is reset to the previous value in close_code.h 
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
+#ifdef _MSC_VER
+#pragma warning(disable: 4103)
+#endif
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#pragma pack(push,4)
+#elif (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=mac68k4byte
+#pragma enumsalwaysint on
+#endif /* Compiler needs structure packing set */
+
+/**
+ *  @def SDL_INLINE_OKAY
+ *  Set up compiler-specific options for inlining functions
+ */
+#ifndef SDL_INLINE_OKAY
+#ifdef __GNUC__
+#define SDL_INLINE_OKAY
+#else
+/* Add any special compiler-specific cases here */
+#if defined(_MSC_VER) || defined(__BORLANDC__) || \
+    defined(__DMC__) || defined(__SC__) || \
+    defined(__WATCOMC__) || defined(__LCC__) || \
+    defined(__DECC) || defined(__EABI__)
+#ifndef __inline__
+#define __inline__     __inline
+#endif
+#define SDL_INLINE_OKAY
+#else
+#if !defined(__MRC__) && !defined(_SGI_SOURCE)
+#ifndef __inline__
+#define __inline__ inline
+#endif
+#define SDL_INLINE_OKAY
+#endif /* Not a funky compiler */
+#endif /* Visual C++ */
+#endif /* GNU C */
+#endif /* SDL_INLINE_OKAY */
+
+/**
+ *  @def __inline__
+ *  If inlining isn't supported, remove "__inline__", turning static
+ *  inlined functions into static functions (resulting in code bloat
+ *  in all files which include the offending header files)
+ */
+#ifndef SDL_INLINE_OKAY
+#define __inline__
+#endif
+
+/**
+ *  @def NULL
+ *  Apparently this is needed by several Windows compilers
+ */
+#if !defined(__MACH__)
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif /* NULL */
+#endif /* ! Mac OS X - breaks precompiled headers */
diff --git a/misc/builddeps/dp.win32/include/SDL/close_code.h b/misc/builddeps/dp.win32/include/SDL/close_code.h
new file mode 100644 (file)
index 0000000..46a0720
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    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
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  @file close_code.h
+ *  This file reverses the effects of begin_code.h and should be included
+ *  after you finish any function and structure declarations in your headers
+ */
+
+#undef _begin_code_h
+
+/**
+ *  @file close_code.h
+ *  Reset structure packing at previous byte alignment
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__)  || defined(__BORLANDC__)
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#if (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=reset
+#pragma enumsalwaysint reset
+#else
+#pragma pack(pop)
+#endif
+#endif /* Compiler needs structure packing set */
+
diff --git a/misc/builddeps/dp.win32/include/SDL/doxyfile b/misc/builddeps/dp.win32/include/SDL/doxyfile
new file mode 100644 (file)
index 0000000..afffb49
--- /dev/null
@@ -0,0 +1,946 @@
+# Doxyfile 1.2.16
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = SDL
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.2.14
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean,
+# Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovene,
+# Spanish, Swedish and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
+# members of a class in the documentation of that class as if those members were
+# ordinary class members. Constructors, destructors and assignment operators of
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH        =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments  will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS           = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = include
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# *.h++ *.idl *.odl
+
+FILE_PATTERNS          = *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER           =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET        =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
+# or Internet explorer 4.0+). Note that for large projects the tree generation
+# can take a very long time. In such cases it is better to disable this feature.
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = YES
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_XML           = NO
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED             = DOXYGEN_SHOULD_IGNORE_THIS=1 SDLCALL= SNDDECLSPEC=
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line and do not end with a semicolon. Such function macros are typically
+# used for boiler-plate code, and will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off. Note that this
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME               = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL                =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL                =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH            =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH            = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS          =
diff --git a/misc/builddeps/dp.win32/include/d3dtypes.h b/misc/builddeps/dp.win32/include/d3dtypes.h
new file mode 100644 (file)
index 0000000..e2e4a1a
--- /dev/null
@@ -0,0 +1,1698 @@
+/*==========================================================================;
+ *
+ *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
+ *
+ *  File:   d3dtypes.h
+ *  Content:    Direct3D types include file
+ *
+ ***************************************************************************/
+
+#ifndef _D3DTYPES_H_
+#define _D3DTYPES_H_
+
+#include <windows.h>
+
+#include <float.h>
+#include <ddraw.h>
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION         0x0600
+#endif
+
+#pragma pack(4)
+
+
+/* D3DVALUE is the fundamental Direct3D fractional data type */
+
+#define D3DVALP(val, prec) ((float)(val))
+#define D3DVAL(val) ((float)(val))
+typedef float D3DVALUE, *LPD3DVALUE;
+#define D3DDivide(a, b)    (float)((double) (a) / (double) (b))
+#define D3DMultiply(a, b)    ((a) * (b))
+
+typedef LONG D3DFIXED;
+
+#ifndef RGB_MAKE
+/*
+ * Format of CI colors is
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *  |    alpha      |         color index           |   fraction    |
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define CI_GETALPHA(ci)    ((ci) >> 24)
+#define CI_GETINDEX(ci)    (((ci) >> 8) & 0xffff)
+#define CI_GETFRACTION(ci) ((ci) & 0xff)
+#define CI_ROUNDINDEX(ci)  CI_GETINDEX((ci) + 0x80)
+#define CI_MASKALPHA(ci)   ((ci) & 0xffffff)
+#define CI_MAKE(a, i, f)    (((a) << 24) | ((i) << 8) | (f))
+
+/*
+ * Format of RGBA colors is
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *  |    alpha      |      red      |     green     |     blue      |
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define RGBA_GETALPHA(rgb)      ((rgb) >> 24)
+#define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
+#define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
+#define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
+#define RGBA_MAKE(r, g, b, a)   ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
+
+/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
+ * The float values must be in the range 0..1
+ */
+#define D3DRGB(r, g, b) \
+    (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
+#define D3DRGBA(r, g, b, a) \
+    (   (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
+    |   (((long)((g) * 255)) << 8) | (long)((b) * 255) \
+    )
+
+/*
+ * Format of RGB colors is
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *  |    ignored    |      red      |     green     |     blue      |
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define RGB_GETRED(rgb)         (((rgb) >> 16) & 0xff)
+#define RGB_GETGREEN(rgb)       (((rgb) >> 8) & 0xff)
+#define RGB_GETBLUE(rgb)        ((rgb) & 0xff)
+#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
+#define RGB_MAKE(r, g, b)       ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b)))
+#define RGBA_TORGB(rgba)       ((D3DCOLOR) ((rgba) & 0xffffff))
+#define RGB_TORGBA(rgb)        ((D3DCOLOR) ((rgb) | 0xff000000))
+
+#endif
+
+/*
+ * Flags for Enumerate functions
+ */
+
+/*
+ * Stop the enumeration
+ */
+#define D3DENUMRET_CANCEL                        DDENUMRET_CANCEL
+
+/*
+ * Continue the enumeration
+ */
+#define D3DENUMRET_OK                            DDENUMRET_OK
+
+typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
+typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
+typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
+
+typedef DWORD D3DCOLOR, *LPD3DCOLOR;
+
+typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
+typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
+typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
+
+typedef struct _D3DCOLORVALUE {
+    union {
+    D3DVALUE r;
+    D3DVALUE dvR;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE g;
+    D3DVALUE dvG;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE b;
+    D3DVALUE dvB;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    union {
+    D3DVALUE a;
+    D3DVALUE dvA;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+} D3DCOLORVALUE, *LPD3DCOLORVALUE;
+
+typedef struct _D3DRECT {
+    union {
+    LONG x1;
+    LONG lX1;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    LONG y1;
+    LONG lY1;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    LONG x2;
+    LONG lX2;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    union {
+    LONG y2;
+    LONG lY2;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+} D3DRECT, *LPD3DRECT;
+
+typedef struct _D3DVECTOR {
+    union {
+    D3DVALUE x;
+    D3DVALUE dvX;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE y;
+    D3DVALUE dvY;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE z;
+    D3DVALUE dvZ;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+
+public:
+
+    // =====================================
+    // Constructors
+    // =====================================
+
+    _D3DVECTOR() { }
+    _D3DVECTOR(D3DVALUE f);
+    _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
+    _D3DVECTOR(const D3DVALUE f[3]);
+
+    // =====================================
+    // Access grants
+    // =====================================
+
+    const D3DVALUE&operator[](int i) const;
+    D3DVALUE&operator[](int i);
+
+    // =====================================
+    // Assignment operators
+    // =====================================
+
+    _D3DVECTOR& operator += (const _D3DVECTOR& v);
+    _D3DVECTOR& operator -= (const _D3DVECTOR& v);
+    _D3DVECTOR& operator *= (const _D3DVECTOR& v);
+    _D3DVECTOR& operator /= (const _D3DVECTOR& v);
+    _D3DVECTOR& operator *= (D3DVALUE s);
+    _D3DVECTOR& operator /= (D3DVALUE s);
+
+    // =====================================
+    // Unary operators
+    // =====================================
+
+    friend _D3DVECTOR operator + (const _D3DVECTOR& v);
+    friend _D3DVECTOR operator - (const _D3DVECTOR& v);
+
+
+    // =====================================
+    // Binary operators
+    // =====================================
+
+    // Addition and subtraction
+        friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+        friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+    // Scalar multiplication and division
+        friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
+        friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
+        friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
+    // Memberwise multiplication and division
+        friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+        friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+    // Vector dominance
+        friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+        friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+    // Bitwise equality
+        friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+    // Length-related functions
+        friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v);
+        friend D3DVALUE Magnitude (const _D3DVECTOR& v);
+
+    // Returns vector with same direction and unit length
+        friend _D3DVECTOR Normalize (const _D3DVECTOR& v);
+
+    // Return min/max component of the input vector
+        friend D3DVALUE Min (const _D3DVECTOR& v);
+        friend D3DVALUE Max (const _D3DVECTOR& v);
+
+    // Return memberwise min/max of input vectors
+        friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+        friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+    // Dot and cross product
+        friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+        friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+#endif
+} D3DVECTOR, *LPD3DVECTOR;
+
+/*
+ * Vertex data types supported in an ExecuteBuffer.
+ */
+
+/*
+ * Homogeneous vertices
+ */
+
+typedef struct _D3DHVERTEX {
+    DWORD           dwFlags;        /* Homogeneous clipping flags */
+    union {
+    D3DVALUE    hx;
+    D3DVALUE    dvHX;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    hy;
+    D3DVALUE    dvHY;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    hz;
+    D3DVALUE    dvHZ;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+} D3DHVERTEX, *LPD3DHVERTEX;
+
+/*
+ * Transformed/lit vertices
+ */
+typedef struct _D3DTLVERTEX {
+    union {
+    D3DVALUE    sx;             /* Screen coordinates */
+    D3DVALUE    dvSX;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    sy;
+    D3DVALUE    dvSY;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    sz;
+    D3DVALUE    dvSZ;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    rhw;        /* Reciprocal of homogeneous w */
+    D3DVALUE    dvRHW;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+    union {
+    D3DCOLOR    color;          /* Vertex color */
+    D3DCOLOR    dcColor;
+#if defined(NONAMELESSUNION)
+    } u5;
+#else
+    };
+#endif
+    union {
+    D3DCOLOR    specular;       /* Specular component of vertex */
+    D3DCOLOR    dcSpecular;
+#if defined(NONAMELESSUNION)
+    } u6;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    tu;             /* Texture coordinates */
+    D3DVALUE    dvTU;
+#if defined(NONAMELESSUNION)
+    } u7;
+#else
+    };
+#endif
+    union {
+    D3DVALUE    tv;
+    D3DVALUE    dvTV;
+#if defined(NONAMELESSUNION)
+    } u8;
+#else
+    };
+#endif
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+    _D3DTLVERTEX() { }
+    _D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
+                 D3DCOLOR _color, D3DCOLOR _specular,
+                 float _tu, float _tv)
+        { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw;
+          color = _color; specular = _specular;
+          tu = _tu; tv = _tv;
+        }
+#endif
+} D3DTLVERTEX, *LPD3DTLVERTEX;
+
+/*
+ * Untransformed/lit vertices
+ */
+typedef struct _D3DLVERTEX {
+    union {
+    D3DVALUE     x;             /* Homogeneous coordinates */
+    D3DVALUE     dvX;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     y;
+    D3DVALUE     dvY;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     z;
+    D3DVALUE     dvZ;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    DWORD            dwReserved;
+    union {
+    D3DCOLOR     color;         /* Vertex color */
+    D3DCOLOR     dcColor;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+    union {
+    D3DCOLOR     specular;      /* Specular component of vertex */
+    D3DCOLOR     dcSpecular;
+#if defined(NONAMELESSUNION)
+    } u5;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     tu;            /* Texture coordinates */
+    D3DVALUE     dvTU;
+#if defined(NONAMELESSUNION)
+    } u6;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     tv;
+    D3DVALUE     dvTV;
+#if defined(NONAMELESSUNION)
+    } u7;
+#else
+    };
+#endif
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+    _D3DLVERTEX() { }
+    _D3DLVERTEX(const D3DVECTOR& v,
+                D3DCOLOR _color, D3DCOLOR _specular,
+                float _tu, float _tv)
+        { x = v.x; y = v.y; z = v.z; dwReserved = 0;
+          color = _color; specular = _specular;
+          tu = _tu; tv = _tv;
+        }
+#endif
+} D3DLVERTEX, *LPD3DLVERTEX;
+
+/*
+ * Untransformed/unlit vertices
+ */
+
+typedef struct _D3DVERTEX {
+    union {
+    D3DVALUE     x;             /* Homogeneous coordinates */
+    D3DVALUE     dvX;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     y;
+    D3DVALUE     dvY;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     z;
+    D3DVALUE     dvZ;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     nx;            /* Normal */
+    D3DVALUE     dvNX;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     ny;
+    D3DVALUE     dvNY;
+#if defined(NONAMELESSUNION)
+    } u5;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     nz;
+    D3DVALUE     dvNZ;
+#if defined(NONAMELESSUNION)
+    } u6;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     tu;            /* Texture coordinates */
+    D3DVALUE     dvTU;
+#if defined(NONAMELESSUNION)
+    } u7;
+#else
+    };
+#endif
+    union {
+    D3DVALUE     tv;
+    D3DVALUE     dvTV;
+#if defined(NONAMELESSUNION)
+    } u8;
+#else
+    };
+#endif
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+    _D3DVERTEX() { }
+    _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
+        { x = v.x; y = v.y; z = v.z;
+          nx = n.x; ny = n.y; nz = n.z;
+          tu = _tu; tv = _tv;
+        }
+#endif
+} D3DVERTEX, *LPD3DVERTEX;
+
+
+/*
+ * Matrix, viewport, and tranformation structures and definitions.
+ */
+
+typedef struct _D3DMATRIX {
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+    union {
+        struct {
+#endif
+
+            D3DVALUE        _11, _12, _13, _14;
+            D3DVALUE        _21, _22, _23, _24;
+            D3DVALUE        _31, _32, _33, _34;
+            D3DVALUE        _41, _42, _43, _44;
+
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+#if defined(NONAMELESSUNION)
+        } u1;
+#else
+        };
+#endif
+        D3DVALUE m[4][4];
+    };
+    _D3DMATRIX() { }
+    _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03,
+                D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13,
+                D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23,
+                D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33
+        )
+        {
+                m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03;
+                m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13;
+                m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23;
+                m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33;
+        }
+
+    D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; }
+    const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; }
+    friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&);
+#endif
+} D3DMATRIX, *LPD3DMATRIX;
+
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+#include "d3dvec.inl"
+#endif
+
+typedef struct _D3DVIEWPORT {
+    DWORD       dwSize;
+    DWORD       dwX;
+    DWORD       dwY;        /* Top left */
+    DWORD       dwWidth;
+    DWORD       dwHeight;   /* Dimensions */
+    D3DVALUE    dvScaleX;   /* Scale homogeneous to screen */
+    D3DVALUE    dvScaleY;   /* Scale homogeneous to screen */
+    D3DVALUE    dvMaxX;     /* Min/max homogeneous x coord */
+    D3DVALUE    dvMaxY;     /* Min/max homogeneous y coord */
+    D3DVALUE    dvMinZ;
+    D3DVALUE    dvMaxZ;     /* Min/max homogeneous z coord */
+} D3DVIEWPORT, *LPD3DVIEWPORT;
+
+typedef struct _D3DVIEWPORT2 {
+    DWORD       dwSize;
+    DWORD       dwX;
+    DWORD       dwY;        /* Viewport Top left */
+    DWORD       dwWidth;
+    DWORD       dwHeight;   /* Viewport Dimensions */
+    D3DVALUE    dvClipX;        /* Top left of clip volume */
+    D3DVALUE    dvClipY;
+    D3DVALUE    dvClipWidth;    /* Clip Volume Dimensions */
+    D3DVALUE    dvClipHeight;
+    D3DVALUE    dvMinZ;         /* Min/max of clip Volume */
+    D3DVALUE    dvMaxZ;
+} D3DVIEWPORT2, *LPD3DVIEWPORT2;
+
+/*
+ * Values for clip fields.
+ */
+#define D3DCLIP_LEFT                0x00000001L
+#define D3DCLIP_RIGHT               0x00000002L
+#define D3DCLIP_TOP             0x00000004L
+#define D3DCLIP_BOTTOM              0x00000008L
+#define D3DCLIP_FRONT               0x00000010L
+#define D3DCLIP_BACK                0x00000020L
+#define D3DCLIP_GEN0                0x00000040L
+#define D3DCLIP_GEN1                0x00000080L
+#define D3DCLIP_GEN2                0x00000100L
+#define D3DCLIP_GEN3                0x00000200L
+#define D3DCLIP_GEN4                0x00000400L
+#define D3DCLIP_GEN5                0x00000800L
+
+/*
+ * Values for d3d status.
+ */
+#define D3DSTATUS_CLIPUNIONLEFT         D3DCLIP_LEFT
+#define D3DSTATUS_CLIPUNIONRIGHT        D3DCLIP_RIGHT
+#define D3DSTATUS_CLIPUNIONTOP          D3DCLIP_TOP
+#define D3DSTATUS_CLIPUNIONBOTTOM       D3DCLIP_BOTTOM
+#define D3DSTATUS_CLIPUNIONFRONT        D3DCLIP_FRONT
+#define D3DSTATUS_CLIPUNIONBACK         D3DCLIP_BACK
+#define D3DSTATUS_CLIPUNIONGEN0         D3DCLIP_GEN0
+#define D3DSTATUS_CLIPUNIONGEN1         D3DCLIP_GEN1
+#define D3DSTATUS_CLIPUNIONGEN2         D3DCLIP_GEN2
+#define D3DSTATUS_CLIPUNIONGEN3         D3DCLIP_GEN3
+#define D3DSTATUS_CLIPUNIONGEN4         D3DCLIP_GEN4
+#define D3DSTATUS_CLIPUNIONGEN5         D3DCLIP_GEN5
+
+#define D3DSTATUS_CLIPINTERSECTIONLEFT      0x00001000L
+#define D3DSTATUS_CLIPINTERSECTIONRIGHT     0x00002000L
+#define D3DSTATUS_CLIPINTERSECTIONTOP       0x00004000L
+#define D3DSTATUS_CLIPINTERSECTIONBOTTOM    0x00008000L
+#define D3DSTATUS_CLIPINTERSECTIONFRONT     0x00010000L
+#define D3DSTATUS_CLIPINTERSECTIONBACK      0x00020000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN0      0x00040000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN1      0x00080000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN2      0x00100000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN3      0x00200000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN4      0x00400000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN5      0x00800000L
+#define D3DSTATUS_ZNOTVISIBLE               0x01000000L
+/* Do not use 0x80000000 for any status flags in future as it is reserved */
+
+#define D3DSTATUS_CLIPUNIONALL  (       \
+        D3DSTATUS_CLIPUNIONLEFT |   \
+        D3DSTATUS_CLIPUNIONRIGHT    |   \
+        D3DSTATUS_CLIPUNIONTOP  |   \
+        D3DSTATUS_CLIPUNIONBOTTOM   |   \
+        D3DSTATUS_CLIPUNIONFRONT    |   \
+        D3DSTATUS_CLIPUNIONBACK |   \
+        D3DSTATUS_CLIPUNIONGEN0 |   \
+        D3DSTATUS_CLIPUNIONGEN1 |   \
+        D3DSTATUS_CLIPUNIONGEN2 |   \
+        D3DSTATUS_CLIPUNIONGEN3 |   \
+        D3DSTATUS_CLIPUNIONGEN4 |   \
+        D3DSTATUS_CLIPUNIONGEN5     \
+        )
+
+#define D3DSTATUS_CLIPINTERSECTIONALL   (       \
+        D3DSTATUS_CLIPINTERSECTIONLEFT  |   \
+        D3DSTATUS_CLIPINTERSECTIONRIGHT |   \
+        D3DSTATUS_CLIPINTERSECTIONTOP   |   \
+        D3DSTATUS_CLIPINTERSECTIONBOTTOM    |   \
+        D3DSTATUS_CLIPINTERSECTIONFRONT |   \
+        D3DSTATUS_CLIPINTERSECTIONBACK  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN0  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN1  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN2  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN3  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN4  |   \
+        D3DSTATUS_CLIPINTERSECTIONGEN5      \
+        )
+
+#define D3DSTATUS_DEFAULT   (           \
+        D3DSTATUS_CLIPINTERSECTIONALL   |   \
+        D3DSTATUS_ZNOTVISIBLE)
+
+
+/*
+ * Options for direct transform calls
+ */
+#define D3DTRANSFORM_CLIPPED       0x00000001l
+#define D3DTRANSFORM_UNCLIPPED     0x00000002l
+
+typedef struct _D3DTRANSFORMDATA {
+    DWORD           dwSize;
+    LPVOID      lpIn;           /* Input vertices */
+    DWORD           dwInSize;       /* Stride of input vertices */
+    LPVOID      lpOut;          /* Output vertices */
+    DWORD           dwOutSize;      /* Stride of output vertices */
+    LPD3DHVERTEX    lpHOut;         /* Output homogeneous vertices */
+    DWORD           dwClip;         /* Clipping hint */
+    DWORD           dwClipIntersection;
+    DWORD           dwClipUnion;    /* Union of all clip flags */
+    D3DRECT         drExtent;       /* Extent of transformed vertices */
+} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
+
+/*
+ * Structure defining position and direction properties for lighting.
+ */
+typedef struct _D3DLIGHTINGELEMENT {
+    D3DVECTOR dvPosition;           /* Lightable point in model space */
+    D3DVECTOR dvNormal;             /* Normalised unit vector */
+} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
+
+/*
+ * Structure defining material properties for lighting.
+ */
+typedef struct _D3DMATERIAL {
+    DWORD           dwSize;
+    union {
+    D3DCOLORVALUE   diffuse;        /* Diffuse color RGBA */
+    D3DCOLORVALUE   dcvDiffuse;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    D3DCOLORVALUE   ambient;        /* Ambient color RGB */
+    D3DCOLORVALUE   dcvAmbient;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    D3DCOLORVALUE   specular;       /* Specular 'shininess' */
+    D3DCOLORVALUE   dcvSpecular;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    union {
+    D3DCOLORVALUE   emissive;       /* Emissive color RGB */
+    D3DCOLORVALUE   dcvEmissive;
+#if defined(NONAMELESSUNION)
+    } u4;
+#else
+    };
+#endif
+    union {
+    D3DVALUE        power;          /* Sharpness if specular highlight */
+    D3DVALUE        dvPower;
+#if defined(NONAMELESSUNION)
+    } u5;
+#else
+    };
+#endif
+    D3DTEXTUREHANDLE    hTexture;       /* Handle to texture map */
+    DWORD           dwRampSize;
+} D3DMATERIAL, *LPD3DMATERIAL;
+
+typedef enum _D3DLIGHTTYPE {
+    D3DLIGHT_POINT          = 1,
+    D3DLIGHT_SPOT           = 2,
+    D3DLIGHT_DIRECTIONAL    = 3,
+    D3DLIGHT_PARALLELPOINT  = 4,
+#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers
+    D3DLIGHT_GLSPOT         = 5,
+#endif
+    D3DLIGHT_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
+} D3DLIGHTTYPE;
+
+/*
+ * Structure defining a light source and its properties.
+ */
+typedef struct _D3DLIGHT {
+    DWORD           dwSize;
+    D3DLIGHTTYPE    dltType;            /* Type of light source */
+    D3DCOLORVALUE   dcvColor;       /* Color of light */
+    D3DVECTOR       dvPosition;     /* Position in world space */
+    D3DVECTOR       dvDirection;        /* Direction in world space */
+    D3DVALUE        dvRange;            /* Cutoff range */
+    D3DVALUE        dvFalloff;          /* Falloff */
+    D3DVALUE        dvAttenuation0;     /* Constant attenuation */
+    D3DVALUE        dvAttenuation1;     /* Linear attenuation */
+    D3DVALUE        dvAttenuation2;     /* Quadratic attenuation */
+    D3DVALUE        dvTheta;            /* Inner angle of spotlight cone */
+    D3DVALUE        dvPhi;              /* Outer angle of spotlight cone */
+} D3DLIGHT, *LPD3DLIGHT;
+
+/*
+ * Structure defining a light source and its properties.
+ */
+
+/* flags bits */
+#define D3DLIGHT_ACTIVE         0x00000001
+#define D3DLIGHT_NO_SPECULAR    0x00000002
+
+/* maximum valid light range */
+#define D3DLIGHT_RANGE_MAX      ((float)sqrt(FLT_MAX))
+
+typedef struct _D3DLIGHT2 {
+    DWORD           dwSize;
+    D3DLIGHTTYPE    dltType;        /* Type of light source */
+    D3DCOLORVALUE   dcvColor;       /* Color of light */
+    D3DVECTOR       dvPosition;     /* Position in world space */
+    D3DVECTOR       dvDirection;    /* Direction in world space */
+    D3DVALUE        dvRange;        /* Cutoff range */
+    D3DVALUE        dvFalloff;      /* Falloff */
+    D3DVALUE        dvAttenuation0; /* Constant attenuation */
+    D3DVALUE        dvAttenuation1; /* Linear attenuation */
+    D3DVALUE        dvAttenuation2; /* Quadratic attenuation */
+    D3DVALUE        dvTheta;        /* Inner angle of spotlight cone */
+    D3DVALUE        dvPhi;          /* Outer angle of spotlight cone */
+    DWORD           dwFlags;
+} D3DLIGHT2, *LPD3DLIGHT2;
+
+typedef struct _D3DLIGHTDATA {
+    DWORD                dwSize;
+    LPD3DLIGHTINGELEMENT lpIn;      /* Input positions and normals */
+    DWORD                dwInSize;  /* Stride of input elements */
+    LPD3DTLVERTEX        lpOut;     /* Output colors */
+    DWORD                dwOutSize; /* Stride of output colors */
+} D3DLIGHTDATA, *LPD3DLIGHTDATA;
+
+/*
+ * Before DX5, these values were in an enum called
+ * D3DCOLORMODEL. This was not correct, since they are
+ * bit flags. A driver can surface either or both flags
+ * in the dcmColorModel member of D3DDEVICEDESC.
+ */
+#define D3DCOLOR_MONO   1
+#define D3DCOLOR_RGB    2
+
+typedef DWORD D3DCOLORMODEL;
+
+/*
+ * Options for clearing
+ */
+#define D3DCLEAR_TARGET            0x00000001l  /* Clear target surface */
+#define D3DCLEAR_ZBUFFER           0x00000002l  /* Clear target z buffer */
+#define D3DCLEAR_STENCIL           0x00000004l  /* Clear stencil planes */
+
+/*
+ * Execute buffers are allocated via Direct3D.  These buffers may then
+ * be filled by the application with instructions to execute along with
+ * vertex data.
+ */
+
+/*
+ * Supported op codes for execute instructions.
+ */
+typedef enum _D3DOPCODE {
+    D3DOP_POINT                 = 1,
+    D3DOP_LINE                  = 2,
+    D3DOP_TRIANGLE      = 3,
+    D3DOP_MATRIXLOAD        = 4,
+    D3DOP_MATRIXMULTIPLY    = 5,
+    D3DOP_STATETRANSFORM        = 6,
+    D3DOP_STATELIGHT        = 7,
+    D3DOP_STATERENDER       = 8,
+    D3DOP_PROCESSVERTICES       = 9,
+    D3DOP_TEXTURELOAD       = 10,
+    D3DOP_EXIT                  = 11,
+    D3DOP_BRANCHFORWARD     = 12,
+    D3DOP_SPAN          = 13,
+    D3DOP_SETSTATUS     = 14,
+    D3DOP_FORCE_DWORD           = 0x7fffffff, /* force 32-bit size enum */
+} D3DOPCODE;
+
+typedef struct _D3DINSTRUCTION {
+    BYTE bOpcode;   /* Instruction opcode */
+    BYTE bSize;     /* Size of each instruction data unit */
+    WORD wCount;    /* Count of instruction data units to follow */
+} D3DINSTRUCTION, *LPD3DINSTRUCTION;
+
+/*
+ * Structure for texture loads
+ */
+typedef struct _D3DTEXTURELOAD {
+    D3DTEXTUREHANDLE hDestTexture;
+    D3DTEXTUREHANDLE hSrcTexture;
+} D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
+
+/*
+ * Structure for picking
+ */
+typedef struct _D3DPICKRECORD {
+    BYTE     bOpcode;
+    BYTE     bPad;
+    DWORD    dwOffset;
+    D3DVALUE dvZ;
+} D3DPICKRECORD, *LPD3DPICKRECORD;
+
+/*
+ * The following defines the rendering states which can be set in the
+ * execute buffer.
+ */
+
+typedef enum _D3DSHADEMODE {
+    D3DSHADE_FLAT              = 1,
+    D3DSHADE_GOURAUD           = 2,
+    D3DSHADE_PHONG             = 3,
+    D3DSHADE_FORCE_DWORD       = 0x7fffffff, /* force 32-bit size enum */
+} D3DSHADEMODE;
+
+typedef enum _D3DFILLMODE {
+    D3DFILL_POINT          = 1,
+    D3DFILL_WIREFRAME          = 2,
+    D3DFILL_SOLID          = 3,
+    D3DFILL_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+} D3DFILLMODE;
+
+typedef struct _D3DLINEPATTERN {
+    WORD    wRepeatFactor;
+    WORD    wLinePattern;
+} D3DLINEPATTERN;
+
+typedef enum _D3DTEXTUREFILTER {
+    D3DFILTER_NEAREST          = 1,
+    D3DFILTER_LINEAR           = 2,
+    D3DFILTER_MIPNEAREST       = 3,
+    D3DFILTER_MIPLINEAR        = 4,
+    D3DFILTER_LINEARMIPNEAREST = 5,
+    D3DFILTER_LINEARMIPLINEAR  = 6,
+    D3DFILTER_FORCE_DWORD      = 0x7fffffff, /* force 32-bit size enum */
+} D3DTEXTUREFILTER;
+
+typedef enum _D3DBLEND {
+    D3DBLEND_ZERO              = 1,
+    D3DBLEND_ONE               = 2,
+    D3DBLEND_SRCCOLOR          = 3,
+    D3DBLEND_INVSRCCOLOR       = 4,
+    D3DBLEND_SRCALPHA          = 5,
+    D3DBLEND_INVSRCALPHA       = 6,
+    D3DBLEND_DESTALPHA         = 7,
+    D3DBLEND_INVDESTALPHA      = 8,
+    D3DBLEND_DESTCOLOR         = 9,
+    D3DBLEND_INVDESTCOLOR      = 10,
+    D3DBLEND_SRCALPHASAT       = 11,
+    D3DBLEND_BOTHSRCALPHA      = 12,
+    D3DBLEND_BOTHINVSRCALPHA   = 13,
+    D3DBLEND_FORCE_DWORD       = 0x7fffffff, /* force 32-bit size enum */
+} D3DBLEND;
+
+typedef enum _D3DTEXTUREBLEND {
+    D3DTBLEND_DECAL            = 1,
+    D3DTBLEND_MODULATE         = 2,
+    D3DTBLEND_DECALALPHA       = 3,
+    D3DTBLEND_MODULATEALPHA    = 4,
+    D3DTBLEND_DECALMASK        = 5,
+    D3DTBLEND_MODULATEMASK     = 6,
+    D3DTBLEND_COPY             = 7,
+    D3DTBLEND_ADD              = 8,
+    D3DTBLEND_FORCE_DWORD      = 0x7fffffff, /* force 32-bit size enum */
+} D3DTEXTUREBLEND;
+
+typedef enum _D3DTEXTUREADDRESS {
+    D3DTADDRESS_WRAP           = 1,
+    D3DTADDRESS_MIRROR         = 2,
+    D3DTADDRESS_CLAMP          = 3,
+    D3DTADDRESS_BORDER         = 4,
+    D3DTADDRESS_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
+} D3DTEXTUREADDRESS;
+
+typedef enum _D3DCULL {
+    D3DCULL_NONE               = 1,
+    D3DCULL_CW                 = 2,
+    D3DCULL_CCW                = 3,
+    D3DCULL_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+} D3DCULL;
+
+typedef enum _D3DCMPFUNC {
+    D3DCMP_NEVER               = 1,
+    D3DCMP_LESS                = 2,
+    D3DCMP_EQUAL               = 3,
+    D3DCMP_LESSEQUAL           = 4,
+    D3DCMP_GREATER             = 5,
+    D3DCMP_NOTEQUAL            = 6,
+    D3DCMP_GREATEREQUAL        = 7,
+    D3DCMP_ALWAYS              = 8,
+    D3DCMP_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+} D3DCMPFUNC;
+
+typedef enum _D3DSTENCILOP {
+    D3DSTENCILOP_KEEP           = 1,
+    D3DSTENCILOP_ZERO           = 2,
+    D3DSTENCILOP_REPLACE        = 3,
+    D3DSTENCILOP_INCRSAT        = 4,
+    D3DSTENCILOP_DECRSAT        = 5,
+    D3DSTENCILOP_INVERT         = 6,
+    D3DSTENCILOP_INCR           = 7,
+    D3DSTENCILOP_DECR           = 8,
+    D3DSTENCILOP_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
+} D3DSTENCILOP;
+
+typedef enum _D3DFOGMODE {
+    D3DFOG_NONE                = 0,
+    D3DFOG_EXP                 = 1,
+    D3DFOG_EXP2                = 2,
+    D3DFOG_LINEAR              = 3,
+    D3DFOG_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+} D3DFOGMODE;
+
+typedef enum _D3DZBUFFERTYPE {
+    D3DZB_FALSE                 = 0,
+    D3DZB_TRUE                  = 1, // Z buffering
+    D3DZB_USEW                  = 2, // W buffering
+    D3DZB_FORCE_DWORD           = 0x7fffffff, /* force 32-bit size enum */
+} D3DZBUFFERTYPE;
+
+typedef enum _D3DANTIALIASMODE {
+    D3DANTIALIAS_NONE          = 0,
+    D3DANTIALIAS_SORTDEPENDENT = 1,
+    D3DANTIALIAS_SORTINDEPENDENT = 2,
+    D3DANTIALIAS_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+} D3DANTIALIASMODE;
+
+// Vertex types supported by Direct3D
+typedef enum _D3DVERTEXTYPE {
+    D3DVT_VERTEX        = 1,
+    D3DVT_LVERTEX       = 2,
+    D3DVT_TLVERTEX      = 3,
+    D3DVT_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+} D3DVERTEXTYPE;
+
+// Primitives supported by draw-primitive API
+typedef enum _D3DPRIMITIVETYPE {
+    D3DPT_POINTLIST     = 1,
+    D3DPT_LINELIST      = 2,
+    D3DPT_LINESTRIP     = 3,
+    D3DPT_TRIANGLELIST  = 4,
+    D3DPT_TRIANGLESTRIP = 5,
+    D3DPT_TRIANGLEFAN   = 6,
+    D3DPT_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+} D3DPRIMITIVETYPE;
+
+/*
+ * Amount to add to a state to generate the override for that state.
+ */
+#define D3DSTATE_OVERRIDE_BIAS      256
+
+/*
+ * A state which sets the override flag for the specified state type.
+ */
+#define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
+
+typedef enum _D3DTRANSFORMSTATETYPE {
+    D3DTRANSFORMSTATE_WORLD           = 1,
+    D3DTRANSFORMSTATE_VIEW            = 2,
+    D3DTRANSFORMSTATE_PROJECTION      = 3,
+    D3DTRANSFORMSTATE_FORCE_DWORD     = 0x7fffffff, /* force 32-bit size enum */
+} D3DTRANSFORMSTATETYPE;
+
+typedef enum _D3DLIGHTSTATETYPE {
+    D3DLIGHTSTATE_MATERIAL          = 1,
+    D3DLIGHTSTATE_AMBIENT           = 2,
+    D3DLIGHTSTATE_COLORMODEL        = 3,
+    D3DLIGHTSTATE_FOGMODE           = 4,
+    D3DLIGHTSTATE_FOGSTART          = 5,
+    D3DLIGHTSTATE_FOGEND            = 6,
+    D3DLIGHTSTATE_FOGDENSITY        = 7,
+    D3DLIGHTSTATE_COLORVERTEX       = 8,
+    D3DLIGHTSTATE_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+} D3DLIGHTSTATETYPE;
+
+typedef enum _D3DRENDERSTATETYPE {
+    D3DRENDERSTATE_TEXTUREHANDLE      = 1,    /* Texture handle for legacy interfaces (Texture,Texture2) */
+    D3DRENDERSTATE_ANTIALIAS          = 2,    /* D3DANTIALIASMODE */
+    D3DRENDERSTATE_TEXTUREADDRESS     = 3,    /* D3DTEXTUREADDRESS  */
+    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,    /* TRUE for perspective correction */
+    D3DRENDERSTATE_WRAPU          = 5,    /* TRUE for wrapping in u */
+    D3DRENDERSTATE_WRAPV          = 6,    /* TRUE for wrapping in v */
+    D3DRENDERSTATE_ZENABLE            = 7,    /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
+    D3DRENDERSTATE_FILLMODE           = 8,    /* D3DFILL_MODE        */
+    D3DRENDERSTATE_SHADEMODE          = 9,    /* D3DSHADEMODE */
+    D3DRENDERSTATE_LINEPATTERN        = 10,   /* D3DLINEPATTERN */
+    D3DRENDERSTATE_MONOENABLE         = 11,   /* TRUE to enable mono rasterization */
+    D3DRENDERSTATE_ROP2               = 12,   /* ROP2 */
+    D3DRENDERSTATE_PLANEMASK          = 13,   /* DWORD physical plane mask */
+    D3DRENDERSTATE_ZWRITEENABLE       = 14,   /* TRUE to enable z writes */
+    D3DRENDERSTATE_ALPHATESTENABLE    = 15,   /* TRUE to enable alpha tests */
+    D3DRENDERSTATE_LASTPIXEL          = 16,   /* TRUE for last-pixel on lines */
+    D3DRENDERSTATE_TEXTUREMAG         = 17,   /* D3DTEXTUREFILTER */
+    D3DRENDERSTATE_TEXTUREMIN         = 18,   /* D3DTEXTUREFILTER */
+    D3DRENDERSTATE_SRCBLEND           = 19,   /* D3DBLEND */
+    D3DRENDERSTATE_DESTBLEND          = 20,   /* D3DBLEND */
+    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21,   /* D3DTEXTUREBLEND */
+    D3DRENDERSTATE_CULLMODE           = 22,   /* D3DCULL */
+    D3DRENDERSTATE_ZFUNC              = 23,   /* D3DCMPFUNC */
+    D3DRENDERSTATE_ALPHAREF           = 24,   /* D3DFIXED */
+    D3DRENDERSTATE_ALPHAFUNC          = 25,   /* D3DCMPFUNC */
+    D3DRENDERSTATE_DITHERENABLE       = 26,   /* TRUE to enable dithering */
+    D3DRENDERSTATE_ALPHABLENDENABLE        = 27,   /* TRUE to enable alpha blending */
+    D3DRENDERSTATE_FOGENABLE          = 28,   /* TRUE to enable fog */
+    D3DRENDERSTATE_SPECULARENABLE     = 29,   /* TRUE to enable specular */
+    D3DRENDERSTATE_ZVISIBLE           = 30,   /* TRUE to enable z checking */
+    D3DRENDERSTATE_SUBPIXEL       = 31,   /* TRUE to enable subpixel correction */
+    D3DRENDERSTATE_SUBPIXELX          = 32,   /* TRUE to enable correction in X only */
+    D3DRENDERSTATE_STIPPLEDALPHA      = 33,   /* TRUE to enable stippled alpha */
+    D3DRENDERSTATE_FOGCOLOR           = 34,   /* D3DCOLOR */
+    D3DRENDERSTATE_FOGTABLEMODE       = 35,   /* D3DFOGMODE */
+    D3DRENDERSTATE_FOGTABLESTART      = 36,   /* Fog table start    */
+    D3DRENDERSTATE_FOGTABLEEND        = 37,   /* Fog table end      */
+    D3DRENDERSTATE_FOGTABLEDENSITY    = 38,   /* Fog table density  */
+    D3DRENDERSTATE_STIPPLEENABLE      = 39,   /* TRUE to enable stippling */
+    D3DRENDERSTATE_EDGEANTIALIAS      = 40,   /* TRUE to enable edge antialiasing */
+    D3DRENDERSTATE_COLORKEYENABLE     = 41,   /* TRUE to enable source colorkeyed textures */
+    D3DRENDERSTATE_BORDERCOLOR        = 43,   /* Border color for texturing w/border */
+    D3DRENDERSTATE_TEXTUREADDRESSU    = 44,   /* Texture addressing mode for U coordinate */
+    D3DRENDERSTATE_TEXTUREADDRESSV    = 45,   /* Texture addressing mode for V coordinate */
+    D3DRENDERSTATE_MIPMAPLODBIAS      = 46,   /* D3DVALUE Mipmap LOD bias */
+    D3DRENDERSTATE_ZBIAS              = 47,   /* LONG Z bias */
+    D3DRENDERSTATE_RANGEFOGENABLE     = 48,   /* Enables range-based fog */
+    D3DRENDERSTATE_ANISOTROPY         = 49,   /* Max. anisotropy. 1 = no anisotropy */
+    D3DRENDERSTATE_FLUSHBATCH         = 50,   /* Explicit flush for DP batching (DX5 Only) */
+    D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */
+    D3DRENDERSTATE_STENCILENABLE      = 52,   /* BOOL enable/disable stenciling */
+    D3DRENDERSTATE_STENCILFAIL        = 53,   /* D3DSTENCILOP to do if stencil test fails */
+    D3DRENDERSTATE_STENCILZFAIL       = 54,   /* D3DSTENCILOP to do if stencil test passes and Z test fails */
+    D3DRENDERSTATE_STENCILPASS        = 55,   /* D3DSTENCILOP to do if both stencil and Z tests pass */
+    D3DRENDERSTATE_STENCILFUNC        = 56,   /* D3DCMPFUNC fn.  Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
+    D3DRENDERSTATE_STENCILREF         = 57,   /* Reference value used in stencil test */
+    D3DRENDERSTATE_STENCILMASK        = 58,   /* Mask value used in stencil test */
+    D3DRENDERSTATE_STENCILWRITEMASK   = 59,   /* Write mask applied to values written to stencil buffer */
+    D3DRENDERSTATE_TEXTUREFACTOR      = 60,   /* D3DCOLOR used for multi-texture blend */
+    D3DRENDERSTATE_STIPPLEPATTERN00   = 64,   /* Stipple pattern 01...  */
+    D3DRENDERSTATE_STIPPLEPATTERN01   = 65,
+    D3DRENDERSTATE_STIPPLEPATTERN02   = 66,
+    D3DRENDERSTATE_STIPPLEPATTERN03   = 67,
+    D3DRENDERSTATE_STIPPLEPATTERN04   = 68,
+    D3DRENDERSTATE_STIPPLEPATTERN05   = 69,
+    D3DRENDERSTATE_STIPPLEPATTERN06   = 70,
+    D3DRENDERSTATE_STIPPLEPATTERN07   = 71,
+    D3DRENDERSTATE_STIPPLEPATTERN08   = 72,
+    D3DRENDERSTATE_STIPPLEPATTERN09   = 73,
+    D3DRENDERSTATE_STIPPLEPATTERN10   = 74,
+    D3DRENDERSTATE_STIPPLEPATTERN11   = 75,
+    D3DRENDERSTATE_STIPPLEPATTERN12   = 76,
+    D3DRENDERSTATE_STIPPLEPATTERN13   = 77,
+    D3DRENDERSTATE_STIPPLEPATTERN14   = 78,
+    D3DRENDERSTATE_STIPPLEPATTERN15   = 79,
+    D3DRENDERSTATE_STIPPLEPATTERN16   = 80,
+    D3DRENDERSTATE_STIPPLEPATTERN17   = 81,
+    D3DRENDERSTATE_STIPPLEPATTERN18   = 82,
+    D3DRENDERSTATE_STIPPLEPATTERN19   = 83,
+    D3DRENDERSTATE_STIPPLEPATTERN20   = 84,
+    D3DRENDERSTATE_STIPPLEPATTERN21   = 85,
+    D3DRENDERSTATE_STIPPLEPATTERN22   = 86,
+    D3DRENDERSTATE_STIPPLEPATTERN23   = 87,
+    D3DRENDERSTATE_STIPPLEPATTERN24   = 88,
+    D3DRENDERSTATE_STIPPLEPATTERN25   = 89,
+    D3DRENDERSTATE_STIPPLEPATTERN26   = 90,
+    D3DRENDERSTATE_STIPPLEPATTERN27   = 91,
+    D3DRENDERSTATE_STIPPLEPATTERN28   = 92,
+    D3DRENDERSTATE_STIPPLEPATTERN29   = 93,
+    D3DRENDERSTATE_STIPPLEPATTERN30   = 94,
+    D3DRENDERSTATE_STIPPLEPATTERN31   = 95,
+
+    /*
+     * 128 values [128, 255] are reserved for texture coordinate wrap flags.
+     * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
+     * a flags word preserves forward compatibility with texture coordinates
+     * that are >2D.
+     */
+    D3DRENDERSTATE_WRAP0              = 128,  /* wrap for 1st texture coord. set */
+    D3DRENDERSTATE_WRAP1              = 129,  /* wrap for 2nd texture coord. set */
+    D3DRENDERSTATE_WRAP2              = 130,  /* wrap for 3rd texture coord. set */
+    D3DRENDERSTATE_WRAP3              = 131,  /* wrap for 4th texture coord. set */
+    D3DRENDERSTATE_WRAP4              = 132,  /* wrap for 5th texture coord. set */
+    D3DRENDERSTATE_WRAP5              = 133,  /* wrap for 6th texture coord. set */
+    D3DRENDERSTATE_WRAP6              = 134,  /* wrap for 7th texture coord. set */
+    D3DRENDERSTATE_WRAP7              = 135,  /* wrap for 8th texture coord. set */
+    D3DRENDERSTATE_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+} D3DRENDERSTATETYPE;
+
+// For back-compatibility with legacy compilations
+#define D3DRENDERSTATE_BLENDENABLE      D3DRENDERSTATE_ALPHABLENDENABLE
+
+
+// Bias to apply to the texture coordinate set to apply a wrap to.
+#define D3DRENDERSTATE_WRAPBIAS                 128UL
+
+/* Flags to construct the WRAP render states */
+#define D3DWRAP_U   0x00000001L
+#define D3DWRAP_V   0x00000002L
+
+
+#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
+
+typedef struct _D3DSTATE {
+    union {
+    D3DTRANSFORMSTATETYPE   dtstTransformStateType;
+    D3DLIGHTSTATETYPE   dlstLightStateType;
+    D3DRENDERSTATETYPE  drstRenderStateType;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    DWORD           dwArg[1];
+    D3DVALUE        dvArg[1];
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+} D3DSTATE, *LPD3DSTATE;
+
+/*
+ * Operation used to load matrices
+ * hDstMat = hSrcMat
+ */
+typedef struct _D3DMATRIXLOAD {
+    D3DMATRIXHANDLE hDestMatrix;   /* Destination matrix */
+    D3DMATRIXHANDLE hSrcMatrix;   /* Source matrix */
+} D3DMATRIXLOAD, *LPD3DMATRIXLOAD;
+
+/*
+ * Operation used to multiply matrices
+ * hDstMat = hSrcMat1 * hSrcMat2
+ */
+typedef struct _D3DMATRIXMULTIPLY {
+    D3DMATRIXHANDLE hDestMatrix;   /* Destination matrix */
+    D3DMATRIXHANDLE hSrcMatrix1;  /* First source matrix */
+    D3DMATRIXHANDLE hSrcMatrix2;  /* Second source matrix */
+} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY;
+
+/*
+ * Operation used to transform and light vertices.
+ */
+typedef struct _D3DPROCESSVERTICES {
+    DWORD        dwFlags;    /* Do we transform or light or just copy? */
+    WORD         wStart;     /* Index to first vertex in source */
+    WORD         wDest;      /* Index to first vertex in local buffer */
+    DWORD        dwCount;    /* Number of vertices to be processed */
+    DWORD    dwReserved; /* Must be zero */
+} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES;
+
+#define D3DPROCESSVERTICES_TRANSFORMLIGHT   0x00000000L
+#define D3DPROCESSVERTICES_TRANSFORM        0x00000001L
+#define D3DPROCESSVERTICES_COPY         0x00000002L
+#define D3DPROCESSVERTICES_OPMASK       0x00000007L
+
+#define D3DPROCESSVERTICES_UPDATEEXTENTS    0x00000008L
+#define D3DPROCESSVERTICES_NOCOLOR      0x00000010L
+
+
+
+
+/*
+ * State enumerants for per-stage texture processing.
+ */
+typedef enum _D3DTEXTURESTAGESTATETYPE
+{
+    D3DTSS_COLOROP        =  1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
+    D3DTSS_COLORARG1      =  2, /* D3DTA_* (texture arg) */
+    D3DTSS_COLORARG2      =  3, /* D3DTA_* (texture arg) */
+    D3DTSS_ALPHAOP        =  4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
+    D3DTSS_ALPHAARG1      =  5, /* D3DTA_* (texture arg) */
+    D3DTSS_ALPHAARG2      =  6, /* D3DTA_* (texture arg) */
+    D3DTSS_BUMPENVMAT00   =  7, /* D3DVALUE (bump mapping matrix) */
+    D3DTSS_BUMPENVMAT01   =  8, /* D3DVALUE (bump mapping matrix) */
+    D3DTSS_BUMPENVMAT10   =  9, /* D3DVALUE (bump mapping matrix) */
+    D3DTSS_BUMPENVMAT11   = 10, /* D3DVALUE (bump mapping matrix) */
+    D3DTSS_TEXCOORDINDEX  = 11, /* identifies which set of texture coordinates index this texture */
+    D3DTSS_ADDRESS        = 12, /* D3DTEXTUREADDRESS for both coordinates */
+    D3DTSS_ADDRESSU       = 13, /* D3DTEXTUREADDRESS for U coordinate */
+    D3DTSS_ADDRESSV       = 14, /* D3DTEXTUREADDRESS for V coordinate */
+    D3DTSS_BORDERCOLOR    = 15, /* D3DCOLOR */
+    D3DTSS_MAGFILTER      = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */
+    D3DTSS_MINFILTER      = 17, /* D3DTEXTUREMINFILTER filter to use for minification */
+    D3DTSS_MIPFILTER      = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */
+    D3DTSS_MIPMAPLODBIAS  = 19, /* D3DVALUE Mipmap LOD bias */
+    D3DTSS_MAXMIPLEVEL    = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
+    D3DTSS_MAXANISOTROPY  = 21, /* DWORD maximum anisotropy */
+    D3DTSS_BUMPENVLSCALE  = 22, /* D3DVALUE scale for bump map luminance */
+    D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */
+    D3DTSS_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+} D3DTEXTURESTAGESTATETYPE;
+
+/*
+ * Enumerations for COLOROP and ALPHAOP texture blending operations set in
+ * texture processing stage controls in D3DRENDERSTATE.
+ */
+typedef enum _D3DTEXTUREOP
+{
+// Control
+    D3DTOP_DISABLE    = 1,      // disables stage
+    D3DTOP_SELECTARG1 = 2,      // the default
+    D3DTOP_SELECTARG2 = 3,
+
+// Modulate
+    D3DTOP_MODULATE   = 4,      // multiply args together
+    D3DTOP_MODULATE2X = 5,      // multiply and  1 bit
+    D3DTOP_MODULATE4X = 6,      // multiply and  2 bits
+
+// Add
+    D3DTOP_ADD          =  7,   // add arguments together
+    D3DTOP_ADDSIGNED    =  8,   // add with -0.5 bias
+    D3DTOP_ADDSIGNED2X  =  9,   // as above but left  1 bit
+    D3DTOP_SUBTRACT     = 10,   // Arg1 - Arg2, with no saturation
+    D3DTOP_ADDSMOOTH    = 11,   // add 2 args, subtract product
+                                // Arg1 + Arg2 - Arg1*Arg2
+                                // = Arg1 + (1-Arg1)*Arg2
+
+// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
+    D3DTOP_BLENDDIFFUSEALPHA    = 12, // iterated alpha
+    D3DTOP_BLENDTEXTUREALPHA    = 13, // texture alpha
+    D3DTOP_BLENDFACTORALPHA     = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR
+    // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
+    D3DTOP_BLENDTEXTUREALPHAPM  = 15, // texture alpha
+    D3DTOP_BLENDCURRENTALPHA    = 16, // by alpha of current color
+
+// Specular mapping
+    D3DTOP_PREMODULATE            = 17,     // modulate with next texture before use
+    D3DTOP_MODULATEALPHA_ADDCOLOR = 18,     // Arg1.RGB + Arg1.A*Arg2.RGB
+                                            // COLOROP only
+    D3DTOP_MODULATECOLOR_ADDALPHA = 19,     // Arg1.RGB*Arg2.RGB + Arg1.A
+                                            // COLOROP only
+    D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,  // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
+                                            // COLOROP only
+    D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,  // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
+                                            // COLOROP only
+
+// Bump mapping
+    D3DTOP_BUMPENVMAP           = 22, // per pixel env map perturbation
+    D3DTOP_BUMPENVMAPLUMINANCE  = 23, // with luminance channel
+    // This can do either diffuse or specular bump mapping with correct input.
+    // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
+    // where each component has been scaled and offset to make it signed.
+    // The result is replicated into all four (including alpha) channels.
+    // This is a valid COLOROP only.
+    D3DTOP_DOTPRODUCT3          = 24,
+
+    D3DTOP_FORCE_DWORD = 0x7fffffff,
+} D3DTEXTUREOP;
+
+/*
+ * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
+ * set in texture processing stage controls in D3DRENDERSTATE.
+ */
+#define D3DTA_SELECTMASK        0x0000000f  // mask for arg selector
+#define D3DTA_DIFFUSE           0x00000000  // select diffuse color
+#define D3DTA_CURRENT           0x00000001  // select result of previous stage
+#define D3DTA_TEXTURE           0x00000002  // select texture color
+#define D3DTA_TFACTOR           0x00000003  // select RENDERSTATE_TEXTUREFACTOR
+
+#define D3DTA_COMPLEMENT        0x00000010  // take 1.0 - x
+#define D3DTA_ALPHAREPLICATE    0x00000020  // replicate alpha to color components
+
+/*
+ *  IDirect3DTexture2 State Filter Types
+ */
+typedef enum _D3DTEXTUREMAGFILTER
+{
+    D3DTFG_POINT        = 1,    // nearest
+    D3DTFG_LINEAR       = 2,    // linear interpolation
+    D3DTFG_FLATCUBIC    = 3,    // cubic
+    D3DTFG_GAUSSIANCUBIC = 4,   // different cubic kernel
+    D3DTFG_ANISOTROPIC  = 5,    //
+    D3DTFG_FORCE_DWORD  = 0x7fffffff,   // force 32-bit size enum
+} D3DTEXTUREMAGFILTER;
+
+typedef enum _D3DTEXTUREMINFILTER
+{
+    D3DTFN_POINT        = 1,    // nearest
+    D3DTFN_LINEAR       = 2,    // linear interpolation
+    D3DTFN_ANISOTROPIC  = 3,    //
+    D3DTFN_FORCE_DWORD  = 0x7fffffff,   // force 32-bit size enum
+} D3DTEXTUREMINFILTER;
+
+typedef enum _D3DTEXTUREMIPFILTER
+{
+    D3DTFP_NONE         = 1,    // mipmapping disabled (use MAG filter)
+    D3DTFP_POINT        = 2,    // nearest
+    D3DTFP_LINEAR       = 3,    // linear interpolation
+    D3DTFP_FORCE_DWORD  = 0x7fffffff,   // force 32-bit size enum
+} D3DTEXTUREMIPFILTER;
+
+
+/*
+ * Triangle flags
+ */
+
+/*
+ * Tri strip and fan flags.
+ * START loads all three vertices
+ * EVEN and ODD load just v3 with even or odd culling
+ * START_FLAT contains a count from 0 to 29 that allows the
+ * whole strip or fan to be culled in one hit.
+ * e.g. for a quad len = 1
+ */
+#define D3DTRIFLAG_START            0x00000000L
+#define D3DTRIFLAG_STARTFLAT(len) (len)     /* 0 < len < 30 */
+#define D3DTRIFLAG_ODD              0x0000001eL
+#define D3DTRIFLAG_EVEN             0x0000001fL
+
+/*
+ * Triangle edge flags
+ * enable edges for wireframe or antialiasing
+ */
+#define D3DTRIFLAG_EDGEENABLE1          0x00000100L /* v0-v1 edge */
+#define D3DTRIFLAG_EDGEENABLE2          0x00000200L /* v1-v2 edge */
+#define D3DTRIFLAG_EDGEENABLE3          0x00000400L /* v2-v0 edge */
+#define D3DTRIFLAG_EDGEENABLETRIANGLE \
+        (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
+
+/*
+ * Primitive structures and related defines.  Vertex offsets are to types
+ * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX.
+ */
+
+/*
+ * Triangle list primitive structure
+ */
+typedef struct _D3DTRIANGLE {
+    union {
+    WORD    v1;            /* Vertex indices */
+    WORD    wV1;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    WORD    v2;
+    WORD    wV2;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+    union {
+    WORD    v3;
+    WORD    wV3;
+#if defined(NONAMELESSUNION)
+    } u3;
+#else
+    };
+#endif
+    WORD        wFlags;       /* Edge (and other) flags */
+} D3DTRIANGLE, *LPD3DTRIANGLE;
+
+/*
+ * Line list structure.
+ * The instruction count defines the number of line segments.
+ */
+typedef struct _D3DLINE {
+    union {
+    WORD    v1;            /* Vertex indices */
+    WORD    wV1;
+#if defined(NONAMELESSUNION)
+    } u1;
+#else
+    };
+#endif
+    union {
+    WORD    v2;
+    WORD    wV2;
+#if defined(NONAMELESSUNION)
+    } u2;
+#else
+    };
+#endif
+} D3DLINE, *LPD3DLINE;
+
+/*
+ * Span structure
+ * Spans join a list of points with the same y value.
+ * If the y value changes, a new span is started.
+ */
+typedef struct _D3DSPAN {
+    WORD    wCount; /* Number of spans */
+    WORD    wFirst; /* Index to first vertex */
+} D3DSPAN, *LPD3DSPAN;
+
+/*
+ * Point structure
+ */
+typedef struct _D3DPOINT {
+    WORD    wCount;     /* number of points     */
+    WORD    wFirst;     /* index to first vertex    */
+} D3DPOINT, *LPD3DPOINT;
+
+
+/*
+ * Forward branch structure.
+ * Mask is logically anded with the driver status mask
+ * if the result equals 'value', the branch is taken.
+ */
+typedef struct _D3DBRANCH {
+    DWORD   dwMask;     /* Bitmask against D3D status */
+    DWORD   dwValue;
+    BOOL    bNegate;        /* TRUE to negate comparison */
+    DWORD   dwOffset;   /* How far to branch forward (0 for exit)*/
+} D3DBRANCH, *LPD3DBRANCH;
+
+/*
+ * Status used for set status instruction.
+ * The D3D status is initialised on device creation
+ * and is modified by all execute calls.
+ */
+typedef struct _D3DSTATUS {
+    DWORD       dwFlags;    /* Do we set extents or status */
+    DWORD   dwStatus;   /* D3D status */
+    D3DRECT drExtent;
+} D3DSTATUS, *LPD3DSTATUS;
+
+#define D3DSETSTATUS_STATUS     0x00000001L
+#define D3DSETSTATUS_EXTENTS        0x00000002L
+#define D3DSETSTATUS_ALL    (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
+
+typedef struct _D3DCLIPSTATUS {
+    DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */
+    DWORD dwStatus; /* Clip status */
+    float minx, maxx; /* X extents */
+    float miny, maxy; /* Y extents */
+    float minz, maxz; /* Z extents */
+} D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
+
+#define D3DCLIPSTATUS_STATUS        0x00000001L
+#define D3DCLIPSTATUS_EXTENTS2      0x00000002L
+#define D3DCLIPSTATUS_EXTENTS3      0x00000004L
+
+/*
+ * Statistics structure
+ */
+typedef struct _D3DSTATS {
+    DWORD        dwSize;
+    DWORD        dwTrianglesDrawn;
+    DWORD        dwLinesDrawn;
+    DWORD        dwPointsDrawn;
+    DWORD        dwSpansDrawn;
+    DWORD        dwVerticesProcessed;
+} D3DSTATS, *LPD3DSTATS;
+
+/*
+ * Execute options.
+ * When calling using D3DEXECUTE_UNCLIPPED all the primitives
+ * inside the buffer must be contained within the viewport.
+ */
+#define D3DEXECUTE_CLIPPED       0x00000001l
+#define D3DEXECUTE_UNCLIPPED     0x00000002l
+
+typedef struct _D3DEXECUTEDATA {
+    DWORD       dwSize;
+    DWORD       dwVertexOffset;
+    DWORD       dwVertexCount;
+    DWORD       dwInstructionOffset;
+    DWORD       dwInstructionLength;
+    DWORD       dwHVertexOffset;
+    D3DSTATUS   dsStatus;   /* Status after execute */
+} D3DEXECUTEDATA, *LPD3DEXECUTEDATA;
+
+/*
+ * Palette flags.
+ * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
+ */
+#define D3DPAL_FREE 0x00    /* Renderer may use this entry freely */
+#define D3DPAL_READONLY 0x40    /* Renderer may not set this entry */
+#define D3DPAL_RESERVED 0x80    /* Renderer may not use this entry */
+
+
+
+typedef struct _D3DVERTEXBUFFERDESC {
+    DWORD dwSize;
+    DWORD dwCaps;
+    DWORD dwFVF;
+    DWORD dwNumVertices;
+} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
+
+/* These correspond to DDSCAPS_* flags */
+#define D3DVBCAPS_SYSTEMMEMORY      0x00000800l
+#define D3DVBCAPS_WRITEONLY         0x00010000l
+#define D3DVBCAPS_OPTIMIZED         0x80000000l
+
+/* Vertex Operations for ProcessVertices */
+#define D3DVOP_LIGHT       (1 << 10)
+#define D3DVOP_TRANSFORM   (1 << 0)
+#define D3DVOP_CLIP        (1 << 2)
+#define D3DVOP_EXTENTS     (1 << 3)
+
+//-------------------------------------------------------------------
+
+// Flexible vertex format bits
+//
+#define D3DFVF_RESERVED0        0x001
+#define D3DFVF_POSITION_MASK    0x00E
+#define D3DFVF_XYZ              0x002
+#define D3DFVF_XYZRHW           0x004
+#define D3DFVF_NORMAL           0x010
+#define D3DFVF_RESERVED1        0x020
+#define D3DFVF_DIFFUSE          0x040
+#define D3DFVF_SPECULAR         0x080
+
+#define D3DFVF_TEXCOUNT_MASK    0xf00
+#define D3DFVF_TEXCOUNT_SHIFT   8
+#define D3DFVF_TEX0             0x000
+#define D3DFVF_TEX1             0x100
+#define D3DFVF_TEX2             0x200
+#define D3DFVF_TEX3             0x300
+#define D3DFVF_TEX4             0x400
+#define D3DFVF_TEX5             0x500
+#define D3DFVF_TEX6             0x600
+#define D3DFVF_TEX7             0x700
+#define D3DFVF_TEX8             0x800
+
+#define D3DFVF_RESERVED2        0xf000  // 4 reserved bits
+
+#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
+#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
+                         D3DFVF_SPECULAR | D3DFVF_TEX1 )
+#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
+                          D3DFVF_TEX1 )
+
+typedef struct _D3DDP_PTRSTRIDE
+{
+    LPVOID lpvData;
+    DWORD  dwStride;
+} D3DDP_PTRSTRIDE;
+
+#define D3DDP_MAXTEXCOORD 8
+
+typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
+{
+    D3DDP_PTRSTRIDE position;
+    D3DDP_PTRSTRIDE normal;
+    D3DDP_PTRSTRIDE diffuse;
+    D3DDP_PTRSTRIDE specular;
+    D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
+} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA;
+//---------------------------------------------------------------------
+// ComputeSphereVisibility return values
+//
+#define D3DVIS_INSIDE_FRUSTUM       0
+#define D3DVIS_INTERSECT_FRUSTUM    1
+#define D3DVIS_OUTSIDE_FRUSTUM      2
+#define D3DVIS_INSIDE_LEFT          0
+#define D3DVIS_INTERSECT_LEFT       (1 << 2)
+#define D3DVIS_OUTSIDE_LEFT         (2 << 2)
+#define D3DVIS_INSIDE_RIGHT         0
+#define D3DVIS_INTERSECT_RIGHT      (1 << 4)
+#define D3DVIS_OUTSIDE_RIGHT        (2 << 4)
+#define D3DVIS_INSIDE_TOP           0
+#define D3DVIS_INTERSECT_TOP        (1 << 6)
+#define D3DVIS_OUTSIDE_TOP          (2 << 6)
+#define D3DVIS_INSIDE_BOTTOM        0
+#define D3DVIS_INTERSECT_BOTTOM     (1 << 8)
+#define D3DVIS_OUTSIDE_BOTTOM       (2 << 8)
+#define D3DVIS_INSIDE_NEAR          0
+#define D3DVIS_INTERSECT_NEAR       (1 << 10)
+#define D3DVIS_OUTSIDE_NEAR         (2 << 10)
+#define D3DVIS_INSIDE_FAR           0
+#define D3DVIS_INTERSECT_FAR        (1 << 12)
+#define D3DVIS_OUTSIDE_FAR          (2 << 12)
+
+#define D3DVIS_MASK_FRUSTUM         (3 << 0)
+#define D3DVIS_MASK_LEFT            (3 << 2)
+#define D3DVIS_MASK_RIGHT           (3 << 4)
+#define D3DVIS_MASK_TOP             (3 << 6)
+#define D3DVIS_MASK_BOTTOM          (3 << 8)
+#define D3DVIS_MASK_NEAR            (3 << 10)
+#define D3DVIS_MASK_FAR             (3 << 12)
+
+
+#pragma pack()
+#endif /* _D3DTYPES_H_ */
+
diff --git a/misc/builddeps/dp.win32/include/ddraw.h b/misc/builddeps/dp.win32/include/ddraw.h
new file mode 100644 (file)
index 0000000..feaec69
--- /dev/null
@@ -0,0 +1,4844 @@
+/*==========================================================================;
+ *
+ *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
+ *
+ *  File:      ddraw.h
+ *  Content:   DirectDraw include file
+ *
+ ***************************************************************************/
+
+#ifndef __DDRAW_INCLUDED__
+#define __DDRAW_INCLUDED__
+
+/*
+ * If you wish an application built against the newest version of DirectDraw
+ * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION
+ * to be the earlies version of DirectDraw you wish to run against. For,
+ * example if you wish an application to run against a DX 3 runtime define
+ * DIRECTDRAW_VERSION to be 0x0300.
+ */
+#ifndef   DIRECTDRAW_VERSION
+#define   DIRECTDRAW_VERSION 0x0600
+#endif /* DIRECTDRAW_VERSION */
+
+#if defined( _WIN32 )  && !defined( _NO_COM )
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#else
+#define IUnknown           void
+#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT)
+       #define CO_E_NOTINITIALIZED 0x800401F0L
+#endif
+#endif
+
+#define _FACDD 0x876
+#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// For compilers that don't support nameless unions, do a
+//
+// #define NONAMELESSUNION
+//
+// before #include <ddraw.h>
+//
+#ifndef DUMMYUNIONNAMEN
+#if defined(__cplusplus) || !defined(NONAMELESSUNION)
+#define DUMMYUNIONNAMEN(n)
+#else
+#define DUMMYUNIONNAMEN(n)      u##n
+#endif
+#endif
+
+#ifndef MAKEFOURCC
+    #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
+                ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   \
+                ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
+#endif //defined(MAKEFOURCC)
+
+/*
+ * FOURCC codes for DX compressed-texture pixel formats
+ */
+#define FOURCC_DXT1  (MAKEFOURCC('D','X','T','1'))
+#define FOURCC_DXT2  (MAKEFOURCC('D','X','T','2'))
+#define FOURCC_DXT3  (MAKEFOURCC('D','X','T','3'))
+#define FOURCC_DXT4  (MAKEFOURCC('D','X','T','4'))
+#define FOURCC_DXT5  (MAKEFOURCC('D','X','T','5'))
+
+/*
+ * GUIDS used by DirectDraw objects
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+
+DEFINE_GUID( CLSID_DirectDraw,                 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
+DEFINE_GUID( CLSID_DirectDrawClipper,           0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
+DEFINE_GUID( IID_IDirectDraw,                  0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDraw2,                  0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+DEFINE_GUID( IID_IDirectDraw4,                  0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
+DEFINE_GUID( IID_IDirectDrawSurface,           0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawSurface2,          0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
+DEFINE_GUID( IID_IDirectDrawSurface3,           0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
+DEFINE_GUID( IID_IDirectDrawSurface4,           0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
+
+DEFINE_GUID( IID_IDirectDrawPalette,           0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawClipper,           0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawColorControl,      0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
+DEFINE_GUID( IID_IDirectDrawGammaControl,       0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
+
+#endif
+
+/*============================================================================
+ *
+ * DirectDraw Structures
+ *
+ * Various structures used to invoke DirectDraw.
+ *
+ *==========================================================================*/
+
+struct IDirectDraw;
+struct IDirectDrawSurface;
+struct IDirectDrawPalette;
+struct IDirectDrawClipper;
+
+typedef struct IDirectDraw              FAR *LPDIRECTDRAW;
+typedef struct IDirectDraw2             FAR *LPDIRECTDRAW2;
+typedef struct IDirectDraw4             FAR *LPDIRECTDRAW4;
+typedef struct IDirectDrawSurface       FAR *LPDIRECTDRAWSURFACE;
+typedef struct IDirectDrawSurface2      FAR *LPDIRECTDRAWSURFACE2;
+typedef struct IDirectDrawSurface3      FAR *LPDIRECTDRAWSURFACE3;
+typedef struct IDirectDrawSurface4      FAR *LPDIRECTDRAWSURFACE4;
+
+typedef struct IDirectDrawPalette              FAR *LPDIRECTDRAWPALETTE;
+typedef struct IDirectDrawClipper              FAR *LPDIRECTDRAWCLIPPER;
+typedef struct IDirectDrawColorControl         FAR *LPDIRECTDRAWCOLORCONTROL;
+typedef struct IDirectDrawGammaControl          FAR *LPDIRECTDRAWGAMMACONTROL;
+
+typedef struct _DDFXROP                        FAR *LPDDFXROP;
+typedef struct _DDSURFACEDESC          FAR *LPDDSURFACEDESC;
+typedef struct _DDSURFACEDESC2         FAR *LPDDSURFACEDESC2;
+typedef struct _DDCOLORCONTROL                 FAR *LPDDCOLORCONTROL;
+
+/*
+ * API's
+ */
+#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM )
+//#if defined( _WIN32 ) && !defined( _NO_ENUM )
+    typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
+    typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID);
+    extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext );
+    extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext );
+    /*
+     * Protect against old SDKs
+     */
+    #ifndef SM_CMONITORS
+        #define HMONITOR    HANDLE
+    #endif
+    typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR);
+    typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
+    extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
+    extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
+    typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
+    typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
+
+    #ifdef UNICODE
+       typedef LPDDENUMCALLBACKW           LPDDENUMCALLBACK;
+       #define DirectDrawEnumerate         DirectDrawEnumerateW
+       typedef LPDDENUMCALLBACKEXW         LPDDENUMCALLBACKEX;
+       typedef LPDIRECTDRAWENUMERATEEXW        LPDIRECTDRAWENUMERATEEX;
+       #define DirectDrawEnumerateEx       DirectDrawEnumerateExW
+    #else
+       typedef LPDDENUMCALLBACKA           LPDDENUMCALLBACK;
+       #define DirectDrawEnumerate         DirectDrawEnumerateA
+       typedef LPDDENUMCALLBACKEXA         LPDDENUMCALLBACKEX;
+       typedef LPDIRECTDRAWENUMERATEEXA        LPDIRECTDRAWENUMERATEEX;
+        #define DirectDrawEnumerateEx      DirectDrawEnumerateExA
+    #endif
+    extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
+    extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter );
+#endif
+/*
+ * Flags for DirectDrawEnumerateEx
+ * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
+ * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
+ * By default, only the primary display device is enumerated.
+ * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
+ */
+
+/*
+ * This flag causes enumeration of any GDI display devices which are part of
+ * the Windows Desktop
+ */
+#define DDENUM_ATTACHEDSECONDARYDEVICES     0x00000001L
+
+/*
+ * This flag causes enumeration of any GDI display devices which are not
+ * part of the Windows Desktop
+ */
+#define DDENUM_DETACHEDSECONDARYDEVICES     0x00000002L
+
+/*
+ * This flag causes enumeration of non-display devices
+ */
+#define DDENUM_NONDISPLAYDEVICES            0x00000004L
+
+
+#define REGSTR_KEY_DDHW_DESCRIPTION    "Description"
+#define REGSTR_KEY_DDHW_DRIVERNAME     "DriverName"
+#define REGSTR_PATH_DDHW               "Hardware\\DirectDrawDrivers"
+
+#define DDCREATE_HARDWAREONLY          0x00000001l
+#define DDCREATE_EMULATIONONLY         0x00000002l
+
+#if defined(WINNT) || !defined(WIN32)
+typedef long HRESULT;
+#endif
+
+//#ifndef WINNT
+typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
+typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
+typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
+typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
+//#endif
+
+/*
+ * Generic pixel format with 8-bit RGB and alpha components
+ */
+typedef struct _DDRGBA
+{
+    BYTE red;
+    BYTE green;
+    BYTE blue;
+    BYTE alpha;
+} DDRGBA;
+
+typedef DDRGBA FAR *LPDDRGBA;
+
+/*
+ * DDCOLORKEY
+ */
+typedef struct _DDCOLORKEY
+{
+    DWORD      dwColorSpaceLowValue;   // low boundary of color space that is to
+                                       // be treated as Color Key, inclusive
+    DWORD      dwColorSpaceHighValue;  // high boundary of color space that is
+                                       // to be treated as Color Key, inclusive
+} DDCOLORKEY;
+
+typedef DDCOLORKEY FAR* LPDDCOLORKEY;
+
+/*
+ * DDBLTFX
+ * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
+ */
+typedef struct _DDBLTFX
+{
+    DWORD      dwSize;                         // size of structure
+    DWORD      dwDDFX;                         // FX operations
+    DWORD      dwROP;                          // Win32 raster operations
+    DWORD      dwDDROP;                        // Raster operations new for DirectDraw
+    DWORD      dwRotationAngle;                // Rotation angle for blt
+    DWORD      dwZBufferOpCode;                // ZBuffer compares
+    DWORD      dwZBufferLow;                   // Low limit of Z buffer
+    DWORD      dwZBufferHigh;                  // High limit of Z buffer
+    DWORD      dwZBufferBaseDest;              // Destination base value
+    DWORD      dwZDestConstBitDepth;           // Bit depth used to specify Z constant for destination
+    union
+    {
+       DWORD   dwZDestConst;                   // Constant to use as Z buffer for dest
+       LPDIRECTDRAWSURFACE lpDDSZBufferDest;   // Surface to use as Z buffer for dest
+    } DUMMYUNIONNAMEN(1);
+    DWORD      dwZSrcConstBitDepth;            // Bit depth used to specify Z constant for source
+    union
+    {
+       DWORD   dwZSrcConst;                    // Constant to use as Z buffer for src
+       LPDIRECTDRAWSURFACE lpDDSZBufferSrc;    // Surface to use as Z buffer for src
+    } DUMMYUNIONNAMEN(2);
+    DWORD      dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
+    DWORD      dwAlphaEdgeBlend;               // Alpha for edge blending
+    DWORD      dwReserved;
+    DWORD      dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
+    union
+    {
+       DWORD   dwAlphaDestConst;               // Constant to use as Alpha Channel
+       LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as Alpha Channel
+    } DUMMYUNIONNAMEN(3);
+    DWORD      dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
+    union
+    {
+       DWORD   dwAlphaSrcConst;                // Constant to use as Alpha Channel
+       LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as Alpha Channel
+    } DUMMYUNIONNAMEN(4);
+    union
+    {
+       DWORD   dwFillColor;                    // color in RGB or Palettized
+       DWORD   dwFillDepth;                    // depth value for z-buffer
+       DWORD   dwFillPixel;                    // pixel value for RGBA or RGBZ
+       LPDIRECTDRAWSURFACE lpDDSPattern;       // Surface to use as pattern
+    } DUMMYUNIONNAMEN(5);
+    DDCOLORKEY ddckDestColorkey;               // DestColorkey override
+    DDCOLORKEY ddckSrcColorkey;                // SrcColorkey override
+} DDBLTFX;
+
+typedef DDBLTFX FAR* LPDDBLTFX;
+
+
+/*
+ * DDSCAPS
+ */
+typedef struct _DDSCAPS
+{
+    DWORD      dwCaps;         // capabilities of surface wanted
+} DDSCAPS;
+
+typedef DDSCAPS FAR* LPDDSCAPS;
+
+
+/*
+ * DDOSCAPS
+ */
+typedef struct _DDOSCAPS
+{
+    DWORD      dwCaps;         // capabilities of surface wanted
+} DDOSCAPS;
+
+typedef DDOSCAPS FAR* LPDDOSCAPS;
+
+/*
+ * This structure is used internally by DirectDraw.
+ */
+typedef struct _DDSCAPSEX
+{
+    DWORD       dwCaps2;
+    DWORD       dwCaps3;
+    DWORD       dwCaps4;
+} DDSCAPSEX, FAR * LPDDSCAPSEX;
+
+/*
+ * DDSCAPS2
+ */
+typedef struct _DDSCAPS2
+{
+    DWORD      dwCaps;         // capabilities of surface wanted
+    DWORD       dwCaps2;
+    DWORD       dwCaps3;
+    DWORD       dwCaps4;
+} DDSCAPS2;
+
+typedef DDSCAPS2 FAR* LPDDSCAPS2;
+
+/*
+ * DDCAPS
+ */
+#define DD_ROP_SPACE           (256/32)        // space required to store ROP array
+
+/*
+ * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X.
+ * It is present for back compatability.
+ */
+typedef struct _DDCAPS_DX3
+{
+    DWORD      dwSize;                 // size of the DDDRIVERCAPS structure
+    DWORD      dwCaps;                 // driver specific capabilities
+    DWORD      dwCaps2;                // more driver specific capabilites
+    DWORD      dwCKeyCaps;             // color key capabilities of the surface
+    DWORD      dwFXCaps;               // driver specific stretching and effects capabilites
+    DWORD      dwFXAlphaCaps;          // alpha driver specific capabilities
+    DWORD      dwPalCaps;              // palette capabilities
+    DWORD      dwSVCaps;               // stereo vision capabilities
+    DWORD      dwAlphaBltConstBitDepths;       // DDBD_2,4,8
+    DWORD      dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
+    DWORD      dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
+    DWORD      dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
+    DWORD      dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
+    DWORD      dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
+    DWORD      dwZBufferBitDepths;             // DDBD_8,16,24,32
+    DWORD      dwVidMemTotal;          // total amount of video memory
+    DWORD      dwVidMemFree;           // amount of free video memory
+    DWORD      dwMaxVisibleOverlays;   // maximum number of visible overlays
+    DWORD      dwCurrVisibleOverlays;  // current number of visible overlays
+    DWORD      dwNumFourCCCodes;       // number of four cc codes
+    DWORD      dwAlignBoundarySrc;     // source rectangle alignment
+    DWORD      dwAlignSizeSrc;         // source rectangle byte size
+    DWORD      dwAlignBoundaryDest;    // dest rectangle alignment
+    DWORD      dwAlignSizeDest;        // dest rectangle byte size
+    DWORD      dwAlignStrideAlign;     // stride alignment
+    DWORD      dwRops[DD_ROP_SPACE];   // ROPS supported
+    DDSCAPS    ddsCaps;                // DDSCAPS structure has all the general capabilities
+    DWORD      dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+    DWORD      dwReserved1;            // reserved
+    DWORD      dwReserved2;            // reserved
+    DWORD      dwReserved3;            // reserved
+    DWORD      dwSVBCaps;              // driver specific capabilities for System->Vmem blts
+    DWORD      dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
+    DWORD      dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
+    DWORD      dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
+    DWORD      dwVSBCaps;              // driver specific capabilities for Vmem->System blts
+    DWORD      dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
+    DWORD      dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
+    DWORD      dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
+    DWORD      dwSSBCaps;              // driver specific capabilities for System->System blts
+    DWORD      dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
+    DWORD      dwSSBFXCaps;            // driver FX capabilities for System->System blts
+    DWORD      dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
+    DWORD      dwReserved4;            // reserved
+    DWORD      dwReserved5;            // reserved
+    DWORD      dwReserved6;            // reserved
+} DDCAPS_DX3;
+typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3;
+
+/*
+ * This structure is the DDCAPS structure as it was in version 5 of Direct X.
+ * It is present for back compatability.
+ */
+typedef struct _DDCAPS_DX5
+{
+/*  0*/ DWORD  dwSize;                 // size of the DDDRIVERCAPS structure
+/*  4*/ DWORD  dwCaps;                 // driver specific capabilities
+/*  8*/ DWORD  dwCaps2;                // more driver specific capabilites
+/*  c*/ DWORD  dwCKeyCaps;             // color key capabilities of the surface
+/* 10*/ DWORD  dwFXCaps;               // driver specific stretching and effects capabilites
+/* 14*/ DWORD  dwFXAlphaCaps;          // alpha driver specific capabilities
+/* 18*/ DWORD  dwPalCaps;              // palette capabilities
+/* 1c*/ DWORD  dwSVCaps;               // stereo vision capabilities
+/* 20*/ DWORD  dwAlphaBltConstBitDepths;       // DDBD_2,4,8
+/* 24*/ DWORD  dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
+/* 28*/ DWORD  dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
+/* 2c*/ DWORD  dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
+/* 30*/ DWORD  dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
+/* 34*/ DWORD  dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
+/* 38*/ DWORD  dwZBufferBitDepths;             // DDBD_8,16,24,32
+/* 3c*/ DWORD  dwVidMemTotal;          // total amount of video memory
+/* 40*/ DWORD  dwVidMemFree;           // amount of free video memory
+/* 44*/ DWORD  dwMaxVisibleOverlays;   // maximum number of visible overlays
+/* 48*/ DWORD  dwCurrVisibleOverlays;  // current number of visible overlays
+/* 4c*/ DWORD  dwNumFourCCCodes;       // number of four cc codes
+/* 50*/ DWORD  dwAlignBoundarySrc;     // source rectangle alignment
+/* 54*/ DWORD  dwAlignSizeSrc;         // source rectangle byte size
+/* 58*/ DWORD  dwAlignBoundaryDest;    // dest rectangle alignment
+/* 5c*/ DWORD  dwAlignSizeDest;        // dest rectangle byte size
+/* 60*/ DWORD  dwAlignStrideAlign;     // stride alignment
+/* 64*/ DWORD  dwRops[DD_ROP_SPACE];   // ROPS supported
+/* 84*/ DDSCAPS        ddsCaps;                // DDSCAPS structure has all the general capabilities
+/* 88*/ DWORD  dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 8c*/ DWORD  dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 90*/ DWORD  dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 94*/ DWORD  dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 98*/ DWORD  dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 9c*/ DWORD  dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* a0*/ DWORD  dwReserved1;            // reserved
+/* a4*/ DWORD  dwReserved2;            // reserved
+/* a8*/ DWORD  dwReserved3;            // reserved
+/* ac*/ DWORD  dwSVBCaps;              // driver specific capabilities for System->Vmem blts
+/* b0*/ DWORD  dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
+/* b4*/ DWORD  dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
+/* b8*/ DWORD  dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
+/* d8*/ DWORD  dwVSBCaps;              // driver specific capabilities for Vmem->System blts
+/* dc*/ DWORD  dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
+/* e0*/ DWORD  dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
+/* e4*/ DWORD  dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
+/*104*/ DWORD  dwSSBCaps;              // driver specific capabilities for System->System blts
+/*108*/ DWORD  dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
+/*10c*/ DWORD  dwSSBFXCaps;            // driver FX capabilities for System->System blts
+/*110*/ DWORD  dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
+// Members added for DX5:
+/*130*/ DWORD  dwMaxVideoPorts;        // maximum number of usable video ports
+/*134*/ DWORD  dwCurrVideoPorts;       // current number of video ports used
+/*138*/ DWORD  dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
+/*13c*/ DWORD  dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
+/*140*/ DWORD  dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
+/*144*/ DWORD  dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
+/*148*/ DWORD  dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
+/*14c*/ DWORD  dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
+} DDCAPS_DX5;
+typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5;
+
+typedef struct _DDCAPS_DX6
+{
+/*  0*/ DWORD  dwSize;                 // size of the DDDRIVERCAPS structure
+/*  4*/ DWORD  dwCaps;                 // driver specific capabilities
+/*  8*/ DWORD  dwCaps2;                // more driver specific capabilites
+/*  c*/ DWORD  dwCKeyCaps;             // color key capabilities of the surface
+/* 10*/ DWORD  dwFXCaps;               // driver specific stretching and effects capabilites
+/* 14*/ DWORD  dwFXAlphaCaps;          // alpha caps
+/* 18*/ DWORD  dwPalCaps;              // palette capabilities
+/* 1c*/ DWORD  dwSVCaps;               // stereo vision capabilities
+/* 20*/ DWORD  dwAlphaBltConstBitDepths;       // DDBD_2,4,8
+/* 24*/ DWORD  dwAlphaBltPixelBitDepths;       // DDBD_1,2,4,8
+/* 28*/ DWORD  dwAlphaBltSurfaceBitDepths;     // DDBD_1,2,4,8
+/* 2c*/ DWORD  dwAlphaOverlayConstBitDepths;   // DDBD_2,4,8
+/* 30*/ DWORD  dwAlphaOverlayPixelBitDepths;   // DDBD_1,2,4,8
+/* 34*/ DWORD  dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
+/* 38*/ DWORD  dwZBufferBitDepths;             // DDBD_8,16,24,32
+/* 3c*/ DWORD  dwVidMemTotal;          // total amount of video memory
+/* 40*/ DWORD  dwVidMemFree;           // amount of free video memory
+/* 44*/ DWORD  dwMaxVisibleOverlays;   // maximum number of visible overlays
+/* 48*/ DWORD  dwCurrVisibleOverlays;  // current number of visible overlays
+/* 4c*/ DWORD  dwNumFourCCCodes;       // number of four cc codes
+/* 50*/ DWORD  dwAlignBoundarySrc;     // source rectangle alignment
+/* 54*/ DWORD  dwAlignSizeSrc;         // source rectangle byte size
+/* 58*/ DWORD  dwAlignBoundaryDest;    // dest rectangle alignment
+/* 5c*/ DWORD  dwAlignSizeDest;        // dest rectangle byte size
+/* 60*/ DWORD  dwAlignStrideAlign;     // stride alignment
+/* 64*/ DWORD  dwRops[DD_ROP_SPACE];   // ROPS supported
+/* 84*/ DDSCAPS        ddsOldCaps;             // Was DDSCAPS  ddsCaps. ddsCaps is of type DDSCAPS2 for DX6
+/* 88*/ DWORD  dwMinOverlayStretch;    // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 8c*/ DWORD  dwMaxOverlayStretch;    // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 90*/ DWORD  dwMinLiveVideoStretch;  // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 94*/ DWORD  dwMaxLiveVideoStretch;  // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 98*/ DWORD  dwMinHwCodecStretch;    // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* 9c*/ DWORD  dwMaxHwCodecStretch;    // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
+/* a0*/ DWORD  dwReserved1;            // reserved
+/* a4*/ DWORD  dwReserved2;            // reserved
+/* a8*/ DWORD  dwReserved3;            // reserved
+/* ac*/ DWORD  dwSVBCaps;              // driver specific capabilities for System->Vmem blts
+/* b0*/ DWORD  dwSVBCKeyCaps;          // driver color key capabilities for System->Vmem blts
+/* b4*/ DWORD  dwSVBFXCaps;            // driver FX capabilities for System->Vmem blts
+/* b8*/ DWORD  dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
+/* d8*/ DWORD  dwVSBCaps;              // driver specific capabilities for Vmem->System blts
+/* dc*/ DWORD  dwVSBCKeyCaps;          // driver color key capabilities for Vmem->System blts
+/* e0*/ DWORD  dwVSBFXCaps;            // driver FX capabilities for Vmem->System blts
+/* e4*/ DWORD  dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
+/*104*/ DWORD  dwSSBCaps;              // driver specific capabilities for System->System blts
+/*108*/ DWORD  dwSSBCKeyCaps;          // driver color key capabilities for System->System blts
+/*10c*/ DWORD  dwSSBFXCaps;            // driver FX capabilities for System->System blts
+/*110*/ DWORD  dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
+/*130*/ DWORD  dwMaxVideoPorts;        // maximum number of usable video ports
+/*134*/ DWORD  dwCurrVideoPorts;       // current number of video ports used
+/*138*/ DWORD  dwSVBCaps2;             // more driver specific capabilities for System->Vmem blts
+/*13c*/ DWORD  dwNLVBCaps;               // driver specific capabilities for non-local->local vidmem blts
+/*140*/ DWORD  dwNLVBCaps2;              // more driver specific capabilities non-local->local vidmem blts
+/*144*/ DWORD  dwNLVBCKeyCaps;           // driver color key capabilities for non-local->local vidmem blts
+/*148*/ DWORD  dwNLVBFXCaps;             // driver FX capabilities for non-local->local blts
+/*14c*/ DWORD  dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
+// Members added for DX6 release
+/*16c*/ DDSCAPS2 ddsCaps;               // Surface Caps
+} DDCAPS_DX6;
+typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6;
+
+
+#if DIRECTDRAW_VERSION <= 0x300
+    typedef DDCAPS_DX3 DDCAPS;
+#elif DIRECTDRAW_VERSION <= 0x500
+    typedef DDCAPS_DX5 DDCAPS;
+#else
+    typedef DDCAPS_DX6 DDCAPS;
+#endif
+
+typedef DDCAPS FAR* LPDDCAPS;
+
+
+
+/*
+ * DDPIXELFORMAT
+ */
+typedef struct _DDPIXELFORMAT
+{
+    DWORD      dwSize;                 // size of structure
+    DWORD      dwFlags;                // pixel format flags
+    DWORD      dwFourCC;               // (FOURCC code)
+    union
+    {
+       DWORD   dwRGBBitCount;          // how many bits per pixel
+       DWORD   dwYUVBitCount;          // how many bits per pixel
+       DWORD   dwZBufferBitDepth;      // how many total bits/pixel in z buffer (including any stencil bits)
+       DWORD   dwAlphaBitDepth;        // how many bits for alpha channels
+       DWORD   dwLuminanceBitCount;    // how many bits per pixel
+        DWORD   dwBumpBitCount;         // how many bits per "buxel", total
+    } DUMMYUNIONNAMEN(1);
+    union
+    {
+       DWORD   dwRBitMask;             // mask for red bit
+       DWORD   dwYBitMask;             // mask for Y bits
+       DWORD   dwStencilBitDepth;      // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
+       DWORD   dwLuminanceBitMask;     // mask for luminance bits
+        DWORD   dwBumpDuBitMask;        // mask for bump map U delta bits
+    } DUMMYUNIONNAMEN(2);
+    union
+    {
+       DWORD   dwGBitMask;             // mask for green bits
+       DWORD   dwUBitMask;             // mask for U bits
+       DWORD   dwZBitMask;             // mask for Z bits
+        DWORD   dwBumpDvBitMask;        // mask for bump map V delta bits
+    } DUMMYUNIONNAMEN(3);
+    union
+    {
+       DWORD   dwBBitMask;             // mask for blue bits
+       DWORD   dwVBitMask;             // mask for V bits
+       DWORD   dwStencilBitMask;       // mask for stencil bits
+        DWORD   dwBumpLuminanceBitMask; // mask for luminance in bump map
+    } DUMMYUNIONNAMEN(4);
+    union
+    {
+       DWORD   dwRGBAlphaBitMask;      // mask for alpha channel
+       DWORD   dwYUVAlphaBitMask;      // mask for alpha channel
+        DWORD   dwLuminanceAlphaBitMask;// mask for alpha channel
+       DWORD   dwRGBZBitMask;          // mask for Z channel
+       DWORD   dwYUVZBitMask;          // mask for Z channel
+    } DUMMYUNIONNAMEN(5);
+} DDPIXELFORMAT;
+
+typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT;
+
+/*
+ * DDOVERLAYFX
+ */
+typedef struct _DDOVERLAYFX
+{
+    DWORD      dwSize;                         // size of structure
+    DWORD      dwAlphaEdgeBlendBitDepth;       // Bit depth used to specify constant for alpha edge blend
+    DWORD      dwAlphaEdgeBlend;               // Constant to use as alpha for edge blend
+    DWORD      dwReserved;
+    DWORD      dwAlphaDestConstBitDepth;       // Bit depth used to specify alpha constant for destination
+    union
+    {
+       DWORD   dwAlphaDestConst;               // Constant to use as alpha channel for dest
+       LPDIRECTDRAWSURFACE lpDDSAlphaDest;     // Surface to use as alpha channel for dest
+    } DUMMYUNIONNAMEN(1);
+    DWORD      dwAlphaSrcConstBitDepth;        // Bit depth used to specify alpha constant for source
+    union
+    {
+       DWORD   dwAlphaSrcConst;                // Constant to use as alpha channel for src
+       LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      // Surface to use as alpha channel for src
+    } DUMMYUNIONNAMEN(2);
+    DDCOLORKEY dckDestColorkey;                // DestColorkey override
+    DDCOLORKEY dckSrcColorkey;                 // DestColorkey override
+    DWORD       dwDDFX;                         // Overlay FX
+    DWORD      dwFlags;                        // flags
+} DDOVERLAYFX;
+
+typedef DDOVERLAYFX FAR *LPDDOVERLAYFX;
+
+
+/*
+ * DDBLTBATCH: BltBatch entry structure
+ */
+typedef struct _DDBLTBATCH
+{
+    LPRECT             lprDest;
+    LPDIRECTDRAWSURFACE        lpDDSSrc;
+    LPRECT             lprSrc;
+    DWORD              dwFlags;
+    LPDDBLTFX          lpDDBltFx;
+} DDBLTBATCH;
+
+typedef DDBLTBATCH FAR * LPDDBLTBATCH;
+
+
+/*
+ * DDGAMMARAMP
+ */
+typedef struct _DDGAMMARAMP
+{
+    WORD                red[256];
+    WORD                green[256];
+    WORD                blue[256];
+} DDGAMMARAMP;
+typedef DDGAMMARAMP FAR * LPDDGAMMARAMP;
+
+/*
+ *  This is the structure within which DirectDraw returns data about the current graphics driver and chipset
+ */
+
+#define MAX_DDDEVICEID_STRING          512
+
+typedef struct tagDDDEVICEIDENTIFIER
+{
+    /*
+     * These elements are for presentation to the user only. They should not be used to identify particular
+     * drivers, since this is unreliable and many different strings may be associated with the same
+     * device, and the same driver from different vendors.
+     */
+    char    szDriver[MAX_DDDEVICEID_STRING];
+    char    szDescription[MAX_DDDEVICEID_STRING];
+
+    /*
+     * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
+     * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
+     * drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
+     *
+     * This version has the form:
+     *  wProduct = HIWORD(liDriverVersion.HighPart)
+     *  wVersion = LOWORD(liDriverVersion.HighPart)
+     *  wSubVersion = HIWORD(liDriverVersion.LowPart)
+     *  wBuild = LOWORD(liDriverVersion.LowPart)
+     */
+#ifdef _WIN32
+    LARGE_INTEGER liDriverVersion;      /* Defined for applications and other 32 bit components */
+#else
+    DWORD   dwDriverVersionLowPart;     /* Defined for 16 bit driver components */
+    DWORD   dwDriverVersionHighPart;
+#endif
+
+
+    /*
+     * These elements can be used to identify particular chipsets. Use with extreme caution. 
+     *   dwVendorId     Identifies the manufacturer. May be zero if unknown.
+     *   dwDeviceId     Identifies the type of chipset. May be zero if unknown.
+     *   dwSubSysId     Identifies the subsystem, typically this means the particular board. May be zero if unknown.
+     *   dwRevision     Identifies the revision level of the chipset. May be zero if unknown.
+     */
+    DWORD   dwVendorId;
+    DWORD   dwDeviceId;
+    DWORD   dwSubSysId;
+    DWORD   dwRevision;
+
+    /*
+     * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
+     * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
+     * reprofile the graphics subsystem.
+     * This element can also be used to identify particular problematic drivers.
+     */
+    GUID    guidDeviceIdentifier;
+} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
+
+/*
+ * Flags for the IDirectDraw4::GetDeviceIdentifier method
+ */
+
+/*
+ * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
+ * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
+ * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
+ * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
+ * of the DirectDraw object involved.
+ */
+#define DDGDI_GETHOSTIDENTIFIER         0x00000001L
+
+
+
+/*
+ * callbacks
+ */
+typedef DWORD  (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext );
+#ifdef STREAMING
+typedef DWORD  (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD);
+#endif
+
+
+/*
+ * INTERACES FOLLOW:
+ *     IDirectDraw
+ *     IDirectDrawClipper
+ *     IDirectDrawPalette
+ *     IDirectDrawSurface
+ */
+
+/*
+ * IDirectDraw
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDraw
+DECLARE_INTERFACE_( IDirectDraw, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDraw methods ***/
+    STDMETHOD(Compact)(THIS) PURE;
+    STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
+    STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
+    STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
+    STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
+    STDMETHOD(FlipToGDISurface)(THIS) PURE;
+    STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
+    STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
+    STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
+    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
+    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
+    STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
+    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
+    STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE;
+    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDraw_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDraw_AddRef(p)                       (p)->lpVtbl->AddRef(p)
+#define IDirectDraw_Release(p)                      (p)->lpVtbl->Release(p)
+#define IDirectDraw_Compact(p)                      (p)->lpVtbl->Compact(p)
+#define IDirectDraw_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
+#define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
+#define IDirectDraw_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
+#define IDirectDraw_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
+#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
+#define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
+#define IDirectDraw_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
+#define IDirectDraw_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
+#define IDirectDraw_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
+#define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
+#define IDirectDraw_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
+#define IDirectDraw_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
+#define IDirectDraw_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
+#define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
+#define IDirectDraw_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
+#define IDirectDraw_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
+#define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
+#define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->lpVtbl->SetDisplayMode(p, a, b, c)
+#define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
+#else
+#define IDirectDraw_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
+#define IDirectDraw_AddRef(p)                       (p)->AddRef()
+#define IDirectDraw_Release(p)                      (p)->Release()
+#define IDirectDraw_Compact(p)                      (p)->Compact()
+#define IDirectDraw_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
+#define IDirectDraw_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
+#define IDirectDraw_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
+#define IDirectDraw_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
+#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
+#define IDirectDraw_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
+#define IDirectDraw_FlipToGDISurface(p)             (p)->FlipToGDISurface()
+#define IDirectDraw_GetCaps(p, a, b)                (p)->GetCaps(a, b)
+#define IDirectDraw_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
+#define IDirectDraw_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
+#define IDirectDraw_GetGDISurface(p, a)             (p)->GetGDISurface(a)
+#define IDirectDraw_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
+#define IDirectDraw_GetScanLine(p, a)               (p)->GetScanLine(a)
+#define IDirectDraw_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
+#define IDirectDraw_Initialize(p, a)                (p)->Initialize(a)
+#define IDirectDraw_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
+#define IDirectDraw_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
+#define IDirectDraw_SetDisplayMode(p, a, b, c)      (p)->SetDisplayMode(a, b, c)
+#define IDirectDraw_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
+#endif
+
+#endif
+
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDraw2
+DECLARE_INTERFACE_( IDirectDraw2, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDraw methods ***/
+    STDMETHOD(Compact)(THIS) PURE;
+    STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
+    STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
+    STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
+    STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
+    STDMETHOD(FlipToGDISurface)(THIS) PURE;
+    STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
+    STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
+    STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
+    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
+    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
+    STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
+    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
+    STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
+    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
+    /*** Added in the v2 interface ***/
+    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
+};
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDraw2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDraw2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
+#define IDirectDraw2_Release(p)                      (p)->lpVtbl->Release(p)
+#define IDirectDraw2_Compact(p)                      (p)->lpVtbl->Compact(p)
+#define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
+#define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
+#define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
+#define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
+#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
+#define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
+#define IDirectDraw2_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
+#define IDirectDraw2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
+#define IDirectDraw2_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
+#define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
+#define IDirectDraw2_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
+#define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
+#define IDirectDraw2_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
+#define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
+#define IDirectDraw2_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
+#define IDirectDraw2_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
+#define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
+#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
+#define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
+#define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
+#else
+#define IDirectDraw2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
+#define IDirectDraw2_AddRef(p)                       (p)->AddRef()
+#define IDirectDraw2_Release(p)                      (p)->Release()
+#define IDirectDraw2_Compact(p)                      (p)->Compact()
+#define IDirectDraw2_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
+#define IDirectDraw2_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
+#define IDirectDraw2_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
+#define IDirectDraw2_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
+#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
+#define IDirectDraw2_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
+#define IDirectDraw2_FlipToGDISurface(p)             (p)->FlipToGDISurface()
+#define IDirectDraw2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
+#define IDirectDraw2_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
+#define IDirectDraw2_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
+#define IDirectDraw2_GetGDISurface(p, a)             (p)->GetGDISurface(a)
+#define IDirectDraw2_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
+#define IDirectDraw2_GetScanLine(p, a)               (p)->GetScanLine(a)
+#define IDirectDraw2_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
+#define IDirectDraw2_Initialize(p, a)                (p)->Initialize(a)
+#define IDirectDraw2_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
+#define IDirectDraw2_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
+#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
+#define IDirectDraw2_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
+#define IDirectDraw2_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
+#endif
+
+#endif
+
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDraw4
+DECLARE_INTERFACE_( IDirectDraw4, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDraw methods ***/
+    STDMETHOD(Compact)(THIS) PURE;
+    STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
+    STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE;
+    STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE;
+    STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE;
+    STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE;
+    STDMETHOD(FlipToGDISurface)(THIS) PURE;
+    STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
+    STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE;
+    STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
+    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE;
+    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
+    STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
+    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
+    STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
+    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
+    /*** Added in the v2 interface ***/
+    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE;
+    /*** Added in the V4 Interface ***/
+    STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE;
+    STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
+    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
+    STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE;
+};
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDraw4_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDraw4_AddRef(p)                       (p)->lpVtbl->AddRef(p)
+#define IDirectDraw4_Release(p)                      (p)->lpVtbl->Release(p)
+#define IDirectDraw4_Compact(p)                      (p)->lpVtbl->Compact(p)
+#define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
+#define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
+#define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
+#define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
+#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
+#define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
+#define IDirectDraw4_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
+#define IDirectDraw4_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
+#define IDirectDraw4_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
+#define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
+#define IDirectDraw4_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
+#define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
+#define IDirectDraw4_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
+#define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
+#define IDirectDraw4_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
+#define IDirectDraw4_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
+#define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
+#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
+#define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
+#define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
+#define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
+#define IDirectDraw4_RestoreAllSurfaces(p)           (p)->lpVtbl->RestoreAllSurfaces(p)
+#define IDirectDraw4_TestCooperativeLevel(p)         (p)->lpVtbl->TestCooperativeLevel(p)
+#define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
+#else
+#define IDirectDraw4_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
+#define IDirectDraw4_AddRef(p)                       (p)->AddRef()
+#define IDirectDraw4_Release(p)                      (p)->Release()
+#define IDirectDraw4_Compact(p)                      (p)->Compact()
+#define IDirectDraw4_CreateClipper(p, a, b, c)       (p)->CreateClipper(a, b, c)
+#define IDirectDraw4_CreatePalette(p, a, b, c, d)    (p)->CreatePalette(a, b, c, d)
+#define IDirectDraw4_CreateSurface(p, a, b, c)       (p)->CreateSurface(a, b, c)
+#define IDirectDraw4_DuplicateSurface(p, a, b)       (p)->DuplicateSurface(a, b)
+#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d)
+#define IDirectDraw4_EnumSurfaces(p, a, b, c, d)     (p)->EnumSurfaces(a, b, c, d)
+#define IDirectDraw4_FlipToGDISurface(p)             (p)->FlipToGDISurface()
+#define IDirectDraw4_GetCaps(p, a, b)                (p)->GetCaps(a, b)
+#define IDirectDraw4_GetDisplayMode(p, a)            (p)->GetDisplayMode(a)
+#define IDirectDraw4_GetFourCCCodes(p, a, b)         (p)->GetFourCCCodes(a, b)
+#define IDirectDraw4_GetGDISurface(p, a)             (p)->GetGDISurface(a)
+#define IDirectDraw4_GetMonitorFrequency(p, a)       (p)->GetMonitorFrequency(a)
+#define IDirectDraw4_GetScanLine(p, a)               (p)->GetScanLine(a)
+#define IDirectDraw4_GetVerticalBlankStatus(p, a)    (p)->GetVerticalBlankStatus(a)
+#define IDirectDraw4_Initialize(p, a)                (p)->Initialize(a)
+#define IDirectDraw4_RestoreDisplayMode(p)           (p)->RestoreDisplayMode()
+#define IDirectDraw4_SetCooperativeLevel(p, a, b)    (p)->SetCooperativeLevel(a, b)
+#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e)
+#define IDirectDraw4_WaitForVerticalBlank(p, a, b)   (p)->WaitForVerticalBlank(a, b)
+#define IDirectDraw4_GetAvailableVidMem(p, a, b, c)  (p)->GetAvailableVidMem(a, b, c)
+#define IDirectDraw4_GetSurfaceFromDC(p, a, b)       (p)->GetSurfaceFromDC(a, b)
+#define IDirectDraw4_RestoreAllSurfaces(p)           (p)->RestoreAllSurfaces()
+#define IDirectDraw4_TestCooperativeLevel(p)         (p)->TestCooperativeLevel()
+#define IDirectDraw4_GetDeviceIdentifier(p,a,b)      (p)->GetDeviceIdentifier(a,b)
+#endif
+
+#endif
+
+
+/*
+ * IDirectDrawPalette
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDrawPalette
+DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawPalette methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE;
+    STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE;
+    STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDrawPalette_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectDrawPalette_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectDrawPalette_GetCaps(p, a)                (p)->lpVtbl->GetCaps(p, a)
+#define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->lpVtbl->GetEntries(p, a, b, c, d)
+#define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->lpVtbl->Initialize(p, a, b, c)
+#define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->lpVtbl->SetEntries(p, a, b, c, d)
+#else
+#define IDirectDrawPalette_QueryInterface(p, a, b)      (p)->QueryInterface(a, b)
+#define IDirectDrawPalette_AddRef(p)                    (p)->AddRef()
+#define IDirectDrawPalette_Release(p)                   (p)->Release()
+#define IDirectDrawPalette_GetCaps(p, a)                (p)->GetCaps(a)
+#define IDirectDrawPalette_GetEntries(p, a, b, c, d)    (p)->GetEntries(a, b, c, d)
+#define IDirectDrawPalette_Initialize(p, a, b, c)       (p)->Initialize(a, b, c)
+#define IDirectDrawPalette_SetEntries(p, a, b, c, d)    (p)->SetEntries(a, b, c, d)
+#endif
+
+#endif
+
+
+
+/*
+ * IDirectDrawClipper
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDrawClipper
+DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawClipper methods ***/
+    STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE;
+    STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE;
+    STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE;
+    STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE;
+    STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDrawClipper_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IDirectDrawClipper_Release(p)               (p)->lpVtbl->Release(p)
+#define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->lpVtbl->GetClipList(p, a, b, c)
+#define IDirectDrawClipper_GetHWnd(p, a)            (p)->lpVtbl->GetHWnd(p, a)
+#define IDirectDrawClipper_Initialize(p, a, b)      (p)->lpVtbl->Initialize(p, a, b)
+#define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->lpVtbl->IsClipListChanged(p, a)
+#define IDirectDrawClipper_SetClipList(p, a, b)     (p)->lpVtbl->SetClipList(p, a, b)
+#define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->lpVtbl->SetHWnd(p, a, b)
+#else
+#define IDirectDrawClipper_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
+#define IDirectDrawClipper_AddRef(p)                (p)->AddRef()
+#define IDirectDrawClipper_Release(p)               (p)->Release()
+#define IDirectDrawClipper_GetClipList(p, a, b, c)  (p)->GetClipList(a, b, c)
+#define IDirectDrawClipper_GetHWnd(p, a)            (p)->GetHWnd(a)
+#define IDirectDrawClipper_Initialize(p, a, b)      (p)->Initialize(a, b)
+#define IDirectDrawClipper_IsClipListChanged(p, a)  (p)->IsClipListChanged(a)
+#define IDirectDrawClipper_SetClipList(p, a, b)     (p)->SetClipList(a, b)
+#define IDirectDrawClipper_SetHWnd(p, a, b)         (p)->SetHWnd(a, b)
+#endif
+
+#endif
+
+/*
+ * IDirectDrawSurface and related interfaces
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDrawSurface
+DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawSurface methods ***/
+    STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+    STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
+    STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE;
+    STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
+    STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE;
+    STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE;
+    STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
+    STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE;
+    STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
+    STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
+    STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
+    STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
+    STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
+    STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
+    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
+    STDMETHOD(IsLost)(THIS) PURE;
+    STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
+    STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
+    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
+    STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
+    STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
+    STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
+    STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
+    STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectDrawSurface_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectDrawSurface_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
+#define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
+#define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
+#define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
+#define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
+#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
+#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
+#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
+#define IDirectDrawSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
+#define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
+#define IDirectDrawSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
+#define IDirectDrawSurface_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
+#define IDirectDrawSurface_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
+#define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
+#define IDirectDrawSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
+#define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
+#define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
+#define IDirectDrawSurface_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
+#define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
+#define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
+#define IDirectDrawSurface_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectDrawSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
+#define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirectDrawSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
+#define IDirectDrawSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
+#define IDirectDrawSurface_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
+#define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
+#define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
+#define IDirectDrawSurface_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
+#define IDirectDrawSurface_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
+#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
+#define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
+#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
+#else
+#define IDirectDrawSurface_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectDrawSurface_AddRef(p)                    (p)->AddRef()
+#define IDirectDrawSurface_Release(p)                   (p)->Release()
+#define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
+#define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
+#define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
+#define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
+#define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
+#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
+#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
+#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
+#define IDirectDrawSurface_Flip(p,a,b)                  (p)->Flip(a,b)
+#define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
+#define IDirectDrawSurface_GetBltStatus(p,a)            (p)->GetBltStatus(a)
+#define IDirectDrawSurface_GetCaps(p,b)                 (p)->GetCaps(b)
+#define IDirectDrawSurface_GetClipper(p,a)              (p)->GetClipper(a)
+#define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
+#define IDirectDrawSurface_GetDC(p,a)                   (p)->GetDC(a)
+#define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
+#define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
+#define IDirectDrawSurface_GetPalette(p,a)              (p)->GetPalette(a)
+#define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
+#define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
+#define IDirectDrawSurface_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectDrawSurface_IsLost(p)                    (p)->IsLost()
+#define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirectDrawSurface_ReleaseDC(p,a)               (p)->ReleaseDC(a)
+#define IDirectDrawSurface_Restore(p)                   (p)->Restore()
+#define IDirectDrawSurface_SetClipper(p,a)              (p)->SetClipper(a)
+#define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
+#define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
+#define IDirectDrawSurface_SetPalette(p,a)              (p)->SetPalette(a)
+#define IDirectDrawSurface_Unlock(p,b)                  (p)->Unlock(b)
+#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
+#define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
+#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
+#endif
+
+/*
+ * IDirectDrawSurface2 and related interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirectDrawSurface2
+DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawSurface methods ***/
+    STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE;
+    STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
+    STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE;
+    STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
+    STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE;
+    STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE;
+    STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE;
+    STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE;
+    STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
+    STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
+    STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
+    STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
+    STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
+    STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
+    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
+    STDMETHOD(IsLost)(THIS) PURE;
+    STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
+    STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
+    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
+    STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
+    STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
+    STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
+    STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
+    STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE;
+    /*** Added in the v2 interface ***/
+    STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
+    STDMETHOD(PageLock)(THIS_ DWORD) PURE;
+    STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectDrawSurface2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectDrawSurface2_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
+#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
+#define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
+#define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
+#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
+#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
+#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
+#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
+#define IDirectDrawSurface2_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
+#define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
+#define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
+#define IDirectDrawSurface2_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
+#define IDirectDrawSurface2_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
+#define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
+#define IDirectDrawSurface2_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
+#define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
+#define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
+#define IDirectDrawSurface2_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
+#define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
+#define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
+#define IDirectDrawSurface2_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectDrawSurface2_IsLost(p)                    (p)->lpVtbl->IsLost(p)
+#define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
+#define IDirectDrawSurface2_Restore(p)                   (p)->lpVtbl->Restore(p)
+#define IDirectDrawSurface2_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
+#define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
+#define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
+#define IDirectDrawSurface2_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
+#define IDirectDrawSurface2_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
+#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
+#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
+#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
+#define IDirectDrawSurface2_GetDDInterface(p,a)                 (p)->lpVtbl->GetDDInterface(p,a)
+#define IDirectDrawSurface2_PageLock(p,a)               (p)->lpVtbl->PageLock(p,a)
+#define IDirectDrawSurface2_PageUnlock(p,a)             (p)->lpVtbl->PageUnlock(p,a)
+#else
+#define IDirectDrawSurface2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectDrawSurface2_AddRef(p)                    (p)->AddRef()
+#define IDirectDrawSurface2_Release(p)                   (p)->Release()
+#define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
+#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
+#define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
+#define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
+#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
+#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
+#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
+#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
+#define IDirectDrawSurface2_Flip(p,a,b)                  (p)->Flip(a,b)
+#define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
+#define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->GetBltStatus(a)
+#define IDirectDrawSurface2_GetCaps(p,b)                 (p)->GetCaps(b)
+#define IDirectDrawSurface2_GetClipper(p,a)              (p)->GetClipper(a)
+#define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
+#define IDirectDrawSurface2_GetDC(p,a)                   (p)->GetDC(a)
+#define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
+#define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
+#define IDirectDrawSurface2_GetPalette(p,a)              (p)->GetPalette(a)
+#define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
+#define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
+#define IDirectDrawSurface2_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectDrawSurface2_IsLost(p)                    (p)->IsLost()
+#define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->ReleaseDC(a)
+#define IDirectDrawSurface2_Restore(p)                   (p)->Restore()
+#define IDirectDrawSurface2_SetClipper(p,a)              (p)->SetClipper(a)
+#define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
+#define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
+#define IDirectDrawSurface2_SetPalette(p,a)              (p)->SetPalette(a)
+#define IDirectDrawSurface2_Unlock(p,b)                  (p)->Unlock(b)
+#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
+#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
+#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
+#define IDirectDrawSurface2_GetDDInterface(p,a)                 (p)->GetDDInterface(a)
+#define IDirectDrawSurface2_PageLock(p,a)               (p)->PageLock(a)
+#define IDirectDrawSurface2_PageUnlock(p,a)             (p)->PageUnlock(a)
+#endif
+
+/*
+ * IDirectDrawSurface3 and related interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirectDrawSurface3
+DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawSurface methods ***/
+    STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
+    STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
+    STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE;
+    STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
+    STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE;
+    STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
+    STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
+    STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
+    STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
+    STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
+    STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
+    STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
+    STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
+    STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
+    STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
+    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
+    STDMETHOD(IsLost)(THIS) PURE;
+    STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
+    STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
+    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
+    STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
+    STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
+    STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
+    STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
+    STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
+    /*** Added in the v2 interface ***/
+    STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
+    STDMETHOD(PageLock)(THIS_ DWORD) PURE;
+    STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
+    /*** Added in the V3 interface ***/
+    STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectDrawSurface3_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectDrawSurface3_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
+#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
+#define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
+#define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
+#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
+#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
+#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
+#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
+#define IDirectDrawSurface3_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
+#define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
+#define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
+#define IDirectDrawSurface3_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
+#define IDirectDrawSurface3_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
+#define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
+#define IDirectDrawSurface3_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
+#define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
+#define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
+#define IDirectDrawSurface3_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
+#define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
+#define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
+#define IDirectDrawSurface3_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectDrawSurface3_IsLost(p)                    (p)->lpVtbl->IsLost(p)
+#define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
+#define IDirectDrawSurface3_Restore(p)                   (p)->lpVtbl->Restore(p)
+#define IDirectDrawSurface3_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
+#define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
+#define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
+#define IDirectDrawSurface3_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
+#define IDirectDrawSurface3_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
+#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
+#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
+#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
+#define IDirectDrawSurface3_GetDDInterface(p,a)                 (p)->lpVtbl->GetDDInterface(p,a)
+#define IDirectDrawSurface3_PageLock(p,a)               (p)->lpVtbl->PageLock(p,a)
+#define IDirectDrawSurface3_PageUnlock(p,a)             (p)->lpVtbl->PageUnlock(p,a)
+#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)       (p)->lpVtbl->SetSurfaceDesc(p,a,b)
+#else
+#define IDirectDrawSurface3_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectDrawSurface3_AddRef(p)                    (p)->AddRef()
+#define IDirectDrawSurface3_Release(p)                   (p)->Release()
+#define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
+#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
+#define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
+#define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
+#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
+#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
+#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
+#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
+#define IDirectDrawSurface3_Flip(p,a,b)                  (p)->Flip(a,b)
+#define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
+#define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->GetBltStatus(a)
+#define IDirectDrawSurface3_GetCaps(p,b)                 (p)->GetCaps(b)
+#define IDirectDrawSurface3_GetClipper(p,a)              (p)->GetClipper(a)
+#define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
+#define IDirectDrawSurface3_GetDC(p,a)                   (p)->GetDC(a)
+#define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
+#define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
+#define IDirectDrawSurface3_GetPalette(p,a)              (p)->GetPalette(a)
+#define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
+#define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
+#define IDirectDrawSurface3_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectDrawSurface3_IsLost(p)                    (p)->IsLost()
+#define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->ReleaseDC(a)
+#define IDirectDrawSurface3_Restore(p)                   (p)->Restore()
+#define IDirectDrawSurface3_SetClipper(p,a)              (p)->SetClipper(a)
+#define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
+#define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
+#define IDirectDrawSurface3_SetPalette(p,a)              (p)->SetPalette(a)
+#define IDirectDrawSurface3_Unlock(p,b)                  (p)->Unlock(b)
+#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
+#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
+#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
+#define IDirectDrawSurface3_GetDDInterface(p,a)                 (p)->GetDDInterface(a)
+#define IDirectDrawSurface3_PageLock(p,a)               (p)->PageLock(a)
+#define IDirectDrawSurface3_PageUnlock(p,a)             (p)->PageUnlock(a)
+#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b)       (p)->SetSurfaceDesc(a,b)
+#endif
+
+/*
+ * IDirectDrawSurface4 and related interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirectDrawSurface4
+DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawSurface methods ***/
+    STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE;
+    STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
+    STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE;
+    STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
+    STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE;
+    STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE;
+    STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
+    STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE;
+    STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE;
+    STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE;
+    STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE;
+    STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
+    STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
+    STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
+    STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
+    STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
+    STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
+    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
+    STDMETHOD(IsLost)(THIS) PURE;
+    STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE;
+    STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
+    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
+    STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
+    STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
+    STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
+    STDMETHOD(Unlock)(THIS_ LPRECT) PURE;
+    STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
+    STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
+    STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE;
+    /*** Added in the v2 interface ***/
+    STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
+    STDMETHOD(PageLock)(THIS_ DWORD) PURE;
+    STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
+    /*** Added in the v3 interface ***/
+    STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE;
+    /*** Added in the v4 interface ***/
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE;
+    STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE;
+    STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectDrawSurface4_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectDrawSurface4_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
+#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
+#define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
+#define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
+#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
+#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
+#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
+#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
+#define IDirectDrawSurface4_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
+#define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
+#define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
+#define IDirectDrawSurface4_GetCaps(p,b)                 (p)->lpVtbl->GetCaps(p,b)
+#define IDirectDrawSurface4_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
+#define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
+#define IDirectDrawSurface4_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
+#define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
+#define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
+#define IDirectDrawSurface4_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
+#define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
+#define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
+#define IDirectDrawSurface4_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectDrawSurface4_IsLost(p)                    (p)->lpVtbl->IsLost(p)
+#define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
+#define IDirectDrawSurface4_Restore(p)                   (p)->lpVtbl->Restore(p)
+#define IDirectDrawSurface4_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
+#define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
+#define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
+#define IDirectDrawSurface4_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
+#define IDirectDrawSurface4_Unlock(p,b)                  (p)->lpVtbl->Unlock(p,b)
+#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
+#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
+#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
+#define IDirectDrawSurface4_GetDDInterface(p,a)                 (p)->lpVtbl->GetDDInterface(p,a)
+#define IDirectDrawSurface4_PageLock(p,a)               (p)->lpVtbl->PageLock(p,a)
+#define IDirectDrawSurface4_PageUnlock(p,a)             (p)->lpVtbl->PageUnlock(p,a)
+#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)       (p)->lpVtbl->SetSurfaceDesc(p,a,b)
+#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)   (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirectDrawSurface4_GetPrivateData(p,a,b,c)     (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirectDrawSurface4_FreePrivateData(p,a)        (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->lpVtbl->GetUniquenessValue(p, a)
+#define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->lpVtbl->ChangeUniquenessValue(p)
+#else
+#define IDirectDrawSurface4_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectDrawSurface4_AddRef(p)                    (p)->AddRef()
+#define IDirectDrawSurface4_Release(p)                   (p)->Release()
+#define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
+#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
+#define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
+#define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
+#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
+#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
+#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
+#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
+#define IDirectDrawSurface4_Flip(p,a,b)                  (p)->Flip(a,b)
+#define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
+#define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->GetBltStatus(a)
+#define IDirectDrawSurface4_GetCaps(p,b)                 (p)->GetCaps(b)
+#define IDirectDrawSurface4_GetClipper(p,a)              (p)->GetClipper(a)
+#define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
+#define IDirectDrawSurface4_GetDC(p,a)                   (p)->GetDC(a)
+#define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
+#define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
+#define IDirectDrawSurface4_GetPalette(p,a)              (p)->GetPalette(a)
+#define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
+#define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
+#define IDirectDrawSurface4_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectDrawSurface4_IsLost(p)                    (p)->IsLost()
+#define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->ReleaseDC(a)
+#define IDirectDrawSurface4_Restore(p)                   (p)->Restore()
+#define IDirectDrawSurface4_SetClipper(p,a)              (p)->SetClipper(a)
+#define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
+#define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
+#define IDirectDrawSurface4_SetPalette(p,a)              (p)->SetPalette(a)
+#define IDirectDrawSurface4_Unlock(p,b)                  (p)->Unlock(b)
+#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
+#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
+#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
+#define IDirectDrawSurface4_GetDDInterface(p,a)                 (p)->GetDDInterface(a)
+#define IDirectDrawSurface4_PageLock(p,a)               (p)->PageLock(a)
+#define IDirectDrawSurface4_PageUnlock(p,a)             (p)->PageUnlock(a)
+#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b)       (p)->SetSurfaceDesc(a,b)
+#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d)   (p)->SetPrivateData(a,b,c,d)
+#define IDirectDrawSurface4_GetPrivateData(p,a,b,c)     (p)->GetPrivateData(a,b,c)
+#define IDirectDrawSurface4_FreePrivateData(p,a)        (p)->FreePrivateData(a)
+#define IDirectDrawSurface4_GetUniquenessValue(p, a)     (p)->GetUniquenessValue(a)
+#define IDirectDrawSurface4_ChangeUniquenessValue(p)     (p)->ChangeUniquenessValue()
+#endif
+
+
+
+/*
+ * IDirectDrawColorControl
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDrawColorControl
+DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawColorControl methods ***/
+    STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
+    STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDrawColorControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IDirectDrawColorControl_Release(p)               (p)->lpVtbl->Release(p)
+#define IDirectDrawColorControl_GetColorControls(p, a)   (p)->lpVtbl->GetColorControls(p, a)
+#define IDirectDrawColorControl_SetColorControls(p, a)   (p)->lpVtbl->SetColorControls(p, a)
+#else
+#define IDirectDrawColorControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
+#define IDirectDrawColorControl_AddRef(p)                (p)->AddRef()
+#define IDirectDrawColorControl_Release(p)               (p)->Release()
+#define IDirectDrawColorControl_GetColorControls(p, a)   (p)->GetColorControls(a)
+#define IDirectDrawColorControl_SetColorControls(p, a)   (p)->SetColorControls(a)
+#endif
+
+#endif
+
+
+/*
+ * IDirectDrawGammaControl
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM )
+#undef INTERFACE
+#define INTERFACE IDirectDrawGammaControl
+DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown )
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IDirectDrawColorControl methods ***/
+    STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
+    STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->lpVtbl->QueryInterface(p, a, b)
+#define IDirectDrawGammaControl_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IDirectDrawGammaControl_Release(p)               (p)->lpVtbl->Release(p)
+#define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->lpVtbl->GetGammaRamp(p, a, b)
+#define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->lpVtbl->SetGammaRamp(p, a, b)
+#else
+#define IDirectDrawGammaControl_QueryInterface(p, a, b)  (p)->QueryInterface(a, b)
+#define IDirectDrawGammaControl_AddRef(p)                (p)->AddRef()
+#define IDirectDrawGammaControl_Release(p)               (p)->Release()
+#define IDirectDrawGammaControl_GetGammaRamp(p, a, b)    (p)->GetGammaRamp(a, b)
+#define IDirectDrawGammaControl_SetGammaRamp(p, a, b)    (p)->SetGammaRamp(a, b)
+#endif
+
+#endif
+
+
+
+#endif
+
+
+/*
+ * DDSURFACEDESC
+ */
+typedef struct _DDSURFACEDESC
+{
+    DWORD              dwSize;                 // size of the DDSURFACEDESC structure
+    DWORD              dwFlags;                // determines what fields are valid
+    DWORD              dwHeight;               // height of surface to be created
+    DWORD              dwWidth;                // width of input surface
+    union
+    {
+        LONG           lPitch;                 // distance to start of next line (return value only)
+        DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
+    } DUMMYUNIONNAMEN(1);
+    DWORD              dwBackBufferCount;      // number of back buffers requested
+    union
+    {
+        DWORD           dwMipMapCount;          // number of mip-map levels requested
+       DWORD           dwZBufferBitDepth;      // depth of Z buffer requested
+       DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
+    } DUMMYUNIONNAMEN(2);
+    DWORD              dwAlphaBitDepth;        // depth of alpha buffer requested
+    DWORD              dwReserved;             // reserved
+    LPVOID             lpSurface;              // pointer to the associated surface memory
+    DDCOLORKEY         ddckCKDestOverlay;      // color key for destination overlay use
+    DDCOLORKEY         ddckCKDestBlt;          // color key for destination blt use
+    DDCOLORKEY         ddckCKSrcOverlay;       // color key for source overlay use
+    DDCOLORKEY         ddckCKSrcBlt;           // color key for source blt use
+    DDPIXELFORMAT      ddpfPixelFormat;        // pixel format description of the surface
+    DDSCAPS            ddsCaps;                // direct draw surface capabilities
+} DDSURFACEDESC;
+
+/*
+ * DDSURFACEDESC2
+ */
+typedef struct _DDSURFACEDESC2
+{
+    DWORD              dwSize;                 // size of the DDSURFACEDESC structure
+    DWORD              dwFlags;                // determines what fields are valid
+    DWORD              dwHeight;               // height of surface to be created
+    DWORD              dwWidth;                // width of input surface
+    union
+    {
+        LONG           lPitch;                 // distance to start of next line (return value only)
+        DWORD           dwLinearSize;           // Formless late-allocated optimized surface size
+    } DUMMYUNIONNAMEN(1);
+    DWORD              dwBackBufferCount;      // number of back buffers requested
+    union
+    {
+        DWORD           dwMipMapCount;          // number of mip-map levels requestde
+                                                // dwZBufferBitDepth removed, use ddpfPixelFormat one instead
+       DWORD           dwRefreshRate;          // refresh rate (used when display mode is described)
+    } DUMMYUNIONNAMEN(2);
+    DWORD              dwAlphaBitDepth;        // depth of alpha buffer requested
+    DWORD              dwReserved;             // reserved
+    LPVOID             lpSurface;              // pointer to the associated surface memory
+    DDCOLORKEY         ddckCKDestOverlay;      // color key for destination overlay use
+    DDCOLORKEY         ddckCKDestBlt;          // color key for destination blt use
+    DDCOLORKEY         ddckCKSrcOverlay;       // color key for source overlay use
+    DDCOLORKEY         ddckCKSrcBlt;           // color key for source blt use
+    DDPIXELFORMAT      ddpfPixelFormat;        // pixel format description of the surface
+    DDSCAPS2           ddsCaps;                // direct draw surface capabilities
+    DWORD               dwTextureStage;         // stage in multitexture cascade
+} DDSURFACEDESC2;
+
+/*
+ * ddsCaps field is valid.
+ */
+#define DDSD_CAPS              0x00000001l     // default
+
+/*
+ * dwHeight field is valid.
+ */
+#define DDSD_HEIGHT            0x00000002l
+
+/*
+ * dwWidth field is valid.
+ */
+#define DDSD_WIDTH             0x00000004l
+
+/*
+ * lPitch is valid.
+ */
+#define DDSD_PITCH             0x00000008l
+
+/*
+ * dwBackBufferCount is valid.
+ */
+#define DDSD_BACKBUFFERCOUNT   0x00000020l
+
+/*
+ * dwZBufferBitDepth is valid.  (shouldnt be used in DDSURFACEDESC2)
+ */
+#define DDSD_ZBUFFERBITDEPTH   0x00000040l
+
+/*
+ * dwAlphaBitDepth is valid.
+ */
+#define DDSD_ALPHABITDEPTH     0x00000080l
+
+
+/*
+ * lpSurface is valid.
+ */
+#define DDSD_LPSURFACE         0x00000800l
+
+/*
+ * ddpfPixelFormat is valid.
+ */
+#define DDSD_PIXELFORMAT       0x00001000l
+
+/*
+ * ddckCKDestOverlay is valid.
+ */
+#define DDSD_CKDESTOVERLAY     0x00002000l
+
+/*
+ * ddckCKDestBlt is valid.
+ */
+#define DDSD_CKDESTBLT         0x00004000l
+
+/*
+ * ddckCKSrcOverlay is valid.
+ */
+#define DDSD_CKSRCOVERLAY      0x00008000l
+
+/*
+ * ddckCKSrcBlt is valid.
+ */
+#define DDSD_CKSRCBLT          0x00010000l
+
+/*
+ * dwMipMapCount is valid.
+ */
+#define DDSD_MIPMAPCOUNT        0x00020000l
+
+ /*
+  * dwRefreshRate is valid
+  */
+#define DDSD_REFRESHRATE       0x00040000l
+
+/*
+ * dwLinearSize is valid
+ */
+#define DDSD_LINEARSIZE                0x00080000l
+
+/*
+ * dwTextureStage is valid
+ */
+#define DDSD_TEXTURESTAGE       0x00100000l
+/*
+ * All input fields are valid.
+ */
+#define DDSD_ALL               0x001ff9eel
+
+
+/*
+ * DDOPTSURFACEDESC
+ */
+typedef struct _DDOPTSURFACEDESC
+{
+    DWORD       dwSize;             // size of the DDOPTSURFACEDESC structure
+    DWORD       dwFlags;            // determines what fields are valid
+    DDSCAPS2    ddSCaps;            // Common caps like: Memory type
+    DDOSCAPS    ddOSCaps;           // Common caps like: Memory type
+    GUID        guid;               // Compression technique GUID
+    DWORD       dwCompressionRatio; // Compression ratio
+} DDOPTSURFACEDESC;
+
+/*
+ * guid field is valid.
+ */
+#define DDOSD_GUID                  0x00000001l
+
+/*
+ * dwCompressionRatio field is valid.
+ */
+#define DDOSD_COMPRESSION_RATIO     0x00000002l
+
+/*
+ * ddSCaps field is valid.
+ */
+#define DDOSD_SCAPS                 0x00000004l
+
+/*
+ * ddOSCaps field is valid.
+ */
+#define DDOSD_OSCAPS                0x00000008l
+
+/*
+ * All input fields are valid.
+ */
+#define DDOSD_ALL                   0x0000000fl
+
+/*
+ * The surface's optimized pixelformat is compressed
+ */
+#define DDOSDCAPS_OPTCOMPRESSED                        0x00000001l
+
+/*
+ * The surface's optimized pixelformat is reordered
+ */
+#define DDOSDCAPS_OPTREORDERED                 0x00000002l
+
+/*
+ * The opt surface is a monolithic mipmap
+ */
+#define DDOSDCAPS_MONOLITHICMIPMAP             0x00000004l
+
+/*
+ * The valid Surf caps:
+ * #define DDSCAPS_SYSTEMMEMORY                        0x00000800l
+ * #define DDSCAPS_VIDEOMEMORY         0x00004000l
+ * #define DDSCAPS_LOCALVIDMEM          0x10000000l
+ * #define DDSCAPS_NONLOCALVIDMEM       0x20000000l
+ */
+#define DDOSDCAPS_VALIDSCAPS           0x30004800l
+
+/*
+ * The valid OptSurf caps
+ */
+#define DDOSDCAPS_VALIDOSCAPS          0x00000007l
+
+
+/*
+ * DDCOLORCONTROL
+ */
+typedef struct _DDCOLORCONTROL
+{
+    DWORD              dwSize;
+    DWORD              dwFlags;
+    LONG               lBrightness;
+    LONG               lContrast;
+    LONG               lHue;
+    LONG               lSaturation;
+    LONG               lSharpness;
+    LONG               lGamma;
+    LONG               lColorEnable;
+    DWORD              dwReserved1;
+} DDCOLORCONTROL;
+
+
+/*
+ * lBrightness field is valid.
+ */
+#define DDCOLOR_BRIGHTNESS             0x00000001l
+
+/*
+ * lContrast field is valid.
+ */
+#define DDCOLOR_CONTRAST               0x00000002l
+
+/*
+ * lHue field is valid.
+ */
+#define DDCOLOR_HUE                    0x00000004l
+
+/*
+ * lSaturation field is valid.
+ */
+#define DDCOLOR_SATURATION             0x00000008l
+
+/*
+ * lSharpness field is valid.
+ */
+#define DDCOLOR_SHARPNESS              0x00000010l
+
+/*
+ * lGamma field is valid.
+ */
+#define DDCOLOR_GAMMA                  0x00000020l
+
+/*
+ * lColorEnable field is valid.
+ */
+#define DDCOLOR_COLORENABLE            0x00000040l
+
+
+
+/*============================================================================
+ *
+ * Direct Draw Capability Flags
+ *
+ * These flags are used to describe the capabilities of a given Surface.
+ * All flags are bit flags.
+ *
+ *==========================================================================*/
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE CAPABILITY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * This bit is reserved. It should not be specified.
+ */
+#define DDSCAPS_RESERVED1                      0x00000001l
+
+/*
+ * Indicates that this surface contains alpha-only information.
+ * (To determine if a surface is RGBA/YUVA, the pixel format must be
+ * interrogated.)
+ */
+#define DDSCAPS_ALPHA                          0x00000002l
+
+/*
+ * Indicates that this surface is a backbuffer.         It is generally
+ * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
+ * It indicates that this surface is THE back buffer of a surface
+ * flipping structure. DirectDraw supports N surfaces in a
+ * surface flipping structure. Only the surface that immediately
+ * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
+ * The other surfaces are identified as back buffers by the presence
+ * of the DDSCAPS_FLIP capability, their attachment order, and the
+ * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
+ * capabilities.  The bit is sent to CreateSurface when a standalone
+ * back buffer is being created.  This surface could be attached to
+ * a front buffer and/or back buffers to form a flipping surface
+ * structure after the CreateSurface call.  See AddAttachments for
+ * a detailed description of the behaviors in this case.
+ */
+#define DDSCAPS_BACKBUFFER                     0x00000004l
+
+/*
+ * Indicates a complex surface structure is being described.  A
+ * complex surface structure results in the creation of more than
+ * one surface.         The additional surfaces are attached to the root
+ * surface.  The complex structure can only be destroyed by
+ * destroying the root.
+ */
+#define DDSCAPS_COMPLEX                                0x00000008l
+
+/*
+ * Indicates that this surface is a part of a surface flipping structure.
+ * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
+ * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface
+ * on the resulting creations. The dwBackBufferCount field in the
+ * DDSURFACEDESC structure must be set to at least 1 in order for
+ * the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
+ * must always be set with creating multiple surfaces through CreateSurface.
+ */
+#define DDSCAPS_FLIP                           0x00000010l
+
+/*
+ * Indicates that this surface is THE front buffer of a surface flipping
+ * structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
+ * capability bit is set.
+ * If this capability is sent to CreateSurface then a standalonw front buffer
+ * is created. This surface will not have the DDSCAPS_FLIP capability.
+ * It can be attached to other back buffers to form a flipping structure.
+ * See AddAttachments for a detailed description of the behaviors in this
+ * case.
+ */
+#define DDSCAPS_FRONTBUFFER                    0x00000020l
+
+/*
+ * Indicates that this surface is any offscreen surface that is not an overlay,
+ * texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
+ * to identify plain vanilla surfaces.
+ */
+#define DDSCAPS_OFFSCREENPLAIN                 0x00000040l
+
+/*
+ * Indicates that this surface is an overlay.  It may or may not be directly visible
+ * depending on whether or not it is currently being overlayed onto the primary
+ * surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
+ * overlayed at the moment.
+ */
+#define DDSCAPS_OVERLAY                                0x00000080l
+
+/*
+ * Indicates that unique DirectDrawPalette objects can be created and
+ * attached to this surface.
+ */
+#define DDSCAPS_PALETTE                                0x00000100l
+
+/*
+ * Indicates that this surface is the primary surface. The primary
+ * surface represents what the user is seeing at the moment.
+ */
+#define DDSCAPS_PRIMARYSURFACE                 0x00000200l
+
+/*
+ * Indicates that this surface is the primary surface for the left eye.
+ * The primary surface for the left eye represents what the user is seeing
+ * at the moment with the users left eye.  When this surface is created the
+ * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
+ * right eye.
+ */
+#define DDSCAPS_PRIMARYSURFACELEFT             0x00000400l
+
+/*
+ * Indicates that this surface memory was allocated in system memory
+ */
+#define DDSCAPS_SYSTEMMEMORY                   0x00000800l
+
+/*
+ * Indicates that this surface can be used as a 3D texture.  It does not
+ * indicate whether or not the surface is being used for that purpose.
+ */
+#define DDSCAPS_TEXTURE                                0x00001000l
+
+/*
+ * Indicates that a surface may be a destination for 3D rendering.  This
+ * bit must be set in order to query for a Direct3D Device Interface
+ * from this surface.
+ */
+#define DDSCAPS_3DDEVICE                        0x00002000l
+
+/*
+ * Indicates that this surface exists in video memory.
+ */
+#define DDSCAPS_VIDEOMEMORY                    0x00004000l
+
+/*
+ * Indicates that changes made to this surface are immediately visible.
+ * It is always set for the primary surface and is set for overlays while
+ * they are being overlayed and texture maps while they are being textured.
+ */
+#define DDSCAPS_VISIBLE                                0x00008000l
+
+/*
+ * Indicates that only writes are permitted to the surface.  Read accesses
+ * from the surface may or may not generate a protection fault, but the
+ * results of a read from this surface will not be meaningful. READ ONLY.
+ */
+#define DDSCAPS_WRITEONLY                      0x00010000l
+
+/*
+ * Indicates that this surface is a z buffer. A z buffer does not contain
+ * displayable information.  Instead it contains bit depth information that is
+ * used to determine which pixels are visible and which are obscured.
+ */
+#define DDSCAPS_ZBUFFER                                0x00020000l
+
+/*
+ * Indicates surface will have a DC associated long term
+ */
+#define DDSCAPS_OWNDC                          0x00040000l
+
+/*
+ * Indicates surface should be able to receive live video
+ */
+#define DDSCAPS_LIVEVIDEO                      0x00080000l
+
+/*
+ * Indicates surface should be able to have a stream decompressed
+ * to it by the hardware.
+ */
+#define DDSCAPS_HWCODEC                                0x00100000l
+
+/*
+ * Surface is a ModeX surface.
+ *
+ */
+#define DDSCAPS_MODEX                          0x00200000l
+
+/*
+ * Indicates surface is one level of a mip-map. This surface will
+ * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
+ * This can be done explicitly, by creating a number of surfaces and
+ * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
+ * If this bit is set then DDSCAPS_TEXTURE must also be set.
+ */
+#define DDSCAPS_MIPMAP                          0x00400000l
+
+/*
+ * This bit is reserved. It should not be specified.
+ */
+#define DDSCAPS_RESERVED2                       0x00800000l
+
+
+/*
+ * Indicates that memory for the surface is not allocated until the surface
+ * is loaded (via the Direct3D texture Load() function).
+ */
+#define DDSCAPS_ALLOCONLOAD                     0x04000000l
+
+/*
+ * Indicates that the surface will recieve data from a video port.
+ */
+#define DDSCAPS_VIDEOPORT                      0x08000000l
+
+/*
+ * Indicates that a video memory surface is resident in true, local video
+ * memory rather than non-local video memory. If this flag is specified then
+ * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
+ * DDSCAPS_NONLOCALVIDMEM.
+ */
+#define DDSCAPS_LOCALVIDMEM                     0x10000000l
+
+/*
+ * Indicates that a video memory surface is resident in non-local video
+ * memory rather than true, local video memory. If this flag is specified
+ * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
+ * DDSCAPS_LOCALVIDMEM.
+ */
+#define DDSCAPS_NONLOCALVIDMEM                  0x20000000l
+
+/*
+ * Indicates that this surface is a standard VGA mode surface, and not a
+ * ModeX surface. (This flag will never be set in combination with the
+ * DDSCAPS_MODEX flag).
+ */
+#define DDSCAPS_STANDARDVGAMODE                 0x40000000l
+
+/*
+ * Indicates that this surface will be an optimized surface. This flag is
+ * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
+ * will be created without any underlying video memory until loaded.
+ */
+#define DDSCAPS_OPTIMIZED                       0x80000000l
+
+
+
+
+/*
+ * Indicates that this surface will receive data from a video port using
+ * the de-interlacing hardware.  This allows the driver to allocate memory
+ * for any extra buffers that may be required.  The DDSCAPS_VIDEOPORT and
+ * DDSCAPS_OVERLAY flags must also be set.
+ */
+#define DDSCAPS2_HARDWAREDEINTERLACE            0x00000002L
+
+/*
+ * Indicates to the driver that this surface will be locked very frequently
+ * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
+ * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
+ * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
+ */
+#define DDSCAPS2_HINTDYNAMIC                   0x00000004L
+
+/*
+ * Indicates to the driver that this surface can be re-ordered/retiled on
+ * load. This operation will not change the size of the texture. It is
+ * relatively fast and symmetrical, since the application may lock these
+ * bits (although it will take a performance hit when doing so). Surfaces
+ * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
+ * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
+ */
+#define DDSCAPS2_HINTSTATIC                    0x00000008L
+
+/*
+ * Indicates that the client would like this texture surface to be managed by the
+ * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
+ * DDSCAPS_TEXTURE set.
+ */
+#define DDSCAPS2_TEXTUREMANAGE                  0x00000010L
+
+/*
+ * These bits are reserved for internal use */
+#define DDSCAPS2_RESERVED1                      0x00000020L
+#define DDSCAPS2_RESERVED2                      0x00000040L
+
+/*
+ * Indicates to the driver that this surface will never be locked again.
+ * The driver is free to optimize this surface via retiling and actual compression.
+ * All calls to Lock() or Blts from this surface will fail. Surfaces with this
+ * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
+ * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
+ */
+#define DDSCAPS2_OPAQUE                         0x00000080L
+
+/*
+ * Applications should set this bit at CreateSurface time to indicate that they
+ * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
+ */
+#define DDSCAPS2_HINTANTIALIASING               0x00000100L
+
+
+
+
+ /****************************************************************************
+ *
+ * DIRECTDRAW DRIVER CAPABILITY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Display hardware has 3D acceleration.
+ */
+#define DDCAPS_3D                      0x00000001l
+
+/*
+ * Indicates that DirectDraw will support only dest rectangles that are aligned
+ * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
+ * READ ONLY.
+ */
+#define DDCAPS_ALIGNBOUNDARYDEST       0x00000002l
+
+/*
+ * Indicates that DirectDraw will support only source rectangles  whose sizes in
+ * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY.
+ */
+#define DDCAPS_ALIGNSIZEDEST           0x00000004l
+/*
+ * Indicates that DirectDraw will support only source rectangles that are aligned
+ * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
+ * READ ONLY.
+ */
+#define DDCAPS_ALIGNBOUNDARYSRC                0x00000008l
+
+/*
+ * Indicates that DirectDraw will support only source rectangles  whose sizes in
+ * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY.
+ */
+#define DDCAPS_ALIGNSIZESRC            0x00000010l
+
+/*
+ * Indicates that DirectDraw will create video memory surfaces that have a stride
+ * alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY.
+ */
+#define DDCAPS_ALIGNSTRIDE             0x00000020l
+
+/*
+ * Display hardware is capable of blt operations.
+ */
+#define DDCAPS_BLT                     0x00000040l
+
+/*
+ * Display hardware is capable of asynchronous blt operations.
+ */
+#define DDCAPS_BLTQUEUE                        0x00000080l
+
+/*
+ * Display hardware is capable of color space conversions during the blt operation.
+ */
+#define DDCAPS_BLTFOURCC               0x00000100l
+
+/*
+ * Display hardware is capable of stretching during blt operations.
+ */
+#define DDCAPS_BLTSTRETCH              0x00000200l
+
+/*
+ * Display hardware is shared with GDI.
+ */
+#define DDCAPS_GDI                     0x00000400l
+
+/*
+ * Display hardware can overlay.
+ */
+#define DDCAPS_OVERLAY                 0x00000800l
+
+/*
+ * Set if display hardware supports overlays but can not clip them.
+ */
+#define DDCAPS_OVERLAYCANTCLIP         0x00001000l
+
+/*
+ * Indicates that overlay hardware is capable of color space conversions during
+ * the overlay operation.
+ */
+#define DDCAPS_OVERLAYFOURCC           0x00002000l
+
+/*
+ * Indicates that stretching can be done by the overlay hardware.
+ */
+#define DDCAPS_OVERLAYSTRETCH          0x00004000l
+
+/*
+ * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
+ * other than the primary surface.
+ */
+#define DDCAPS_PALETTE                 0x00008000l
+
+/*
+ * Indicates that palette changes can be syncd with the veritcal refresh.
+ */
+#define DDCAPS_PALETTEVSYNC            0x00010000l
+
+/*
+ * Display hardware can return the current scan line.
+ */
+#define DDCAPS_READSCANLINE            0x00020000l
+
+/*
+ * Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
+ * can be created.
+ */
+#define DDCAPS_STEREOVIEW              0x00040000l
+
+/*
+ * Display hardware is capable of generating a vertical blank interrupt.
+ */
+#define DDCAPS_VBI                     0x00080000l
+
+/*
+ * Supports the use of z buffers with blt operations.
+ */
+#define DDCAPS_ZBLTS                   0x00100000l
+
+/*
+ * Supports Z Ordering of overlays.
+ */
+#define DDCAPS_ZOVERLAYS               0x00200000l
+
+/*
+ * Supports color key
+ */
+#define DDCAPS_COLORKEY                        0x00400000l
+
+/*
+ * Supports alpha surfaces
+ */
+#define DDCAPS_ALPHA                   0x00800000l
+
+/*
+ * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
+ */
+#define DDCAPS_COLORKEYHWASSIST                0x01000000l
+
+/*
+ * no hardware support at all
+ */
+#define DDCAPS_NOHARDWARE              0x02000000l
+
+/*
+ * Display hardware is capable of color fill with bltter
+ */
+#define DDCAPS_BLTCOLORFILL            0x04000000l
+
+/*
+ * Display hardware is bank switched, and potentially very slow at
+ * random access to VRAM.
+ */
+#define DDCAPS_BANKSWITCHED            0x08000000l
+
+/*
+ * Display hardware is capable of depth filling Z-buffers with bltter
+ */
+#define DDCAPS_BLTDEPTHFILL            0x10000000l
+
+/*
+ * Display hardware is capable of clipping while bltting.
+ */
+#define DDCAPS_CANCLIP                 0x20000000l
+
+/*
+ * Display hardware is capable of clipping while stretch bltting.
+ */
+#define DDCAPS_CANCLIPSTRETCHED                0x40000000l
+
+/*
+ * Display hardware is capable of bltting to or from system memory
+ */
+#define DDCAPS_CANBLTSYSMEM            0x80000000l
+
+
+ /****************************************************************************
+ *
+ * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
+ *
+ ****************************************************************************/
+
+/*
+ * Display hardware is certified
+ */
+#define DDCAPS2_CERTIFIED              0x00000001l
+
+/*
+ * Driver cannot interleave 2D operations (lock and blt) to surfaces with
+ * Direct3D rendering operations between calls to BeginScene() and EndScene()
+ */
+#define DDCAPS2_NO2DDURING3DSCENE       0x00000002l
+
+/*
+ * Display hardware contains a video port
+ */
+#define DDCAPS2_VIDEOPORT               0x00000004l
+
+/*
+ * The overlay can be automatically flipped according to the video port
+ * VSYNCs, providing automatic doubled buffered display of video port
+ * data using an overlay
+ */
+#define DDCAPS2_AUTOFLIPOVERLAY         0x00000008l
+
+/*
+ * Overlay can display each field of interlaced data individually while
+ * it is interleaved in memory without causing jittery artifacts.
+ */
+#define DDCAPS2_CANBOBINTERLEAVED       0x00000010l
+
+/*
+ * Overlay can display each field of interlaced data individually while
+ * it is not interleaved in memory without causing jittery artifacts.
+ */
+#define DDCAPS2_CANBOBNONINTERLEAVED    0x00000020l
+
+/*
+ * The overlay surface contains color controls (brightness, sharpness, etc.)
+ */
+#define DDCAPS2_COLORCONTROLOVERLAY     0x00000040l
+
+/*
+ * The primary surface contains color controls (gamma, etc.)
+ */
+#define DDCAPS2_COLORCONTROLPRIMARY     0x00000080l
+
+/*
+ * RGBZ -> RGB supported for 16:16 RGB:Z
+ */
+#define DDCAPS2_CANDROPZ16BIT           0x00000100l
+
+/*
+ * Driver supports non-local video memory.
+ */
+#define DDCAPS2_NONLOCALVIDMEM          0x00000200l
+
+/*
+ * Dirver supports non-local video memory but has different capabilities for
+ * non-local video memory surfaces. If this bit is set then so must
+ * DDCAPS2_NONLOCALVIDMEM.
+ */
+#define DDCAPS2_NONLOCALVIDMEMCAPS      0x00000400l
+
+/*
+ * Driver neither requires nor prefers surfaces to be pagelocked when performing
+ * blts involving system memory surfaces
+ */
+#define DDCAPS2_NOPAGELOCKREQUIRED      0x00000800l
+
+/*
+ * Driver can create surfaces which are wider than the primary surface
+ */
+#define DDCAPS2_WIDESURFACES            0x00001000l
+
+/*
+ * Driver supports bob without using a video port by handling the
+ * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
+ */
+#define DDCAPS2_CANFLIPODDEVEN          0x00002000l
+
+/*
+ * Driver supports bob using hardware
+ */
+#define DDCAPS2_CANBOBHARDWARE          0x00004000l
+
+/*
+ * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
+ */
+#define DDCAPS2_COPYFOURCC              0x00008000l
+
+
+/*
+ * Driver supports loadable gamma ramps for the primary surface
+ */
+#define DDCAPS2_PRIMARYGAMMA            0x00020000l
+
+/*
+ * Driver can render in windowed mode.
+ */
+#define DDCAPS2_CANRENDERWINDOWED       0x00080000l
+
+/*
+ * A calibrator is available to adjust the gamma ramp according to the
+ * physical display properties so that the result will be identical on
+ * all calibrated systems.
+ */
+#define DDCAPS2_CANCALIBRATEGAMMA       0x00100000l
+
+/*
+ * Indicates that the driver will respond to DDFLIP_INTERVALn flags
+ */
+#define DDCAPS2_FLIPINTERVAL            0x00200000l
+
+/*
+ * Indicates that the driver will respond to DDFLIP_NOVSYNC
+ */
+#define DDCAPS2_FLIPNOVSYNC             0x00400000l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Supports alpha blending around the edge of a source color keyed surface.
+ * For Blt.
+ */
+#define DDFXALPHACAPS_BLTALPHAEDGEBLEND                0x00000001l
+
+/*
+ * Supports alpha information in the pixel format.  The bit depth of alpha
+ * information in the pixel format can be 1,2,4, or 8. The alpha value becomes
+ * more opaque as the alpha value increases.  (0 is transparent.)
+ * For Blt.
+ */
+#define DDFXALPHACAPS_BLTALPHAPIXELS           0x00000002l
+
+/*
+ * Supports alpha information in the pixel format.  The bit depth of alpha
+ * information in the pixel format can be 1,2,4, or 8. The alpha value
+ * becomes more transparent as the alpha value increases.  (0 is opaque.)
+ * This flag can only be set if DDCAPS_ALPHA is set.
+ * For Blt.
+ */
+#define DDFXALPHACAPS_BLTALPHAPIXELSNEG                0x00000004l
+
+/*
+ * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
+ * 1,2,4, or 8.         The alpha value becomes more opaque as the alpha value increases.
+ * (0 is transparent.)
+ * For Blt.
+ */
+#define DDFXALPHACAPS_BLTALPHASURFACES         0x00000008l
+
+/*
+ * The depth of the alpha channel data can range can be 1,2,4, or 8.
+ * The NEG suffix indicates that this alpha channel becomes more transparent
+ * as the alpha value increases. (0 is opaque.)         This flag can only be set if
+ * DDCAPS_ALPHA is set.
+ * For Blt.
+ */
+#define DDFXALPHACAPS_BLTALPHASURFACESNEG      0x00000010l
+
+/*
+ * Supports alpha blending around the edge of a source color keyed surface.
+ * For Overlays.
+ */
+#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND    0x00000020l
+
+/*
+ * Supports alpha information in the pixel format.  The bit depth of alpha
+ * information in the pixel format can be 1,2,4, or 8. The alpha value becomes
+ * more opaque as the alpha value increases.  (0 is transparent.)
+ * For Overlays.
+ */
+#define DDFXALPHACAPS_OVERLAYALPHAPIXELS       0x00000040l
+
+/*
+ * Supports alpha information in the pixel format.  The bit depth of alpha
+ * information in the pixel format can be 1,2,4, or 8. The alpha value
+ * becomes more transparent as the alpha value increases.  (0 is opaque.)
+ * This flag can only be set if DDCAPS_ALPHA is set.
+ * For Overlays.
+ */
+#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG    0x00000080l
+
+/*
+ * Supports alpha only surfaces.  The bit depth of an alpha only surface can be
+ * 1,2,4, or 8.         The alpha value becomes more opaque as the alpha value increases.
+ * (0 is transparent.)
+ * For Overlays.
+ */
+#define DDFXALPHACAPS_OVERLAYALPHASURFACES     0x00000100l
+
+/*
+ * The depth of the alpha channel data can range can be 1,2,4, or 8.
+ * The NEG suffix indicates that this alpha channel becomes more transparent
+ * as the alpha value increases. (0 is opaque.)         This flag can only be set if
+ * DDCAPS_ALPHA is set.
+ * For Overlays.
+ */
+#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG  0x00000200l
+
+#if DIRECTDRAW_VERSION < 0x0600
+#endif  //DIRECTDRAW_VERSION
+
+
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW FX CAPABILITY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Uses arithmetic operations to stretch and shrink surfaces during blt
+ * rather than pixel doubling techniques.  Along the Y axis.
+ */
+#define DDFXCAPS_BLTARITHSTRETCHY      0x00000020l
+
+/*
+ * Uses arithmetic operations to stretch during blt
+ * rather than pixel doubling techniques.  Along the Y axis. Only
+ * works for x1, x2, etc.
+ */
+#define DDFXCAPS_BLTARITHSTRETCHYN     0x00000010l
+
+/*
+ * Supports mirroring left to right in blt.
+ */
+#define DDFXCAPS_BLTMIRRORLEFTRIGHT    0x00000040l
+
+/*
+ * Supports mirroring top to bottom in blt.
+ */
+#define DDFXCAPS_BLTMIRRORUPDOWN       0x00000080l
+
+/*
+ * Supports arbitrary rotation for blts.
+ */
+#define DDFXCAPS_BLTROTATION           0x00000100l
+
+/*
+ * Supports 90 degree rotations for blts.
+ */
+#define DDFXCAPS_BLTROTATION90         0x00000200l
+
+/*
+ * DirectDraw supports arbitrary shrinking of a surface along the
+ * x axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSHRINKX            0x00000400l
+
+/*
+ * DirectDraw supports integer shrinking (1x,2x,) of a surface
+ * along the x axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSHRINKXN           0x00000800l
+
+/*
+ * DirectDraw supports arbitrary shrinking of a surface along the
+ * y axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSHRINKY            0x00001000l
+
+/*
+ * DirectDraw supports integer shrinking (1x,2x,) of a surface
+ * along the y axis (vertical direction) for blts.
+ */
+#define DDFXCAPS_BLTSHRINKYN           0x00002000l
+
+/*
+ * DirectDraw supports arbitrary stretching of a surface along the
+ * x axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSTRETCHX           0x00004000l
+
+/*
+ * DirectDraw supports integer stretching (1x,2x,) of a surface
+ * along the x axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSTRETCHXN          0x00008000l
+
+/*
+ * DirectDraw supports arbitrary stretching of a surface along the
+ * y axis (horizontal direction) for blts.
+ */
+#define DDFXCAPS_BLTSTRETCHY           0x00010000l
+
+/*
+ * DirectDraw supports integer stretching (1x,2x,) of a surface
+ * along the y axis (vertical direction) for blts.
+ */
+#define DDFXCAPS_BLTSTRETCHYN          0x00020000l
+
+/*
+ * Uses arithmetic operations to stretch and shrink surfaces during
+ * overlay rather than pixel doubling techniques.  Along the Y axis
+ * for overlays.
+ */
+#define DDFXCAPS_OVERLAYARITHSTRETCHY  0x00040000l
+
+/*
+ * Uses arithmetic operations to stretch surfaces during
+ * overlay rather than pixel doubling techniques.  Along the Y axis
+ * for overlays. Only works for x1, x2, etc.
+ */
+#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l
+
+/*
+ * DirectDraw supports arbitrary shrinking of a surface along the
+ * x axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSHRINKX                0x00080000l
+
+/*
+ * DirectDraw supports integer shrinking (1x,2x,) of a surface
+ * along the x axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSHRINKXN       0x00100000l
+
+/*
+ * DirectDraw supports arbitrary shrinking of a surface along the
+ * y axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSHRINKY                0x00200000l
+
+/*
+ * DirectDraw supports integer shrinking (1x,2x,) of a surface
+ * along the y axis (vertical direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSHRINKYN       0x00400000l
+
+/*
+ * DirectDraw supports arbitrary stretching of a surface along the
+ * x axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSTRETCHX       0x00800000l
+
+/*
+ * DirectDraw supports integer stretching (1x,2x,) of a surface
+ * along the x axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSTRETCHXN      0x01000000l
+
+/*
+ * DirectDraw supports arbitrary stretching of a surface along the
+ * y axis (horizontal direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSTRETCHY       0x02000000l
+
+/*
+ * DirectDraw supports integer stretching (1x,2x,) of a surface
+ * along the y axis (vertical direction) for overlays.
+ */
+#define DDFXCAPS_OVERLAYSTRETCHYN      0x04000000l
+
+/*
+ * DirectDraw supports mirroring of overlays across the vertical axis
+ */
+#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT        0x08000000l
+
+/*
+ * DirectDraw supports mirroring of overlays across the horizontal axis
+ */
+#define DDFXCAPS_OVERLAYMIRRORUPDOWN   0x10000000l
+
+/*
+ * Driver can do alpha blending for blits.
+ */
+#define DDFXCAPS_BLTALPHA              0x00000001l
+
+/*
+ * Driver can do geometric transformations (or warps) for blits.
+ */
+#define DDFXCAPS_BLTTRANSFORM          0x00000002l
+
+/*
+ * Driver can do surface-reconstruction filtering for warped blits.
+ */
+#define DDFXCAPS_BLTFILTER             DDFXCAPS_BLTARITHSTRETCHY
+
+/*
+ * Driver can do alpha blending for overlays.
+ */
+#define DDFXCAPS_OVERLAYALPHA          0x00000004l
+
+/*
+ * Driver can do geometric transformations (or warps) for overlays.
+ */
+#define DDFXCAPS_OVERLAYTRANSFORM      0x20000000l
+
+/*
+ * Driver can do surface-reconstruction filtering for warped overlays.
+ */
+#define DDFXCAPS_OVERLAYFILTER                 DDFXCAPS_OVERLAYARITHSTRETCHY
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW STEREO VIEW CAPABILITIES
+ *
+ ****************************************************************************/
+
+/*
+ * The stereo view is accomplished via enigma encoding.
+ */
+#define DDSVCAPS_ENIGMA                        0x00000001l
+
+/*
+ * The stereo view is accomplished via high frequency flickering.
+ */
+#define DDSVCAPS_FLICKER               0x00000002l
+
+/*
+ * The stereo view is accomplished via red and blue filters applied
+ * to the left and right eyes. All images must adapt their colorspaces
+ * for this process.
+ */
+#define DDSVCAPS_REDBLUE               0x00000004l
+
+/*
+ * The stereo view is accomplished with split screen technology.
+ */
+#define DDSVCAPS_SPLIT                 0x00000008l
+
+/****************************************************************************
+ *
+ * DIRECTDRAWPALETTE CAPABILITIES
+ *
+ ****************************************************************************/
+
+/*
+ * Index is 4 bits.  There are sixteen color entries in the palette table.
+ */
+#define DDPCAPS_4BIT                   0x00000001l
+
+/*
+ * Index is onto a 8 bit color index.  This field is only valid with the
+ * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
+ * surface is in 8bpp. Each color entry is one byte long and is an index
+ * into destination surface's 8bpp palette.
+ */
+#define DDPCAPS_8BITENTRIES            0x00000002l
+
+/*
+ * Index is 8 bits.  There are 256 color entries in the palette table.
+ */
+#define DDPCAPS_8BIT                   0x00000004l
+
+/*
+ * Indicates that this DIRECTDRAWPALETTE should use the palette color array
+ * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
+ * object.
+ */
+#define DDPCAPS_INITIALIZE             0x00000008l
+
+/*
+ * This palette is the one attached to the primary surface.  Changing this
+ * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
+ * and supported.
+ */
+#define DDPCAPS_PRIMARYSURFACE         0x00000010l
+
+/*
+ * This palette is the one attached to the primary surface left.  Changing
+ * this table has immediate effect on the display for the left eye unless
+ * DDPSETPAL_VSYNC is specified and supported.
+ */
+#define DDPCAPS_PRIMARYSURFACELEFT     0x00000020l
+
+/*
+ * This palette can have all 256 entries defined
+ */
+#define DDPCAPS_ALLOW256               0x00000040l
+
+/*
+ * This palette can have modifications to it synced with the monitors
+ * refresh rate.
+ */
+#define DDPCAPS_VSYNC                  0x00000080l
+
+/*
+ * Index is 1 bit.  There are two color entries in the palette table.
+ */
+#define DDPCAPS_1BIT                   0x00000100l
+
+/*
+ * Index is 2 bit.  There are four color entries in the palette table.
+ */
+#define DDPCAPS_2BIT                   0x00000200l
+
+/*
+ * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
+ */
+#define DDPCAPS_ALPHA                  0x00000400l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWPALETTE SETENTRY CONSTANTS
+ *
+ ****************************************************************************/
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWPALETTE GETENTRY CONSTANTS
+ *
+ ****************************************************************************/
+
+/* 0 is the only legal value */
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS
+ *
+ ****************************************************************************/
+
+/*
+ * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
+ * must be set to sizeof(IUnknown*). DirectDraw will call AddRef through this
+ * pointer and Release when the private data is destroyed. This includes when
+ * the surface or palette is destroyed before such priovate data is destroyed.
+ */
+#define DDSPD_IUNKNOWNPOINTER           0x00000001L
+
+/*
+ * Private data is only valid for the current state of the object,
+ * as determined by the uniqueness value.
+ */
+#define DDSPD_VOLATILE                  0x00000002L
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
+ *
+ ****************************************************************************/
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW BITDEPTH CONSTANTS
+ *
+ * NOTE:  These are only used to indicate supported bit depths.   These
+ * are flags only, they are not to be used as an actual bit depth.   The
+ * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
+ * bit depths in a surface or for changing the display mode.
+ *
+ ****************************************************************************/
+
+/*
+ * 1 bit per pixel.
+ */
+#define DDBD_1                 0x00004000l
+
+/*
+ * 2 bits per pixel.
+ */
+#define DDBD_2                 0x00002000l
+
+/*
+ * 4 bits per pixel.
+ */
+#define DDBD_4                 0x00001000l
+
+/*
+ * 8 bits per pixel.
+ */
+#define DDBD_8                 0x00000800l
+
+/*
+ * 16 bits per pixel.
+ */
+#define DDBD_16                        0x00000400l
+
+/*
+ * 24 bits per pixel.
+ */
+#define DDBD_24                        0X00000200l
+
+/*
+ * 32 bits per pixel.
+ */
+#define DDBD_32                        0x00000100l
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Set if the structure contains a color space.         Not set if the structure
+ * contains a single color key.
+ */
+#define DDCKEY_COLORSPACE      0x00000001l
+
+/*
+ * Set if the structure specifies a color key or color space which is to be
+ * used as a destination color key for blt operations.
+ */
+#define DDCKEY_DESTBLT         0x00000002l
+
+/*
+ * Set if the structure specifies a color key or color space which is to be
+ * used as a destination color key for overlay operations.
+ */
+#define DDCKEY_DESTOVERLAY     0x00000004l
+
+/*
+ * Set if the structure specifies a color key or color space which is to be
+ * used as a source color key for blt operations.
+ */
+#define DDCKEY_SRCBLT          0x00000008l
+
+/*
+ * Set if the structure specifies a color key or color space which is to be
+ * used as a source color key for overlay operations.
+ */
+#define DDCKEY_SRCOVERLAY      0x00000010l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Supports transparent blting using a color key to identify the replaceable
+ * bits of the destination surface for RGB colors.
+ */
+#define DDCKEYCAPS_DESTBLT                     0x00000001l
+
+/*
+ * Supports transparent blting using a color space to identify the replaceable
+ * bits of the destination surface for RGB colors.
+ */
+#define DDCKEYCAPS_DESTBLTCLRSPACE             0x00000002l
+
+/*
+ * Supports transparent blting using a color space to identify the replaceable
+ * bits of the destination surface for YUV colors.
+ */
+#define DDCKEYCAPS_DESTBLTCLRSPACEYUV          0x00000004l
+
+/*
+ * Supports transparent blting using a color key to identify the replaceable
+ * bits of the destination surface for YUV colors.
+ */
+#define DDCKEYCAPS_DESTBLTYUV                  0x00000008l
+
+/*
+ * Supports overlaying using colorkeying of the replaceable bits of the surface
+ * being overlayed for RGB colors.
+ */
+#define DDCKEYCAPS_DESTOVERLAY                 0x00000010l
+
+/*
+ * Supports a color space as the color key for the destination for RGB colors.
+ */
+#define DDCKEYCAPS_DESTOVERLAYCLRSPACE         0x00000020l
+
+/*
+ * Supports a color space as the color key for the destination for YUV colors.
+ */
+#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV      0x00000040l
+
+/*
+ * Supports only one active destination color key value for visible overlay
+ * surfaces.
+ */
+#define DDCKEYCAPS_DESTOVERLAYONEACTIVE                0x00000080l
+
+/*
+ * Supports overlaying using colorkeying of the replaceable bits of the
+ * surface being overlayed for YUV colors.
+ */
+#define DDCKEYCAPS_DESTOVERLAYYUV              0x00000100l
+
+/*
+ * Supports transparent blting using the color key for the source with
+ * this surface for RGB colors.
+ */
+#define DDCKEYCAPS_SRCBLT                      0x00000200l
+
+/*
+ * Supports transparent blting using a color space for the source with
+ * this surface for RGB colors.
+ */
+#define DDCKEYCAPS_SRCBLTCLRSPACE              0x00000400l
+
+/*
+ * Supports transparent blting using a color space for the source with
+ * this surface for YUV colors.
+ */
+#define DDCKEYCAPS_SRCBLTCLRSPACEYUV           0x00000800l
+
+/*
+ * Supports transparent blting using the color key for the source with
+ * this surface for YUV colors.
+ */
+#define DDCKEYCAPS_SRCBLTYUV                   0x00001000l
+
+/*
+ * Supports overlays using the color key for the source with this
+ * overlay surface for RGB colors.
+ */
+#define DDCKEYCAPS_SRCOVERLAY                  0x00002000l
+
+/*
+ * Supports overlays using a color space as the source color key for
+ * the overlay surface for RGB colors.
+ */
+#define DDCKEYCAPS_SRCOVERLAYCLRSPACE          0x00004000l
+
+/*
+ * Supports overlays using a color space as the source color key for
+ * the overlay surface for YUV colors.
+ */
+#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV       0x00008000l
+
+/*
+ * Supports only one active source color key value for visible
+ * overlay surfaces.
+ */
+#define DDCKEYCAPS_SRCOVERLAYONEACTIVE         0x00010000l
+
+/*
+ * Supports overlays using the color key for the source with this
+ * overlay surface for YUV colors.
+ */
+#define DDCKEYCAPS_SRCOVERLAYYUV               0x00020000l
+
+/*
+ * there are no bandwidth trade-offs for using colorkey with an overlay
+ */
+#define DDCKEYCAPS_NOCOSTOVERLAY               0x00040000l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW PIXELFORMAT FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * The surface has alpha channel information in the pixel format.
+ */
+#define DDPF_ALPHAPIXELS                       0x00000001l
+
+/*
+ * The pixel format contains alpha only information
+ */
+#define DDPF_ALPHA                             0x00000002l
+
+/*
+ * The FourCC code is valid.
+ */
+#define DDPF_FOURCC                            0x00000004l
+
+/*
+ * The surface is 4-bit color indexed.
+ */
+#define DDPF_PALETTEINDEXED4                   0x00000008l
+
+/*
+ * The surface is indexed into a palette which stores indices
+ * into the destination surface's 8-bit palette.
+ */
+#define DDPF_PALETTEINDEXEDTO8                 0x00000010l
+
+/*
+ * The surface is 8-bit color indexed.
+ */
+#define DDPF_PALETTEINDEXED8                   0x00000020l
+
+/*
+ * The RGB data in the pixel format structure is valid.
+ */
+#define DDPF_RGB                               0x00000040l
+
+/*
+ * The surface will accept pixel data in the format specified
+ * and compress it during the write.
+ */
+#define DDPF_COMPRESSED                                0x00000080l
+
+/*
+ * The surface will accept RGB data and translate it during
+ * the write to YUV data.  The format of the data to be written
+ * will be contained in the pixel format structure.  The DDPF_RGB
+ * flag will be set.
+ */
+#define DDPF_RGBTOYUV                          0x00000100l
+
+/*
+ * pixel format is YUV - YUV data in pixel format struct is valid
+ */
+#define DDPF_YUV                               0x00000200l
+
+/*
+ * pixel format is a z buffer only surface
+ */
+#define DDPF_ZBUFFER                           0x00000400l
+
+/*
+ * The surface is 1-bit color indexed.
+ */
+#define DDPF_PALETTEINDEXED1                   0x00000800l
+
+/*
+ * The surface is 2-bit color indexed.
+ */
+#define DDPF_PALETTEINDEXED2                   0x00001000l
+
+/*
+ * The surface contains Z information in the pixels
+ */
+#define DDPF_ZPIXELS                           0x00002000l
+
+/*
+ * The surface contains stencil information along with Z
+ */
+#define DDPF_STENCILBUFFER                     0x00004000l
+
+/*
+ * Premultiplied alpha format -- the color components have been
+ * premultiplied by the alpha component.
+ */
+#define DDPF_ALPHAPREMULT                      0x00008000l
+
+
+/*
+ * Luminance data in the pixel format is valid.
+ * Use this flag for luminance-only or luminance+alpha surfaces,
+ * the bit depth is then ddpf.dwLuminanceBitCount.
+ */
+#define DDPF_LUMINANCE                          0x00020000l
+
+/*
+ * Luminance data in the pixel format is valid.
+ * Use this flag when hanging luminance off bumpmap surfaces,
+ * the bit mask for the luminance portion of the pixel is then
+ * ddpf.dwBumpLuminanceBitMask
+ */
+#define DDPF_BUMPLUMINANCE                      0x00040000l
+
+/*
+ * Bump map dUdV data in the pixel format is valid.
+ */
+#define DDPF_BUMPDUDV                           0x00080000l
+
+/*===========================================================================
+ *
+ *
+ * DIRECTDRAW CALLBACK FLAGS
+ *
+ *
+ *==========================================================================*/
+
+/****************************************************************************
+ *
+ * DIRECTDRAW ENUMSURFACES FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Enumerate all of the surfaces that meet the search criterion.
+ */
+#define DDENUMSURFACES_ALL                     0x00000001l
+
+/*
+ * A search hit is a surface that matches the surface description.
+ */
+#define DDENUMSURFACES_MATCH                   0x00000002l
+
+/*
+ * A search hit is a surface that does not match the surface description.
+ */
+#define DDENUMSURFACES_NOMATCH                 0x00000004l
+
+/*
+ * Enumerate the first surface that can be created which meets the search criterion.
+ */
+#define DDENUMSURFACES_CANBECREATED            0x00000008l
+
+/*
+ * Enumerate the surfaces that already exist that meet the search criterion.
+ */
+#define DDENUMSURFACES_DOESEXIST               0x00000010l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW SETDISPLAYMODE FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * The desired mode is a standard VGA mode
+ */
+#define DDSDM_STANDARDVGAMODE                   0x00000001l
+
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW ENUMDISPLAYMODES FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Enumerate Modes with different refresh rates.  EnumDisplayModes guarantees
+ * that a particular mode will be enumerated only once.  This flag specifies whether
+ * the refresh rate is taken into account when determining if a mode is unique.
+ */
+#define DDEDM_REFRESHRATES                     0x00000001l
+
+/*
+ * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
+ * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
+ * enumerated if the application has previously called SetCooperativeLevel with the
+ * DDSCL_ALLOWMODEX flag set).
+ */
+#define DDEDM_STANDARDVGAMODES                  0x00000002L
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Exclusive mode owner will be responsible for the entire primary surface.
+ * GDI can be ignored. used with DD
+ */
+#define DDSCL_FULLSCREEN                       0x00000001l
+
+/*
+ * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
+ */
+#define DDSCL_ALLOWREBOOT                      0x00000002l
+
+/*
+ * prevents DDRAW from modifying the application window.
+ * prevents DDRAW from minimize/restore the application window on activation.
+ */
+#define DDSCL_NOWINDOWCHANGES                  0x00000004l
+
+/*
+ * app wants to work as a regular Windows application
+ */
+#define DDSCL_NORMAL                           0x00000008l
+
+/*
+ * app wants exclusive access
+ */
+#define DDSCL_EXCLUSIVE                         0x00000010l
+
+
+/*
+ * app can deal with non-windows display modes
+ */
+#define DDSCL_ALLOWMODEX                        0x00000040l
+
+/*
+ * this window will receive the focus messages
+ */
+#define DDSCL_SETFOCUSWINDOW                    0x00000080l
+
+/*
+ * this window is associated with the DDRAW object and will
+ * cover the screen in fullscreen mode
+ */
+#define DDSCL_SETDEVICEWINDOW                   0x00000100l
+
+/*
+ * app wants DDRAW to create a window to be associated with the
+ * DDRAW object
+ */
+#define DDSCL_CREATEDEVICEWINDOW                0x00000200l
+
+/*
+ * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
+ * take the global crtisec more frequently.
+ */
+#define DDSCL_MULTITHREADED                     0x00000400l
+
+/*
+ * App hints that it would like to keep the FPU set up for optimal Direct3D
+ * performance (single precision and exceptions disabled) so Direct3D
+ * does not need to explicitly set the FPU each time
+ */
+#define DDSCL_FPUSETUP                          0x00000800l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW BLT FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Use the alpha information in the pixel format or the alpha channel surface
+ * attached to the destination surface as the alpha channel for this blt.
+ */
+#define DDBLT_ALPHADEST                                0x00000001l
+
+/*
+ * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
+ * for the destination surface for this blt.
+ */
+#define DDBLT_ALPHADESTCONSTOVERRIDE           0x00000002l
+
+/*
+ * The NEG suffix indicates that the destination surface becomes more
+ * transparent as the alpha value increases. (0 is opaque)
+ */
+#define DDBLT_ALPHADESTNEG                     0x00000004l
+
+/*
+ * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
+ * channel for the destination for this blt.
+ */
+#define DDBLT_ALPHADESTSURFACEOVERRIDE         0x00000008l
+
+/*
+ * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
+ * for the edges of the image that border the color key colors.
+ */
+#define DDBLT_ALPHAEDGEBLEND                   0x00000010l
+
+/*
+ * Use the alpha information in the pixel format or the alpha channel surface
+ * attached to the source surface as the alpha channel for this blt.
+ */
+#define DDBLT_ALPHASRC                         0x00000020l
+
+/*
+ * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
+ * for the source for this blt.
+ */
+#define DDBLT_ALPHASRCCONSTOVERRIDE            0x00000040l
+
+/*
+ * The NEG suffix indicates that the source surface becomes more transparent
+ * as the alpha value increases. (0 is opaque)
+ */
+#define DDBLT_ALPHASRCNEG                      0x00000080l
+
+/*
+ * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
+ * for the source for this blt.
+ */
+#define DDBLT_ALPHASRCSURFACEOVERRIDE          0x00000100l
+
+/*
+ * Do this blt asynchronously through the FIFO in the order received.  If
+ * there is no room in the hardware FIFO fail the call.
+ */
+#define DDBLT_ASYNC                            0x00000200l
+
+/*
+ * Uses the dwFillColor field in the DDBLTFX structure as the RGB color
+ * to fill the destination rectangle on the destination surface with.
+ */
+#define DDBLT_COLORFILL                                0x00000400l
+
+/*
+ * Uses the dwDDFX field in the DDBLTFX structure to specify the effects
+ * to use for the blt.
+ */
+#define DDBLT_DDFX                             0x00000800l
+
+/*
+ * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
+ * that are not part of the Win32 API.
+ */
+#define DDBLT_DDROPS                           0x00001000l
+
+/*
+ * Use the color key associated with the destination surface.
+ */
+#define DDBLT_KEYDEST                          0x00002000l
+
+/*
+ * Use the dckDestColorkey field in the DDBLTFX structure as the color key
+ * for the destination surface.
+ */
+#define DDBLT_KEYDESTOVERRIDE                  0x00004000l
+
+/*
+ * Use the color key associated with the source surface.
+ */
+#define DDBLT_KEYSRC                           0x00008000l
+
+/*
+ * Use the dckSrcColorkey field in the DDBLTFX structure as the color key
+ * for the source surface.
+ */
+#define DDBLT_KEYSRCOVERRIDE                   0x00010000l
+
+/*
+ * Use the dwROP field in the DDBLTFX structure for the raster operation
+ * for this blt.  These ROPs are the same as the ones defined in the Win32 API.
+ */
+#define DDBLT_ROP                              0x00020000l
+
+/*
+ * Use the dwRotationAngle field in the DDBLTFX structure as the angle
+ * (specified in 1/100th of a degree) to rotate the surface.
+ */
+#define DDBLT_ROTATIONANGLE                    0x00040000l
+
+/*
+ * Z-buffered blt using the z-buffers attached to the source and destination
+ * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
+ * z-buffer opcode.
+ */
+#define DDBLT_ZBUFFER                          0x00080000l
+
+/*
+ * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
+ * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
+ * for the destination.
+ */
+#define DDBLT_ZBUFFERDESTCONSTOVERRIDE         0x00100000l
+
+/*
+ * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
+ * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
+ * respectively for the destination.
+ */
+#define DDBLT_ZBUFFERDESTOVERRIDE              0x00200000l
+
+/*
+ * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
+ * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
+ * for the source.
+ */
+#define DDBLT_ZBUFFERSRCCONSTOVERRIDE          0x00400000l
+
+/*
+ * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
+ * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
+ * respectively for the source.
+ */
+#define DDBLT_ZBUFFERSRCOVERRIDE                0x00800000l
+
+/*
+ * wait until the device is ready to handle the blt
+ * this will cause blt to not return DDERR_WASSTILLDRAWING
+ */
+#define DDBLT_WAIT                              0x01000000l
+
+/*
+ * Uses the dwFillDepth field in the DDBLTFX structure as the depth value
+ * to fill the destination rectangle on the destination Z-buffer surface
+ * with.
+ */
+#define DDBLT_DEPTHFILL                                0x02000000l
+
+
+/****************************************************************************
+ *
+ * BLTFAST FLAGS
+ *
+ ****************************************************************************/
+
+#define DDBLTFAST_NOCOLORKEY                    0x00000000
+#define DDBLTFAST_SRCCOLORKEY                   0x00000001
+#define DDBLTFAST_DESTCOLORKEY                  0x00000002
+#define DDBLTFAST_WAIT                          0x00000010
+
+
+
+
+/****************************************************************************
+ *
+ * FLIP FLAGS
+ *
+ ****************************************************************************/
+
+#define DDFLIP_WAIT                          0x00000001L
+
+/*
+ * Indicates that the target surface contains the even field of video data.
+ * This flag is only valid with an overlay surface.
+ */
+#define DDFLIP_EVEN                          0x00000002L
+
+/*
+ * Indicates that the target surface contains the odd field of video data.
+ * This flag is only valid with an overlay surface.
+ */
+#define DDFLIP_ODD                           0x00000004L
+
+/*
+ * Causes DirectDraw to perform the physical flip immediately and return
+ * to the application. Typically, what was the front buffer but is now the back
+ * buffer will still be visible (depending on timing) until the next vertical 
+ * retrace. Subsequent operations involving the two flipped surfaces will
+ * not check to see if the physical flip has finished (i.e. will not return
+ * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
+ * This allows an application to perform Flips at a higher frequency than the
+ * monitor refresh rate, but may introduce visible artifacts.
+ * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set, 
+ * DDFLIP_NOVSYNC has no effect.
+ */
+#define DDFLIP_NOVSYNC                       0x00000008L
+
+
+/*
+ * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
+ * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
+ * surface involved in the flip until the specified number of vertical retraces has
+ * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set, 
+ * DDFLIP_INTERVALn has no effect.
+ */
+
+/*
+ * DirectDraw will flip on every other vertical sync
+ */
+#define DDFLIP_INTERVAL2                     0x02000000L
+
+
+/*
+ * DirectDraw will flip on every third vertical sync
+ */
+#define DDFLIP_INTERVAL3                     0x03000000L
+
+
+/*
+ * DirectDraw will flip on every fourth vertical sync
+ */
+#define DDFLIP_INTERVAL4                     0x04000000L
+
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW SURFACE OVERLAY FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Use the alpha information in the pixel format or the alpha channel surface
+ * attached to the destination surface as the alpha channel for the
+ * destination overlay.
+ */
+#define DDOVER_ALPHADEST                       0x00000001l
+
+/*
+ * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
+ * destination alpha channel for this overlay.
+ */
+#define DDOVER_ALPHADESTCONSTOVERRIDE          0x00000002l
+
+/*
+ * The NEG suffix indicates that the destination surface becomes more
+ * transparent as the alpha value increases.
+ */
+#define DDOVER_ALPHADESTNEG                    0x00000004l
+
+/*
+ * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
+ * channel destination for this overlay.
+ */
+#define DDOVER_ALPHADESTSURFACEOVERRIDE                0x00000008l
+
+/*
+ * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
+ * channel for the edges of the image that border the color key colors.
+ */
+#define DDOVER_ALPHAEDGEBLEND                  0x00000010l
+
+/*
+ * Use the alpha information in the pixel format or the alpha channel surface
+ * attached to the source surface as the source alpha channel for this overlay.
+ */
+#define DDOVER_ALPHASRC                                0x00000020l
+
+/*
+ * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
+ * alpha channel for this overlay.
+ */
+#define DDOVER_ALPHASRCCONSTOVERRIDE           0x00000040l
+
+/*
+ * The NEG suffix indicates that the source surface becomes more transparent
+ * as the alpha value increases.
+ */
+#define DDOVER_ALPHASRCNEG                     0x00000080l
+
+/*
+ * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
+ * source for this overlay.
+ */
+#define DDOVER_ALPHASRCSURFACEOVERRIDE         0x00000100l
+
+/*
+ * Turn this overlay off.
+ */
+#define DDOVER_HIDE                            0x00000200l
+
+/*
+ * Use the color key associated with the destination surface.
+ */
+#define DDOVER_KEYDEST                         0x00000400l
+
+/*
+ * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
+ * for the destination surface
+ */
+#define DDOVER_KEYDESTOVERRIDE                 0x00000800l
+
+/*
+ * Use the color key associated with the source surface.
+ */
+#define DDOVER_KEYSRC                          0x00001000l
+
+/*
+ * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
+ * for the source surface.
+ */
+#define DDOVER_KEYSRCOVERRIDE                  0x00002000l
+
+/*
+ * Turn this overlay on.
+ */
+#define DDOVER_SHOW                            0x00004000l
+
+/*
+ * Add a dirty rect to an emulated overlayed surface.
+ */
+#define DDOVER_ADDDIRTYRECT                     0x00008000l
+
+/*
+ * Redraw all dirty rects on an emulated overlayed surface.
+ */
+#define DDOVER_REFRESHDIRTYRECTS               0x00010000l
+
+/*
+ * Redraw the entire surface on an emulated overlayed surface.
+ */
+#define DDOVER_REFRESHALL                      0x00020000l
+
+
+/*
+ * Use the overlay FX flags to define special overlay FX
+ */
+#define DDOVER_DDFX                            0x00080000l
+
+/*
+ * Autoflip the overlay when ever the video port autoflips
+ */
+#define DDOVER_AUTOFLIP                        0x00100000l
+
+/*
+ * Display each field of video port data individually without
+ * causing any jittery artifacts
+ */
+#define DDOVER_BOB                             0x00200000l
+
+/*
+ * Indicates that bob/weave decisions should not be overridden by other
+ * interfaces.
+ */
+#define DDOVER_OVERRIDEBOBWEAVE                        0x00400000l
+
+/*
+ * Indicates that the surface memory is composed of interleaved fields.
+ */
+#define DDOVER_INTERLEAVED                     0x00800000l
+
+/*
+ * Indicates that bob will be performed using hardware rather than
+ * software or emulated.
+ */
+#define DDOVER_BOBHARDWARE                     0x01000000l
+
+
+
+
+
+
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE LOCK FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * The default.         Set to indicate that Lock should return a valid memory pointer
+ * to the top of the specified rectangle.  If no rectangle is specified then a
+ * pointer to the top of the surface is returned.
+ */
+#define DDLOCK_SURFACEMEMORYPTR                        0x00000000L     // default
+
+/*
+ * Set to indicate that Lock should wait until it can obtain a valid memory
+ * pointer before returning.  If this bit is set, Lock will never return
+ * DDERR_WASSTILLDRAWING.
+ */
+#define DDLOCK_WAIT                            0x00000001L
+
+/*
+ * Set if an event handle is being passed to Lock.  Lock will trigger the event
+ * when it can return the surface memory pointer requested.
+ */
+#define DDLOCK_EVENT                           0x00000002L
+
+/*
+ * Indicates that the surface being locked will only be read from.
+ */
+#define DDLOCK_READONLY                                0x00000010L
+
+/*
+ * Indicates that the surface being locked will only be written to
+ */
+#define DDLOCK_WRITEONLY                       0x00000020L
+
+
+/*
+ * Indicates that a system wide lock should not be taken when this surface
+ * is locked. This has several advantages (cursor responsiveness, ability
+ * to call more Windows functions, easier debugging) when locking video
+ * memory surfaces. However, an application specifying this flag must
+ * comply with a number of conditions documented in the help file.
+ * Furthermore, this flag cannot be specified when locking the primary.
+ */
+#define DDLOCK_NOSYSLOCK                        0x00000800L
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE PAGELOCK FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * No flags defined at present
+ */
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * No flags defined at present
+ */
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE BLT FX FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * If stretching, use arithmetic stretching along the Y axis for this blt.
+ */
+#define DDBLTFX_ARITHSTRETCHY                  0x00000001l
+
+/*
+ * Do this blt mirroring the surface left to right.  Spin the
+ * surface around its y-axis.
+ */
+#define DDBLTFX_MIRRORLEFTRIGHT                        0x00000002l
+
+/*
+ * Do this blt mirroring the surface up and down.  Spin the surface
+ * around its x-axis.
+ */
+#define DDBLTFX_MIRRORUPDOWN                   0x00000004l
+
+/*
+ * Schedule this blt to avoid tearing.
+ */
+#define DDBLTFX_NOTEARING                      0x00000008l
+
+/*
+ * Do this blt rotating the surface one hundred and eighty degrees.
+ */
+#define DDBLTFX_ROTATE180                      0x00000010l
+
+/*
+ * Do this blt rotating the surface two hundred and seventy degrees.
+ */
+#define DDBLTFX_ROTATE270                      0x00000020l
+
+/*
+ * Do this blt rotating the surface ninety degrees.
+ */
+#define DDBLTFX_ROTATE90                       0x00000040l
+
+/*
+ * Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
+ * specified to limit the bits copied from the source surface.
+ */
+#define DDBLTFX_ZBUFFERRANGE                   0x00000080l
+
+/*
+ * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
+ * before comparing it with the desting z values.
+ */
+#define DDBLTFX_ZBUFFERBASEDEST                        0x00000100l
+
+/****************************************************************************
+ *
+ * DIRECTDRAWSURFACE OVERLAY FX FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * If stretching, use arithmetic stretching along the Y axis for this overlay.
+ */
+#define DDOVERFX_ARITHSTRETCHY                 0x00000001l
+
+/*
+ * Mirror the overlay across the vertical axis
+ */
+#define DDOVERFX_MIRRORLEFTRIGHT               0x00000002l
+
+/*
+ * Mirror the overlay across the horizontal axis
+ */
+#define DDOVERFX_MIRRORUPDOWN                  0x00000004l
+
+/****************************************************************************
+ *
+ * Flags for dwDDFX member of DDSPRITEFX structure
+ *
+ ****************************************************************************/
+/*
+ * Use affine transformation matrix in fTransform member.
+ */
+#define DDSPRITEFX_AFFINETRANSFORM             0x00000001l
+
+/*
+ * Use RGBA scaling factors in ddrgbaScaleFactors member.
+ */
+#define DDSPRITEFX_RGBASCALING                 0x00000002l
+
+/*
+ * Degrade RGBA scaling factors to accommodate driver's capabilities.
+ */
+#define DDSPRITEFX_DEGRADERGBASCALING          0x00000004l
+
+/*
+ * Do bilinear filtering of stretched or warped sprite.
+ */
+#define DDSPRITEFX_BILINEARFILTER              0x00000008l
+
+/*
+ * Do "blur" filtering of stretched or warped sprite.
+ */
+#define DDSPRITEFX_BLURFILTER                  0x00000010l
+
+/*
+ * Do "flat" filtering of stretched or warped sprite.
+ */
+#define DDSPRITEFX_FLATFILTER                  0x00000020l
+
+/*
+ * Degrade filtering operation to accommodate driver's capabilities.
+ */
+#define DDSPRITEFX_DEGRADEFILTER               0x00000040l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * return when the vertical blank interval begins
+ */
+#define DDWAITVB_BLOCKBEGIN                    0x00000001l
+
+/*
+ * set up an event to trigger when the vertical blank begins
+ */
+#define DDWAITVB_BLOCKBEGINEVENT               0x00000002l
+
+/*
+ * return when the vertical blank interval ends and display begins
+ */
+#define DDWAITVB_BLOCKEND                      0x00000004l
+
+/****************************************************************************
+ *
+ * DIRECTDRAW GETFLIPSTATUS FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * is it OK to flip now?
+ */
+#define DDGFS_CANFLIP                  0x00000001l
+
+/*
+ * is the last flip finished?
+ */
+#define DDGFS_ISFLIPDONE               0x00000002l
+
+/****************************************************************************
+ *
+ * DIRECTDRAW GETBLTSTATUS FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * is it OK to blt now?
+ */
+#define DDGBS_CANBLT                   0x00000001l
+
+/*
+ * is the blt to the surface finished?
+ */
+#define DDGBS_ISBLTDONE                        0x00000002l
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Enumerate overlays back to front.
+ */
+#define DDENUMOVERLAYZ_BACKTOFRONT     0x00000000l
+
+/*
+ * Enumerate overlays front to back
+ */
+#define DDENUMOVERLAYZ_FRONTTOBACK     0x00000001l
+
+/****************************************************************************
+ *
+ * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Send overlay to front
+ */
+#define DDOVERZ_SENDTOFRONT            0x00000000l
+
+/*
+ * Send overlay to back
+ */
+#define DDOVERZ_SENDTOBACK             0x00000001l
+
+/*
+ * Move Overlay forward
+ */
+#define DDOVERZ_MOVEFORWARD            0x00000002l
+
+/*
+ * Move Overlay backward
+ */
+#define DDOVERZ_MOVEBACKWARD           0x00000003l
+
+/*
+ * Move Overlay in front of relative surface
+ */
+#define DDOVERZ_INSERTINFRONTOF                0x00000004l
+
+/*
+ * Move Overlay in back of relative surface
+ */
+#define DDOVERZ_INSERTINBACKOF         0x00000005l
+
+
+
+/****************************************************************************
+ *
+ * DIRECTDRAW SETGAMMARAMP FLAGS
+ *
+ ****************************************************************************/
+
+/*
+ * Request calibrator to adjust the gamma ramp according to the physical
+ * properties of the display so that the result should appear identical
+ * on all systems.
+ */
+#define DDSGR_CALIBRATE                        0x00000001L
+
+
+/*===========================================================================
+ *
+ *
+ * DIRECTDRAW RETURN CODES
+ *
+ * The return values from DirectDraw Commands and Surface that return an HRESULT
+ * are codes from DirectDraw concerning the results of the action
+ * requested by DirectDraw.
+ *
+ *==========================================================================*/
+
+/*
+ * Status is OK
+ *
+ * Issued by: DirectDraw Commands and all callbacks
+ */
+#define DD_OK                                  0
+#define DD_FALSE                                S_FALSE
+
+/****************************************************************************
+ *
+ * DIRECTDRAW ENUMCALLBACK RETURN VALUES
+ *
+ * EnumCallback returns are used to control the flow of the DIRECTDRAW and
+ * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
+ * enumeration callback routines.
+ *
+ ****************************************************************************/
+
+/*
+ * stop the enumeration
+ */
+#define DDENUMRET_CANCEL                       0
+
+/*
+ * continue the enumeration
+ */
+#define DDENUMRET_OK                           1
+
+/****************************************************************************
+ *
+ * DIRECTDRAW ERRORS
+ *
+ * Errors are represented by negative values and cannot be combined.
+ *
+ ****************************************************************************/
+
+/*
+ * This object is already initialized
+ */
+#define DDERR_ALREADYINITIALIZED               MAKE_DDHRESULT( 5 )
+
+/*
+ * This surface can not be attached to the requested surface.
+ */
+#define DDERR_CANNOTATTACHSURFACE              MAKE_DDHRESULT( 10 )
+
+/*
+ * This surface can not be detached from the requested surface.
+ */
+#define DDERR_CANNOTDETACHSURFACE              MAKE_DDHRESULT( 20 )
+
+/*
+ * Support is currently not available.
+ */
+#define DDERR_CURRENTLYNOTAVAIL                        MAKE_DDHRESULT( 40 )
+
+/*
+ * An exception was encountered while performing the requested operation
+ */
+#define DDERR_EXCEPTION                                MAKE_DDHRESULT( 55 )
+
+/*
+ * Generic failure.
+ */
+#define DDERR_GENERIC                          E_FAIL
+
+/*
+ * Height of rectangle provided is not a multiple of reqd alignment
+ */
+#define DDERR_HEIGHTALIGN                      MAKE_DDHRESULT( 90 )
+
+/*
+ * Unable to match primary surface creation request with existing
+ * primary surface.
+ */
+#define DDERR_INCOMPATIBLEPRIMARY              MAKE_DDHRESULT( 95 )
+
+/*
+ * One or more of the caps bits passed to the callback are incorrect.
+ */
+#define DDERR_INVALIDCAPS                      MAKE_DDHRESULT( 100 )
+
+/*
+ * DirectDraw does not support provided Cliplist.
+ */
+#define DDERR_INVALIDCLIPLIST                  MAKE_DDHRESULT( 110 )
+
+/*
+ * DirectDraw does not support the requested mode
+ */
+#define DDERR_INVALIDMODE                      MAKE_DDHRESULT( 120 )
+
+/*
+ * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
+ */
+#define DDERR_INVALIDOBJECT                    MAKE_DDHRESULT( 130 )
+
+/*
+ * One or more of the parameters passed to the callback function are
+ * incorrect.
+ */
+#define DDERR_INVALIDPARAMS                    E_INVALIDARG
+
+/*
+ * pixel format was invalid as specified
+ */
+#define DDERR_INVALIDPIXELFORMAT               MAKE_DDHRESULT( 145 )
+
+/*
+ * Rectangle provided was invalid.
+ */
+#define DDERR_INVALIDRECT                      MAKE_DDHRESULT( 150 )
+
+/*
+ * Operation could not be carried out because one or more surfaces are locked
+ */
+#define DDERR_LOCKEDSURFACES                   MAKE_DDHRESULT( 160 )
+
+/*
+ * There is no 3D present.
+ */
+#define DDERR_NO3D                             MAKE_DDHRESULT( 170 )
+
+/*
+ * Operation could not be carried out because there is no alpha accleration
+ * hardware present or available.
+ */
+#define DDERR_NOALPHAHW                                MAKE_DDHRESULT( 180 )
+
+
+/*
+ * no clip list available
+ */
+#define DDERR_NOCLIPLIST                       MAKE_DDHRESULT( 205 )
+
+/*
+ * Operation could not be carried out because there is no color conversion
+ * hardware present or available.
+ */
+#define DDERR_NOCOLORCONVHW                    MAKE_DDHRESULT( 210 )
+
+/*
+ * Create function called without DirectDraw object method SetCooperativeLevel
+ * being called.
+ */
+#define DDERR_NOCOOPERATIVELEVELSET            MAKE_DDHRESULT( 212 )
+
+/*
+ * Surface doesn't currently have a color key
+ */
+#define DDERR_NOCOLORKEY                       MAKE_DDHRESULT( 215 )
+
+/*
+ * Operation could not be carried out because there is no hardware support
+ * of the dest color key.
+ */
+#define DDERR_NOCOLORKEYHW                     MAKE_DDHRESULT( 220 )
+
+/*
+ * No DirectDraw support possible with current display driver
+ */
+#define DDERR_NODIRECTDRAWSUPPORT              MAKE_DDHRESULT( 222 )
+
+/*
+ * Operation requires the application to have exclusive mode but the
+ * application does not have exclusive mode.
+ */
+#define DDERR_NOEXCLUSIVEMODE                  MAKE_DDHRESULT( 225 )
+
+/*
+ * Flipping visible surfaces is not supported.
+ */
+#define DDERR_NOFLIPHW                         MAKE_DDHRESULT( 230 )
+
+/*
+ * There is no GDI present.
+ */
+#define DDERR_NOGDI                            MAKE_DDHRESULT( 240 )
+
+/*
+ * Operation could not be carried out because there is no hardware present
+ * or available.
+ */
+#define DDERR_NOMIRRORHW                       MAKE_DDHRESULT( 250 )
+
+/*
+ * Requested item was not found
+ */
+#define DDERR_NOTFOUND                         MAKE_DDHRESULT( 255 )
+
+/*
+ * Operation could not be carried out because there is no overlay hardware
+ * present or available.
+ */
+#define DDERR_NOOVERLAYHW                      MAKE_DDHRESULT( 260 )
+
+/*
+ * Operation could not be carried out because the source and destination
+ * rectangles are on the same surface and overlap each other.
+ */
+#define DDERR_OVERLAPPINGRECTS                 MAKE_DDHRESULT( 270 )
+
+/*
+ * Operation could not be carried out because there is no appropriate raster
+ * op hardware present or available.
+ */
+#define DDERR_NORASTEROPHW                     MAKE_DDHRESULT( 280 )
+
+/*
+ * Operation could not be carried out because there is no rotation hardware
+ * present or available.
+ */
+#define DDERR_NOROTATIONHW                     MAKE_DDHRESULT( 290 )
+
+/*
+ * Operation could not be carried out because there is no hardware support
+ * for stretching
+ */
+#define DDERR_NOSTRETCHHW                      MAKE_DDHRESULT( 310 )
+
+/*
+ * DirectDrawSurface is not in 4 bit color palette and the requested operation
+ * requires 4 bit color palette.
+ */
+#define DDERR_NOT4BITCOLOR                     MAKE_DDHRESULT( 316 )
+
+/*
+ * DirectDrawSurface is not in 4 bit color index palette and the requested
+ * operation requires 4 bit color index palette.
+ */
+#define DDERR_NOT4BITCOLORINDEX                        MAKE_DDHRESULT( 317 )
+
+/*
+ * DirectDraw Surface is not in 8 bit color mode and the requested operation
+ * requires 8 bit color.
+ */
+#define DDERR_NOT8BITCOLOR                     MAKE_DDHRESULT( 320 )
+
+/*
+ * Operation could not be carried out because there is no texture mapping
+ * hardware present or available.
+ */
+#define DDERR_NOTEXTUREHW                      MAKE_DDHRESULT( 330 )
+
+/*
+ * Operation could not be carried out because there is no hardware support
+ * for vertical blank synchronized operations.
+ */
+#define DDERR_NOVSYNCHW                                MAKE_DDHRESULT( 335 )
+
+/*
+ * Operation could not be carried out because there is no hardware support
+ * for zbuffer blting.
+ */
+#define DDERR_NOZBUFFERHW                      MAKE_DDHRESULT( 340 )
+
+/*
+ * Overlay surfaces could not be z layered based on their BltOrder because
+ * the hardware does not support z layering of overlays.
+ */
+#define DDERR_NOZOVERLAYHW                     MAKE_DDHRESULT( 350 )
+
+/*
+ * The hardware needed for the requested operation has already been
+ * allocated.
+ */
+#define DDERR_OUTOFCAPS                                MAKE_DDHRESULT( 360 )
+
+/*
+ * DirectDraw does not have enough memory to perform the operation.
+ */
+#define DDERR_OUTOFMEMORY                      E_OUTOFMEMORY
+
+/*
+ * DirectDraw does not have enough memory to perform the operation.
+ */
+#define DDERR_OUTOFVIDEOMEMORY                 MAKE_DDHRESULT( 380 )
+
+/*
+ * hardware does not support clipped overlays
+ */
+#define DDERR_OVERLAYCANTCLIP                  MAKE_DDHRESULT( 382 )
+
+/*
+ * Can only have ony color key active at one time for overlays
+ */
+#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE     MAKE_DDHRESULT( 384 )
+
+/*
+ * Access to this palette is being refused because the palette is already
+ * locked by another thread.
+ */
+#define DDERR_PALETTEBUSY                      MAKE_DDHRESULT( 387 )
+
+/*
+ * No src color key specified for this operation.
+ */
+#define DDERR_COLORKEYNOTSET                   MAKE_DDHRESULT( 400 )
+
+/*
+ * This surface is already attached to the surface it is being attached to.
+ */
+#define DDERR_SURFACEALREADYATTACHED           MAKE_DDHRESULT( 410 )
+
+/*
+ * This surface is already a dependency of the surface it is being made a
+ * dependency of.
+ */
+#define DDERR_SURFACEALREADYDEPENDENT          MAKE_DDHRESULT( 420 )
+
+/*
+ * Access to this surface is being refused because the surface is already
+ * locked by another thread.
+ */
+#define DDERR_SURFACEBUSY                      MAKE_DDHRESULT( 430 )
+
+/*
+ * Access to this surface is being refused because no driver exists
+ * which can supply a pointer to the surface.
+ * This is most likely to happen when attempting to lock the primary
+ * surface when no DCI provider is present.
+ * Will also happen on attempts to lock an optimized surface.
+ */
+#define DDERR_CANTLOCKSURFACE                   MAKE_DDHRESULT( 435 )
+
+/*
+ * Access to Surface refused because Surface is obscured.
+ */
+#define DDERR_SURFACEISOBSCURED                        MAKE_DDHRESULT( 440 )
+
+/*
+ * Access to this surface is being refused because the surface is gone.
+ * The DIRECTDRAWSURFACE object representing this surface should
+ * have Restore called on it.
+ */
+#define DDERR_SURFACELOST                      MAKE_DDHRESULT( 450 )
+
+/*
+ * The requested surface is not attached.
+ */
+#define DDERR_SURFACENOTATTACHED               MAKE_DDHRESULT( 460 )
+
+/*
+ * Height requested by DirectDraw is too large.
+ */
+#define DDERR_TOOBIGHEIGHT                     MAKE_DDHRESULT( 470 )
+
+/*
+ * Size requested by DirectDraw is too large --         The individual height and
+ * width are OK.
+ */
+#define DDERR_TOOBIGSIZE                       MAKE_DDHRESULT( 480 )
+
+/*
+ * Width requested by DirectDraw is too large.
+ */
+#define DDERR_TOOBIGWIDTH                      MAKE_DDHRESULT( 490 )
+
+/*
+ * Action not supported.
+ */
+#define DDERR_UNSUPPORTED                      E_NOTIMPL
+
+/*
+ * FOURCC format requested is unsupported by DirectDraw
+ */
+#define DDERR_UNSUPPORTEDFORMAT                        MAKE_DDHRESULT( 510 )
+
+/*
+ * Bitmask in the pixel format requested is unsupported by DirectDraw
+ */
+#define DDERR_UNSUPPORTEDMASK                  MAKE_DDHRESULT( 520 )
+
+/*
+ * The specified stream contains invalid data
+ */
+#define DDERR_INVALIDSTREAM                     MAKE_DDHRESULT( 521 )
+
+/*
+ * vertical blank is in progress
+ */
+#define DDERR_VERTICALBLANKINPROGRESS          MAKE_DDHRESULT( 537 )
+
+/*
+ * Informs DirectDraw that the previous Blt which is transfering information
+ * to or from this Surface is incomplete.
+ */
+#define DDERR_WASSTILLDRAWING                  MAKE_DDHRESULT( 540 )
+
+
+/*
+ * Rectangle provided was not horizontally aligned on reqd. boundary
+ */
+#define DDERR_XALIGN                           MAKE_DDHRESULT( 560 )
+
+/*
+ * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
+ * identifier.
+ */
+#define DDERR_INVALIDDIRECTDRAWGUID            MAKE_DDHRESULT( 561 )
+
+/*
+ * A DirectDraw object representing this driver has already been created
+ * for this process.
+ */
+#define DDERR_DIRECTDRAWALREADYCREATED         MAKE_DDHRESULT( 562 )
+
+/*
+ * A hardware only DirectDraw object creation was attempted but the driver
+ * did not support any hardware.
+ */
+#define DDERR_NODIRECTDRAWHW                   MAKE_DDHRESULT( 563 )
+
+/*
+ * this process already has created a primary surface
+ */
+#define DDERR_PRIMARYSURFACEALREADYEXISTS      MAKE_DDHRESULT( 564 )
+
+/*
+ * software emulation not available.
+ */
+#define DDERR_NOEMULATION                      MAKE_DDHRESULT( 565 )
+
+/*
+ * region passed to Clipper::GetClipList is too small.
+ */
+#define DDERR_REGIONTOOSMALL                   MAKE_DDHRESULT( 566 )
+
+/*
+ * an attempt was made to set a clip list for a clipper objec that
+ * is already monitoring an hwnd.
+ */
+#define DDERR_CLIPPERISUSINGHWND               MAKE_DDHRESULT( 567 )
+
+/*
+ * No clipper object attached to surface object
+ */
+#define DDERR_NOCLIPPERATTACHED                        MAKE_DDHRESULT( 568 )
+
+/*
+ * Clipper notification requires an HWND or
+ * no HWND has previously been set as the CooperativeLevel HWND.
+ */
+#define DDERR_NOHWND                           MAKE_DDHRESULT( 569 )
+
+/*
+ * HWND used by DirectDraw CooperativeLevel has been subclassed,
+ * this prevents DirectDraw from restoring state.
+ */
+#define DDERR_HWNDSUBCLASSED                   MAKE_DDHRESULT( 570 )
+
+/*
+ * The CooperativeLevel HWND has already been set.
+ * It can not be reset while the process has surfaces or palettes created.
+ */
+#define DDERR_HWNDALREADYSET                   MAKE_DDHRESULT( 571 )
+
+/*
+ * No palette object attached to this surface.
+ */
+#define DDERR_NOPALETTEATTACHED                        MAKE_DDHRESULT( 572 )
+
+/*
+ * No hardware support for 16 or 256 color palettes.
+ */
+#define DDERR_NOPALETTEHW                      MAKE_DDHRESULT( 573 )
+
+/*
+ * If a clipper object is attached to the source surface passed into a
+ * BltFast call.
+ */
+#define DDERR_BLTFASTCANTCLIP                  MAKE_DDHRESULT( 574 )
+
+/*
+ * No blter.
+ */
+#define DDERR_NOBLTHW                          MAKE_DDHRESULT( 575 )
+
+/*
+ * No DirectDraw ROP hardware.
+ */
+#define DDERR_NODDROPSHW                       MAKE_DDHRESULT( 576 )
+
+/*
+ * returned when GetOverlayPosition is called on a hidden overlay
+ */
+#define DDERR_OVERLAYNOTVISIBLE                        MAKE_DDHRESULT( 577 )
+
+/*
+ * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
+ * has never been called on to establish a destionation.
+ */
+#define DDERR_NOOVERLAYDEST                    MAKE_DDHRESULT( 578 )
+
+/*
+ * returned when the position of the overlay on the destionation is no longer
+ * legal for that destionation.
+ */
+#define DDERR_INVALIDPOSITION                  MAKE_DDHRESULT( 579 )
+
+/*
+ * returned when an overlay member is called for a non-overlay surface
+ */
+#define DDERR_NOTAOVERLAYSURFACE               MAKE_DDHRESULT( 580 )
+
+/*
+ * An attempt was made to set the cooperative level when it was already
+ * set to exclusive.
+ */
+#define DDERR_EXCLUSIVEMODEALREADYSET          MAKE_DDHRESULT( 581 )
+
+/*
+ * An attempt has been made to flip a surface that is not flippable.
+ */
+#define DDERR_NOTFLIPPABLE                     MAKE_DDHRESULT( 582 )
+
+/*
+ * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
+ * created.
+ */
+#define DDERR_CANTDUPLICATE                    MAKE_DDHRESULT( 583 )
+
+/*
+ * Surface was not locked.  An attempt to unlock a surface that was not
+ * locked at all, or by this process, has been attempted.
+ */
+#define DDERR_NOTLOCKED                                MAKE_DDHRESULT( 584 )
+
+/*
+ * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
+ * surface when the surface had no palette AND the display mode was not palette-indexed
+ * (in this case DirectDraw cannot select a proper palette into the DC)
+ */
+#define DDERR_CANTCREATEDC                     MAKE_DDHRESULT( 585 )
+
+/*
+ * No DC was ever created for this surface.
+ */
+#define DDERR_NODC                             MAKE_DDHRESULT( 586 )
+
+/*
+ * This surface can not be restored because it was created in a different
+ * mode.
+ */
+#define DDERR_WRONGMODE                                MAKE_DDHRESULT( 587 )
+
+/*
+ * This surface can not be restored because it is an implicitly created
+ * surface.
+ */
+#define DDERR_IMPLICITLYCREATED                        MAKE_DDHRESULT( 588 )
+
+/*
+ * The surface being used is not a palette-based surface
+ */
+#define DDERR_NOTPALETTIZED                    MAKE_DDHRESULT( 589 )
+
+
+/*
+ * The display is currently in an unsupported mode
+ */
+#define DDERR_UNSUPPORTEDMODE                  MAKE_DDHRESULT( 590 )
+
+/*
+ * Operation could not be carried out because there is no mip-map
+ * texture mapping hardware present or available.
+ */
+#define DDERR_NOMIPMAPHW                       MAKE_DDHRESULT( 591 )
+
+/*
+ * The requested action could not be performed because the surface was of
+ * the wrong type.
+ */
+#define DDERR_INVALIDSURFACETYPE                MAKE_DDHRESULT( 592 )
+
+
+
+/*
+ * Device does not support optimized surfaces, therefore no video memory optimized surfaces
+ */
+#define DDERR_NOOPTIMIZEHW                      MAKE_DDHRESULT( 600 )
+
+/*
+ * Surface is an optimized surface, but has not yet been allocated any memory
+ */
+#define DDERR_NOTLOADED                         MAKE_DDHRESULT( 601 )
+
+/*
+ * Attempt was made to create or set a device window without first setting
+ * the focus window
+ */
+#define DDERR_NOFOCUSWINDOW                     MAKE_DDHRESULT( 602 )
+
+/*
+ * A DC has already been returned for this surface. Only one DC can be
+ * retrieved per surface.
+ */
+#define DDERR_DCALREADYCREATED                 MAKE_DDHRESULT( 620 )
+
+/*
+ * An attempt was made to allocate non-local video memory from a device
+ * that does not support non-local video memory.
+ */
+#define DDERR_NONONLOCALVIDMEM                  MAKE_DDHRESULT( 630 )
+
+/*
+ * The attempt to page lock a surface failed.
+ */
+#define DDERR_CANTPAGELOCK                     MAKE_DDHRESULT( 640 )
+
+
+/*
+ * The attempt to page unlock a surface failed.
+ */
+#define DDERR_CANTPAGEUNLOCK                   MAKE_DDHRESULT( 660 )
+
+/*
+ * An attempt was made to page unlock a surface with no outstanding page locks.
+ */
+#define DDERR_NOTPAGELOCKED                    MAKE_DDHRESULT( 680 )
+
+/*
+ * There is more data available than the specified buffer size could hold
+ */
+#define DDERR_MOREDATA                                 MAKE_DDHRESULT( 690 )
+
+/*
+ * The data has expired and is therefore no longer valid.
+ */
+#define DDERR_EXPIRED                           MAKE_DDHRESULT( 691 )
+
+/*
+ * The video port is not active
+ */
+#define DDERR_VIDEONOTACTIVE                           MAKE_DDHRESULT( 695 )
+
+/*
+ * Surfaces created by one direct draw device cannot be used directly by
+ * another direct draw device.
+ */
+#define DDERR_DEVICEDOESNTOWNSURFACE                   MAKE_DDHRESULT( 699 )
+
+
+/*
+ * An attempt was made to invoke an interface member of a DirectDraw object
+ * created by CoCreateInstance() before it was initialized.
+ */
+#define DDERR_NOTINITIALIZED                    CO_E_NOTINITIALIZED
+
+
+/* Alpha bit depth constants */
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
+
diff --git a/misc/builddeps/dp.win32/include/dinput.h b/misc/builddeps/dp.win32/include/dinput.h
new file mode 100644 (file)
index 0000000..5bf9f5a
--- /dev/null
@@ -0,0 +1,1849 @@
+/****************************************************************************
+ *
+ *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
+ *
+ *  File:       dinput.h
+ *  Content:    DirectInput include file
+ *
+ ****************************************************************************/
+
+#ifndef __DINPUT_INCLUDED__
+#define __DINPUT_INCLUDED__
+
+#ifndef DIJ_RINGZERO
+
+#ifdef _WIN32
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#endif
+
+#endif /* DIJ_RINGZERO */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef DIRECTINPUT_VERSION
+#define DIRECTINPUT_VERSION         0x0500
+#endif
+
+#ifndef DIJ_RINGZERO
+/****************************************************************************
+ *
+ *      Class IDs
+ *
+ ****************************************************************************/
+
+DEFINE_GUID(CLSID_DirectInput,      0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(CLSID_DirectInputDevice,0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+/****************************************************************************
+ *
+ *      Interfaces
+ *
+ ****************************************************************************/
+
+DEFINE_GUID(IID_IDirectInputA,     0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInputW,     0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInput2A,    0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInput2W,    0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+DEFINE_GUID(IID_IDirectInputEffect,  0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+
+/****************************************************************************
+ *
+ *      Predefined object types
+ *
+ ****************************************************************************/
+
+DEFINE_GUID(GUID_XAxis,   0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_YAxis,   0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_ZAxis,   0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_RxAxis,  0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_RyAxis,  0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_RzAxis,  0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_Slider,  0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+DEFINE_GUID(GUID_Button,  0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_Key,     0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+DEFINE_GUID(GUID_POV,     0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+/****************************************************************************
+ *
+ *      Predefined product GUIDs
+ *
+ ****************************************************************************/
+
+DEFINE_GUID(GUID_SysMouse,   0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+DEFINE_GUID(GUID_Joystick   ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
+
+/****************************************************************************
+ *
+ *      Predefined force feedback effects
+ *
+ ****************************************************************************/
+
+DEFINE_GUID(GUID_ConstantForce,0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_RampForce,    0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Square,       0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Sine,         0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Triangle,     0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_SawtoothUp,   0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Spring,       0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Damper,       0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Inertia,      0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_Friction,     0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+DEFINE_GUID(GUID_CustomForce,  0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
+
+
+#endif /* DIJ_RINGZERO */
+
+/****************************************************************************
+ *
+ *      Interfaces and Structures...
+ *
+ ****************************************************************************/
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+
+/****************************************************************************
+ *
+ *      IDirectInputEffect
+ *
+ ****************************************************************************/
+
+#define DIEFT_ALL                   0x00000000
+
+#define DIEFT_CONSTANTFORCE         0x00000001
+#define DIEFT_RAMPFORCE             0x00000002
+#define DIEFT_PERIODIC              0x00000003
+#define DIEFT_CONDITION             0x00000004
+#define DIEFT_CUSTOMFORCE           0x00000005
+#define DIEFT_HARDWARE              0x000000FF
+
+#define DIEFT_FFATTACK              0x00000200
+#define DIEFT_FFFADE                0x00000400
+#define DIEFT_SATURATION            0x00000800
+#define DIEFT_POSNEGCOEFFICIENTS    0x00001000
+#define DIEFT_POSNEGSATURATION      0x00002000
+#define DIEFT_DEADBAND              0x00004000
+
+#define DIEFT_GETTYPE(n)            LOBYTE(n)
+
+#define DI_DEGREES                  100
+#define DI_FFNOMINALMAX             10000
+#define DI_SECONDS                  1000000
+
+typedef struct DICONSTANTFORCE {
+    LONG  lMagnitude;
+} DICONSTANTFORCE, *LPDICONSTANTFORCE;
+typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
+
+typedef struct DIRAMPFORCE {
+    LONG  lStart;
+    LONG  lEnd;
+} DIRAMPFORCE, *LPDIRAMPFORCE;
+typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
+
+typedef struct DIPERIODIC {
+    DWORD dwMagnitude;
+    LONG  lOffset;
+    DWORD dwPhase;
+    DWORD dwPeriod;
+} DIPERIODIC, *LPDIPERIODIC;
+typedef const DIPERIODIC *LPCDIPERIODIC;
+
+typedef struct DICONDITION {
+    LONG  lOffset;
+    LONG  lPositiveCoefficient;
+    LONG  lNegativeCoefficient;
+    DWORD dwPositiveSaturation;
+    DWORD dwNegativeSaturation;
+    LONG  lDeadBand;
+} DICONDITION, *LPDICONDITION;
+typedef const DICONDITION *LPCDICONDITION;
+
+typedef struct DICUSTOMFORCE {
+    DWORD cChannels;
+    DWORD dwSamplePeriod;
+    DWORD cSamples;
+    LPLONG rglForceData;
+} DICUSTOMFORCE, *LPDICUSTOMFORCE;
+typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
+
+typedef struct DIENVELOPE {
+    DWORD dwSize;                   /* sizeof(DIENVELOPE)   */
+    DWORD dwAttackLevel;
+    DWORD dwAttackTime;             /* Microseconds         */
+    DWORD dwFadeLevel;
+    DWORD dwFadeTime;               /* Microseconds         */
+} DIENVELOPE, *LPDIENVELOPE;
+typedef const DIENVELOPE *LPCDIENVELOPE;
+
+typedef struct DIEFFECT {
+    DWORD dwSize;                   /* sizeof(DIEFFECT)     */
+    DWORD dwFlags;                  /* DIEFF_*              */
+    DWORD dwDuration;               /* Microseconds         */
+    DWORD dwSamplePeriod;           /* Microseconds         */
+    DWORD dwGain;
+    DWORD dwTriggerButton;          /* or DIEB_NOTRIGGER    */
+    DWORD dwTriggerRepeatInterval;  /* Microseconds         */
+    DWORD cAxes;                    /* Number of axes       */
+    LPDWORD rgdwAxes;               /* Array of axes        */
+    LPLONG rglDirection;            /* Array of directions  */
+    LPDIENVELOPE lpEnvelope;        /* Optional             */
+    DWORD cbTypeSpecificParams;     /* Size of params       */
+    LPVOID lpvTypeSpecificParams;   /* Pointer to params    */
+} DIEFFECT, *LPDIEFFECT;
+typedef const DIEFFECT *LPCDIEFFECT;
+
+#define DIEFF_OBJECTIDS             0x00000001
+#define DIEFF_OBJECTOFFSETS         0x00000002
+#define DIEFF_CARTESIAN             0x00000010
+#define DIEFF_POLAR                 0x00000020
+#define DIEFF_SPHERICAL             0x00000040
+
+#define DIEP_DURATION               0x00000001
+#define DIEP_SAMPLEPERIOD           0x00000002
+#define DIEP_GAIN                   0x00000004
+#define DIEP_TRIGGERBUTTON          0x00000008
+#define DIEP_TRIGGERREPEATINTERVAL  0x00000010
+#define DIEP_AXES                   0x00000020
+#define DIEP_DIRECTION              0x00000040
+#define DIEP_ENVELOPE               0x00000080
+#define DIEP_TYPESPECIFICPARAMS     0x00000100
+#define DIEP_ALLPARAMS              0x000001FF
+#define DIEP_START                  0x20000000
+#define DIEP_NORESTART              0x40000000
+#define DIEP_NODOWNLOAD             0x80000000
+#define DIEB_NOTRIGGER              0xFFFFFFFF
+
+#define DIES_SOLO                   0x00000001
+#define DIES_NODOWNLOAD             0x80000000
+
+#define DIEGES_PLAYING              0x00000001
+#define DIEGES_EMULATED             0x00000002
+
+typedef struct DIEFFESCAPE {
+    DWORD   dwSize;
+    DWORD   dwCommand;
+    LPVOID  lpvInBuffer;
+    DWORD   cbInBuffer;
+    LPVOID  lpvOutBuffer;
+    DWORD   cbOutBuffer;
+} DIEFFESCAPE, *LPDIEFFESCAPE;
+
+#ifndef DIJ_RINGZERO
+
+#undef INTERFACE
+#define INTERFACE IDirectInputEffect
+
+DECLARE_INTERFACE_(IDirectInputEffect, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputEffect methods ***/
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
+    STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE;
+    STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE;
+    STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE;
+    STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE;
+    STDMETHOD(Stop)(THIS) PURE;
+    STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE;
+    STDMETHOD(Download)(THIS) PURE;
+    STDMETHOD(Unload)(THIS) PURE;
+    STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
+};
+
+typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p)
+#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
+#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a)
+#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b)
+#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b)
+#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b)
+#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a)
+#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p)
+#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p)
+#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a)
+#else
+#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectInputEffect_AddRef(p) (p)->AddRef()
+#define IDirectInputEffect_Release(p) (p)->Release()
+#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
+#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a)
+#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b)
+#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b)
+#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b)
+#define IDirectInputEffect_Stop(p) (p)->Stop()
+#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a)
+#define IDirectInputEffect_Download(p) (p)->Download()
+#define IDirectInputEffect_Unload(p) (p)->Unload()
+#define IDirectInputEffect_Escape(p,a) (p)->Escape(a)
+#endif
+
+#endif /* DIJ_RINGZERO */
+
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+/****************************************************************************
+ *
+ *      IDirectInputDevice
+ *
+ ****************************************************************************/
+
+#define DIDEVTYPE_DEVICE    1
+#define DIDEVTYPE_MOUSE     2
+#define DIDEVTYPE_KEYBOARD  3
+#define DIDEVTYPE_JOYSTICK  4
+#define DIDEVTYPE_HID       0x00010000
+
+#define DIDEVTYPEMOUSE_UNKNOWN          1
+#define DIDEVTYPEMOUSE_TRADITIONAL      2
+#define DIDEVTYPEMOUSE_FINGERSTICK      3
+#define DIDEVTYPEMOUSE_TOUCHPAD         4
+#define DIDEVTYPEMOUSE_TRACKBALL        5
+
+#define DIDEVTYPEKEYBOARD_UNKNOWN       0
+#define DIDEVTYPEKEYBOARD_PCXT          1
+#define DIDEVTYPEKEYBOARD_OLIVETTI      2
+#define DIDEVTYPEKEYBOARD_PCAT          3
+#define DIDEVTYPEKEYBOARD_PCENH         4
+#define DIDEVTYPEKEYBOARD_NOKIA1050     5
+#define DIDEVTYPEKEYBOARD_NOKIA9140     6
+#define DIDEVTYPEKEYBOARD_NEC98         7
+#define DIDEVTYPEKEYBOARD_NEC98LAPTOP   8
+#define DIDEVTYPEKEYBOARD_NEC98106      9
+#define DIDEVTYPEKEYBOARD_JAPAN106     10
+#define DIDEVTYPEKEYBOARD_JAPANAX      11
+#define DIDEVTYPEKEYBOARD_J3100        12
+
+#define DIDEVTYPEJOYSTICK_UNKNOWN       1
+#define DIDEVTYPEJOYSTICK_TRADITIONAL   2
+#define DIDEVTYPEJOYSTICK_FLIGHTSTICK   3
+#define DIDEVTYPEJOYSTICK_GAMEPAD       4
+#define DIDEVTYPEJOYSTICK_RUDDER        5
+#define DIDEVTYPEJOYSTICK_WHEEL         6
+#define DIDEVTYPEJOYSTICK_HEADTRACKER   7
+
+#define GET_DIDEVICE_TYPE(dwDevType)    LOBYTE(dwDevType)
+#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+/* This structure is defined for DirectX 3.0 compatibility */
+
+typedef struct DIDEVCAPS_DX3 {
+    DWORD   dwSize;
+    DWORD   dwFlags;
+    DWORD   dwDevType;
+    DWORD   dwAxes;
+    DWORD   dwButtons;
+    DWORD   dwPOVs;
+} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+typedef struct DIDEVCAPS {
+    DWORD   dwSize;
+    DWORD   dwFlags;
+    DWORD   dwDevType;
+    DWORD   dwAxes;
+    DWORD   dwButtons;
+    DWORD   dwPOVs;
+#if(DIRECTINPUT_VERSION >= 0x0500)
+    DWORD   dwFFSamplePeriod;
+    DWORD   dwFFMinTimeResolution;
+    DWORD   dwFirmwareRevision;
+    DWORD   dwHardwareRevision;
+    DWORD   dwFFDriverVersion;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+} DIDEVCAPS, *LPDIDEVCAPS;
+
+#define DIDC_ATTACHED           0x00000001
+#define DIDC_POLLEDDEVICE       0x00000002
+#define DIDC_EMULATED           0x00000004
+#define DIDC_POLLEDDATAFORMAT   0x00000008
+#if(DIRECTINPUT_VERSION >= 0x0500)
+#define DIDC_FORCEFEEDBACK      0x00000100
+#define DIDC_FFATTACK           0x00000200
+#define DIDC_FFFADE             0x00000400
+#define DIDC_SATURATION         0x00000800
+#define DIDC_POSNEGCOEFFICIENTS 0x00001000
+#define DIDC_POSNEGSATURATION   0x00002000
+#define DIDC_DEADBAND           0x00004000
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+#define DIDFT_ALL           0x00000000
+
+#define DIDFT_RELAXIS       0x00000001
+#define DIDFT_ABSAXIS       0x00000002
+#define DIDFT_AXIS          0x00000003
+
+#define DIDFT_PSHBUTTON     0x00000004
+#define DIDFT_TGLBUTTON     0x00000008
+#define DIDFT_BUTTON        0x0000000C
+
+#define DIDFT_POV           0x00000010
+
+#define DIDFT_COLLECTION    0x00000040
+#define DIDFT_NODATA        0x00000080
+
+#define DIDFT_ANYINSTANCE   0x00FFFF00
+#define DIDFT_INSTANCEMASK  DIDFT_ANYINSTANCE
+#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
+#define DIDFT_GETTYPE(n)     LOBYTE(n)
+#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
+#define DIDFT_FFACTUATOR        0x01000000
+#define DIDFT_FFEFFECTTRIGGER   0x02000000
+
+#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
+#define DIDFT_NOCOLLECTION      0x00FFFF00
+
+
+#ifndef DIJ_RINGZERO
+
+typedef struct _DIOBJECTDATAFORMAT {
+    const GUID *pguid;
+    DWORD   dwOfs;
+    DWORD   dwType;
+    DWORD   dwFlags;
+} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
+typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
+
+typedef struct _DIDATAFORMAT {
+    DWORD   dwSize;
+    DWORD   dwObjSize;
+    DWORD   dwFlags;
+    DWORD   dwDataSize;
+    DWORD   dwNumObjs;
+    LPDIOBJECTDATAFORMAT rgodf;
+} DIDATAFORMAT, *LPDIDATAFORMAT;
+typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
+
+#define DIDF_ABSAXIS            0x00000001
+#define DIDF_RELAXIS            0x00000002
+
+extern const DIDATAFORMAT c_dfDIMouse;
+extern const DIDATAFORMAT c_dfDIKeyboard;
+extern const DIDATAFORMAT c_dfDIJoystick;
+extern const DIDATAFORMAT c_dfDIJoystick2;
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+/* These structures are defined for DirectX 3.0 compatibility */
+
+typedef struct DIDEVICEOBJECTINSTANCE_DX3A {
+    DWORD   dwSize;
+    GUID    guidType;
+    DWORD   dwOfs;
+    DWORD   dwType;
+    DWORD   dwFlags;
+    CHAR    tszName[MAX_PATH];
+} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A;
+typedef struct DIDEVICEOBJECTINSTANCE_DX3W {
+    DWORD   dwSize;
+    GUID    guidType;
+    DWORD   dwOfs;
+    DWORD   dwType;
+    DWORD   dwFlags;
+    WCHAR   tszName[MAX_PATH];
+} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W;
+#ifdef UNICODE
+typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3;
+typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3;
+#else
+typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3;
+typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3;
+#endif // UNICODE
+typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
+typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
+typedef const DIDEVICEOBJECTINSTANCE_DX3  *LPCDIDEVICEOBJECTINSTANCE_DX3;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+typedef struct DIDEVICEOBJECTINSTANCEA {
+    DWORD   dwSize;
+    GUID    guidType;
+    DWORD   dwOfs;
+    DWORD   dwType;
+    DWORD   dwFlags;
+    CHAR    tszName[MAX_PATH];
+#if(DIRECTINPUT_VERSION >= 0x0500)
+    DWORD   dwFFMaxForce;
+    DWORD   dwFFForceResolution;
+    WORD    wCollectionNumber;
+    WORD    wDesignatorIndex;
+    WORD    wUsagePage;
+    WORD    wUsage;
+    DWORD   dwDimension;
+    WORD    wExponent;
+    WORD    wReserved;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA;
+typedef struct DIDEVICEOBJECTINSTANCEW {
+    DWORD   dwSize;
+    GUID    guidType;
+    DWORD   dwOfs;
+    DWORD   dwType;
+    DWORD   dwFlags;
+    WCHAR   tszName[MAX_PATH];
+#if(DIRECTINPUT_VERSION >= 0x0500)
+    DWORD   dwFFMaxForce;
+    DWORD   dwFFForceResolution;
+    WORD    wCollectionNumber;
+    WORD    wDesignatorIndex;
+    WORD    wUsagePage;
+    WORD    wUsage;
+    DWORD   dwDimension;
+    WORD    wExponent;
+    WORD    wReserved;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW;
+#ifdef UNICODE
+typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE;
+typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE;
+#else
+typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE;
+typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE;
+#endif // UNICODE
+typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
+typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
+typedef const DIDEVICEOBJECTINSTANCE  *LPCDIDEVICEOBJECTINSTANCE;
+
+typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
+typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID);
+#ifdef UNICODE
+#define LPDIENUMDEVICEOBJECTSCALLBACK  LPDIENUMDEVICEOBJECTSCALLBACKW
+#else
+#define LPDIENUMDEVICEOBJECTSCALLBACK  LPDIENUMDEVICEOBJECTSCALLBACKA
+#endif // !UNICODE
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+#define DIDOI_FFACTUATOR        0x00000001
+#define DIDOI_FFEFFECTTRIGGER   0x00000002
+#define DIDOI_POLLED            0x00008000
+#define DIDOI_ASPECTPOSITION    0x00000100
+#define DIDOI_ASPECTVELOCITY    0x00000200
+#define DIDOI_ASPECTACCEL       0x00000300
+#define DIDOI_ASPECTFORCE       0x00000400
+#define DIDOI_ASPECTMASK        0x00000F00
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+typedef struct DIPROPHEADER {
+    DWORD   dwSize;
+    DWORD   dwHeaderSize;
+    DWORD   dwObj;
+    DWORD   dwHow;
+} DIPROPHEADER, *LPDIPROPHEADER;
+typedef const DIPROPHEADER *LPCDIPROPHEADER;
+
+#define DIPH_DEVICE             0
+#define DIPH_BYOFFSET           1
+#define DIPH_BYID               2
+
+typedef struct DIPROPDWORD {
+    DIPROPHEADER diph;
+    DWORD   dwData;
+} DIPROPDWORD, *LPDIPROPDWORD;
+typedef const DIPROPDWORD *LPCDIPROPDWORD;
+
+typedef struct DIPROPRANGE {
+    DIPROPHEADER diph;
+    LONG    lMin;
+    LONG    lMax;
+} DIPROPRANGE, *LPDIPROPRANGE;
+typedef const DIPROPRANGE *LPCDIPROPRANGE;
+
+#define DIPROPRANGE_NOMIN       ((LONG)0x80000000)
+#define DIPROPRANGE_NOMAX       ((LONG)0x7FFFFFFF)
+
+#ifdef __cplusplus
+#define MAKEDIPROP(prop)    (*(const GUID *)(prop))
+#else
+#define MAKEDIPROP(prop)    ((REFGUID)(prop))
+#endif
+
+#define DIPROP_BUFFERSIZE       MAKEDIPROP(1)
+
+#define DIPROP_AXISMODE         MAKEDIPROP(2)
+
+#define DIPROPAXISMODE_ABS      0
+#define DIPROPAXISMODE_REL      1
+
+#define DIPROP_GRANULARITY      MAKEDIPROP(3)
+
+#define DIPROP_RANGE            MAKEDIPROP(4)
+
+#define DIPROP_DEADZONE         MAKEDIPROP(5)
+
+#define DIPROP_SATURATION       MAKEDIPROP(6)
+
+#define DIPROP_FFGAIN           MAKEDIPROP(7)
+
+#define DIPROP_FFLOAD           MAKEDIPROP(8)
+
+#define DIPROP_AUTOCENTER       MAKEDIPROP(9)
+
+#define DIPROPAUTOCENTER_OFF    0
+#define DIPROPAUTOCENTER_ON     1
+
+#define DIPROP_CALIBRATIONMODE  MAKEDIPROP(10)
+
+#define DIPROPCALIBRATIONMODE_COOKED    0
+#define DIPROPCALIBRATIONMODE_RAW       1
+
+typedef struct DIDEVICEOBJECTDATA {
+    DWORD   dwOfs;
+    DWORD   dwData;
+    DWORD   dwTimeStamp;
+    DWORD   dwSequence;
+} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;
+typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
+
+#define DIGDD_PEEK          0x00000001
+
+#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
+                        ((int)((dwSequence1) - (dwSequence2)) cmp 0)
+#define DISCL_EXCLUSIVE     0x00000001
+#define DISCL_NONEXCLUSIVE  0x00000002
+#define DISCL_FOREGROUND    0x00000004
+#define DISCL_BACKGROUND    0x00000008
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+/* These structures are defined for DirectX 3.0 compatibility */
+
+typedef struct DIDEVICEINSTANCE_DX3A {
+    DWORD   dwSize;
+    GUID    guidInstance;
+    GUID    guidProduct;
+    DWORD   dwDevType;
+    CHAR    tszInstanceName[MAX_PATH];
+    CHAR    tszProductName[MAX_PATH];
+} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A;
+typedef struct DIDEVICEINSTANCE_DX3W {
+    DWORD   dwSize;
+    GUID    guidInstance;
+    GUID    guidProduct;
+    DWORD   dwDevType;
+    WCHAR   tszInstanceName[MAX_PATH];
+    WCHAR   tszProductName[MAX_PATH];
+} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W;
+#ifdef UNICODE
+typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3;
+typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3;
+#else
+typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3;
+typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3;
+#endif // UNICODE
+typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
+typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
+typedef const DIDEVICEINSTANCE_DX3  *LPCDIDEVICEINSTANCE_DX3;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+typedef struct DIDEVICEINSTANCEA {
+    DWORD   dwSize;
+    GUID    guidInstance;
+    GUID    guidProduct;
+    DWORD   dwDevType;
+    CHAR    tszInstanceName[MAX_PATH];
+    CHAR    tszProductName[MAX_PATH];
+#if(DIRECTINPUT_VERSION >= 0x0500)
+    GUID    guidFFDriver;
+    WORD    wUsagePage;
+    WORD    wUsage;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA;
+typedef struct DIDEVICEINSTANCEW {
+    DWORD   dwSize;
+    GUID    guidInstance;
+    GUID    guidProduct;
+    DWORD   dwDevType;
+    WCHAR   tszInstanceName[MAX_PATH];
+    WCHAR   tszProductName[MAX_PATH];
+#if(DIRECTINPUT_VERSION >= 0x0500)
+    GUID    guidFFDriver;
+    WORD    wUsagePage;
+    WORD    wUsage;
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW;
+#ifdef UNICODE
+typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE;
+typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE;
+#else
+typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE;
+typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE;
+#endif // UNICODE
+typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
+typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
+typedef const DIDEVICEINSTANCE  *LPCDIDEVICEINSTANCE;
+
+#undef INTERFACE
+#define INTERFACE IDirectInputDeviceW
+
+DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputDeviceW methods ***/
+    STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
+    STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
+    STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
+    STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
+    STDMETHOD(Acquire)(THIS) PURE;
+    STDMETHOD(Unacquire)(THIS) PURE;
+    STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
+    STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+    STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
+    STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
+    STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
+};
+
+typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW;
+
+#undef INTERFACE
+#define INTERFACE IDirectInputDeviceA
+
+DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputDeviceA methods ***/
+    STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
+    STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
+    STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
+    STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
+    STDMETHOD(Acquire)(THIS) PURE;
+    STDMETHOD(Unacquire)(THIS) PURE;
+    STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
+    STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+    STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
+    STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
+    STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
+};
+
+typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA;
+
+#ifdef UNICODE
+#define IID_IDirectInputDevice IID_IDirectInputDeviceW
+#define IDirectInputDevice IDirectInputDeviceW
+#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl
+#else
+#define IID_IDirectInputDevice IID_IDirectInputDeviceA
+#define IDirectInputDevice IDirectInputDeviceA
+#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl
+#endif
+typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p)
+#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
+#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
+#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
+#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
+#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p)
+#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p)
+#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
+#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
+#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
+#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
+#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
+#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
+#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
+#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
+#else
+#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectInputDevice_AddRef(p) (p)->AddRef()
+#define IDirectInputDevice_Release(p) (p)->Release()
+#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a)
+#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
+#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b)
+#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b)
+#define IDirectInputDevice_Acquire(p) (p)->Acquire()
+#define IDirectInputDevice_Unacquire(p) (p)->Unacquire()
+#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
+#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
+#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a)
+#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a)
+#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
+#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
+#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
+#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
+#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
+#endif
+
+#endif /* DIJ_RINGZERO */
+
+
+#if(DIRECTINPUT_VERSION >= 0x0500)
+
+#define DISFFC_RESET            0x00000001
+#define DISFFC_STOPALL          0x00000002
+#define DISFFC_PAUSE            0x00000004
+#define DISFFC_CONTINUE         0x00000008
+#define DISFFC_SETACTUATORSON   0x00000010
+#define DISFFC_SETACTUATORSOFF  0x00000020
+
+#define DIGFFS_EMPTY            0x00000001
+#define DIGFFS_STOPPED          0x00000002
+#define DIGFFS_PAUSED           0x00000004
+#define DIGFFS_ACTUATORSON      0x00000010
+#define DIGFFS_ACTUATORSOFF     0x00000020
+#define DIGFFS_POWERON          0x00000040
+#define DIGFFS_POWEROFF         0x00000080
+#define DIGFFS_SAFETYSWITCHON   0x00000100
+#define DIGFFS_SAFETYSWITCHOFF  0x00000200
+#define DIGFFS_USERFFSWITCHON   0x00000400
+#define DIGFFS_USERFFSWITCHOFF  0x00000800
+#define DIGFFS_DEVICELOST       0x80000000
+
+#ifndef DIJ_RINGZERO
+
+typedef struct DIEFFECTINFOA {
+    DWORD   dwSize;
+    GUID    guid;
+    DWORD   dwEffType;
+    DWORD   dwStaticParams;
+    DWORD   dwDynamicParams;
+    CHAR    tszName[MAX_PATH];
+} DIEFFECTINFOA, *LPDIEFFECTINFOA;
+typedef struct DIEFFECTINFOW {
+    DWORD   dwSize;
+    GUID    guid;
+    DWORD   dwEffType;
+    DWORD   dwStaticParams;
+    DWORD   dwDynamicParams;
+    WCHAR   tszName[MAX_PATH];
+} DIEFFECTINFOW, *LPDIEFFECTINFOW;
+#ifdef UNICODE
+typedef DIEFFECTINFOW DIEFFECTINFO;
+typedef LPDIEFFECTINFOW LPDIEFFECTINFO;
+#else
+typedef DIEFFECTINFOA DIEFFECTINFO;
+typedef LPDIEFFECTINFOA LPDIEFFECTINFO;
+#endif // UNICODE
+typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
+typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
+typedef const DIEFFECTINFO  *LPCDIEFFECTINFO;
+
+typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
+typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
+#ifdef UNICODE
+#define LPDIENUMEFFECTSCALLBACK  LPDIENUMEFFECTSCALLBACKW
+#else
+#define LPDIENUMEFFECTSCALLBACK  LPDIENUMEFFECTSCALLBACKA
+#endif // !UNICODE
+typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
+
+#undef INTERFACE
+#define INTERFACE IDirectInputDevice2W
+
+DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputDeviceW methods ***/
+    STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
+    STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
+    STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
+    STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
+    STDMETHOD(Acquire)(THIS) PURE;
+    STDMETHOD(Unacquire)(THIS) PURE;
+    STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
+    STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+    STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
+    STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
+    STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
+
+    /*** IDirectInputDevice2W methods ***/
+    STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
+    STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
+    STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
+    STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
+    STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
+    STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
+    STDMETHOD(Poll)(THIS) PURE;
+    STDMETHOD(SendDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+};
+
+typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W;
+
+#undef INTERFACE
+#define INTERFACE IDirectInputDevice2A
+
+DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputDeviceA methods ***/
+    STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
+    STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
+    STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
+    STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
+    STDMETHOD(Acquire)(THIS) PURE;
+    STDMETHOD(Unacquire)(THIS) PURE;
+    STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
+    STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+    STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
+    STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
+    STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
+
+    /*** IDirectInputDevice2A methods ***/
+    STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
+    STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
+    STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
+    STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
+    STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
+    STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
+    STDMETHOD(Poll)(THIS) PURE;
+    STDMETHOD(SendDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
+};
+
+typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A;
+
+#ifdef UNICODE
+#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W
+#define IDirectInputDevice2 IDirectInputDevice2W
+#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl
+#else
+#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A
+#define IDirectInputDevice2 IDirectInputDevice2A
+#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl
+#endif
+typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
+#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
+#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
+#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
+#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p)
+#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p)
+#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
+#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
+#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
+#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
+#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
+#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
+#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
+#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
+#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
+#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
+#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
+#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
+#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
+#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
+#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a)
+#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p)
+#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
+#else
+#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectInputDevice2_AddRef(p) (p)->AddRef()
+#define IDirectInputDevice2_Release(p) (p)->Release()
+#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a)
+#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
+#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b)
+#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b)
+#define IDirectInputDevice2_Acquire(p) (p)->Acquire()
+#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire()
+#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
+#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
+#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a)
+#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a)
+#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
+#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
+#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
+#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
+#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
+#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
+#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
+#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
+#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
+#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
+#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
+#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a)
+#define IDirectInputDevice2_Poll(p) (p)->Poll()
+#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
+#endif
+
+#endif /* DIJ_RINGZERO */
+
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+/****************************************************************************
+ *
+ *      Mouse
+ *
+ ****************************************************************************/
+
+#ifndef DIJ_RINGZERO
+
+typedef struct _DIMOUSESTATE {
+    LONG    lX;
+    LONG    lY;
+    LONG    lZ;
+    BYTE    rgbButtons[4];
+} DIMOUSESTATE, *LPDIMOUSESTATE;
+
+#define DIMOFS_X        FIELD_OFFSET(DIMOUSESTATE, lX)
+#define DIMOFS_Y        FIELD_OFFSET(DIMOUSESTATE, lY)
+#define DIMOFS_Z        FIELD_OFFSET(DIMOUSESTATE, lZ)
+#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
+#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
+#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
+#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
+
+#endif /* DIJ_RINGZERO */
+
+/****************************************************************************
+ *
+ *      Keyboard
+ *
+ ****************************************************************************/
+
+#ifndef DIJ_RINGZERO
+
+/****************************************************************************
+ *
+ *      DirectInput keyboard scan codes
+ *
+ ****************************************************************************/
+
+#define DIK_ESCAPE          0x01
+#define DIK_1               0x02
+#define DIK_2               0x03
+#define DIK_3               0x04
+#define DIK_4               0x05
+#define DIK_5               0x06
+#define DIK_6               0x07
+#define DIK_7               0x08
+#define DIK_8               0x09
+#define DIK_9               0x0A
+#define DIK_0               0x0B
+#define DIK_MINUS           0x0C    /* - on main keyboard */
+#define DIK_EQUALS          0x0D
+#define DIK_BACK            0x0E    /* backspace */
+#define DIK_TAB             0x0F
+#define DIK_Q               0x10
+#define DIK_W               0x11
+#define DIK_E               0x12
+#define DIK_R               0x13
+#define DIK_T               0x14
+#define DIK_Y               0x15
+#define DIK_U               0x16
+#define DIK_I               0x17
+#define DIK_O               0x18
+#define DIK_P               0x19
+#define DIK_LBRACKET        0x1A
+#define DIK_RBRACKET        0x1B
+#define DIK_RETURN          0x1C    /* Enter on main keyboard */
+#define DIK_LCONTROL        0x1D
+#define DIK_A               0x1E
+#define DIK_S               0x1F
+#define DIK_D               0x20
+#define DIK_F               0x21
+#define DIK_G               0x22
+#define DIK_H               0x23
+#define DIK_J               0x24
+#define DIK_K               0x25
+#define DIK_L               0x26
+#define DIK_SEMICOLON       0x27
+#define DIK_APOSTROPHE      0x28
+#define DIK_GRAVE           0x29    /* accent grave */
+#define DIK_LSHIFT          0x2A
+#define DIK_BACKSLASH       0x2B
+#define DIK_Z               0x2C
+#define DIK_X               0x2D
+#define DIK_C               0x2E
+#define DIK_V               0x2F
+#define DIK_B               0x30
+#define DIK_N               0x31
+#define DIK_M               0x32
+#define DIK_COMMA           0x33
+#define DIK_PERIOD          0x34    /* . on main keyboard */
+#define DIK_SLASH           0x35    /* / on main keyboard */
+#define DIK_RSHIFT          0x36
+#define DIK_MULTIPLY        0x37    /* * on numeric keypad */
+#define DIK_LMENU           0x38    /* left Alt */
+#define DIK_SPACE           0x39
+#define DIK_CAPITAL         0x3A
+#define DIK_F1              0x3B
+#define DIK_F2              0x3C
+#define DIK_F3              0x3D
+#define DIK_F4              0x3E
+#define DIK_F5              0x3F
+#define DIK_F6              0x40
+#define DIK_F7              0x41
+#define DIK_F8              0x42
+#define DIK_F9              0x43
+#define DIK_F10             0x44
+#define DIK_NUMLOCK         0x45
+#define DIK_SCROLL          0x46    /* Scroll Lock */
+#define DIK_NUMPAD7         0x47
+#define DIK_NUMPAD8         0x48
+#define DIK_NUMPAD9         0x49
+#define DIK_SUBTRACT        0x4A    /* - on numeric keypad */
+#define DIK_NUMPAD4         0x4B
+#define DIK_NUMPAD5         0x4C
+#define DIK_NUMPAD6         0x4D
+#define DIK_ADD             0x4E    /* + on numeric keypad */
+#define DIK_NUMPAD1         0x4F
+#define DIK_NUMPAD2         0x50
+#define DIK_NUMPAD3         0x51
+#define DIK_NUMPAD0         0x52
+#define DIK_DECIMAL         0x53    /* . on numeric keypad */
+#define DIK_F11             0x57
+#define DIK_F12             0x58
+
+#define DIK_F13             0x64    /*                     (NEC PC98) */
+#define DIK_F14             0x65    /*                     (NEC PC98) */
+#define DIK_F15             0x66    /*                     (NEC PC98) */
+
+#define DIK_KANA            0x70    /* (Japanese keyboard)            */
+#define DIK_CONVERT         0x79    /* (Japanese keyboard)            */
+#define DIK_NOCONVERT       0x7B    /* (Japanese keyboard)            */
+#define DIK_YEN             0x7D    /* (Japanese keyboard)            */
+#define DIK_NUMPADEQUALS    0x8D    /* = on numeric keypad (NEC PC98) */
+#define DIK_CIRCUMFLEX      0x90    /* (Japanese keyboard)            */
+#define DIK_AT              0x91    /*                     (NEC PC98) */
+#define DIK_COLON           0x92    /*                     (NEC PC98) */
+#define DIK_UNDERLINE       0x93    /*                     (NEC PC98) */
+#define DIK_KANJI           0x94    /* (Japanese keyboard)            */
+#define DIK_STOP            0x95    /*                     (NEC PC98) */
+#define DIK_AX              0x96    /*                     (Japan AX) */
+#define DIK_UNLABELED       0x97    /*                        (J3100) */
+#define DIK_NUMPADENTER     0x9C    /* Enter on numeric keypad */
+#define DIK_RCONTROL        0x9D
+#define DIK_NUMPADCOMMA     0xB3    /* , on numeric keypad (NEC PC98) */
+#define DIK_DIVIDE          0xB5    /* / on numeric keypad */
+#define DIK_SYSRQ           0xB7
+#define DIK_RMENU           0xB8    /* right Alt */
+#define DIK_HOME            0xC7    /* Home on arrow keypad */
+#define DIK_UP              0xC8    /* UpArrow on arrow keypad */
+#define DIK_PRIOR           0xC9    /* PgUp on arrow keypad */
+#define DIK_LEFT            0xCB    /* LeftArrow on arrow keypad */
+#define DIK_RIGHT           0xCD    /* RightArrow on arrow keypad */
+#define DIK_END             0xCF    /* End on arrow keypad */
+#define DIK_DOWN            0xD0    /* DownArrow on arrow keypad */
+#define DIK_NEXT            0xD1    /* PgDn on arrow keypad */
+#define DIK_INSERT          0xD2    /* Insert on arrow keypad */
+#define DIK_DELETE          0xD3    /* Delete on arrow keypad */
+#define DIK_LWIN            0xDB    /* Left Windows key */
+#define DIK_RWIN            0xDC    /* Right Windows key */
+#define DIK_APPS            0xDD    /* AppMenu key */
+
+/*
+ *  Alternate names for keys, to facilitate transition from DOS.
+ */
+#define DIK_BACKSPACE       DIK_BACK            /* backspace */
+#define DIK_NUMPADSTAR      DIK_MULTIPLY        /* * on numeric keypad */
+#define DIK_LALT            DIK_LMENU           /* left Alt */
+#define DIK_CAPSLOCK        DIK_CAPITAL         /* CapsLock */
+#define DIK_NUMPADMINUS     DIK_SUBTRACT        /* - on numeric keypad */
+#define DIK_NUMPADPLUS      DIK_ADD             /* + on numeric keypad */
+#define DIK_NUMPADPERIOD    DIK_DECIMAL         /* . on numeric keypad */
+#define DIK_NUMPADSLASH     DIK_DIVIDE          /* / on numeric keypad */
+#define DIK_RALT            DIK_RMENU           /* right Alt */
+#define DIK_UPARROW         DIK_UP              /* UpArrow on arrow keypad */
+#define DIK_PGUP            DIK_PRIOR           /* PgUp on arrow keypad */
+#define DIK_LEFTARROW       DIK_LEFT            /* LeftArrow on arrow keypad */
+#define DIK_RIGHTARROW      DIK_RIGHT           /* RightArrow on arrow keypad */
+#define DIK_DOWNARROW       DIK_DOWN            /* DownArrow on arrow keypad */
+#define DIK_PGDN            DIK_NEXT            /* PgDn on arrow keypad */
+
+#endif /* DIJ_RINGZERO */
+
+/****************************************************************************
+ *
+ *      Joystick
+ *
+ ****************************************************************************/
+
+#ifndef DIJ_RINGZERO
+
+typedef struct DIJOYSTATE {
+    LONG    lX;                     /* x-axis position              */
+    LONG    lY;                     /* y-axis position              */
+    LONG    lZ;                     /* z-axis position              */
+    LONG    lRx;                    /* x-axis rotation              */
+    LONG    lRy;                    /* y-axis rotation              */
+    LONG    lRz;                    /* z-axis rotation              */
+    LONG    rglSlider[2];           /* extra axes positions         */
+    DWORD   rgdwPOV[4];             /* POV directions               */
+    BYTE    rgbButtons[32];         /* 32 buttons                   */
+} DIJOYSTATE, *LPDIJOYSTATE;
+
+typedef struct DIJOYSTATE2 {
+    LONG    lX;                     /* x-axis position              */
+    LONG    lY;                     /* y-axis position              */
+    LONG    lZ;                     /* z-axis position              */
+    LONG    lRx;                    /* x-axis rotation              */
+    LONG    lRy;                    /* y-axis rotation              */
+    LONG    lRz;                    /* z-axis rotation              */
+    LONG    rglSlider[2];           /* extra axes positions         */
+    DWORD   rgdwPOV[4];             /* POV directions               */
+    BYTE    rgbButtons[128];        /* 128 buttons                  */
+    LONG    lVX;                    /* x-axis velocity              */
+    LONG    lVY;                    /* y-axis velocity              */
+    LONG    lVZ;                    /* z-axis velocity              */
+    LONG    lVRx;                   /* x-axis angular velocity      */
+    LONG    lVRy;                   /* y-axis angular velocity      */
+    LONG    lVRz;                   /* z-axis angular velocity      */
+    LONG    rglVSlider[2];          /* extra axes velocities        */
+    LONG    lAX;                    /* x-axis acceleration          */
+    LONG    lAY;                    /* y-axis acceleration          */
+    LONG    lAZ;                    /* z-axis acceleration          */
+    LONG    lARx;                   /* x-axis angular acceleration  */
+    LONG    lARy;                   /* y-axis angular acceleration  */
+    LONG    lARz;                   /* z-axis angular acceleration  */
+    LONG    rglASlider[2];          /* extra axes accelerations     */
+    LONG    lFX;                    /* x-axis force                 */
+    LONG    lFY;                    /* y-axis force                 */
+    LONG    lFZ;                    /* z-axis force                 */
+    LONG    lFRx;                   /* x-axis torque                */
+    LONG    lFRy;                   /* y-axis torque                */
+    LONG    lFRz;                   /* z-axis torque                */
+    LONG    rglFSlider[2];          /* extra axes forces            */
+} DIJOYSTATE2, *LPDIJOYSTATE2;
+
+#define DIJOFS_X            FIELD_OFFSET(DIJOYSTATE, lX)
+#define DIJOFS_Y            FIELD_OFFSET(DIJOYSTATE, lY)
+#define DIJOFS_Z            FIELD_OFFSET(DIJOYSTATE, lZ)
+#define DIJOFS_RX           FIELD_OFFSET(DIJOYSTATE, lRx)
+#define DIJOFS_RY           FIELD_OFFSET(DIJOYSTATE, lRy)
+#define DIJOFS_RZ           FIELD_OFFSET(DIJOYSTATE, lRz)
+#define DIJOFS_SLIDER(n)   (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
+                                                        (n) * sizeof(LONG))
+#define DIJOFS_POV(n)      (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
+                                                        (n) * sizeof(DWORD))
+#define DIJOFS_BUTTON(n)   (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
+#define DIJOFS_BUTTON0      DIJOFS_BUTTON(0)
+#define DIJOFS_BUTTON1      DIJOFS_BUTTON(1)
+#define DIJOFS_BUTTON2      DIJOFS_BUTTON(2)
+#define DIJOFS_BUTTON3      DIJOFS_BUTTON(3)
+#define DIJOFS_BUTTON4      DIJOFS_BUTTON(4)
+#define DIJOFS_BUTTON5      DIJOFS_BUTTON(5)
+#define DIJOFS_BUTTON6      DIJOFS_BUTTON(6)
+#define DIJOFS_BUTTON7      DIJOFS_BUTTON(7)
+#define DIJOFS_BUTTON8      DIJOFS_BUTTON(8)
+#define DIJOFS_BUTTON9      DIJOFS_BUTTON(9)
+#define DIJOFS_BUTTON10     DIJOFS_BUTTON(10)
+#define DIJOFS_BUTTON11     DIJOFS_BUTTON(11)
+#define DIJOFS_BUTTON12     DIJOFS_BUTTON(12)
+#define DIJOFS_BUTTON13     DIJOFS_BUTTON(13)
+#define DIJOFS_BUTTON14     DIJOFS_BUTTON(14)
+#define DIJOFS_BUTTON15     DIJOFS_BUTTON(15)
+#define DIJOFS_BUTTON16     DIJOFS_BUTTON(16)
+#define DIJOFS_BUTTON17     DIJOFS_BUTTON(17)
+#define DIJOFS_BUTTON18     DIJOFS_BUTTON(18)
+#define DIJOFS_BUTTON19     DIJOFS_BUTTON(19)
+#define DIJOFS_BUTTON20     DIJOFS_BUTTON(20)
+#define DIJOFS_BUTTON21     DIJOFS_BUTTON(21)
+#define DIJOFS_BUTTON22     DIJOFS_BUTTON(22)
+#define DIJOFS_BUTTON23     DIJOFS_BUTTON(23)
+#define DIJOFS_BUTTON24     DIJOFS_BUTTON(24)
+#define DIJOFS_BUTTON25     DIJOFS_BUTTON(25)
+#define DIJOFS_BUTTON26     DIJOFS_BUTTON(26)
+#define DIJOFS_BUTTON27     DIJOFS_BUTTON(27)
+#define DIJOFS_BUTTON28     DIJOFS_BUTTON(28)
+#define DIJOFS_BUTTON29     DIJOFS_BUTTON(29)
+#define DIJOFS_BUTTON30     DIJOFS_BUTTON(30)
+#define DIJOFS_BUTTON31     DIJOFS_BUTTON(31)
+
+
+#endif /* DIJ_RINGZERO */
+
+/****************************************************************************
+ *
+ *  IDirectInput
+ *
+ ****************************************************************************/
+
+#ifndef DIJ_RINGZERO
+
+#define DIENUM_STOP             0
+#define DIENUM_CONTINUE         1
+
+typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID);
+typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID);
+#ifdef UNICODE
+#define LPDIENUMDEVICESCALLBACK  LPDIENUMDEVICESCALLBACKW
+#else
+#define LPDIENUMDEVICESCALLBACK  LPDIENUMDEVICESCALLBACKA
+#endif // !UNICODE
+
+#define DIEDFL_ALLDEVICES       0x00000000
+#define DIEDFL_ATTACHEDONLY     0x00000001
+#if(DIRECTINPUT_VERSION >= 0x0500)
+#define DIEDFL_FORCEFEEDBACK    0x00000100
+#endif /* DIRECTINPUT_VERSION >= 0x0500 */
+
+#undef INTERFACE
+#define INTERFACE IDirectInputW
+
+DECLARE_INTERFACE_(IDirectInputW, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputW methods ***/
+    STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
+    STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
+};
+
+typedef struct IDirectInputW *LPDIRECTINPUTW;
+
+#undef INTERFACE
+#define INTERFACE IDirectInputA
+
+DECLARE_INTERFACE_(IDirectInputA, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputA methods ***/
+    STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
+    STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
+};
+
+typedef struct IDirectInputA *LPDIRECTINPUTA;
+
+#ifdef UNICODE
+#define IID_IDirectInput IID_IDirectInputW
+#define IDirectInput IDirectInputW
+#define IDirectInputVtbl IDirectInputWVtbl
+#else
+#define IID_IDirectInput IID_IDirectInputA
+#define IDirectInput IDirectInputA
+#define IDirectInputVtbl IDirectInputAVtbl
+#endif
+typedef struct IDirectInput *LPDIRECTINPUT;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectInput_Release(p) (p)->lpVtbl->Release(p)
+#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
+#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
+#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
+#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#else
+#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectInput_AddRef(p) (p)->AddRef()
+#define IDirectInput_Release(p) (p)->Release()
+#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
+#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
+#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
+#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
+#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b)
+#endif
+
+#undef INTERFACE
+#define INTERFACE IDirectInput2W
+
+DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputW methods ***/
+    STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
+    STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
+
+    /*** IDirectInput2W methods ***/
+    STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
+};
+
+typedef struct IDirectInput2W *LPDIRECTINPUT2W;
+
+#undef INTERFACE
+#define INTERFACE IDirectInput2A
+
+DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+    /*** IDirectInputA methods ***/
+    STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
+    STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
+    STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
+    STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
+    STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
+
+    /*** IDirectInput2A methods ***/
+    STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
+};
+
+typedef struct IDirectInput2A *LPDIRECTINPUT2A;
+
+#ifdef UNICODE
+#define IID_IDirectInput2 IID_IDirectInput2W
+#define IDirectInput2 IDirectInput2W
+#define IDirectInput2Vtbl IDirectInput2WVtbl
+#else
+#define IID_IDirectInput2 IID_IDirectInput2A
+#define IDirectInput2 IDirectInput2A
+#define IDirectInput2Vtbl IDirectInput2AVtbl
+#endif
+typedef struct IDirectInput2 *LPDIRECTINPUT2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
+#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
+#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
+#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
+#else
+#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectInput2_AddRef(p) (p)->AddRef()
+#define IDirectInput2_Release(p) (p)->Release()
+#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
+#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
+#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
+#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
+#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
+#endif
+
+extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
+extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
+#ifdef UNICODE
+#define DirectInputCreate  DirectInputCreateW
+#else
+#define DirectInputCreate  DirectInputCreateA
+#endif // !UNICODE
+
+#endif /* DIJ_RINGZERO */
+
+
+/****************************************************************************
+ *
+ *  Return Codes
+ *
+ ****************************************************************************/
+
+/*
+ *  The operation completed successfully.
+ */
+#define DI_OK                           S_OK
+
+/*
+ *  The device exists but is not currently attached.
+ */
+#define DI_NOTATTACHED                  S_FALSE
+
+/*
+ *  The device buffer overflowed.  Some input was lost.
+ */
+#define DI_BUFFEROVERFLOW               S_FALSE
+
+/*
+ *  The change in device properties had no effect.
+ */
+#define DI_PROPNOEFFECT                 S_FALSE
+
+/*
+ *  The operation had no effect.
+ */
+#define DI_NOEFFECT                     S_FALSE
+
+/*
+ *  The device is a polled device.  As a result, device buffering
+ *  will not collect any data and event notifications will not be
+ *  signalled until GetDeviceState is called.
+ */
+#define DI_POLLEDDEVICE                 ((HRESULT)0x00000002L)
+
+/*
+ *  The parameters of the effect were successfully updated by
+ *  IDirectInputEffect::SetParameters, but the effect was not
+ *  downloaded because the device is not exclusively acquired
+ *  or because the DIEP_NODOWNLOAD flag was passed.
+ */
+#define DI_DOWNLOADSKIPPED              ((HRESULT)0x00000003L)
+
+/*
+ *  The parameters of the effect were successfully updated by
+ *  IDirectInputEffect::SetParameters, but in order to change
+ *  the parameters, the effect needed to be restarted.
+ */
+#define DI_EFFECTRESTARTED              ((HRESULT)0x00000004L)
+
+/*
+ *  The parameters of the effect were successfully updated by
+ *  IDirectInputEffect::SetParameters, but some of them were
+ *  beyond the capabilities of the device and were truncated.
+ */
+#define DI_TRUNCATED                    ((HRESULT)0x00000008L)
+
+/*
+ *  Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
+ */
+#define DI_TRUNCATEDANDRESTARTED        ((HRESULT)0x0000000CL)
+
+/*
+ *  The application requires a newer version of DirectInput.
+ */
+#define DIERR_OLDDIRECTINPUTVERSION     \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
+
+/*
+ *  The application was written for an unsupported prerelease version
+ *  of DirectInput.
+ */
+#define DIERR_BETADIRECTINPUTVERSION    \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
+
+/*
+ *  The object could not be created due to an incompatible driver version
+ *  or mismatched or incomplete driver components.
+ */
+#define DIERR_BADDRIVERVER              \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
+
+/*
+ * The device or device instance or effect is not registered with DirectInput.
+ */
+#define DIERR_DEVICENOTREG              REGDB_E_CLASSNOTREG
+
+/*
+ * The requested object does not exist.
+ */
+#define DIERR_NOTFOUND                  \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
+
+/*
+ * The requested object does not exist.
+ */
+#define DIERR_OBJECTNOTFOUND            \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
+
+/*
+ * An invalid parameter was passed to the returning function,
+ * or the object was not in a state that admitted the function
+ * to be called.
+ */
+#define DIERR_INVALIDPARAM              E_INVALIDARG
+
+/*
+ * The specified interface is not supported by the object
+ */
+#define DIERR_NOINTERFACE               E_NOINTERFACE
+
+/*
+ * An undetermined error occured inside the DInput subsystem
+ */
+#define DIERR_GENERIC                   E_FAIL
+
+/*
+ * The DInput subsystem couldn't allocate sufficient memory to complete the
+ * caller's request.
+ */
+#define DIERR_OUTOFMEMORY               E_OUTOFMEMORY
+
+/*
+ * The function called is not supported at this time
+ */
+#define DIERR_UNSUPPORTED               E_NOTIMPL
+
+/*
+ * This object has not been initialized
+ */
+#define DIERR_NOTINITIALIZED            \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
+
+/*
+ * This object is already initialized
+ */
+#define DIERR_ALREADYINITIALIZED        \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
+
+/*
+ * This object does not support aggregation
+ */
+#define DIERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
+
+/*
+ * Another app has a higher priority level, preventing this call from
+ * succeeding.
+ */
+#define DIERR_OTHERAPPHASPRIO           E_ACCESSDENIED
+
+/*
+ * Access to the device has been lost.  It must be re-acquired.
+ */
+#define DIERR_INPUTLOST                 \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
+
+/*
+ * The operation cannot be performed while the device is acquired.
+ */
+#define DIERR_ACQUIRED                  \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
+
+/*
+ * The operation cannot be performed unless the device is acquired.
+ */
+#define DIERR_NOTACQUIRED               \
+    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
+
+/*
+ * The specified property cannot be changed.
+ */
+#define DIERR_READONLY                  E_ACCESSDENIED
+
+/*
+ * The device already has an event notification associated with it.
+ */
+#define DIERR_HANDLEEXISTS              E_ACCESSDENIED
+
+/*
+ * Data is not yet available.
+ */
+#ifndef E_PENDING
+#define E_PENDING                       0x80070007L
+#endif
+
+/*
+ * Unable to IDirectInputJoyConfig_Acquire because the user
+ * does not have sufficient privileges to change the joystick
+ * configuration.
+ */
+#define DIERR_INSUFFICIENTPRIVS         0x80040200L
+
+/*
+ * The device is full.
+ */
+#define DIERR_DEVICEFULL                0x80040201L
+
+/*
+ * Not all the requested information fit into the buffer.
+ */
+#define DIERR_MOREDATA                  0x80040202L
+
+/*
+ * The effect is not downloaded.
+ */
+#define DIERR_NOTDOWNLOADED             0x80040203L
+
+/*
+ *  The device cannot be reinitialized because there are still effects
+ *  attached to it.
+ */
+#define DIERR_HASEFFECTS                0x80040204L
+
+/*
+ *  The operation cannot be performed unless the device is acquired
+ *  in DISCL_EXCLUSIVE mode.
+ */
+#define DIERR_NOTEXCLUSIVEACQUIRED      0x80040205L
+
+/*
+ *  The effect could not be downloaded because essential information
+ *  is missing.  For example, no axes have been associated with the
+ *  effect, or no type-specific information has been created.
+ */
+#define DIERR_INCOMPLETEEFFECT          0x80040206L
+
+/*
+ *  Attempted to read buffered device data from a device that is
+ *  not buffered.
+ */
+#define DIERR_NOTBUFFERED               0x80040207L
+
+/*
+ *  An attempt was made to modify parameters of an effect while it is
+ *  playing.  Not all hardware devices support altering the parameters
+ *  of an effect while it is playing.
+ */
+#define DIERR_EFFECTPLAYING             0x80040208L
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif  /* __DINPUT_INCLUDED__ */
+
+/****************************************************************************
+ *
+ *  Definitions for non-IDirectInput (VJoyD) features defined more recently
+ *  than the current sdk files
+ *
+ ****************************************************************************/
+
+#ifdef _INC_MMSYSTEM
+#ifndef MMNOJOY
+
+#ifndef __VJOYDX_INCLUDED__
+#define __VJOYDX_INCLUDED__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
+ * contains mini-driver specific data to be passed by VJoyD to the mini-
+ * driver instead of doing a poll.
+ */
+#define JOY_PASSDRIVERDATA          0x10000000l
+
+/*
+ * Informs the joystick driver that the configuration has been changed
+ * and should be reloaded from the registery.
+ * dwFlags is reserved and should be set to zero
+ */
+WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags );
+
+/*
+ * Hardware Setting indicating that the device is a headtracker
+ */
+#define JOY_HWS_ISHEADTRACKER       0x02000000l
+
+/*
+ * Hardware Setting indicating that the VxD is used to replace
+ * the standard analog polling
+ */
+#define JOY_HWS_ISGAMEPORTDRIVER    0x04000000l
+
+/*
+ * Hardware Setting indicating that the driver needs a standard
+ * gameport in order to communicate with the device.
+ */
+#define JOY_HWS_ISANALOGPORTDRIVER  0x08000000l 
+
+/*
+ * Hardware Setting indicating that VJoyD should not load this 
+ * driver, it will be loaded externally and will register with
+ * VJoyD of it's own accord.
+ */
+#define JOY_HWS_AUTOLOAD            0x10000000l
+
+/*
+ * Hardware Setting indicating that the driver acquires any 
+ * resources needed without needing a devnode through VJoyD.
+ */
+#define JOY_HWS_NODEVNODE           0x20000000l
+
+/*
+ * Hardware Setting indicating that the VxD can be used as
+ * a port 201h emulator.
+ */
+#define JOY_HWS_ISGAMEPORTEMULATOR  0x40000000l
+
+
+/*
+ * Usage Setting indicating that the settings are volatile and
+ * should be removed if still present on a reboot.
+ */
+#define JOY_US_VOLATILE             0x00000008L
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif  /* __VJOYDX_INCLUDED__ */
+
+#endif  /* not MMNOJOY */
+#endif  /* _INC_MMSYSTEM */
+
+/****************************************************************************
+ *
+ *  Definitions for non-IDirectInput (VJoyD) features defined more recently
+ *  than the current ddk files
+ *
+ ****************************************************************************/
+
+#ifndef DIJ_RINGZERO
+
+#ifdef _INC_MMDDK
+#ifndef MMNOJOYDEV
+
+#ifndef __VJOYDXD_INCLUDED__
+#define __VJOYDXD_INCLUDED__
+/*
+ * Poll type in which the do_other field of the JOYOEMPOLLDATA
+ * structure contains mini-driver specific data passed from an app.
+ */
+#define JOY_OEMPOLL_PASSDRIVERDATA  7
+
+#endif  /* __VJOYDXD_INCLUDED__ */
+
+#endif  /* not MMNOJOYDEV */
+#endif  /* _INC_MMDDK */
+
+#endif /* DIJ_RINGZERO */
diff --git a/misc/builddeps/dp.win32/include/dsound.h b/misc/builddeps/dp.win32/include/dsound.h
new file mode 100644 (file)
index 0000000..9f3d66f
--- /dev/null
@@ -0,0 +1,863 @@
+/*==========================================================================;
+ *
+ *  Copyright (C) 1995,1996 Microsoft Corporation.  All Rights Reserved.
+ *
+ *  File:       dsound.h
+ *  Content:    DirectSound include file
+ *
+ **************************************************************************/
+
+#ifndef __DSOUND_INCLUDED__
+#define __DSOUND_INCLUDED__
+
+#include <d3dtypes.h>
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+
+#define _FACDS  0x878
+#define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
+DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+
+// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
+DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+//
+// Structures
+// 
+
+#ifdef __cplusplus
+// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
+struct IDirectSound;
+struct IDirectSoundBuffer;
+struct IDirectSound3DListener;
+struct IDirectSound3DBuffer;
+struct IDirectSoundCapture;
+struct IDirectSoundCaptureBuffer;
+struct IDirectSoundNotify;
+#endif // __cplusplus
+
+typedef struct IDirectSound *LPDIRECTSOUND;
+typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
+typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
+typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
+typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
+typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
+typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
+
+typedef struct _DSCAPS
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwMinSecondarySampleRate;
+    DWORD           dwMaxSecondarySampleRate;
+    DWORD           dwPrimaryBuffers;
+    DWORD           dwMaxHwMixingAllBuffers;
+    DWORD           dwMaxHwMixingStaticBuffers;
+    DWORD           dwMaxHwMixingStreamingBuffers;
+    DWORD           dwFreeHwMixingAllBuffers;
+    DWORD           dwFreeHwMixingStaticBuffers;
+    DWORD           dwFreeHwMixingStreamingBuffers;
+    DWORD           dwMaxHw3DAllBuffers;
+    DWORD           dwMaxHw3DStaticBuffers;
+    DWORD           dwMaxHw3DStreamingBuffers;
+    DWORD           dwFreeHw3DAllBuffers;
+    DWORD           dwFreeHw3DStaticBuffers;
+    DWORD           dwFreeHw3DStreamingBuffers;
+    DWORD           dwTotalHwMemBytes;
+    DWORD           dwFreeHwMemBytes;
+    DWORD           dwMaxContigFreeHwMemBytes;
+    DWORD           dwUnlockTransferRateHwBuffers;
+    DWORD           dwPlayCpuOverheadSwBuffers;
+    DWORD           dwReserved1;
+    DWORD           dwReserved2;
+} DSCAPS, *LPDSCAPS;
+
+typedef const DSCAPS *LPCDSCAPS;
+
+typedef struct _DSBCAPS
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwBufferBytes;
+    DWORD           dwUnlockTransferRate;
+    DWORD           dwPlayCpuOverhead;
+} DSBCAPS, *LPDSBCAPS;
+
+typedef const DSBCAPS *LPCDSBCAPS;
+
+typedef struct _DSBUFFERDESC
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwBufferBytes;
+    DWORD           dwReserved;
+    LPWAVEFORMATEX  lpwfxFormat;
+} DSBUFFERDESC, *LPDSBUFFERDESC;
+
+typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
+
+typedef struct _DS3DBUFFER
+{
+    DWORD           dwSize;
+    D3DVECTOR       vPosition;
+    D3DVECTOR       vVelocity;
+    DWORD           dwInsideConeAngle;
+    DWORD           dwOutsideConeAngle;
+    D3DVECTOR       vConeOrientation;
+    LONG            lConeOutsideVolume;
+    D3DVALUE        flMinDistance;
+    D3DVALUE        flMaxDistance;
+    DWORD           dwMode;
+} DS3DBUFFER, *LPDS3DBUFFER;
+
+typedef const DS3DBUFFER *LPCDS3DBUFFER;
+
+typedef struct _DS3DLISTENER
+{
+    DWORD           dwSize;
+    D3DVECTOR       vPosition;
+    D3DVECTOR       vVelocity;
+    D3DVECTOR       vOrientFront;
+    D3DVECTOR       vOrientTop;
+    D3DVALUE        flDistanceFactor;
+    D3DVALUE        flRolloffFactor;
+    D3DVALUE        flDopplerFactor;
+} DS3DLISTENER, *LPDS3DLISTENER;
+
+typedef const DS3DLISTENER *LPCDS3DLISTENER;
+
+typedef struct _DSCCAPS
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwFormats;
+    DWORD           dwChannels;
+} DSCCAPS, *LPDSCCAPS;
+
+typedef const DSCCAPS *LPCDSCCAPS;
+
+typedef struct _DSCBUFFERDESC
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwBufferBytes;
+    DWORD           dwReserved;
+    LPWAVEFORMATEX  lpwfxFormat;
+} DSCBUFFERDESC, *LPDSCBUFFERDESC;
+
+typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
+
+typedef struct _DSCBCAPS 
+{
+    DWORD           dwSize;
+    DWORD           dwFlags;
+    DWORD           dwBufferBytes;
+    DWORD           dwReserved;
+} DSCBCAPS, *LPDSCBCAPS;
+
+typedef const DSCBCAPS *LPCDSCBCAPS;
+
+typedef struct _DSBPOSITIONNOTIFY
+{
+    DWORD           dwOffset;
+    HANDLE          hEventNotify;
+} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
+
+typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
+
+//
+// Compatibility typedefs
+//
+
+typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
+typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
+typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
+typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
+typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
+typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
+typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
+typedef LPVOID *LPLPVOID;
+//typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
+
+//
+// DirectSound API
+//
+
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
+
+extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
+extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
+
+extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
+
+#ifdef UNICODE
+#define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
+#define DirectSoundEnumerate        DirectSoundEnumerateW
+#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
+#else // UNICODE
+#define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
+#define DirectSoundEnumerate        DirectSoundEnumerateA
+#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
+#endif // UNICODE
+
+//
+// IDirectSound
+//
+
+DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound
+
+DECLARE_INTERFACE_(IDirectSound, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
+    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
+    STDMETHOD_(ULONG,Release)       (THIS) PURE;
+    
+    // IDirectSound methods
+    STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
+    STDMETHOD(GetCaps)              (THIS_ LPDSCAPS) PURE;
+    STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
+    STDMETHOD(SetCooperativeLevel)  (THIS_ HWND, DWORD) PURE;
+    STDMETHOD(Compact)              (THIS) PURE;
+    STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD) PURE;
+    STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD) PURE;
+    STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound_AddRef(p)                   (p)->lpVtbl->AddRef(p)
+#define IDirectSound_Release(p)                  (p)->lpVtbl->Release(p)
+#define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
+#define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
+#define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
+#define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
+#define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
+#define IDirectSound_AddRef(p)                   (p)->AddRef()
+#define IDirectSound_Release(p)                  (p)->Release()
+#define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
+#define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
+#define IDirectSound_Compact(p)                  (p)->Compact()
+#define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
+#define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
+#define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundBuffer
+//
+
+DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundBuffer
+
+DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
+    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
+    STDMETHOD_(ULONG,Release)       (THIS) PURE;
+    
+    // IDirectSoundBuffer methods
+    STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS) PURE;
+    STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD) PURE;
+    STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
+    STDMETHOD(GetVolume)            (THIS_ LPLONG) PURE;
+    STDMETHOD(GetPan)               (THIS_ LPLONG) PURE;
+    STDMETHOD(GetFrequency)         (THIS_ LPDWORD) PURE;
+    STDMETHOD(GetStatus)            (THIS_ LPDWORD) PURE;
+    STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
+    STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
+    STDMETHOD(Play)                 (THIS_ DWORD, DWORD, DWORD) PURE;
+    STDMETHOD(SetCurrentPosition)   (THIS_ DWORD) PURE;
+    STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX) PURE;
+    STDMETHOD(SetVolume)            (THIS_ LONG) PURE;
+    STDMETHOD(SetPan)               (THIS_ LONG) PURE;
+    STDMETHOD(SetFrequency)         (THIS_ DWORD) PURE;
+    STDMETHOD(Stop)                 (THIS) PURE;
+    STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
+    STDMETHOD(Restore)              (THIS) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectSoundBuffer_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectSoundBuffer_AddRef(p)                    (p)->AddRef()
+#define IDirectSoundBuffer_Release(p)                   (p)->Release()
+#define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
+#define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
+#define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
+#define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
+#define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
+#define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
+#define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
+#define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
+#define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSound3DListener
+//
+
+DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound3DListener
+
+DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID FAR *) PURE;
+    STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
+    STDMETHOD_(ULONG,Release)           (THIS) PURE;
+
+    // IDirectSound3D methods
+    STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER) PURE;
+    STDMETHOD(GetDistanceFactor)        (THIS_ LPD3DVALUE) PURE;
+    STDMETHOD(GetDopplerFactor)         (THIS_ LPD3DVALUE) PURE;
+    STDMETHOD(GetOrientation)           (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
+    STDMETHOD(GetPosition)              (THIS_ LPD3DVECTOR) PURE;
+    STDMETHOD(GetRolloffFactor)         (THIS_ LPD3DVALUE) PURE;
+    STDMETHOD(GetVelocity)              (THIS_ LPD3DVECTOR) PURE;
+    STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER, DWORD) PURE;
+    STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetOrientation)           (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetPosition)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetVelocity)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound3DListener_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirectSound3DListener_Release(p)                       (p)->lpVtbl->Release(p)
+#define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
+#define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
+#define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
+#define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirectSound3DListener_AddRef(p)                        (p)->AddRef()
+#define IDirectSound3DListener_Release(p)                       (p)->Release()
+#define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
+#define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
+#define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
+#define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSound3DBuffer
+//
+
+DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound3DBuffer
+
+DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
+    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
+    STDMETHOD_(ULONG,Release)       (THIS) PURE;
+
+    // IDirectSoundBuffer3D methods
+    STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER) PURE;
+    STDMETHOD(GetConeAngles)        (THIS_ LPDWORD, LPDWORD) PURE;
+    STDMETHOD(GetConeOrientation)   (THIS_ LPD3DVECTOR) PURE;
+    STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
+    STDMETHOD(GetMaxDistance)       (THIS_ LPD3DVALUE) PURE;
+    STDMETHOD(GetMinDistance)       (THIS_ LPD3DVALUE) PURE;
+    STDMETHOD(GetMode)              (THIS_ LPDWORD) PURE;
+    STDMETHOD(GetPosition)          (THIS_ LPD3DVECTOR) PURE;
+    STDMETHOD(GetVelocity)          (THIS_ LPD3DVECTOR) PURE;
+    STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER, DWORD) PURE;
+    STDMETHOD(SetConeAngles)        (THIS_ DWORD, DWORD, DWORD) PURE;
+    STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
+    STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetMode)              (THIS_ DWORD, DWORD) PURE;
+    STDMETHOD(SetPosition)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    STDMETHOD(SetVelocity)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound3DBuffer_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IDirectSound3DBuffer_Release(p)                 (p)->lpVtbl->Release(p)
+#define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->lpVtbl->GetConeAngles(p,a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->lpVtbl->GetConeOrientation(p,a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->lpVtbl->GetConeOutsideVolume(p,a)
+#define IDirectSound3DBuffer_GetPosition(p,a)           (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->lpVtbl->GetMinDistance(p,a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->lpVtbl->GetMaxDistance(p,a)
+#define IDirectSound3DBuffer_GetMode(p,a)               (p)->lpVtbl->GetMode(p,a)
+#define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->lpVtbl->SetConeAngles(p,a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->lpVtbl->SetMinDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->lpVtbl->SetMaxDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->lpVtbl->SetMode(p,a,b)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
+#define IDirectSound3DBuffer_AddRef(p)                  (p)->AddRef()
+#define IDirectSound3DBuffer_Release(p)                 (p)->Release()
+#define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->GetAllParameters(a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->GetConeAngles(a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->GetConeOrientation(a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->GetConeOutsideVolume(a)
+#define IDirectSound3DBuffer_GetPosition(p,a)           (p)->GetPosition(a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->GetMinDistance(a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->GetMaxDistance(a)
+#define IDirectSound3DBuffer_GetMode(p,a)               (p)->GetMode(a)
+#define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->GetVelocity(a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->SetAllParameters(a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->SetConeAngles(a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->SetMinDistance(a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->SetMaxDistance(a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->SetMode(a,b)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->SetVelocity(a,b,c,d)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundCapture
+//
+
+DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCapture
+
+DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
+    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
+    STDMETHOD_(ULONG,Release)       (THIS) PURE;
+
+    // IDirectSoundCapture methods
+    STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
+    STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS ) PURE;
+    STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCapture_AddRef(p)                       (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCapture_Release(p)                      (p)->lpVtbl->Release(p)
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->QueryInterface(a,b)
+#define IDirectSoundCapture_AddRef(p)                       (p)->AddRef()
+#define IDirectSoundCapture_Release(p)                      (p)->Release()
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
+#define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundCaptureBuffer
+//
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCaptureBuffer
+
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
+    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
+    STDMETHOD_(ULONG,Release)       (THIS) PURE;
+
+    // IDirectSoundCaptureBuffer methods
+    STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS ) PURE;
+    STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD ) PURE;
+    STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
+    STDMETHOD(GetStatus)            (THIS_ LPDWORD ) PURE;
+    STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
+    STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
+    STDMETHOD(Start)                (THIS_ DWORD) PURE;
+    STDMETHOD(Stop)                 (THIS) PURE;
+    STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCaptureBuffer_Release(p)                   (p)->lpVtbl->Release(p)
+#define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->AddRef()
+#define IDirectSoundCaptureBuffer_Release(p)                   (p)->Release()
+#define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->Start(a)
+#define IDirectSoundCaptureBuffer_Stop(p)                      (p)->Stop()
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundNotify
+//
+
+DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundNotify
+
+DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
+    STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
+    STDMETHOD_(ULONG,Release)           (THIS) PURE;
+
+    // IDirectSoundNotify methods
+    STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundNotify_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirectSoundNotify_Release(p)                       (p)->lpVtbl->Release(p)
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirectSoundNotify_AddRef(p)                        (p)->AddRef()
+#define IDirectSoundNotify_Release(p)                       (p)->Release()
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IKsPropertySet
+//
+
+#ifndef _IKsPropertySet_
+#define _IKsPropertySet_
+
+#ifdef __cplusplus
+// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
+struct IKsPropertySet;
+#endif // __cplusplus
+
+typedef struct IKsPropertySet *LPKSPROPERTYSET;
+
+#define KSPROPERTY_SUPPORT_GET  0x00000001
+#define KSPROPERTY_SUPPORT_SET  0x00000002
+
+DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
+
+#undef INTERFACE
+#define INTERFACE IKsPropertySet
+
+DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
+{
+    // IUnknown methods
+    STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
+    STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
+    STDMETHOD_(ULONG,Release)   (THIS) PURE;
+
+    // IKsPropertySet methods
+    STDMETHOD(Get)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
+    STDMETHOD(Set)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
+    STDMETHOD(QuerySupport)     (THIS_ REFGUID, ULONG, PULONG) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IKsPropertySet_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
+#define IKsPropertySet_AddRef(p)                   (p)->lpVtbl->AddRef(p)
+#define IKsPropertySet_Release(p)                  (p)->lpVtbl->Release(p)
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IKsPropertySet_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
+#define IKsPropertySet_AddRef(p)                   (p)->AddRef()
+#define IKsPropertySet_Release(p)                  (p)->Release()
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // _IKsPropertySet_
+
+//
+// Return Codes
+//
+
+#define DS_OK                           0
+
+// The call failed because resources (such as a priority level)
+// were already being used by another caller.
+#define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
+
+// The control (vol,pan,etc.) requested by the caller is not available.
+#define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
+
+// An invalid parameter was passed to the returning function
+#define DSERR_INVALIDPARAM              E_INVALIDARG
+
+// This call is not valid for the current state of this object
+#define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
+
+// An undetermined error occured inside the DirectSound subsystem
+#define DSERR_GENERIC                   E_FAIL
+
+// The caller does not have the priority level required for the function to
+// succeed.
+#define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
+
+// Not enough free memory is available to complete the operation
+#define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
+
+// The specified WAVE format is not supported
+#define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
+
+// The function called is not supported at this time
+#define DSERR_UNSUPPORTED               E_NOTIMPL
+
+// No sound driver is available for use
+#define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
+
+// This object is already initialized
+#define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
+
+// This object does not support aggregation
+#define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
+
+// The buffer memory has been lost, and must be restored.
+#define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
+
+// Another app has a higher priority level, preventing this call from
+// succeeding.
+#define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
+
+// This object has not been initialized
+#define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
+
+// The requested COM interface is not available
+#define DSERR_NOINTERFACE               E_NOINTERFACE
+
+//
+// Flags
+//
+
+#define DSCAPS_PRIMARYMONO          0x00000001
+#define DSCAPS_PRIMARYSTEREO        0x00000002
+#define DSCAPS_PRIMARY8BIT          0x00000004
+#define DSCAPS_PRIMARY16BIT         0x00000008
+#define DSCAPS_CONTINUOUSRATE       0x00000010
+#define DSCAPS_EMULDRIVER           0x00000020
+#define DSCAPS_CERTIFIED            0x00000040
+#define DSCAPS_SECONDARYMONO        0x00000100
+#define DSCAPS_SECONDARYSTEREO      0x00000200
+#define DSCAPS_SECONDARY8BIT        0x00000400
+#define DSCAPS_SECONDARY16BIT       0x00000800
+
+#define DSBPLAY_LOOPING             0x00000001
+      
+#define DSBSTATUS_PLAYING           0x00000001
+#define DSBSTATUS_BUFFERLOST        0x00000002
+#define DSBSTATUS_LOOPING           0x00000004
+
+#define DSBLOCK_FROMWRITECURSOR     0x00000001
+#define DSBLOCK_ENTIREBUFFER        0x00000002
+
+#define DSSCL_NORMAL                0x00000001
+#define DSSCL_PRIORITY              0x00000002
+#define DSSCL_EXCLUSIVE             0x00000003
+#define DSSCL_WRITEPRIMARY          0x00000004
+
+#define DS3DMODE_NORMAL             0x00000000
+#define DS3DMODE_HEADRELATIVE       0x00000001
+#define DS3DMODE_DISABLE            0x00000002
+
+#define DS3D_IMMEDIATE              0x00000000
+#define DS3D_DEFERRED               0x00000001
+
+#define DS3D_MINDISTANCEFACTOR      0.0f
+#define DS3D_MAXDISTANCEFACTOR      10.0f
+#define DS3D_DEFAULTDISTANCEFACTOR  1.0f
+
+#define DS3D_MINROLLOFFFACTOR       0.0f
+#define DS3D_MAXROLLOFFFACTOR       10.0f
+#define DS3D_DEFAULTROLLOFFFACTOR   1.0f
+
+#define DS3D_MINDOPPLERFACTOR       0.0f
+#define DS3D_MAXDOPPLERFACTOR       10.0f
+#define DS3D_DEFAULTDOPPLERFACTOR   1.0f
+
+#define DS3D_DEFAULTMINDISTANCE     1.0f
+#define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
+
+#define DS3D_MINCONEANGLE           0
+#define DS3D_MAXCONEANGLE           360
+#define DS3D_DEFAULTCONEANGLE       360
+
+#define DS3D_DEFAULTCONEOUTSIDEVOLUME   0
+
+#define DSBCAPS_PRIMARYBUFFER       0x00000001
+#define DSBCAPS_STATIC              0x00000002
+#define DSBCAPS_LOCHARDWARE         0x00000004
+#define DSBCAPS_LOCSOFTWARE         0x00000008
+#define DSBCAPS_CTRL3D              0x00000010
+#define DSBCAPS_CTRLFREQUENCY       0x00000020
+#define DSBCAPS_CTRLPAN             0x00000040
+#define DSBCAPS_CTRLVOLUME          0x00000080
+#define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
+#define DSBCAPS_CTRLDEFAULT         0x000000E0
+#define DSBCAPS_CTRLALL             0x000001F0
+#define DSBCAPS_STICKYFOCUS         0x00004000
+#define DSBCAPS_GLOBALFOCUS         0x00008000 
+#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
+#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
+
+#define DSCBCAPS_WAVEMAPPED         0x80000000
+
+#define DSSPEAKER_HEADPHONE         0x00000001
+#define DSSPEAKER_MONO              0x00000002
+#define DSSPEAKER_QUAD              0x00000003
+#define DSSPEAKER_STEREO            0x00000004
+#define DSSPEAKER_SURROUND          0x00000005
+
+#define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
+#define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
+#define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
+#define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
+
+#define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
+#define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
+#define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
+
+#define DSCCAPS_EMULDRIVER          0x00000020
+
+#define DSCBLOCK_ENTIREBUFFER       0x00000001
+
+#define DSCBSTATUS_CAPTURING        0x00000001
+#define DSCBSTATUS_LOOPING          0x00000002
+
+#define DSCBSTART_LOOPING           0x00000001
+
+#define DSBFREQUENCY_MIN            100
+#define DSBFREQUENCY_MAX            100000
+#define DSBFREQUENCY_ORIGINAL       0
+
+#define DSBPAN_LEFT                 -10000
+#define DSBPAN_CENTER               0
+#define DSBPAN_RIGHT                10000
+
+#define DSBVOLUME_MIN               -10000
+#define DSBVOLUME_MAX               0
+
+#define DSBSIZE_MIN                 4
+#define DSBSIZE_MAX                 0x0FFFFFFF
+
+#define DSBPN_OFFSETSTOP            0xFFFFFFFF
+
+#ifdef __cplusplus
+};
+#endif // __cplusplus
+
+#endif  // __DSOUND_INCLUDED__ 
diff --git a/misc/builddeps/dp.win32/include/wspiapi.h b/misc/builddeps/dp.win32/include/wspiapi.h
new file mode 100644 (file)
index 0000000..ba5e7c2
--- /dev/null
@@ -0,0 +1,1061 @@
+/*++\r
+\r
+Copyright (c) Microsoft Corporation. All rights reserved.\r
+\r
+Module Name:\r
+    wspiapi.h\r
+\r
+Abstract:\r
+    The file contains protocol independent API functions.\r
+\r
+Revision History:\r
+    Wed Jul 12 10:50:31 2000, Created\r
+\r
+--*/\r
+\r
+#ifndef _WSPIAPI_H_\r
+#define _WSPIAPI_H_\r
+\r
+#pragma once\r
+\r
+#if (NTDDI_VERSION >= NTDDI_WIN2K)\r
+\r
+#include <stdio.h>              // sprintf()\r
+#include <stdlib.h>             // calloc(), strtoul()\r
+#include <malloc.h>             // calloc()\r
+#include <string.h>             // strlen(), strcmp(), strstr()\r
+\r
+#if defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L\r
+\r
+#define _WSPIAPI_STRCPY_S strcpy_s\r
+#define _WSPIAPI_STRCAT_S strcat_s\r
+#define _WSPIAPI_STRNCPY_S strncpy_s\r
+#define _WSPIAPI_SPRINTF_S_1 sprintf_s\r
+\r
+#else\r
+\r
+#define _WSPIAPI_STRCPY_S(_Dst, _Size, _Src) strcpy((_Dst), (_Src))\r
+#define _WSPIAPI_STRCAT_S(_Dst, _Size, _Src) strcat((_Dst), (_Src))\r
+#define _WSPIAPI_STRNCPY_S(_Dst, _Size, _Src, _Count) strncpy((_Dst), (_Src), (_Count)); (_Dst)[(_Size) - 1] = 0\r
+#define _WSPIAPI_SPRINTF_S_1(_Dst, _Size, _Format, _Arg1) sprintf((_Dst), (_Format), (_Arg1))\r
+\r
+#endif // defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L\r
+\r
+#if !defined(_WSPIAPI_COUNTOF)\r
+#if !defined(__cplusplus)\r
+#define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0]))\r
+#else\r
+template <typename __CountofType, size_t _N>\r
+char (&__wspiapi_countof_helper(__CountofType (&_Array)[_N]))[_N];\r
+#define _WSPIAPI_COUNTOF(_Array) sizeof(__wspiapi_countof_helper(_Array))\r
+#endif\r
+#endif\r
+\r
+#define WspiapiMalloc(tSize)    calloc(1, (tSize))\r
+#define WspiapiFree(p)          free(p)\r
+#define WspiapiSwap(a, b, c)    { (c) = (a); (a) = (b); (b) = (c); }\r
+#define getaddrinfo             WspiapiGetAddrInfo\r
+#define getnameinfo             WspiapiGetNameInfo\r
+#define freeaddrinfo            WspiapiFreeAddrInfo\r
+\r
+//\r
+// These function pointers are also within the #if (NTDDI_VERSION >= WIN2K)\r
+// because they are used by the other functions defined in this file available\r
+// only on win2k and above.\r
+//\r
+typedef int (WINAPI *WSPIAPI_PGETADDRINFO) (\r
+    IN  const char                      *nodename,\r
+    IN  const char                      *servname,\r
+    IN  const struct addrinfo           *hints,\r
+    OUT struct addrinfo                 **res);\r
+\r
+typedef int (WINAPI *WSPIAPI_PGETNAMEINFO) (\r
+    IN  const struct sockaddr           *sa,\r
+    IN  socklen_t                       salen,\r
+    OUT char                            *host,\r
+    IN  size_t                          hostlen,\r
+    OUT char                            *serv,\r
+    IN  size_t                          servlen,\r
+    IN  int                             flags);\r
+\r
+typedef void (WINAPI *WSPIAPI_PFREEADDRINFO) (\r
+    IN  struct addrinfo                 *ai);\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+    \r
+////////////////////////////////////////////////////////////\r
+// v4 only versions of getaddrinfo and friends.\r
+// NOTE: gai_strerror is inlined in ws2tcpip.h\r
+////////////////////////////////////////////////////////////\r
+\r
+__inline    \r
+char *\r
+WINAPI\r
+WspiapiStrdup (\r
+        IN  const char *                    pszString)\r
+/*++\r
+\r
+Routine Description\r
+    allocates enough storage via calloc() for a copy of the string,\r
+    copies the string into the new memory, and returns a pointer to it.\r
+\r
+Arguments\r
+    pszString       string to copy into new memory\r
+\r
+Return Value\r
+    a pointer to the newly allocated storage with the string in it.\r
+    NULL if enough memory could not be allocated, or string was NULL.\r
+\r
+--*/    \r
+{\r
+    char    *pszMemory;\r
+    size_t  cchMemory;\r
+\r
+    if (!pszString)\r
+        return(NULL);\r
+\r
+    cchMemory = strlen(pszString) + 1;\r
+    pszMemory = (char *) WspiapiMalloc(cchMemory);\r
+    if (!pszMemory)\r
+        return(NULL);\r
+\r
+    _WSPIAPI_STRCPY_S(pszMemory, cchMemory, pszString);\r
+    return pszMemory;\r
+}\r
+\r
+    \r
+    \r
+__inline\r
+BOOL\r
+WINAPI\r
+WspiapiParseV4Address (\r
+    IN  const char *                    pszAddress,\r
+    OUT PDWORD                          pdwAddress)\r
+/*++\r
+\r
+Routine Description\r
+    get the IPv4 address (in network byte order) from its string\r
+    representation.  the syntax should be a.b.c.d.\r
+    \r
+Arguments\r
+    pszArgument         string representation of the IPv4 address\r
+    ptAddress           pointer to the resulting IPv4 address\r
+\r
+Return Value\r
+    Returns FALSE if there is an error, TRUE for success.\r
+    \r
+--*/\r
+{\r
+    DWORD       dwAddress   = 0;\r
+    const char  *pcNext     = NULL;\r
+    int         iCount      = 0;\r
+\r
+    // ensure there are 3 '.' (periods)\r
+    for (pcNext = pszAddress; *pcNext != '\0'; pcNext++)\r
+        if (*pcNext == '.')\r
+            iCount++;\r
+    if (iCount != 3)\r
+        return FALSE;\r
+\r
+    // return an error if dwAddress is INADDR_NONE (255.255.255.255)\r
+    // since this is never a valid argument to getaddrinfo.\r
+    dwAddress = inet_addr(pszAddress);\r
+    if (dwAddress == INADDR_NONE)\r
+        return FALSE;\r
+\r
+    *pdwAddress = dwAddress;\r
+    return TRUE;\r
+}\r
+\r
+\r
+\r
+__inline\r
+struct addrinfo *\r
+WINAPI\r
+WspiapiNewAddrInfo (\r
+    IN  int                             iSocketType,\r
+    IN  int                             iProtocol,\r
+    IN  WORD                            wPort,\r
+    IN  DWORD                           dwAddress)\r
+/*++\r
+\r
+Routine Description\r
+    allocate an addrinfo structure and populate fields.\r
+    IPv4 specific internal function, not exported.\r
+    \r
+Arguments\r
+    iSocketType         SOCK_*.  can be wildcarded (zero).\r
+    iProtocol           IPPROTO_*.  can be wildcarded (zero).\r
+    wPort               port number of service (in network order).\r
+    dwAddress           IPv4 address (in network order).\r
+    \r
+Return Value\r
+    returns an addrinfo struct, or NULL if out of memory.\r
+\r
+--*/    \r
+{\r
+    struct addrinfo     *ptNew;\r
+    struct sockaddr_in  *ptAddress;\r
+\r
+    // allocate a new addrinfo structure.\r
+    ptNew       =\r
+        (struct addrinfo *) WspiapiMalloc(sizeof(struct addrinfo));\r
+    if (!ptNew)\r
+        return NULL;\r
+\r
+    ptAddress   =\r
+        (struct sockaddr_in *) WspiapiMalloc(sizeof(struct sockaddr_in));\r
+    if (!ptAddress)\r
+    {\r
+        WspiapiFree(ptNew);\r
+        return NULL;\r
+    }\r
+    ptAddress->sin_family       = AF_INET;\r
+    ptAddress->sin_port         = wPort;\r
+    ptAddress->sin_addr.s_addr  = dwAddress;\r
+    \r
+    // fill in the fields...\r
+    ptNew->ai_family            = PF_INET;\r
+    ptNew->ai_socktype          = iSocketType;\r
+    ptNew->ai_protocol          = iProtocol;\r
+    ptNew->ai_addrlen           = sizeof(struct sockaddr_in);\r
+    ptNew->ai_addr              = (struct sockaddr *) ptAddress;\r
+\r
+    return ptNew;\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiQueryDNS(\r
+    IN  const char                      *pszNodeName,\r
+    IN  int                             iSocketType,\r
+    IN  int                             iProtocol,  \r
+    IN  WORD                            wPort,      \r
+    OUT char                            pszAlias[NI_MAXHOST],\r
+    OUT struct addrinfo                 **pptResult)\r
+/*++\r
+\r
+Routine Description\r
+    helper routine for WspiapiLookupNode.\r
+    performs name resolution by querying the DNS for A records.\r
+    *pptResult would need to be freed if an error is returned.\r
+    \r
+Arguments\r
+    pszNodeName         name of node to resolve.\r
+    iSocketType         SOCK_*.  can be wildcarded (zero).\r
+    iProtocol           IPPROTO_*.  can be wildcarded (zero).\r
+    wPort               port number of service (in network order).\r
+    pszAlias            where to return the alias.  must be of size NI_MAXHOST.\r
+    pptResult           where to return the result.\r
+    \r
+Return Value\r
+    Returns 0 on success, an EAI_* style error value otherwise.\r
+\r
+--*/    \r
+{\r
+    struct addrinfo **pptNext   = pptResult;\r
+    struct hostent  *ptHost     = NULL;\r
+    char            **ppAddresses;\r
+\r
+    *pptNext    = NULL;\r
+    pszAlias[0] = '\0';\r
+\r
+    ptHost = gethostbyname(pszNodeName);\r
+    if (ptHost)\r
+    {\r
+        if ((ptHost->h_addrtype == AF_INET)     &&\r
+            (ptHost->h_length   == sizeof(struct in_addr)))\r
+        {\r
+            for (ppAddresses    = ptHost->h_addr_list;\r
+                 *ppAddresses   != NULL;\r
+                 ppAddresses++)\r
+            {\r
+                // create an addrinfo structure...\r
+                *pptNext = WspiapiNewAddrInfo(\r
+                    iSocketType,\r
+                    iProtocol,\r
+                    wPort,\r
+                    ((struct in_addr *) *ppAddresses)->s_addr);\r
+                if (!*pptNext)\r
+                    return EAI_MEMORY;\r
+\r
+                pptNext = &((*pptNext)->ai_next);\r
+            }\r
+        }\r
+\r
+        // pick up the canonical name.\r
+        _WSPIAPI_STRNCPY_S(pszAlias, NI_MAXHOST, ptHost->h_name, NI_MAXHOST - 1);\r
+        \r
+        return 0;\r
+    }\r
+    \r
+    switch (WSAGetLastError())\r
+    {\r
+        case WSAHOST_NOT_FOUND: return EAI_NONAME;\r
+        case WSATRY_AGAIN:      return EAI_AGAIN;\r
+        case WSANO_RECOVERY:    return EAI_FAIL;\r
+        case WSANO_DATA:        return EAI_NODATA;\r
+        default:                return EAI_NONAME;\r
+    }\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiLookupNode(\r
+    IN  const char                      *pszNodeName,\r
+    IN  int                             iSocketType,\r
+    IN  int                             iProtocol,  \r
+    IN  WORD                            wPort,      \r
+    IN  BOOL                            bAI_CANONNAME,\r
+    OUT struct addrinfo                 **pptResult)\r
+/*++\r
+\r
+Routine Description\r
+    resolve a nodename and return a list of addrinfo structures.\r
+    IPv4 specific internal function, not exported.\r
+    *pptResult would need to be freed if an error is returned.\r
+    \r
+    NOTE: if bAI_CANONNAME is true, the canonical name should be\r
+          returned in the first addrinfo structure.\r
+    \r
+Arguments\r
+    pszNodeName         name of node to resolve.\r
+    iSocketType         SOCK_*.  can be wildcarded (zero).\r
+    iProtocol           IPPROTO_*.  can be wildcarded (zero).\r
+    wPort               port number of service (in network order).\r
+    bAI_CANONNAME       whether the AI_CANONNAME flag is set.\r
+    pptResult           where to return result.\r
+    \r
+Return Value\r
+    Returns 0 on success, an EAI_* style error value otherwise.\r
+\r
+--*/\r
+{\r
+    int     iError              = 0;\r
+    int     iAliasCount         = 0;\r
+\r
+    char    szFQDN1[NI_MAXHOST] = "";\r
+    char    szFQDN2[NI_MAXHOST] = "";\r
+    char    *pszName            = szFQDN1;\r
+    char    *pszAlias           = szFQDN2;\r
+    char    *pszScratch         = NULL;\r
+    _WSPIAPI_STRNCPY_S(pszName, NI_MAXHOST, pszNodeName, NI_MAXHOST - 1);\r
+    \r
+    for (;;)\r
+    {\r
+        iError = WspiapiQueryDNS(pszNodeName,\r
+                                 iSocketType,\r
+                                 iProtocol,\r
+                                 wPort,\r
+                                 pszAlias,\r
+                                 pptResult);\r
+        if (iError)\r
+            break;\r
+\r
+        // if we found addresses, then we are done.\r
+        if (*pptResult)\r
+            break;\r
+\r
+        // stop infinite loops due to DNS misconfiguration.  there appears\r
+        // to be no particular recommended limit in RFCs 1034 and 1035.\r
+        if ((!strlen(pszAlias))             ||\r
+            (!strcmp(pszName, pszAlias))    ||\r
+            (++iAliasCount == 16))\r
+        {\r
+            iError = EAI_FAIL;\r
+            break;\r
+        }\r
+\r
+        // there was a new CNAME, look again.\r
+        WspiapiSwap(pszName, pszAlias, pszScratch);\r
+    }\r
+\r
+    if (!iError && bAI_CANONNAME)\r
+    {\r
+        (*pptResult)->ai_canonname = WspiapiStrdup(pszAlias);\r
+        if (!(*pptResult)->ai_canonname)\r
+            iError = EAI_MEMORY;\r
+    }\r
+\r
+    return iError;\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiClone (\r
+    IN  WORD                            wPort,      \r
+    IN  struct addrinfo                 *ptResult)\r
+/*++\r
+\r
+Routine Description\r
+    clone every addrinfo structure in ptResult for the UDP service.\r
+    ptResult would need to be freed if an error is returned.\r
+    \r
+Arguments\r
+    wPort               port number of UDP service.\r
+    ptResult            list of addrinfo structures, each\r
+                        of whose node needs to be cloned.\r
+\r
+Return Value\r
+    Returns 0 on success, an EAI_MEMORY on allocation failure.\r
+\r
+--*/\r
+{\r
+    struct addrinfo *ptNext = NULL;\r
+    struct addrinfo *ptNew  = NULL;\r
+\r
+    for (ptNext = ptResult; ptNext != NULL; )\r
+    {\r
+        // create an addrinfo structure...\r
+        ptNew = WspiapiNewAddrInfo(\r
+            SOCK_DGRAM,\r
+            ptNext->ai_protocol,\r
+            wPort,\r
+            ((struct sockaddr_in *) ptNext->ai_addr)->sin_addr.s_addr);\r
+        if (!ptNew)\r
+            break;\r
+\r
+        // link the cloned addrinfo\r
+        ptNew->ai_next  = ptNext->ai_next;\r
+        ptNext->ai_next = ptNew;\r
+        ptNext          = ptNew->ai_next;\r
+    }\r
+\r
+    if (ptNext != NULL)\r
+        return EAI_MEMORY;\r
+    \r
+    return 0;\r
+}\r
+\r
+\r
+\r
+__inline\r
+void\r
+WINAPI\r
+WspiapiLegacyFreeAddrInfo (\r
+    IN  struct addrinfo                 *ptHead)\r
+/*++\r
+\r
+Routine Description\r
+    Free an addrinfo structure (or chain of structures).\r
+    As specified in RFC 2553, Section 6.4.\r
+    \r
+Arguments\r
+    ptHead              structure (chain) to free\r
+    \r
+--*/    \r
+{\r
+    struct addrinfo *ptNext;    // next strcture to free\r
+\r
+    for (ptNext = ptHead; ptNext != NULL; ptNext = ptHead)\r
+    {\r
+        if (ptNext->ai_canonname)\r
+            WspiapiFree(ptNext->ai_canonname);\r
+        \r
+        if (ptNext->ai_addr)\r
+            WspiapiFree(ptNext->ai_addr);\r
+\r
+        ptHead = ptNext->ai_next;\r
+        WspiapiFree(ptNext);\r
+    }\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiLegacyGetAddrInfo(\r
+    IN const char                       *pszNodeName,\r
+    IN const char                       *pszServiceName,\r
+    IN const struct addrinfo            *ptHints,\r
+    OUT struct addrinfo                 **pptResult)\r
+/*++\r
+\r
+Routine Description\r
+    Protocol-independent name-to-address translation.\r
+    As specified in RFC 2553, Section 6.4.\r
+    This is the hacked version that only supports IPv4.\r
+    \r
+Arguments\r
+    pszNodeName         node name to lookup.\r
+    pszServiceName      service name to lookup.\r
+    ptHints             hints about how to process request.\r
+    pptResult           where to return result.\r
+    \r
+Return Value\r
+    returns zero if successful, an EAI_* error code if not.\r
+\r
+--*/    \r
+{\r
+    int                 iError      = 0;\r
+    int                 iFlags      = 0;\r
+    int                 iFamily     = PF_UNSPEC;\r
+    int                 iSocketType = 0;\r
+    int                 iProtocol   = 0;\r
+    WORD                wPort       = 0;\r
+    DWORD               dwAddress   = 0;\r
+\r
+    struct servent      *ptService  = NULL;\r
+    char                *pc         = NULL;\r
+    BOOL                bClone      = FALSE;\r
+    WORD                wTcpPort    = 0;\r
+    WORD                wUdpPort    = 0;\r
+    \r
+    \r
+    // initialize pptResult with default return value.\r
+    *pptResult  = NULL;\r
+\r
+\r
+    ////////////////////////////////////////\r
+    // validate arguments...\r
+    //\r
+    \r
+    // both the node name and the service name can't be NULL.\r
+    if ((!pszNodeName) && (!pszServiceName))\r
+        return EAI_NONAME;\r
+\r
+    // validate hints.\r
+    if (ptHints)\r
+    {\r
+        // all members other than ai_flags, ai_family, ai_socktype\r
+        // and ai_protocol must be zero or a null pointer.\r
+        if ((ptHints->ai_addrlen    != 0)       ||\r
+            (ptHints->ai_canonname  != NULL)    ||\r
+            (ptHints->ai_addr       != NULL)    ||\r
+            (ptHints->ai_next       != NULL))\r
+        {\r
+            return EAI_FAIL;\r
+        }\r
+        \r
+        // the spec has the "bad flags" error code, so presumably we\r
+        // should check something here.  insisting that there aren't\r
+        // any unspecified flags set would break forward compatibility,\r
+        // however.  so we just check for non-sensical combinations.\r
+        //\r
+        // we cannot come up with a canonical name given a null node name.\r
+        iFlags      = ptHints->ai_flags;\r
+        if ((iFlags & AI_CANONNAME) && !pszNodeName)\r
+            return EAI_BADFLAGS;\r
+\r
+        // we only support a limited number of protocol families.\r
+        iFamily     = ptHints->ai_family;\r
+        if ((iFamily != PF_UNSPEC) && (iFamily != PF_INET))\r
+            return EAI_FAMILY;\r
+\r
+        // we only support only these socket types.\r
+        iSocketType = ptHints->ai_socktype;\r
+        if ((iSocketType != 0)                  &&\r
+            (iSocketType != SOCK_STREAM)        &&\r
+            (iSocketType != SOCK_DGRAM)         &&\r
+            (iSocketType != SOCK_RAW))\r
+            return EAI_SOCKTYPE;\r
+\r
+        // REVIEW: What if ai_socktype and ai_protocol are at odds?\r
+        iProtocol   = ptHints->ai_protocol;\r
+    }\r
+\r
+\r
+    ////////////////////////////////////////\r
+    // do service lookup...\r
+\r
+    if (pszServiceName)\r
+    {\r
+        wPort = (WORD) strtoul(pszServiceName, &pc, 10);\r
+        if (*pc == '\0')        // numeric port string\r
+        {\r
+            wPort = wTcpPort = wUdpPort = htons(wPort);\r
+            if (iSocketType == 0)\r
+            {\r
+                bClone      = TRUE;\r
+                iSocketType = SOCK_STREAM;\r
+            }\r
+        }\r
+        else                    // non numeric port string\r
+        {\r
+            if ((iSocketType == 0) || (iSocketType == SOCK_DGRAM))\r
+            {\r
+                ptService = getservbyname(pszServiceName, "udp");\r
+                if (ptService)\r
+                    wPort = wUdpPort = ptService->s_port;\r
+            }\r
+\r
+            if ((iSocketType == 0) || (iSocketType == SOCK_STREAM))\r
+            {\r
+                ptService = getservbyname(pszServiceName, "tcp");\r
+                if (ptService)\r
+                    wPort = wTcpPort = ptService->s_port;\r
+            }\r
+            \r
+            // assumes 0 is an invalid service port...\r
+            if (wPort == 0)     // no service exists\r
+                return (iSocketType ? EAI_SERVICE : EAI_NONAME);\r
+\r
+            if (iSocketType == 0)\r
+            {\r
+                // if both tcp and udp, process tcp now & clone udp later.\r
+                iSocketType = (wTcpPort) ? SOCK_STREAM : SOCK_DGRAM;\r
+                bClone      = (wTcpPort && wUdpPort); \r
+            }\r
+        }\r
+    }\r
+    \r
+\r
+\r
+    ////////////////////////////////////////\r
+    // do node name lookup...\r
+\r
+    // if we weren't given a node name,\r
+    // return the wildcard or loopback address (depending on AI_PASSIVE).\r
+    //\r
+    // if we have a numeric host address string,\r
+    // return the binary address.\r
+    //\r
+    if ((!pszNodeName) || (WspiapiParseV4Address(pszNodeName, &dwAddress)))\r
+    {\r
+        if (!pszNodeName)\r
+        {\r
+            dwAddress = htonl((iFlags & AI_PASSIVE)\r
+                              ? INADDR_ANY\r
+                              : INADDR_LOOPBACK);\r
+        }\r
+        \r
+        // create an addrinfo structure...\r
+        *pptResult =\r
+            WspiapiNewAddrInfo(iSocketType, iProtocol, wPort, dwAddress);\r
+        if (!(*pptResult))\r
+            iError = EAI_MEMORY;\r
+        \r
+        if (!iError && pszNodeName)\r
+        {\r
+            // implementation specific behavior: set AI_NUMERICHOST\r
+            // to indicate that we got a numeric host address string.\r
+            (*pptResult)->ai_flags |= AI_NUMERICHOST;\r
+            \r
+            // return the numeric address string as the canonical name\r
+            if (iFlags & AI_CANONNAME)\r
+            {\r
+                (*pptResult)->ai_canonname =\r
+                    WspiapiStrdup(inet_ntoa(*((struct in_addr *) &dwAddress)));\r
+                if (!(*pptResult)->ai_canonname)        \r
+                    iError = EAI_MEMORY;\r
+            }\r
+        }\r
+    }\r
+\r
+\r
+    // if we do not have a numeric host address string and\r
+    // AI_NUMERICHOST flag is set, return an error!\r
+    else if (iFlags & AI_NUMERICHOST)\r
+    {\r
+        iError = EAI_NONAME;\r
+    }\r
+    \r
+\r
+    // since we have a non-numeric node name,\r
+    // we have to do a regular node name lookup.\r
+    else\r
+    {\r
+        iError = WspiapiLookupNode(pszNodeName,\r
+                                   iSocketType,\r
+                                   iProtocol,\r
+                                   wPort,\r
+                                   (iFlags & AI_CANONNAME),\r
+                                   pptResult);\r
+    }\r
+\r
+    if (!iError && bClone)\r
+    {\r
+        iError = WspiapiClone(wUdpPort, *pptResult);\r
+    }\r
+\r
+    if (iError)\r
+    {\r
+        WspiapiLegacyFreeAddrInfo(*pptResult);\r
+        *pptResult  = NULL;        \r
+    }\r
+\r
+    return (iError);\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiLegacyGetNameInfo(\r
+    IN  const struct sockaddr           *ptSocketAddress,\r
+    IN  socklen_t                       tSocketLength,\r
+    OUT char                            *pszNodeName,\r
+    IN  size_t                          tNodeLength,\r
+    OUT char                            *pszServiceName,\r
+    IN  size_t                          tServiceLength,\r
+    IN  int                             iFlags)\r
+/*++\r
+\r
+Routine Description\r
+    protocol-independent address-to-name translation.\r
+    as specified in RFC 2553, Section 6.5.\r
+    this is the hacked version that only supports IPv4.\r
+    \r
+Arguments\r
+    ptSocketAddress     socket address to translate.\r
+    tSocketLength       length of above socket address.\r
+    pszNodeName         where to return the node name.\r
+    tNodeLength         size of above buffer.\r
+    pszServiceName      where to return the service name.\r
+    tServiceLength      size of above buffer.\r
+    iFlags              flags of type NI_*.\r
+    \r
+Return Value\r
+    returns zero if successful, an EAI_* error code if not.\r
+\r
+--*/    \r
+{\r
+    struct servent  *ptService;\r
+    WORD            wPort;    \r
+    char            szBuffer[]  = "65535";\r
+    char            *pszService = szBuffer;\r
+\r
+    struct hostent  *ptHost;\r
+    struct in_addr  tAddress;\r
+    char            *pszNode    = NULL;\r
+    char            *pc         = NULL;\r
+    \r
+\r
+    // sanity check ptSocketAddress and tSocketLength.\r
+    if ((!ptSocketAddress) || (tSocketLength < sizeof(struct sockaddr)))\r
+        return EAI_FAIL;\r
+    \r
+    if (ptSocketAddress->sa_family != AF_INET)\r
+        return EAI_FAMILY;\r
+\r
+    if (tSocketLength < sizeof(struct sockaddr_in))\r
+        return EAI_FAIL;\r
+    \r
+    if (!(pszNodeName && tNodeLength) &&\r
+        !(pszServiceName && tServiceLength))\r
+    {\r
+        return EAI_NONAME;    \r
+    }\r
+\r
+    // the draft has the "bad flags" error code, so presumably we\r
+    // should check something here.  insisting that there aren't\r
+    // any unspecified flags set would break forward compatibility,\r
+    // however.  so we just check for non-sensical combinations.\r
+    if ((iFlags & NI_NUMERICHOST) && (iFlags & NI_NAMEREQD))\r
+    {                                                                       \r
+        return EAI_BADFLAGS;\r
+    }\r
+        \r
+    // translate the port to a service name (if requested).\r
+    if (pszServiceName && tServiceLength)\r
+    {\r
+        wPort = ((struct sockaddr_in *) ptSocketAddress)->sin_port;\r
+        \r
+        if (iFlags & NI_NUMERICSERV)\r
+        {\r
+            // return numeric form of the address.\r
+            _WSPIAPI_SPRINTF_S_1(szBuffer, _WSPIAPI_COUNTOF(szBuffer), "%u", ntohs(wPort));\r
+        }\r
+        else\r
+        {\r
+            // return service name corresponding to port.\r
+            ptService = getservbyport(wPort,\r
+                                      (iFlags & NI_DGRAM) ? "udp" : NULL);\r
+            if (ptService && ptService->s_name)\r
+            {\r
+                // lookup successful.\r
+                pszService = ptService->s_name;\r
+            }\r
+            else\r
+            {\r
+                // DRAFT: return numeric form of the port!\r
+                _WSPIAPI_SPRINTF_S_1(szBuffer, _WSPIAPI_COUNTOF(szBuffer), "%u", ntohs(wPort));\r
+            }\r
+        }\r
+        \r
+        \r
+        if (tServiceLength > strlen(pszService))\r
+            _WSPIAPI_STRCPY_S(pszServiceName, tServiceLength, pszService);\r
+        else\r
+            return EAI_FAIL;\r
+    }\r
+\r
+    \r
+    // translate the address to a node name (if requested).\r
+    if (pszNodeName && tNodeLength)\r
+    {    \r
+        // this is the IPv4-only version, so we have an IPv4 address.\r
+        tAddress = ((struct sockaddr_in *) ptSocketAddress)->sin_addr;\r
+\r
+        if (iFlags & NI_NUMERICHOST)\r
+        {\r
+            // return numeric form of the address.\r
+            pszNode  = inet_ntoa(tAddress);\r
+        }\r
+        else\r
+        {\r
+            // return node name corresponding to address.\r
+            ptHost = gethostbyaddr((char *) &tAddress,\r
+                                   sizeof(struct in_addr),\r
+                                   AF_INET);\r
+            if (ptHost && ptHost->h_name)\r
+            {\r
+                // DNS lookup successful.\r
+                // stop copying at a "." if NI_NOFQDN is specified.\r
+                pszNode = ptHost->h_name;\r
+                if ((iFlags & NI_NOFQDN) &&\r
+                    ((pc = strchr(pszNode, '.')) != NULL))\r
+                    *pc = '\0';\r
+            }\r
+            else\r
+            {\r
+                // DNS lookup failed.  return numeric form of the address.\r
+                if (iFlags & NI_NAMEREQD)\r
+                {\r
+                    switch (WSAGetLastError())\r
+                    {\r
+                        case WSAHOST_NOT_FOUND: return EAI_NONAME;\r
+                        case WSATRY_AGAIN:      return EAI_AGAIN;\r
+                        case WSANO_RECOVERY:    return EAI_FAIL;\r
+                        default:                return EAI_NONAME;\r
+                    }\r
+                }\r
+                else\r
+                    pszNode  = inet_ntoa(tAddress);\r
+            }\r
+        }\r
+\r
+        if (tNodeLength > strlen(pszNode))\r
+            _WSPIAPI_STRCPY_S(pszNodeName, tNodeLength, pszNode);\r
+        else\r
+            return EAI_FAIL;\r
+    }\r
+\r
+    return 0;\r
+}\r
+\r
+\r
+\r
+typedef struct \r
+{\r
+    char const          *pszName;\r
+    FARPROC             pfAddress;\r
+} WSPIAPI_FUNCTION;\r
+\r
+#define WSPIAPI_FUNCTION_ARRAY                                  \\r
+{                                                               \\r
+    "getaddrinfo",      (FARPROC) WspiapiLegacyGetAddrInfo,     \\r
+    "getnameinfo",      (FARPROC) WspiapiLegacyGetNameInfo,     \\r
+    "freeaddrinfo",     (FARPROC) WspiapiLegacyFreeAddrInfo,    \\r
+}\r
+\r
+\r
+\r
+__inline\r
+FARPROC\r
+WINAPI\r
+WspiapiLoad(\r
+    IN  WORD                            wFunction)\r
+/*++\r
+\r
+Routine Description\r
+    try to locate the address family independent name resolution routines\r
+    (i.e. getaddrinfo, getnameinfo, freeaddrinfo, gai_strerror).\r
+    \r
+Locks\r
+    this function call is not synchronized.  hence the library containing\r
+    the routines might be loaded multiple times.  another option is to\r
+    synchronize through a spin lock using a static local variable and the\r
+    InterlockedExchange operation.  \r
+\r
+    \r
+Arguments\r
+    wFunction           ordinal # of the function to get the pointer to\r
+                        0   getaddrinfo\r
+                        1   getnameinfo\r
+                        2   freeaddrinfo\r
+    \r
+Return Value\r
+    address of the library/legacy routine\r
+\r
+--*/\r
+{\r
+    HMODULE                 hLibrary        = NULL;\r
+\r
+    // these static variables store state across calls, across threads.\r
+    static BOOL             bInitialized    = FALSE;\r
+    static WSPIAPI_FUNCTION rgtGlobal[]     = WSPIAPI_FUNCTION_ARRAY;\r
+    static const int        iNumGlobal      = (sizeof(rgtGlobal) /\r
+                                               sizeof(WSPIAPI_FUNCTION));\r
+    \r
+    // we overwrite rgtGlobal only if all routines exist in library.\r
+    WSPIAPI_FUNCTION        rgtLocal[]      = WSPIAPI_FUNCTION_ARRAY;\r
+    FARPROC                 fScratch        = NULL;\r
+    int                     i               = 0;\r
+    \r
+    \r
+    if (bInitialized)           // WspiapiLoad has already been called once\r
+        return (rgtGlobal[wFunction].pfAddress);\r
+\r
+    for (;;)                    // breakout loop\r
+    {\r
+        CHAR SystemDir[MAX_PATH + 1];\r
+        CHAR Path[MAX_PATH + 8];\r
+\r
+        if (GetSystemDirectoryA(SystemDir, MAX_PATH) == 0) \r
+        {\r
+            break;\r
+        }\r
+\r
+        // in Whistler and beyond...\r
+        // the routines are present in the WinSock 2 library (ws2_32.dll).\r
+        // printf("Looking in ws2_32 for getaddrinfo...\n");\r
+        _WSPIAPI_STRCPY_S(Path, _WSPIAPI_COUNTOF(Path), SystemDir);\r
+        _WSPIAPI_STRCAT_S(Path, _WSPIAPI_COUNTOF(Path), "\\ws2_32");\r
+        hLibrary = LoadLibraryA(Path);\r
+        if (hLibrary != NULL)\r
+        {\r
+            fScratch = GetProcAddress(hLibrary, "getaddrinfo");\r
+            if (fScratch == NULL)\r
+            {\r
+                FreeLibrary(hLibrary);\r
+                hLibrary = NULL;\r
+            }\r
+        }\r
+        if (hLibrary != NULL)\r
+            break;\r
+        \r
+\r
+        // in the IPv6 Technology Preview...        \r
+        // the routines are present in the IPv6 WinSock library (wship6.dll).\r
+        // printf("Looking in wship6 for getaddrinfo...\n");\r
+        _WSPIAPI_STRCPY_S(Path, _WSPIAPI_COUNTOF(Path), SystemDir);\r
+        _WSPIAPI_STRCAT_S(Path, _WSPIAPI_COUNTOF(Path), "\\wship6");\r
+        hLibrary = LoadLibraryA(Path);\r
+        if (hLibrary != NULL)\r
+        {\r
+            fScratch = GetProcAddress(hLibrary, "getaddrinfo");\r
+            if (fScratch == NULL)\r
+            {\r
+                FreeLibrary(hLibrary);\r
+                hLibrary = NULL;\r
+            }\r
+        }\r
+\r
+        break;\r
+    }\r
+\r
+\r
+    if (hLibrary != NULL)\r
+    {\r
+        // use routines from this library...\r
+        // since getaddrinfo is here, we expect all routines to be here,\r
+        // but will fall back to IPv4-only if any of them is missing.\r
+        for (i = 0; i < iNumGlobal; i++)\r
+        {\r
+            rgtLocal[i].pfAddress\r
+                = GetProcAddress(hLibrary, rgtLocal[i].pszName);\r
+            if (rgtLocal[i].pfAddress == NULL)\r
+            {\r
+                FreeLibrary(hLibrary);\r
+                hLibrary = NULL;\r
+                break;\r
+            }\r
+        }\r
+\r
+        if (hLibrary != NULL)\r
+        {\r
+            // printf("found!\n");\r
+            for (i = 0; i < iNumGlobal; i++)\r
+                rgtGlobal[i].pfAddress = rgtLocal[i].pfAddress;\r
+        }\r
+    }\r
+    \r
+    bInitialized = TRUE;\r
+    return (rgtGlobal[wFunction].pfAddress);\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiGetAddrInfo(\r
+    IN const char                       *nodename,\r
+    IN const char                       *servname,\r
+    IN const struct addrinfo            *hints,\r
+    OUT struct addrinfo                 **res)\r
+{\r
+    int                             iError;\r
+    static WSPIAPI_PGETADDRINFO     pfGetAddrInfo   = NULL;\r
+    \r
+    if (!pfGetAddrInfo)\r
+        pfGetAddrInfo   = (WSPIAPI_PGETADDRINFO) WspiapiLoad(0);\r
+\r
+    iError = (*pfGetAddrInfo)(nodename, servname, hints, res);\r
+    WSASetLastError(iError);\r
+    return iError;\r
+}\r
+\r
+\r
+\r
+__inline\r
+int\r
+WINAPI\r
+WspiapiGetNameInfo (\r
+    IN  const struct sockaddr           *sa,\r
+    IN  socklen_t                       salen,\r
+    OUT char                            *host,\r
+    IN  size_t                          hostlen,\r
+    OUT char                            *serv,\r
+    IN  size_t                          servlen,\r
+    IN  int                             flags)\r
+{\r
+    int                             iError;\r
+    static WSPIAPI_PGETNAMEINFO     pfGetNameInfo   = NULL;\r
+    \r
+    if (!pfGetNameInfo)\r
+        pfGetNameInfo   = (WSPIAPI_PGETNAMEINFO) WspiapiLoad(1);\r
+\r
+    iError = (*pfGetNameInfo)(sa, salen, host, hostlen, serv, servlen, flags);\r
+    WSASetLastError(iError);\r
+    return iError;\r
+}\r
+\r
+\r
+\r
+__inline\r
+void\r
+WINAPI\r
+WspiapiFreeAddrInfo (\r
+    IN  struct addrinfo                 *ai)\r
+{\r
+    static WSPIAPI_PFREEADDRINFO    pfFreeAddrInfo   = NULL;\r
+\r
+    if (!pfFreeAddrInfo)\r
+        pfFreeAddrInfo  = (WSPIAPI_PFREEADDRINFO) WspiapiLoad(2);\r
+    (*pfFreeAddrInfo)(ai);\r
+}\r
+\r
+#ifdef  __cplusplus\r
+}\r
+#endif\r
+\r
+#endif // if (NTDDI_VERSION >= WIN2K)\r
+#endif // _WSPIAPI_H_\r
+\r
diff --git a/misc/builddeps/dp.win32/lib/libSDL.dll.a b/misc/builddeps/dp.win32/lib/libSDL.dll.a
new file mode 100755 (executable)
index 0000000..64772b0
Binary files /dev/null and b/misc/builddeps/dp.win32/lib/libSDL.dll.a differ
diff --git a/misc/builddeps/dp.win32/lib/libSDL.la b/misc/builddeps/dp.win32/lib/libSDL.la
new file mode 100755 (executable)
index 0000000..4f0519f
--- /dev/null
@@ -0,0 +1,41 @@
+# libSDL.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/SDL.dll'
+
+# Names of this library.
+library_names='libSDL.dll.a'
+
+# The name of the static archive.
+old_library='libSDL.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -luser32 -lgdi32 -lwinmm -ldxguid'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libSDL.
+current=11
+age=11
+revision=3
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/local/lib'
diff --git a/misc/builddeps/dp.win32/lib/libSDLmain.a b/misc/builddeps/dp.win32/lib/libSDLmain.a
new file mode 100644 (file)
index 0000000..068941a
Binary files /dev/null and b/misc/builddeps/dp.win32/lib/libSDLmain.a differ
diff --git a/misc/builddeps/dp.win32/share/aclocal/sdl.m4 b/misc/builddeps/dp.win32/share/aclocal/sdl.m4
new file mode 100644 (file)
index 0000000..4a10202
--- /dev/null
@@ -0,0 +1,183 @@
+# Configure paths for SDL
+# Sam Lantinga 9/21/99
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+dnl
+AC_DEFUN([AM_PATH_SDL],
+[dnl 
+dnl Get the cflags and libraries from the sdl-config script
+dnl
+AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
+            sdl_prefix="$withval", sdl_prefix="")
+AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+            sdl_exec_prefix="$withval", sdl_exec_prefix="")
+AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
+                   , enable_sdltest=yes)
+
+  if test x$sdl_exec_prefix != x ; then
+    sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
+    if test x${SDL_CONFIG+set} != xset ; then
+      SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+    fi
+  fi
+  if test x$sdl_prefix != x ; then
+    sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
+    if test x${SDL_CONFIG+set} != xset ; then
+      SDL_CONFIG=$sdl_prefix/bin/sdl-config
+    fi
+  fi
+
+  as_save_PATH="$PATH"
+  if test "x$prefix" != xNONE; then
+    PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+  fi
+  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+  PATH="$as_save_PATH"
+  min_sdl_version=ifelse([$1], ,0.11.0,$1)
+  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+  no_sdl=""
+  if test "$SDL_CONFIG" = "no" ; then
+    no_sdl=yes
+  else
+    SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
+    SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
+
+    sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_sdltest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_CXXFLAGS="$CXXFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $SDL_CFLAGS"
+      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+      LIBS="$LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed SDL is sufficiently new. (Also sanity
+dnl checks the results of sdl-config to some extent
+dnl
+      rm -f conf.sdltest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  /* This hangs on some systems (?)
+  system ("touch conf.sdltest");
+  */
+  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_sdl_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_sdl_version");
+     exit(1);
+   }
+
+   if (($sdl_major_version > major) ||
+      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       CXXFLAGS="$ac_save_CXXFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_sdl" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$SDL_CONFIG" = "no" ; then
+       echo "*** The sdl-config script installed by SDL could not be found"
+       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the SDL_CONFIG environment variable to the"
+       echo "*** full path to sdl-config."
+     else
+       if test -f conf.sdltest ; then
+        :
+       else
+          echo "*** Could not run SDL test program, checking why..."
+          CFLAGS="$CFLAGS $SDL_CFLAGS"
+          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+          LIBS="$LIBS $SDL_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{ return 0; }
+#undef  main
+#define main K_and_R_C_main
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding SDL or finding the wrong"
+          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          CXXFLAGS="$ac_save_CXXFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     SDL_CFLAGS=""
+     SDL_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(SDL_CFLAGS)
+  AC_SUBST(SDL_LIBS)
+  rm -f conf.sdltest
+])
index 3ce97a59deb86e64d75443ff5bbf55a697a501ac..49f8aa008fbfe6722d8a9bf0824c72c6ed074197 100644 (file)
Binary files a/misc/buildfiles/win32/SDL.dll and b/misc/buildfiles/win32/SDL.dll differ