changeset 4862:7b1d35d98294

Merged Eli's Google Summer of Code work from SDL-gsoc2010-shaped_windows
author Sam Lantinga <slouken@libsdl.org>
date Sun, 22 Aug 2010 13:45:56 -0700
parents 102675835e08 (diff) b67815cf9f25 (current diff)
children cfe6336d7e60
files .hgignore Makefile.in VisualC/SDL_VS2005.sln Xcode/SDL/SDL.xcodeproj/project.pbxproj configure.in include/SDL_config.h.in include/SDL_video.h src/video/SDL_sysvideo.h src/video/SDL_video.c src/video/cocoa/SDL_cocoavideo.m src/video/cocoa/SDL_cocoawindow.m src/video/win32/SDL_win32events.c src/video/win32/SDL_win32video.c src/video/x11/SDL_x11sym.h src/video/x11/SDL_x11video.c src/video/x11/SDL_x11video.h src/video/x11/SDL_x11window.c test/Makefile.in
diffstat 266 files changed, 26752 insertions(+), 12776 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Aug 22 12:43:27 2010 -0700
+++ b/.hgignore	Sun Aug 22 13:45:56 2010 -0700
@@ -14,7 +14,19 @@
 build-deps
 VisualC
 VisualCE
-Xcode
+# for Xcode
+*.orig
+*.swp
+*.tmp
+*.rej
+*~
+*.o
+*.mode1*
+*.model*
+*.perspective*
+*.perspective*
+*.pbxuser
+(^|/)build($|/)
 .DS_Store
 sdl.pc
 include/SDL_config.h
@@ -32,52 +44,53 @@
 test/checkkeys
 test/graywin
 test/loopwave
-test/testpower
 test/testalpha
+test/testatomic
+test/testaudioinfo
 test/testbitmap
 test/testblitspeed
 test/testcdrom
+test/testcursor
+test/testdraw2
 test/testdyngl
+test/testdyngles
 test/testerror
+test/testeyes
 test/testfile
+test/testfill
 test/testgamma
+test/testgesture
 test/testgl
+test/testgl2
+test/testgles
+test/testhaptic
 test/testhread
 test/testiconv
+test/testime
+test/testintersections
 test/testjoystick
 test/testkeys
+test/testloadso
 test/testlock
+test/testmmousetablet
+test/testmultiaudio
 test/testoverlay
 test/testoverlay2
 test/testpalette
 test/testplatform
+test/testpower
+test/testresample
 test/testsem
 test/testsprite
+test/testsprite2
+test/testspriteminimal
 test/testtimer
 test/testver
 test/testvidinfo
 test/testwin
 test/testwm
+test/testwm2
 test/threadwin
 test/torturethread
-test/testloadso
-test/testgl2
-test/testcursor
-test/testwm2
-test/testmultiaudio
-test/testresample
-test/testdraw2
-test/testmmousetablet
-test/testdyngles
-test/testaudioinfo
-test/testgles
-test/testsprite2
-test/testintersections
-test/testhaptic
-test/testime
-test/testatomic
-test/testspriteminimal
-test/testfill
-test/testeyes
 test/*.exe
 test/*.dSYM
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.android	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,52 @@
+# Makefile to build the SDL library
+
+include ./android/config.cfg #get ANDROID_NDK
+
+TOOLS_PATH=$(ANDROID_NDK)/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin
+ANDROID_INCLUDES = 	-I$(ANDROID_NDK)/build/platforms/android-4/common/include \
+					-I$(ANDROID_NDK)/build/platforms/android-4/arch-arm/usr/include 
+INCLUDE = -I./include
+CFLAGS  = -g -O2 $(INCLUDE) $(ANDROID_INCLUDES) -DANDROID -DANDROID_NDK -static
+
+AR	= $(TOOLS_PATH)/arm-eabi-ar
+RANLIB	= $(TOOLS_PATH)/arm-eabi-ranlib
+CC = $(TOOLS_PATH)/arm-eabi-gcc
+
+
+CONFIG_H = include/SDL_config.h
+TARGET  = libSDL.a
+SOURCES = \
+	src/*.c \
+	src/audio/*.c \
+	src/cpuinfo/*.c \
+	src/events/*.c \
+	src/file/*.c \
+	src/joystick/*.c \
+	src/haptic/*.c \
+	src/stdlib/*.c \
+	src/thread/*.c \
+	src/timer/*.c \
+	src/video/*.c \
+	src/power/*.c \
+	src/audio/android/*.c \
+	src/video/android/*.c \
+	src/joystick/android/*.c \
+	src/haptic/dummy/*.c \
+	src/atomic/dummy/*.c \
+	src/thread/pthread/*.c \
+	src/timer/unix/*.c \
+	src/loadso/dummy/*.c \
+
+OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
+
+all: $(TARGET)
+
+$(TARGET): $(CONFIG_H) $(OBJECTS)
+	$(AR) crv $@ $^
+	$(RANLIB) $@
+
+$(CONFIG_H):
+	cp $(CONFIG_H).default $(CONFIG_H)
+
+clean:
+	rm -f $(TARGET) $(OBJECTS)
--- a/Makefile.in	Sun Aug 22 12:43:27 2010 -0700
+++ b/Makefile.in	Sun Aug 22 13:45:56 2010 -0700
@@ -44,7 +44,7 @@
 
 DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode Xcode-iPhoneOS
 
-HDRS = SDL.h SDL_assert.h SDL_atomic.h SDL_audio.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_shape.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
+HDRS = SDL.h SDL_assert.h SDL_atomic.h SDL_audio.h SDL_clipboard.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_gesture.h SDL_haptic.h SDL_input.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_shape.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_touch.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
 
 LT_AGE      = @LT_AGE@
 LT_CURRENT  = @LT_CURRENT@
--- a/Makefile.pandora	Sun Aug 22 12:43:27 2010 -0700
+++ b/Makefile.pandora	Sun Aug 22 13:45:56 2010 -0700
@@ -12,14 +12,15 @@
 
 TARGET  = libSDL.a
 
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c \
+SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
 	./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
 	./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
 	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c ./src/audio/dma/*.c \
 	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
 	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
-	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c ./src/cdrom/dummy/*.c \
-	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c
+	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
+	./src/atomic/linux/*.c \
+	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c 
 	
 
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
--- a/README.DirectFB	Sun Aug 22 12:43:27 2010 -0700
+++ b/README.DirectFB	Sun Aug 22 13:45:56 2010 -0700
@@ -65,10 +65,26 @@
 OPENGL Support
 ==============
 
-As of this writing 20070810 you need to pull Mesa from git and do the following:
+The following instructions will give you *software* opengl. However this
+works at least on all directfb supported platforms.
+
+As of this writing 20100802 you need to pull Mesa from git and do the following:
 
 ------------------------
+git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
 cd mesa 
+git clone git://anongit.freedesktop.org/git/mesa/mesa
+------------------------
+
+Edit configs/linux-directfb so that the Directories-section looks like
+------------------------
+# Directories
+SRC_DIRS     = mesa glu 
+GLU_DIRS     = sgi
+DRIVER_DIRS  = directfb
+PROGRAM_DIRS = 
+------------------------
+
 make linux-directfb
 make
 
@@ -87,3 +103,4 @@
 export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
 
 ./testgl
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.android	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,45 @@
+================================================================================
+Simple DirectMedia Layer for Android
+================================================================================
+
+Requirements: Android NDK r4 or later
+
+================================================================================
+ How the port works
+================================================================================
+
+- Android applications are Java-based, optionally with parts written in C
+- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to 
+the SDL library
+- This means that your application C code must be placed inside an android 
+Java project, along with some C support code that communicates with Java
+- This eventually produces a standard Android .apk package
+
+
+
+
+
+
+================================================================================
+ Building an app
+================================================================================
+
+Instructions:
+1. Edit android/config.cfg to point to the location of the NDK
+2. Run 'make -f Makefile.android'. If all goes well, libsdl.a should be created
+3. Place your application source files in android/project/jni
+4. Edit the Android.mk to include your source files
+5. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
+6. Run 'ant' in android/testproject. This compiles the .java and eventually 
+creates a .apk with the C source embedded
+7. 'ant install' will push the apk to the device or emulator (if connected)
+
+
+
+
+================================================================================
+ Known issues
+================================================================================
+
+- SDL audio (although it's mostly written, just not working properly yet)
+- TODO. I'm sure there's a bunch more stuff I haven't thought of 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.gesture	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,72 @@
+===========================================================================
+Dollar Gestures
+===========================================================================
+SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
+
+Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. 
+
+Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
+
+Recording:
+----------
+To begin recording on a touch device call:
+SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
+
+Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
+A SDL_DOLLARRECORD event is a dgesture with the following fields:
+
+event.dgesture.touchId   - the Id of the touch used to record the gesture.
+event.dgesture.gestureId - the unique id of the recoreded gesture.
+
+
+Performing:
+-----------
+As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
+
+event.dgesture.touchId    - the Id of the touch which performed the gesture.
+event.dgesture.gestureId  - the unique id of the closest gesture to the performed stroke.
+event.dgesture.error      - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
+event.dgesture.numFingers - the number of fingers used to draw the stroke.
+
+Most programs will want to define an appropriate error threshold and check to be sure taht the error of a gesture is not abnormally high (an indicator that no gesture was performed). 
+
+
+
+Saving:
+-------
+To save a template, call SDL_SaveDollarTemplate(gestureId, src) where gestureId is the id of the gesture you want to save, and src is an SDL_RWops pointer to the file where the gesture will be stored.
+
+To save all currently loaded templates, call SDL_SaveAllDollarTemplates(src) where source is an SDL_RWops pointer to the file where the gesture will be stored.
+
+Both functions return the number of gestures sucessfully saved.
+
+
+Loading:
+--------
+To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file. 
+
+SDL_LoadDollarTemplates returns the number of templates sucessfully loaded. 
+
+
+
+===========================================================================
+Multi Gestures
+===========================================================================
+SDL provides simple support for pinch/rotate/swipe gestures. 
+Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
+
+event.mgesture.touchId - the Id of the touch on which the gesture was performed.
+event.mgesture.x       - the normalized x cooridinate of the gesture. (0..1)
+event.mgesture.y       - the normalized y cooridinate of the gesture. (0..1)
+event.mgesture.dTheta  - the amount that the fingers rotated during this motion.
+event.mgesture.dDist   - the amount that the fingers pinched during this motion.
+event.mgesture.numFingers - the number of fingers used in the gesture.
+
+
+===========================================================================
+Notes
+===========================================================================
+For a complete example see test/testgesture.c
+
+Please direct questions/comments to:
+   jim.tla+sdl_touch@gmail.com
--- a/README.iphoneos	Sun Aug 22 12:43:27 2010 -0700
+++ b/README.iphoneos	Sun Aug 22 13:45:56 2010 -0700
@@ -34,14 +34,6 @@
 5.  Delete the contents of main.m and program your app as a regular SDL program instead.  You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code.
 
 ==============================================================================
-Notes -- Touch Input
-==============================================================================
-
-Touch input in SDL for iPhone OS is presently exposed through SDL's mouse input API.  Multi-touch input is reported as multiple mice, with each touch associated with a specific mouse.  This association stays coherent from the time the touch starts to the time a touch ends.
-
-By default, multi-touch is turned ON.  This requires some care, because if you simply respond to mouse events without checking which mouse caused the event, you may end up fetching data from the wrong mouse, ie, from an incorrect or invalid touch.  To turn multi-touch OFF, you can recompile SDL for iPhone with the macro SDL_IPHONE_MULTIPLE_MICE (found in SDL_config_iphoneos.h) set to 0.
-
-==============================================================================
 Notes -- Accelerometer as Joystick
 ==============================================================================
 
@@ -55,7 +47,7 @@
 
 Your SDL application for iPhone uses OpenGL ES for video by default.
 
-OpenGL ES for iPhone supports two display pixel formats, RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively.  By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
+OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively.  By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
 
 If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.touch	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,101 @@
+===========================================================================
+System Specific Notes
+===========================================================================
+Linux:
+The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
+
+Mac: 
+The Mac and Iphone API's are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
+
+iPhone: 
+Works out of box.
+
+Windows:
+Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
+
+===========================================================================
+Events
+===========================================================================
+SDL_FINGERDOWN:
+Sent when a finger (or stylus) is placed on a touch device.
+Fields:
+event.tfinger.touchId  - the Id of the touch device.
+event.tfinger.fingerId - the Id of the finger which just went down.
+event.tfinger.x        - the x coordinate of the touch (0..touch.xres)
+event.tfinger.y        - the y coordinate of the touch (0..touch.yres)
+event.tfinger.pressure - the pressure of the touch (0..touch.pressureres)
+
+SDL_FINGERMOTION:
+Sent when a finger (or stylus) is moved on the touch device.
+Fields:
+Same as FINGERDOWN but with additional:
+event.tfginer.dx       - change in x coordinate during this motion event.
+event.tfginer.dy       - change in y coordinate during this motion event.
+
+SDL_FINGERMOTION:
+Sent when a finger (or stylus) is lifted from the touch device.
+Fields:
+Same as FINGERDOWN.
+
+
+===========================================================================
+Functions
+===========================================================================
+SDL provides the ability to access the underlying Touch and Finger structures.
+These structures should _never_ be modified.
+
+The following functions are included from SDL_Touch.h
+
+To get a SDL_Touch device call SDL_GetTouch(touchId). 
+This returns an SDL_Touch*. 
+IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouch will return null. Be sure to check for this!
+
+An SDL_Touch has the following fields:
+>xres,yres,pressures:
+	The resolution at which x,y, and pressure values are reported. Currently these will always be equal to 2^15, but this may not always be the case. 
+
+>pressure_max, pressure_min, x_max, x_min, y_max, y_min
+	Which give, respectively, the maximum and minumum values that the touch digitizer can return for pressure, x coordiniate, and y coordinate AS REPORTED BY THE OPERATING SYSTEM.
+On Mac/iPhone systems _max will always be 0, and _min will always be 1. 
+
+>native_xres,native_yres,native_pressureres:
+	The native resolution of the touch device AS REPORTED BY THE OPERATING SYSTEM.
+On Mac/iPhone systems these will always be 1.
+
+>num_fingers:
+	The number of fingers currently down on the device.
+
+>fingers:
+	An array of pointers to the fingers which are on the device.
+
+
+The most common reason to access a touch device is to normalize inputs. This would be accomplished by code like the following:
+
+      SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
+      if(inTouch == NULL) continue; //The touch has been removed
+
+      float x = ((float)event.tfinger.x)/inTouch->xres;
+      float y = ((float)event.tfinger.y)/inTouch->yres;
+
+
+
+To get an SDL_Finger, call SDL_GetFinger(touch,fingerId), where touch is a pointer to an SDL_Touch device, and fingerId is the id of the requested finger.
+This returns an SDL_Finger*, or null if the finger does not exist, or has been removed.
+An SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the FINGERUP event is polled. 
+As a result, be very careful to check for null return values.
+
+An SDL_Finger has the following fields:
+>x,y,pressure:
+	The current coordinates of the touch.
+>xdelta,ydelta: 
+	The change in position resulting from the last finger motion.
+>last_x, last_y, last_pressure:
+	 The previous coordinates of the touch.
+
+===========================================================================
+Notes
+===========================================================================
+For a complete example see test/testgesture.c
+
+Please direct questions/comments to:
+   jim.tla+sdl_touch@gmail.com
--- a/VisualC/SDL.sln	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release_NoSTDIO|Win32 = Release_NoSTDIO|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
--- a/VisualC/SDL/SDL.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1038 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="SDL"
-	ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-	RootNamespace="SDL"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/SDL.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="msimg32.lib winmm.lib"
-				OutputFile=".\Debug/SDL.dll"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				IgnoreAllDefaultLibraries="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/SDL.pdb"
-				SubSystem="2"
-				ImportLibrary=".\Debug/SDL.lib"
-				CLRUnmanagedCodeCheck="false"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				EnableIntrinsicFunctions="false"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/SDL.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="msimg32.lib winmm.lib"
-				OutputFile=".\Release/SDL.dll"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				IgnoreAllDefaultLibraries="true"
-				ProgramDatabaseFile=".\Release/SDL.pdb"
-				SubSystem="2"
-				ImportLibrary=".\Release/SDL.lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="API Headers"
-			>
-			<File
-				RelativePath="..\..\include\SDL.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_assert.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_atomic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_audio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_compat.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_config_win32.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_copying.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_cpuinfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_endian.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_error.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_events.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_haptic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_joystick.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_keyboard.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_keysym.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_loadso.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_main.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mouse.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mutex.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_name.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_opengl.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_opengles.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_pixels.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_platform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_power.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_quit.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_rect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_rwops.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_scancode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_stdinc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_surface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_syswm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_thread.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_timer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_types.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_version.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_video.h"
-				>
-			</File>
-		</Filter>
-		<File
-			RelativePath="..\..\src\events\blank_cursor.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\default_cursor.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\windx5\directx.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_log.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_pow.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_rem_pio2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_sqrt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_cos.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_rem_pio2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_sin.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\math.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\math_private.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\mmx.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_copysign.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_cos.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_fabs.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_floor.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_scalbn.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_sin.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_alphamult.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_alphamult.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_assert.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audio_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiocvt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiodev.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiodev_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiomem.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blendfillrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blendline.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blendpoint.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blendrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_0.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_1.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_A.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_auto.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_auto.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_copy.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_copy.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_N.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_slow.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_slow.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_bmp.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_compat.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_d3drender.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_d3drender.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\windib\SDL_dibaudio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\windib\SDL_dibaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_draw.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_drawline.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_drawpoint.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_drawrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\windx5\SDL_dx5audio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\windx5\SDL_dx5audio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\win32\SDL_dxjoystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_error.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_error_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_events.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_events_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_fatal.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_fatal.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_fillrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_gamma.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_gdirender.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_gdirender.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_getenv.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_glesfuncs.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_glfuncs.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\SDL_haptic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_iconv.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_joystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_joystick_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_keyboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_keyboard_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_leaks.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_malloc.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_m68k.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_m68k.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_MMX.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_MMX.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\win32\SDL_mmjoystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_mouse.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_mouse_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullrender.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullrender_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullvideo.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_pixels.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_pixels_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\power\SDL_power.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_qsort.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_quit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_rect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_rect_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_renderer_gl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_renderer_gl.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_renderer_sw.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_renderer_sw.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_RLEaccel.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_RLEaccel_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\file\SDL_rwops.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_stdlib.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_stretch.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_stretch_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_string.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_surface.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_sysaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_sysevents.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\win32\SDL_syshaptic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\SDL_syshaptic.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\loadso\win32\SDL_sysloadso.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\win32\SDL_sysmutex.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\power\windows\SDL_syspower.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\win32\SDL_syssem.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\win32\SDL_systhread.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_systhread.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\win32\SDL_systhread_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\win32\SDL_systimer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_systimer.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_sysvideo.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_thread.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_thread_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_timer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_timer_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_video.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_vkeys.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_wave.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_wave.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32events.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32events.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32gamma.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32gamma.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32keyboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32keyboard.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32modes.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32modes.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32mouse.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32mouse.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32opengl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32opengl.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32video.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32video.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32window.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\SDL_win32window.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_yuv_mmx.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_yuv_sw.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_yuv_sw_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\win32\wmmsg.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/SDL/SDL_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,1108 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+<<<<<<< local
+	Version="8.00"
+=======
+	Version="9.00"
+>>>>>>> other
+	Name="SDL"
+	ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
+	RootNamespace="SDL"
+<<<<<<< local
+=======
+	TargetFrameworkVersion="131072"
+>>>>>>> other
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Making sure basic SDL headers are in place..."
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/SDL.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\include"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/SDL.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+<<<<<<< local
+				AdditionalOptions="/MACHINE:I386"
+=======
+				AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;msvcrt.lib"
+>>>>>>> other
+				AdditionalDependencies="msimg32.lib winmm.lib"
+				OutputFile=".\Debug/SDL.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+<<<<<<< local
+				IgnoreAllDefaultLibraries="true"
+=======
+				IgnoreAllDefaultLibraries="false"
+				IgnoreDefaultLibraryNames=""
+>>>>>>> other
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/SDL.pdb"
+<<<<<<< local
+				SubSystem="2"
+=======
+				SubSystem="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+>>>>>>> other
+				ImportLibrary=".\Debug/SDL.lib"
+<<<<<<< local
+=======
+				Profile="true"
+				CLRThreadAttribute="0"
+>>>>>>> other
+				CLRUnmanagedCodeCheck="false"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+<<<<<<< local
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+=======
+>>>>>>> other
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Making sure basic SDL headers are in place..."
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/SDL.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="false"
+				AdditionalIncludeDirectories="..\..\include"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400;__MMX__;__3dNOW__;__SSE__;__SSE2__"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/SDL.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="false"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="msimg32.lib winmm.lib"
+				OutputFile=".\Release/SDL.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreAllDefaultLibraries="true"
+				ProgramDatabaseFile=".\Release/SDL.pdb"
+				SubSystem="2"
+<<<<<<< local
+=======
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+>>>>>>> other
+				ImportLibrary=".\Release/SDL.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+<<<<<<< local
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+=======
+>>>>>>> other
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="API Headers"
+			>
+			<File
+				RelativePath="..\..\include\SDL.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_assert.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_atomic.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_audio.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_clipboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_compat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_config_win32.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_copying.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_cpuinfo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_endian.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_error.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_events.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_haptic.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_joystick.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_keyboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_keysym.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_loadso.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_main.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_mouse.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_mutex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_name.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_opengl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_opengles.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_pixels.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_platform.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_power.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_quit.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_rect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_rwops.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_scancode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_stdinc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_surface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_syswm.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_thread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_timer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_types.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_version.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_video.h"
+				>
+			</File>
+		</Filter>
+		<File
+			RelativePath="..\..\src\events\blank_cursor.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\default_cursor.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\windx5\directx.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\e_log.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\e_pow.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\e_rem_pio2.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\e_sqrt.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\k_cos.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\k_rem_pio2.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\k_sin.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\math.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\math_private.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\mmx.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_copysign.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_cos.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_fabs.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_floor.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_scalbn.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\libm\s_sin.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_alphamult.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_alphamult.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_assert.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audio.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audio_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audiocvt.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audiodev.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audiodev_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audiomem.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendfillrect.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendline.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendpoint.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendrect.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_0.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_1.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_A.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_auto.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_auto.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_copy.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_copy.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_N.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_slow.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blit_slow.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_bmp.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_clipboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_clipboardevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_clipboardevents_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_compat.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_d3drender.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_d3drender.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\windib\SDL_dibaudio.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\windib\SDL_dibaudio.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_draw.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_drawline.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_drawpoint.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_drawrect.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\windx5\SDL_dx5audio.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\windx5\SDL_dx5audio.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\joystick\win32\SDL_dxjoystick.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_error.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_error_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_events.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_events_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_fatal.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\SDL_fatal.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_fillrect.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_gamma.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_gdirender.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_gdirender.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_getenv.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_glesfuncs.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_glfuncs.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\haptic\SDL_haptic.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_iconv.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\joystick\SDL_joystick.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\joystick\SDL_joystick_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_keyboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_keyboard_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_leaks.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_malloc.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_m68k.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_m68k.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_MMX.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_MMX.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\joystick\win32\SDL_mmjoystick.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_mouse.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_mouse_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullrender.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullrender_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\dummy\SDL_nullvideo.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_pixels.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_pixels_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\power\SDL_power.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_qsort.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_quit.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_rect.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_rect_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_renderer_gl.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_renderer_gl.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_renderer_sw.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_renderer_sw.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_RLEaccel.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_RLEaccel_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\file\SDL_rwops.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_stdlib.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_stretch.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\stdlib\SDL_string.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_surface.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_sysaudio.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_sysevents.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\haptic\win32\SDL_syshaptic.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\haptic\SDL_syshaptic.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\loadso\win32\SDL_sysloadso.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\win32\SDL_sysmutex.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\power\windows\SDL_syspower.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\win32\SDL_syssem.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\win32\SDL_systhread.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\SDL_systhread.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\win32\SDL_systhread_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\timer\win32\SDL_systimer.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\timer\SDL_systimer.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_sysvideo.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\SDL_thread.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\thread\SDL_thread_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\timer\SDL_timer.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\timer\SDL_timer_c.h"
+			>
+		</File>
+		<File
+<<<<<<< local
+=======
+			RelativePath="..\..\src\events\SDL_touch.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_touch_c.h"
+			>
+		</File>
+		<File
+>>>>>>> other
+			RelativePath="..\..\src\video\SDL_video.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_vkeys.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_wave.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\audio\SDL_wave.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32clipboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32clipboard.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32events.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32events.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32gamma.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32gamma.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32keyboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32keyboard.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32modes.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32modes.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32mouse.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32mouse.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32opengl.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32opengl.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32video.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32video.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32window.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32window.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_windowevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_windowevents_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_yuv_mmx.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_yuv_sw.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_yuv_sw_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\wmmsg.h"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/VisualC/SDL/SDL_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -383,6 +383,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_clipboard.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_compat.h"
 				>
 			</File>
@@ -716,6 +720,18 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_clipboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_clipboardevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_clipboardevents_c.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\SDL_compat.c"
 			>
 		</File>
@@ -996,10 +1012,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\video\SDL_stretch_c.h"
-			>
-		</File>
-		<File
 			RelativePath="..\..\src\stdlib\SDL_string.c"
 			>
 		</File>
@@ -1100,6 +1112,14 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\win32\SDL_win32clipboard.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\win32\SDL_win32clipboard.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\win32\SDL_win32events.c"
 			>
 		</File>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/SDL_VS2005.sln	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL_VS2005.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain_VS2005.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release_NoSTDIO|Win32 = Release_NoSTDIO|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
--- a/VisualC/SDL_VS2008.sln	Sun Aug 22 12:43:27 2010 -0700
+++ b/VisualC/SDL_VS2008.sln	Sun Aug 22 13:45:56 2010 -0700
@@ -6,7 +6,127 @@
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "automated", "tests\automated\automated.vcproj", "{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "automated", "tests\automated\automated_VS2008.vcproj", "{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2008.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graywin", "tests\graywin\graywin_VS2008.vcproj", "{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2008.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testalpha", "tests\testalpha\testalpha_VS2008.vcproj", "{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2008.vcproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2008.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamma", "tests\testgamma\testgamma_VS2008.vcproj", "{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl", "tests\testgl\testgl_VS2008.vcproj", "{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2008.vcproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08304}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay", "tests\testoverlay\testoverlay_VS2008.vcproj", "{9E320A14-B443-4DD7-8725-B7020DCFF730}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2008.vcproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpalette", "tests\testpalette\testpalette_VS2008.vcproj", "{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2008.vcproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite_VS2008.vcproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2008.vcproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvidinfo", "tests\testvidinfo\testvidinfo_VS2008.vcproj", "{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwin", "tests\testwin\testwin_VS2008.vcproj", "{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
+	ProjectSection(ProjectDependencies) = postProject
+		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
+		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\testwm_VS2008.vcproj", "{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
 	ProjectSection(ProjectDependencies) = postProject
 		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
 		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
@@ -55,11 +175,211 @@
 		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
 		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
 		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
+		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.Build.0 = Debug|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|x64.ActiveCfg = Debug|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.ActiveCfg = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.Build.0 = Release|Win32
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|x64.ActiveCfg = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.Build.0 = Debug|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|x64.ActiveCfg = Debug|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.ActiveCfg = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.Build.0 = Release|Win32
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|x64.ActiveCfg = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.Build.0 = Debug|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|x64.ActiveCfg = Debug|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.ActiveCfg = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.Build.0 = Release|Win32
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|x64.ActiveCfg = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.Build.0 = Debug|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|x64.ActiveCfg = Debug|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.ActiveCfg = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.Build.0 = Release|Win32
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|x64.ActiveCfg = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32
+		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Debug|Win32.Build.0 = Debug|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Debug|x64.ActiveCfg = Debug|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release|Win32.ActiveCfg = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release|Win32.Build.0 = Release|Win32
+		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release|x64.ActiveCfg = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.Build.0 = Debug|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|x64.ActiveCfg = Debug|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.ActiveCfg = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.Build.0 = Release|Win32
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|x64.ActiveCfg = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
+		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Debug|Win32.Build.0 = Debug|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Debug|x64.ActiveCfg = Debug|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release|Win32.ActiveCfg = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release|Win32.Build.0 = Release|Win32
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}.Release|x64.ActiveCfg = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.Build.0 = Debug|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|x64.ActiveCfg = Debug|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.ActiveCfg = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.Build.0 = Release|Win32
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|x64.ActiveCfg = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.Build.0 = Debug|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|x64.ActiveCfg = Debug|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.ActiveCfg = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.Build.0 = Release|Win32
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|x64.ActiveCfg = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.Build.0 = Debug|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|x64.ActiveCfg = Debug|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.ActiveCfg = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.Build.0 = Release|Win32
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|x64.ActiveCfg = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 		{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{0BCCA0BF-073E-439E-BCE0-C9353C177487} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{7814D54B-65D3-4677-AD77-E0B980B4FA2D} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{D974A0DF-3E2E-445C-A2EB-E899E9B582CB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{55812185-D13C-4022-9C81-32E0F4A08304} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{9E320A14-B443-4DD7-8725-B7020DCFF730} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{575FD095-EDAB-4BD4-B733-CD4A874F6FB0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{0FFD1A21-11DB-492C-A989-E4F195B0C441} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
+		{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
 	EndGlobalSection
 EndGlobal
--- a/VisualC/SDLmain/SDLmain.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="SDLmain"
-	ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/SDLmain.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile=".\Release\SDLmain.lib"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release_NoSTDIO|Win32"
-			OutputDirectory=".\Release_NOSTDIO"
-			IntermediateDirectory=".\Release_NOSTDIO"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release_NOSTDIO/SDLmain.pch"
-				AssemblerListingLocation=".\Release_NOSTDIO/"
-				ObjectFile=".\Release_NOSTDIO/"
-				ProgramDataBaseFileName=".\Release_NOSTDIO/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile=".\Release_NOSTDIO\SDLmain.lib"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/SDLmain.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile=".\Debug\SDLmain.lib"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Src\Main\Win32\SDL_win32_main.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/SDLmain/SDLmain_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+<<<<<<< local
+	Version="8.00"
+=======
+	Version="9.00"
+>>>>>>> other
+	Name="SDLmain"
+	ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
+<<<<<<< local
+=======
+	TargetFrameworkVersion="131072"
+>>>>>>> other
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Making sure basic SDL headers are in place..."
+<<<<<<< local
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+=======
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+>>>>>>> other
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/SDLmain.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\SDLmain.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release_NoSTDIO|Win32"
+			OutputDirectory=".\Release_NOSTDIO"
+			IntermediateDirectory=".\Release_NOSTDIO"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Making sure basic SDL headers are in place..."
+<<<<<<< local
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+=======
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+>>>>>>> other
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release_NOSTDIO/SDLmain.pch"
+				AssemblerListingLocation=".\Release_NOSTDIO/"
+				ObjectFile=".\Release_NOSTDIO/"
+				ProgramDataBaseFileName=".\Release_NOSTDIO/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release_NOSTDIO\SDLmain.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Making sure basic SDL headers are in place..."
+<<<<<<< local
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+=======
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+>>>>>>> other
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/SDLmain.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="1"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\SDLmain.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Src\Main\Win32\SDL_win32_main.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/SDLmain/SDLmain_VS2008.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/VisualC/SDLmain/SDLmain_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -29,7 +29,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -166,7 +166,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -303,7 +303,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
+				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
--- a/VisualC/tests/automated/automated.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="automated"
-	ProjectGUID="{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
-	RootNamespace="automated"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="196613"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="$(SolutionDir)\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories="$(SolutionDir)\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath="..\..\..\test\automated\audio\audio.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\common\common.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\platform\platform.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\rect\rect.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\render\render.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\rwops\rwops.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\SDL_at.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\surface\surface.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\testsdl.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath="..\..\..\test\automated\audio\audio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\common\common.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\common\images.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\platform\platform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\render\render.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\rwops\rwops.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\SDL_at.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\test\automated\surface\surface.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/automated/automated_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="automated"
+	ProjectGUID="{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
+	RootNamespace="automated"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="$(SolutionDir)\..\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\test\automated\audio\audio.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\common\common.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\platform\platform.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\rect\rect.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\render\render.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\rwops\rwops.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\rwops\TestSupportRWops_Generic.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\SDL_at.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\surface\surface.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\testsdl.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\test\automated\audio\audio.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\common\common.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\common\images.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\platform\platform.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\render\render.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\rwops\rwops.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\SDL_at.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\test\automated\surface\surface.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/checkkeys/checkkeys.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="checkkeys"
-	ProjectGUID="{26828762-C95D-4637-9CB1-7F0979523813}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/checkkeys.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/checkkeys.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/checkkeys.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/checkkeys.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/checkkeys.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/checkkeys.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/checkkeys.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/checkkeys.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\checkkeys.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/checkkeys/checkkeys_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="checkkeys"
+	ProjectGUID="{26828762-C95D-4637-9CB1-7F0979523813}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/checkkeys.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/checkkeys.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/checkkeys.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/checkkeys.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/checkkeys.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/checkkeys.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/checkkeys.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/checkkeys.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\checkkeys.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="checkkeys"
+	ProjectGUID="{26828762-C95D-4637-9CB1-7F0979523813}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/checkkeys.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/checkkeys.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/checkkeys.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/checkkeys.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/checkkeys.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/checkkeys.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/checkkeys.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/checkkeys.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\checkkeys.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/graywin/graywin.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="graywin"
-	ProjectGUID="{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/graywin.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/graywin.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/graywin.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/graywin.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/graywin.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/graywin.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/graywin.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/graywin.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\graywin.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/graywin/graywin_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="graywin"
+	ProjectGUID="{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/graywin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/graywin.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/graywin.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/graywin.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/graywin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/graywin.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/graywin.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/graywin.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\graywin.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/graywin/graywin_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="graywin"
+	ProjectGUID="{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/graywin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/graywin.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/graywin.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/graywin.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/graywin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/graywin.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/graywin.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/graywin.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\graywin.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/loopwave/loopwave.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="loopwave"
-	ProjectGUID="{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/loopwave.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/loopwave.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/loopwave.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/loopwave.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/loopwave.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/loopwave.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/loopwave.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/loopwave.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\Test\Loopwave.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/loopwave/loopwave_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="loopwave"
+	ProjectGUID="{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/loopwave.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/loopwave.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/loopwave.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/loopwave.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/loopwave.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/loopwave.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/loopwave.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/loopwave.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\Loopwave.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/loopwave/loopwave_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="loopwave"
+	ProjectGUID="{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/loopwave.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/loopwave.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/loopwave.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/loopwave.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/loopwave.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/loopwave.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/loopwave.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/loopwave.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\Loopwave.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testalpha/testalpha.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testalpha"
-	ProjectGUID="{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testalpha.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testalpha.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testalpha.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testalpha.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testalpha.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testalpha.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testalpha.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testalpha.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\Test\testalpha.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testalpha/testalpha_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testalpha"
+	ProjectGUID="{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testalpha.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testalpha.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testalpha.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testalpha.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testalpha.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testalpha.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testalpha.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testalpha.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\Test\testalpha.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testalpha/testalpha_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testalpha"
+	ProjectGUID="{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testalpha.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testalpha.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testalpha.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testalpha.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testalpha.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testalpha.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testalpha.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testalpha.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\testalpha.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testdraw2/testdraw2.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testdraw2"
-	ProjectGUID="{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testdraw2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testdraw2.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testdraw2.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testdraw2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testdraw2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testdraw2.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testdraw2.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testdraw2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\common.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testdraw2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testdraw2/testdraw2_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testdraw2"
+	ProjectGUID="{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testdraw2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testdraw2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testdraw2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testdraw2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testdraw2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testdraw2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testdraw2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testdraw2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testdraw2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testdraw2"
+	ProjectGUID="{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testdraw2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testdraw2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testdraw2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testdraw2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testdraw2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testdraw2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testdraw2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testdraw2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testdraw2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testfile/testfile.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testfile"
-	ProjectGUID="{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testfile.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testfile.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testfile.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testfile.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testfile.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testfile.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testfile.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testfile.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\Test\testfile.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testfile/testfile_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testfile"
+	ProjectGUID="{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testfile.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testfile.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testfile.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testfile.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testfile.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testfile.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testfile.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testfile.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\Test\testfile.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testfile/testfile_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testfile"
+	ProjectGUID="{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testfile.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testfile.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testfile.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testfile.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testfile.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testfile.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testfile.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testfile.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\testfile.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testgamma/testgamma.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testgamma"
-	ProjectGUID="{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testgamma.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testgamma.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testgamma.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testgamma.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testgamma.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testgamma.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testgamma.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testgamma.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testgamma.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgamma/testgamma_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testgamma"
+	ProjectGUID="{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgamma.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgamma.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testgamma.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgamma.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgamma.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgamma.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testgamma.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgamma.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testgamma.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgamma/testgamma_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testgamma"
+	ProjectGUID="{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgamma.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgamma.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testgamma.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgamma.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgamma.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgamma.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testgamma.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgamma.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testgamma.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testgl/testgl.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testgl"
-	ProjectGUID="{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testgl.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testgl.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				OutputFile=".\Debug/testgl.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testgl.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testgl.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testgl.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				OutputFile=".\Release/testgl.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testgl.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testgl.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgl/testgl_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testgl"
+	ProjectGUID="{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgl.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgl.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Debug/testgl.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgl.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgl.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgl.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Release/testgl.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgl.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testgl.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgl/testgl_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testgl"
+	ProjectGUID="{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgl.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgl.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Debug/testgl.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgl.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgl.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgl.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Release/testgl.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgl.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testgl.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testgl2/testgl2.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testgl2"
-	ProjectGUID="{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testgl2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testgl2.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				OutputFile=".\Debug/testgl2.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testgl2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testgl2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testgl2.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				OutputFile=".\Release/testgl2.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testgl2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\common.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testgl2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgl2/testgl2_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testgl2"
+	ProjectGUID="{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgl2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgl2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Debug/testgl2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgl2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgl2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgl2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Release/testgl2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgl2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testgl2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testgl2/testgl2_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testgl2"
+	ProjectGUID="{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testgl2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testgl2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Debug/testgl2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testgl2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testgl2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testgl2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				AdditionalDependencies="opengl32.lib"
+				OutputFile=".\Release/testgl2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testgl2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testgl2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testjoystick/testjoystick.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testjoystick"
-	ProjectGUID="{55812185-D13C-4022-9C81-32E0F4A08304}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testjoystick.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testjoystick.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testjoystick.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testjoystick.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testjoystick.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testjoystick.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testjoystick.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testjoystick.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testjoystick.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testjoystick/testjoystick_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testjoystick"
+	ProjectGUID="{55812185-D13C-4022-9C81-32E0F4A08304}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testjoystick.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testjoystick.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testjoystick.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testjoystick.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testjoystick.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testjoystick.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testjoystick.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testjoystick.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testjoystick.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testjoystick"
+	ProjectGUID="{55812185-D13C-4022-9C81-32E0F4A08304}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testjoystick.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testjoystick.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testjoystick.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testjoystick.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testjoystick.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testjoystick.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testjoystick.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testjoystick.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testjoystick.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testoverlay/testoverlay.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testoverlay"
-	ProjectGUID="{9E320A14-B443-4DD7-8725-B7020DCFF730}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testoverlay.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testoverlay.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testoverlay.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testoverlay.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testoverlay.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testoverlay.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testoverlay.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testoverlay.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testoverlay.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testoverlay/testoverlay_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testoverlay"
+	ProjectGUID="{9E320A14-B443-4DD7-8725-B7020DCFF730}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testoverlay.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testoverlay.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testoverlay.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testoverlay.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testoverlay.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testoverlay.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testoverlay.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testoverlay.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testoverlay.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testoverlay/testoverlay_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testoverlay"
+	ProjectGUID="{9E320A14-B443-4DD7-8725-B7020DCFF730}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testoverlay.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testoverlay.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testoverlay.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testoverlay.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testoverlay.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testoverlay.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testoverlay.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testoverlay.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testoverlay.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testoverlay2/testoverlay2.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testoverlay2"
-	ProjectGUID="{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testoverlay2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testoverlay2.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testoverlay2.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testoverlay2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testoverlay2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testoverlay2.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testoverlay2.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testoverlay2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testoverlay2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testoverlay2/testoverlay2_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testoverlay2"
+	ProjectGUID="{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testoverlay2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testoverlay2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testoverlay2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testoverlay2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testoverlay2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testoverlay2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testoverlay2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testoverlay2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testoverlay2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testoverlay2"
+	ProjectGUID="{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testoverlay2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testoverlay2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testoverlay2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testoverlay2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testoverlay2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testoverlay2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testoverlay2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testoverlay2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testoverlay2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testpalette/testpalette.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testpalette"
-	ProjectGUID="{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testpalette.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testpalette.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testpalette.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testpalette.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testpalette.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testpalette.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testpalette.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testpalette.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testpalette.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testpalette/testpalette_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testpalette"
+	ProjectGUID="{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testpalette.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testpalette.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testpalette.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testpalette.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testpalette.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testpalette.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testpalette.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testpalette.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testpalette.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testpalette/testpalette_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testpalette"
+	ProjectGUID="{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testpalette.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testpalette.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testpalette.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testpalette.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testpalette.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testpalette.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testpalette.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testpalette.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testpalette.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testplatform/testplatform.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testplatform"
-	ProjectGUID="{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testplatform.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				RuntimeLibrary="2"
-				PrecompiledHeaderFile=".\Debug/testplatform.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile=".\Debug/testplatform.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testplatform.pdb"
-				SubSystem="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Debug/testplatform.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testplatform.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				PrecompiledHeaderFile=".\Release/testplatform.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile=".\Release/testplatform.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testplatform.pdb"
-				SubSystem="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Release/testplatform.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\Test\testplatform.c"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					AdditionalIncludeDirectories=""
-					PreprocessorDefinitions=""
-				/>
-			</FileConfiguration>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					AdditionalIncludeDirectories=""
-					PreprocessorDefinitions=""
-				/>
-			</FileConfiguration>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testplatform/testplatform_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testplatform"
+	ProjectGUID="{26932B24-EFC6-4E3A-B277-ED653DA37968}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testplatform.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				PrecompiledHeaderFile=".\Debug/testplatform.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\Debug/testplatform.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testplatform.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/testplatform.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testplatform.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/testplatform.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\Release/testplatform.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testplatform.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/testplatform.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\Test\testplatform.c"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					AdditionalIncludeDirectories=""
+					PreprocessorDefinitions=""
+				/>
+			</FileConfiguration>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testplatform/testplatform_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testplatform"
+	ProjectGUID="{26932B24-EFC6-4E3A-B277-ED653DA37968}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testplatform.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				PrecompiledHeaderFile=".\Debug/testplatform.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\Debug/testplatform.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testplatform.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/testplatform.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testplatform.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/testplatform.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\Release/testplatform.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testplatform.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/testplatform.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\testplatform.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testpower/testpower.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testpower"
-	ProjectGUID="{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-	RootNamespace="testpower"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testwm.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testwm.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testwm.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testpower.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testpower.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testpower.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testpower.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testpower.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testpower.c"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					PrecompiledHeaderFile=".\Debug/testpower.pch"
-				/>
-			</FileConfiguration>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testpower/testpower_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testpower"
+	ProjectGUID="{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
+	RootNamespace="testpower"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwm.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testpower.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testpower.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testpower.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testpower.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testpower.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testpower.c"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					PrecompiledHeaderFile=".\Debug/testpower.pch"
+				/>
+			</FileConfiguration>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testpower/testpower_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testpower"
+	ProjectGUID="{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
+	RootNamespace="testpower"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwm.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testpower.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testpower.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testpower.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testpower.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testpower.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testpower.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testsprite/testsprite.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testsprite"
-	ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testsprite.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testsprite.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testsprite.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testsprite.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testsprite.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testsprite.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testsprite.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testsprite.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testsprite.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testsprite/testsprite_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testsprite"
+	ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testsprite.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testsprite.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testsprite.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testsprite.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testsprite.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testsprite.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testsprite.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testsprite.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testsprite.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testsprite/testsprite_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testsprite"
+	ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E5}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testsprite.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testsprite.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testsprite.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testsprite.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testsprite.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testsprite.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testsprite.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testsprite.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testsprite.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testsprite2/testsprite2.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testsprite2"
-	ProjectGUID="{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testsprite2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testsprite2.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testsprite2.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testsprite2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testsprite2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testsprite2.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testsprite2.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testsprite2.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\common.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testsprite2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testsprite2/testsprite2_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testsprite2"
+	ProjectGUID="{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testsprite2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testsprite2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testsprite2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testsprite2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testsprite2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testsprite2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testsprite2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testsprite2.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testsprite2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testsprite2"
+	ProjectGUID="{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testsprite2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testsprite2.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testsprite2.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testsprite2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testsprite2.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testsprite2.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testsprite2.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testsprite2.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\common.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testsprite2.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testvidinfo/testvidinfo.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testvidinfo"
-	ProjectGUID="{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testvidinfo.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testvidinfo.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testvidinfo.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testvidinfo.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testvidinfo.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testvidinfo.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testvidinfo.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testvidinfo.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\Test\testvidinfo.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testvidinfo/testvidinfo_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testvidinfo"
+	ProjectGUID="{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testvidinfo.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testvidinfo.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testvidinfo.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testvidinfo.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testvidinfo.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testvidinfo.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testvidinfo.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testvidinfo.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\Test\testvidinfo.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testvidinfo/testvidinfo_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testvidinfo"
+	ProjectGUID="{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testvidinfo.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testvidinfo.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testvidinfo.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testvidinfo.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testvidinfo.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testvidinfo.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testvidinfo.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testvidinfo.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\testvidinfo.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testwin/testwin.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testwin"
-	ProjectGUID="{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testwin.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testwin.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testwin.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testwin.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testwin.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testwin.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testwin.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testwin.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\Test\Testwin.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testwin/testwin_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testwin"
+	ProjectGUID="{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwin.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwin.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testwin.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testwin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testwin.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testwin.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testwin.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\Test\Testwin.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testwin/testwin_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testwin"
+	ProjectGUID="{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwin.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwin.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testwin.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testwin.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testwin.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testwin.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testwin.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\Test\Testwin.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/VisualC/tests/testwm/testwm.vcproj	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="testwm"
-	ProjectGUID="{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testwm.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testwm.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Debug/testwm.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testwm.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testwm.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testwm.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				OutputFile=".\Release/testwm.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testwm.pdb"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\Sdl\Debug\SDL.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testwm.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testwm/testwm_VS2005.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="testwm"
+	ProjectGUID="{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwm.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testwm.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testwm.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testwm.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testwm.pdb"
+				SubSystem="2"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\Sdl\Debug\SDL.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\test\testwm.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualC/tests/testwm/testwm_VS2008.vcproj	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="testwm"
+	ProjectGUID="{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/testwm.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Debug/testwm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/testwm.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/testwm.tlb"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..\include"
+				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/testwm.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:I386"
+				OutputFile=".\Release/testwm.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/testwm.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="..\..\..\test\testwm.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 13:45:56 2010 -0700
@@ -105,6 +105,13 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
+		04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = FD1B48920E313154007AB34E /* SDLiPhoneOS.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 006E982211955059001DE610;
+			remoteInfo = testsdl;
+		};
 		FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = FD1B48920E313154007AB34E /* SDLiPhoneOS.xcodeproj */;
@@ -318,6 +325,7 @@
 			isa = PBXGroup;
 			children = (
 				FD1B489E0E313154007AB34E /* libSDLiPhoneOS.a */,
+				04AB757111E563D200BE9753 /* testsdl.app */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -523,6 +531,13 @@
 /* End PBXProject section */
 
 /* Begin PBXReferenceProxy section */
+		04AB757111E563D200BE9753 /* testsdl.app */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.application;
+			path = testsdl.app;
+			remoteRef = 04AB757011E563D200BE9753 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
 		FD1B489E0E313154007AB34E /* libSDLiPhoneOS.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
@@ -731,7 +746,7 @@
 				OTHER_CFLAGS = "";
 				PREBINDING = NO;
 				PRELINK_LIBS = "";
-				SDKROOT = iphoneos2.0;
+				SDKROOT = iphoneos3.2;
 			};
 			name = Debug;
 		};
@@ -749,7 +764,7 @@
 				OTHER_CFLAGS = "";
 				PREBINDING = NO;
 				PRELINK_LIBS = "";
-				SDKROOT = iphoneos2.0;
+				SDKROOT = iphoneos3.2;
 			};
 			name = Release;
 		};
--- a/Xcode-iPhoneOS/Demos/src/fireworks.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/Demos/src/fireworks.c	Sun Aug 22 13:45:56 2010 -0700
@@ -430,9 +430,7 @@
                 done = 1;
             }
             if (event.type == SDL_MOUSEBUTTONDOWN) {
-                int which = event.button.which;
                 int x, y;
-                SDL_SelectMouse(which);
                 SDL_GetMouseState(&x, &y);
                 spawnEmitterParticle(x, y);
             }
--- a/Xcode-iPhoneOS/Demos/src/mixer.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/Demos/src/mixer.c	Sun Aug 22 13:45:56 2010 -0700
@@ -124,10 +124,9 @@
 
     int x, y, mouseIndex, i, drumIndex;
 
-    mouseIndex = event->button.which;
+    mouseIndex = 0;
     drumIndex = -1;
 
-    SDL_SelectMouse(mouseIndex);
     SDL_GetMouseState(&x, &y);
     /* check if we hit any of the drum buttons */
     for (i = 0; i < NUM_DRUMS; i++) {
@@ -153,7 +152,7 @@
 handleMouseButtonUp(SDL_Event * event)
 {
     int i;
-    int mouseIndex = event->button.which;
+    int mouseIndex = 0;
     /* check if this should cause any of the buttons to become unpressed */
     for (i = 0; i < NUM_DRUMS; i++) {
         if (buttons[i].touchIndex == mouseIndex) {
--- a/Xcode-iPhoneOS/Demos/src/touch.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/Demos/src/touch.c	Sun Aug 22 13:45:56 2010 -0700
@@ -106,7 +106,6 @@
             done = 1;
             break;
         case SDL_MOUSEMOTION:
-            SDL_SelectMouse(event.motion.which);        /* select 'mouse' (touch) that moved */
             state = SDL_GetMouseState(&x, &y);  /* get its location */
             SDL_GetRelativeMouseState(&dx, &dy);        /* find how much the mouse moved */
             if (state & SDL_BUTTON_LMASK) {     /* is the mouse (touch) down? */
--- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 13:45:56 2010 -0700
@@ -62,11 +62,16 @@
 		0098A5631195B4D900343137 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5621195B4D900343137 /* OpenGLES.framework */; };
 		0098A5651195B4D900343137 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5641195B4D900343137 /* UIKit.framework */; };
 		0098A5851195B5E200343137 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5841195B5E200343137 /* QuartzCore.framework */; };
+		0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; };
+		0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
 		043DD76F10FD8A0000DED673 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */; };
 		043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */; };
 		043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */; };
 		043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */; };
 		04461DEE0EA76BA3006C462D /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04461DED0EA76BA3006C462D /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB311E6069F0076F181 /* SDL_clipboard.h */; };
+		044E5FB611E6069F0076F181 /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB411E6069F0076F181 /* SDL_input.h */; };
+		044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; };
 		0463873F0F0B5B7D0041FD65 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387370F0B5B7D0041FD65 /* SDL_blendline.c */; };
 		046387400F0B5B7D0041FD65 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */; };
 		046387410F0B5B7D0041FD65 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387390F0B5B7D0041FD65 /* SDL_blendrect.c */; };
@@ -90,6 +95,12 @@
 		04B2ECEE1025CE4800F9BC5F /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = 04B2ECE81025CE4800F9BC5F /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		04B2ECFF1025CEB900F9BC5F /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04B2ECF11025CEB900F9BC5F /* SDL_atomic.c */; };
 		04B2ED081025CF9E00F9BC5F /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 04B2ED061025CF9E00F9BC5F /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */; };
+		04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; };
+		04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */; };
+		04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
+		04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */; };
+		04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */; };
 		04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; };
 		04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; };
 		04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
@@ -308,11 +319,16 @@
 		0098A5621195B4D900343137 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
 		0098A5641195B4D900343137 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
 		0098A5841195B5E200343137 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+		0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = "<group>"; };
+		0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = "<group>"; };
 		043DD76B10FD8A0000DED673 /* SDL_alphamult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_alphamult.c; sourceTree = "<group>"; };
 		043DD76C10FD8A0000DED673 /* SDL_alphamult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_alphamult.h; sourceTree = "<group>"; };
 		043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
 		043DD76E10FD8A0000DED673 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = "<group>"; };
 		04461DED0EA76BA3006C462D /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_haptic.h; path = ../../include/SDL_haptic.h; sourceTree = SOURCE_ROOT; };
+		044E5FB311E6069F0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
+		044E5FB411E6069F0076F181 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; };
+		044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
 		046387370F0B5B7D0041FD65 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
 		046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
 		046387390F0B5B7D0041FD65 /* SDL_blendrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendrect.c; sourceTree = "<group>"; };
@@ -336,6 +352,12 @@
 		04B2ECE81025CE4800F9BC5F /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_revision.h; path = ../../include/SDL_revision.h; sourceTree = SOURCE_ROOT; };
 		04B2ECF11025CEB900F9BC5F /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
 		04B2ED061025CF9E00F9BC5F /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = ../../include/SDL_config.h; sourceTree = SOURCE_ROOT; };
+		04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = "<group>"; };
+		04BA9D6011EF474A00B60E01 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = "<group>"; };
+		04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = "<group>"; };
+		04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
+		04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; };
+		04BA9D7C11EF497E00B60E01 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = ../../include/SDL_touch.h; sourceTree = SOURCE_ROOT; };
 		04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = ../../include/SDL_config_iphoneos.h; sourceTree = SOURCE_ROOT; };
 		04F2AF531104ABC300D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
 		04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
@@ -826,19 +848,24 @@
 		FD99B8BC0DD52E5C00FB1D6B /* Public Headers */ = {
 			isa = PBXGroup;
 			children = (
-				04F2AF531104ABC300D6DDF7 /* SDL_assert.h */,
-				04B2ECE61025CE4800F9BC5F /* SDL_atomic.h */,
 				FD99B8CC0DD52EB400FB1D6B /* begin_code.h */,
 				FD99B8CD0DD52EB400FB1D6B /* close_code.h */,
+				FD99B8F50DD52EB400FB1D6B /* SDL.h */,
+				04F2AF531104ABC300D6DDF7 /* SDL_assert.h */,
+				04B2ECE61025CE4800F9BC5F /* SDL_atomic.h */,
 				FD99B8CF0DD52EB400FB1D6B /* SDL_audio.h */,
+				044E5FB311E6069F0076F181 /* SDL_clipboard.h */,
 				FD99B8D10DD52EB400FB1D6B /* SDL_compat.h */,
+				04B2ED061025CF9E00F9BC5F /* SDL_config.h */,
 				04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */,
-				04B2ED061025CF9E00F9BC5F /* SDL_config.h */,
 				FD99B8DA0DD52EB400FB1D6B /* SDL_copying.h */,
 				FD99B8DB0DD52EB400FB1D6B /* SDL_cpuinfo.h */,
+				FD99B8F60DD52EB400FB1D6B /* SDL_endian.h */,
 				FD99B8DC0DD52EB400FB1D6B /* SDL_error.h */,
 				FD99B8DD0DD52EB400FB1D6B /* SDL_events.h */,
+				04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */,
 				04461DED0EA76BA3006C462D /* SDL_haptic.h */,
+				044E5FB411E6069F0076F181 /* SDL_input.h */,
 				FD99B8DE0DD52EB400FB1D6B /* SDL_joystick.h */,
 				FD99B8DF0DD52EB400FB1D6B /* SDL_keyboard.h */,
 				FD99B8E00DD52EB400FB1D6B /* SDL_keysym.h */,
@@ -862,11 +889,10 @@
 				FD99B8EF0DD52EB400FB1D6B /* SDL_syswm.h */,
 				FD99B8F00DD52EB400FB1D6B /* SDL_thread.h */,
 				FD99B8F10DD52EB400FB1D6B /* SDL_timer.h */,
+				04BA9D7C11EF497E00B60E01 /* SDL_touch.h */,
 				FD99B8F20DD52EB400FB1D6B /* SDL_types.h */,
 				FD99B8F30DD52EB400FB1D6B /* SDL_version.h */,
 				FD99B8F40DD52EB400FB1D6B /* SDL_video.h */,
-				FD99B8F50DD52EB400FB1D6B /* SDL.h */,
-				FD99B8F60DD52EB400FB1D6B /* SDL_endian.h */,
 			);
 			name = "Public Headers";
 			sourceTree = "<group>";
@@ -944,12 +970,18 @@
 		FD99B98C0DD52EDC00FB1D6B /* events */ = {
 			isa = PBXGroup;
 			children = (
+				04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */,
+				04BA9D6011EF474A00B60E01 /* SDL_gesture.c */,
+				04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */,
+				04BA9D6211EF474A00B60E01 /* SDL_touch.c */,
 				FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */,
 				FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */,
 				FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */,
 				FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */,
 				FD99B9910DD52EDC00FB1D6B /* scancodes_win32.h */,
 				FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */,
+				0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */,
+				0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */,
 				FD99B9930DD52EDC00FB1D6B /* SDL_events.c */,
 				FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */,
 				FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */,
@@ -1023,6 +1055,7 @@
 		FDA682420DF2374D00F98A1A /* video */ = {
 			isa = PBXGroup;
 			children = (
+				044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
 				FD689F090E26E5D900F90B21 /* uikit */,
 				FDA685F40DF244C800F98A1A /* dummy */,
 				0495E6850E97408800152DFE /* SDL_glfuncs.h */,
@@ -1173,6 +1206,13 @@
 				043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */,
 				04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */,
 				006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
+				044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */,
+				044E5FB611E6069F0076F181 /* SDL_input.h in Headers */,
+				0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
+				04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */,
+				04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */,
+				04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */,
+				04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1411,6 +1451,10 @@
 				56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */,
 				56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */,
 				006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
+				044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */,
+				0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */,
+				04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */,
+				04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
--- a/Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Sun Aug 22 13:45:56 2010 -0700
@@ -287,6 +287,13 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
+		0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 006E982211955059001DE610 /* testsdl.app */;
+			remoteInfo = testsdl;
+		};
 		FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */;
@@ -298,9 +305,7 @@
 
 /* Begin PBXFileReference section */
 		1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		56ED04F7118A8FCC00A56AA6 /* testpower-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testpower-Info.plist"; sourceTree = "<group>"; };
 		56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		56ED050F118A8FE400A56AA6 /* Info copy.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info copy.plist"; sourceTree = "<group>"; };
 		56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
 		FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDLiPhoneOS.xcodeproj; path = ../SDL/SDLiPhoneOS.xcodeproj; sourceTree = SOURCE_ROOT; };
 		FDA8A7400E2D0F1600EA573E /* testalpha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testalpha.c; path = ../../test/testalpha.c; sourceTree = SOURCE_ROOT; };
@@ -861,14 +866,11 @@
 		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
 			isa = PBXGroup;
 			children = (
-				56ED0510118A904200A56AA6 /* testpower.c */,
 				FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */,
 				FDA8AAD60E2D339A00EA573E /* Resources */,
 				FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */,
 				FDA8A73B0E2D0F0400EA573E /* src */,
 				19C28FACFE9D520D11CA2CBB /* Products */,
-				56ED04F7118A8FCC00A56AA6 /* testpower-Info.plist */,
-				56ED050F118A8FE400A56AA6 /* Info copy.plist */,
 			);
 			name = CustomTemplate;
 			sourceTree = "<group>";
@@ -877,6 +879,7 @@
 			isa = PBXGroup;
 			children = (
 				FD1B48B80E3131CA007AB34E /* libSDLiPhoneOS.a */,
+				0466EE7011E565E4000198A4 /* testsdl.app */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -910,6 +913,7 @@
 				FDA8A7540E2D0F1600EA573E /* testoverlay2.c */,
 				FDA8A7550E2D0F1600EA573E /* testpalette.c */,
 				FDA8A7560E2D0F1600EA573E /* testplatform.c */,
+				56ED0510118A904200A56AA6 /* testpower.c */,
 				FDA8A7570E2D0F1600EA573E /* testsem.c */,
 				FDA8A7580E2D0F1600EA573E /* testsprite.c */,
 				FDA8A7590E2D0F1600EA573E /* testsprite2.c */,
@@ -1502,6 +1506,13 @@
 /* End PBXProject section */
 
 /* Begin PBXReferenceProxy section */
+		0466EE7011E565E4000198A4 /* testsdl.app */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.application;
+			path = testsdl.app;
+			remoteRef = 0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
 		FD1B48B80E3131CA007AB34E /* libSDLiPhoneOS.a */ = {
 			isa = PBXReferenceProxy;
 			fileType = archive.ar;
@@ -2034,7 +2045,7 @@
 				ONLY_ACTIVE_ARCH = YES;
 				PREBINDING = NO;
 				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
-				SDKROOT = iphoneos2.2.1;
+				SDKROOT = iphoneos3.2;
 			};
 			name = Debug;
 		};
@@ -2049,7 +2060,7 @@
 				HEADER_SEARCH_PATHS = ../../include;
 				PREBINDING = NO;
 				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
-				SDKROOT = iphoneos2.2.1;
+				SDKROOT = iphoneos3.2;
 			};
 			name = Release;
 		};
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Sun Aug 22 12:43:27 2010 -0700
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Sun Aug 22 13:45:56 2010 -0700
@@ -438,6 +438,24 @@
 		00D8DA281195093100638393 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA151195093100638393 /* SDL_at.c */; };
 		00D8DA291195093100638393 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA181195093100638393 /* surface.c */; };
 		00D8DA2A1195093100638393 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA1A1195093100638393 /* testsdl.c */; };
+		0420496111E6EFD3007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420495F11E6EFD3007E7EC9 /* SDL_clipboardevents_c.h */; };
+		0420496211E6EFD3007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496011E6EFD3007E7EC9 /* SDL_clipboardevents.c */; };
+		0420496311E6EFD3007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420495F11E6EFD3007E7EC9 /* SDL_clipboardevents_c.h */; };
+		0420496411E6EFD3007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496011E6EFD3007E7EC9 /* SDL_clipboardevents.c */; };
+		0420497A11E6F052007E7EC9 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497411E6F052007E7EC9 /* blank_cursor.h */; };
+		0420497B11E6F052007E7EC9 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497511E6F052007E7EC9 /* default_cursor.h */; };
+		0420497C11E6F052007E7EC9 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497611E6F052007E7EC9 /* scancodes_darwin.h */; };
+		0420497D11E6F052007E7EC9 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497711E6F052007E7EC9 /* scancodes_linux.h */; };
+		0420497E11E6F052007E7EC9 /* scancodes_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497811E6F052007E7EC9 /* scancodes_win32.h */; };
+		0420497F11E6F052007E7EC9 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497911E6F052007E7EC9 /* scancodes_xfree86.h */; };
+		0420498011E6F052007E7EC9 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497411E6F052007E7EC9 /* blank_cursor.h */; };
+		0420498111E6F052007E7EC9 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497511E6F052007E7EC9 /* default_cursor.h */; };
+		0420498211E6F052007E7EC9 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497611E6F052007E7EC9 /* scancodes_darwin.h */; };
+		0420498311E6F052007E7EC9 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497711E6F052007E7EC9 /* scancodes_linux.h */; };
+		0420498411E6F052007E7EC9 /* scancodes_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497811E6F052007E7EC9 /* scancodes_win32.h */; };
+		0420498511E6F052007E7EC9 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420497911E6F052007E7EC9 /* scancodes_xfree86.h */; };
+		044E5F8511E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; };
 		046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
 		046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
 		046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; };
@@ -446,10 +464,28 @@
 		04DB838D10FD8C81000519B5 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04DB838B10FD8C81000519B5 /* SDL_drawrect.c */; };
 		04DB838E10FD8C81000519B5 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04DB838A10FD8C81000519B5 /* SDL_blendfillrect.c */; };
 		04DB838F10FD8C81000519B5 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04DB838B10FD8C81000519B5 /* SDL_drawrect.c */; };
+		04DEA57111E6006A00386CAC /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA56F11E6006A00386CAC /* SDL_input.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		04DEA57311E6006A00386CAC /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA56F11E6006A00386CAC /* SDL_input.h */; };
+		04DEA57511E6009000386CAC /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04DEA57411E6009000386CAC /* SDL_clipboard.c */; };
+		04DEA57611E6009000386CAC /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04DEA57411E6009000386CAC /* SDL_clipboard.c */; };
+		04DEA57911E600A600386CAC /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA57711E600A600386CAC /* SDL_cocoaclipboard.h */; };
+		04DEA57A11E600A600386CAC /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DEA57811E600A600386CAC /* SDL_cocoaclipboard.m */; };
+		04DEA57B11E600A600386CAC /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA57711E600A600386CAC /* SDL_cocoaclipboard.h */; };
+		04DEA57C11E600A600386CAC /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DEA57811E600A600386CAC /* SDL_cocoaclipboard.m */; };
 		04F2AF661104AC0800D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF651104AC0800D6DDF7 /* SDL_assert.c */; };
 		04F2AF671104AC0800D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF651104AC0800D6DDF7 /* SDL_assert.c */; };
-		04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; };
+		04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; };
+		8CB0A76C11F6A84800CBA2DE /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CB0A76A11F6A84800CBA2DE /* SDL_x11clipboard.c */; };
+		8CB0A76D11F6A84800CBA2DE /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A76B11F6A84800CBA2DE /* SDL_x11clipboard.h */; };
+		8CB0A77811F6A87F00CBA2DE /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */; };
+		8CB0A77911F6A87F00CBA2DE /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */; };
+		8CB0A77E11F6A8E700CBA2DE /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77A11F6A8E700CBA2DE /* SDL_gesture_c.h */; };
+		8CB0A77F11F6A8E700CBA2DE /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CB0A77B11F6A8E700CBA2DE /* SDL_gesture.c */; };
+		8CB0A78011F6A8E700CBA2DE /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77C11F6A8E700CBA2DE /* SDL_touch_c.h */; };
+		8CB0A78111F6A8E700CBA2DE /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CB0A77D11F6A8E700CBA2DE /* SDL_touch.c */; };
+		8CB0A78711F6A90B00CBA2DE /* SDL_eventtouch.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CB0A78511F6A90B00CBA2DE /* SDL_eventtouch.c */; };
+		8CB0A78811F6A90B00CBA2DE /* SDL_eventtouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A78611F6A90B00CBA2DE /* SDL_eventtouch.h */; };
 		4537737D1207C4CE002F0F45 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4537737B1207C4CE002F0F45 /* SDL_shape_internals.h */; };
 		4537737E1207C4CE002F0F45 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 4537737C1207C4CE002F0F45 /* SDL_shape.c */; };
 		453773821207C518002F0F45 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 453773811207C518002F0F45 /* SDL_shape.h */; };
@@ -802,10 +838,23 @@
 		01538439006D7D947F000001 /* SDL_fatal.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_fatal.c; path = ../../src/SDL_fatal.c; sourceTree = SOURCE_ROOT; };
 		0153843C006D7D947F000001 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = SOURCE_ROOT; };
 		01538445006D7EC67F000001 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_thread.c; path = ../../src/thread/SDL_thread.c; sourceTree = SOURCE_ROOT; };
+		0420495F11E6EFD3007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = "<group>"; };
+		0420496011E6EFD3007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = "<group>"; };
+		0420497411E6F052007E7EC9 /* blank_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blank_cursor.h; sourceTree = "<group>"; };
+		0420497511E6F052007E7EC9 /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = "<group>"; };
+		0420497611E6F052007E7EC9 /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = "<group>"; };
+		0420497711E6F052007E7EC9 /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = "<group>"; };
+		0420497811E6F052007E7EC9 /* scancodes_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_win32.h; sourceTree = "<group>"; };
+		0420497911E6F052007E7EC9 /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = "<group>"; };
+		044E5F8411E6051C0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
 		046B91E90A11B53500FB151C /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = "<group>"; };
 		046B92100A11B8AD00FB151C /* SDL_dlcompat.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dlcompat.c; sourceTree = "<group>"; };
 		04DB838A10FD8C81000519B5 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
 		04DB838B10FD8C81000519B5 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = "<group>"; };
+		04DEA56F11E6006A00386CAC /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; };
+		04DEA57411E6009000386CAC /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
+		04DEA57711E600A600386CAC /* SDL_cocoaclipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaclipboard.h; sourceTree = "<group>"; };
+		04DEA57811E600A600386CAC /* SDL_cocoaclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaclipboard.m; sourceTree = "<group>"; };
 		04F2AF651104AC0800D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
 		04F2AF681104AC4500D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
 		083E489D006D88D97F000001 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = "<group>"; };
@@ -832,6 +881,17 @@
 		0C5AF5FD01191D2B7F000001 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = ../../include/SDL_version.h; sourceTree = SOURCE_ROOT; };
 		0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; };
 		0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; };
+		8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "gestureSDLTest-Info.plist"; sourceTree = "<group>"; };
+		8CB0A76A11F6A84800CBA2DE /* SDL_x11clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11clipboard.c; sourceTree = "<group>"; };
+		8CB0A76B11F6A84800CBA2DE /* SDL_x11clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11clipboard.h; sourceTree = "<group>"; };
+		8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; };
+		8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = ../../include/SDL_touch.h; sourceTree = SOURCE_ROOT; };
+		8CB0A77A11F6A8E700CBA2DE /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = "<group>"; };
+		8CB0A77B11F6A8E700CBA2DE /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = "<group>"; };
+		8CB0A77C11F6A8E700CBA2DE /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = "<group>"; };
+		8CB0A77D11F6A8E700CBA2DE /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
+		8CB0A78511F6A90B00CBA2DE /* SDL_eventtouch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_eventtouch.c; sourceTree = "<group>"; };
+		8CB0A78611F6A90B00CBA2DE /* SDL_eventtouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_eventtouch.h; sourceTree = "<group>"; };
 		4537737B1207C4CE002F0F45 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = "<group>"; };
 		4537737C1207C4CE002F0F45 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = "<group>"; };
 		453773811207C518002F0F45 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_shape.h; path = ../../include/SDL_shape.h; sourceTree = SOURCE_ROOT; };
@@ -1047,6 +1107,8 @@
 		00CFA703106B498A00758660 /* cocoa */ = {
 			isa = PBXGroup;
 			children = (
+				04DEA57711E600A600386CAC /* SDL_cocoaclipboard.h */,
+				04DEA57811E600A600386CAC /* SDL_cocoaclipboard.m */,
 				00CFA704106B498A00758660 /* SDL_cocoaevents.h */,
 				00CFA705106B498A00758660 /* SDL_cocoaevents.m */,
 				00CFA706106B498A00758660 /* SDL_cocoakeyboard.h */,
@@ -1083,6 +1145,10 @@
 		00CFA719106B498B00758660 /* x11 */ = {
 			isa = PBXGroup;
 			children = (
+				8CB0A78511F6A90B00CBA2DE /* SDL_eventtouch.c */,
+				8CB0A78611F6A90B00CBA2DE /* SDL_eventtouch.h */,
+				8CB0A76A11F6A84800CBA2DE /* SDL_x11clipboard.c */,
+				8CB0A76B11F6A84800CBA2DE /* SDL_x11clipboard.h */,
 				00CFA71A106B498B00758660 /* imKStoUCS.c */,
 				00CFA71B106B498B00758660 /* imKStoUCS.h */,
 				00CFA71C106B498B00758660 /* SDL_x11dyn.c */,
@@ -1330,6 +1396,18 @@
 		01538367006D79147F000001 /* events */ = {
 			isa = PBXGroup;
 			children = (
+				8CB0A77A11F6A8E700CBA2DE /* SDL_gesture_c.h */,
+				8CB0A77B11F6A8E700CBA2DE /* SDL_gesture.c */,
+				8CB0A77C11F6A8E700CBA2DE /* SDL_touch_c.h */,
+				8CB0A77D11F6A8E700CBA2DE /* SDL_touch.c */,
+				0420497411E6F052007E7EC9 /* blank_cursor.h */,
+				0420497511E6F052007E7EC9 /* default_cursor.h */,
+				0420497611E6F052007E7EC9 /* scancodes_darwin.h */,
+				0420497711E6F052007E7EC9 /* scancodes_linux.h */,
+				0420497811E6F052007E7EC9 /* scancodes_win32.h */,
+				0420497911E6F052007E7EC9 /* scancodes_xfree86.h */,
+				0420495F11E6EFD3007E7EC9 /* SDL_clipboardevents_c.h */,
+				0420496011E6EFD3007E7EC9 /* SDL_clipboardevents.c */,
 				00CFA6C2106B480800758660 /* SDL_events_c.h */,
 				01538369006D79147F000001 /* SDL_events.c */,
 				00CFA6C3106B480800758660 /* SDL_keyboard_c.h */,
@@ -1398,6 +1476,7 @@
 				00CFA7FA106B49B600758660 /* SDL_blit.c */,
 				00CFA7FB106B49B600758660 /* SDL_blit.h */,
 				00CFA7FC106B49B600758660 /* SDL_bmp.c */,
+				04DEA57411E6009000386CAC /* SDL_clipboard.c */,
 				00CFA7FD106B49B600758660 /* SDL_draw.h */,
 				00CFA7FE106B49B600758660 /* SDL_drawline.c */,
 				00CFA7FF106B49B600758660 /* SDL_drawpoint.c */,
@@ -1440,12 +1519,15 @@
 		0153844A006D81B07F000001 /* Public Headers */ = {
 			isa = PBXGroup;
 			children = (
-				04F2AF681104AC4500D6DDF7 /* SDL_assert.h */,
+				8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */,
+				8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */,
 				0C5AF5E501191D2B7F000001 /* begin_code.h */,
 				0C5AF5E601191D2B7F000001 /* close_code.h */,
 				0C5AF5FF01191D2B7F000001 /* SDL.h */,
+				04F2AF681104AC4500D6DDF7 /* SDL_assert.h */,
 				00CFA67A106B44CE00758660 /* SDL_atomic.h */,
 				0C5AF5E801191D2B7F000001 /* SDL_audio.h */,
+				044E5F8411E6051C0076F181 /* SDL_clipboard.h */,
 				00CFA67B106B44CE00758660 /* SDL_compat.h */,
 				00162D3709BD1FA90037C8D0 /* SDL_config.h */,
 				00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */,
@@ -1455,6 +1537,7 @@
 				0C5AF5ED01191D2B7F000001 /* SDL_error.h */,
 				0C5AF5EE01191D2B7F000001 /* SDL_events.h */,
 				00CFA67C106B44CE00758660 /* SDL_haptic.h */,
+				04DEA56F11E6006A00386CAC /* SDL_input.h */,
 				0C5AF5F001191D2B7F000001 /* SDL_joystick.h */,
 				0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */,
 				0C5AF5F201191D2B7F000001 /* SDL_keysym.h */,
@@ -1530,6 +1613,7 @@
 				BECDF66B0761BA81005FE872 /* Info-Framework.plist */,
 				BEC562FE0761C0E800A33029 /* Linked Frameworks */,
 				00D8D9F11195090700638393 /* testsdl-Info.plist */,
+				8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */,
 			);
 			comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n";
 			name = SDLFramework;
@@ -1764,6 +1848,22 @@
 				00A6EBDA1078D569001EEA06 /* SDL_revision.h in Headers */,
 				04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */,
 				006E95B011952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
+				04DEA57111E6006A00386CAC /* SDL_input.h in Headers */,
+				04DEA57911E600A600386CAC /* SDL_cocoaclipboard.h in Headers */,
+				044E5F8511E6051C0076F181 /* SDL_clipboard.h in Headers */,
+				0420496111E6EFD3007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
+				0420497A11E6F052007E7EC9 /* blank_cursor.h in Headers */,
+				0420497B11E6F052007E7EC9 /* default_cursor.h in Headers */,
+				0420497C11E6F052007E7EC9 /* scancodes_darwin.h in Headers */,
+				0420497D11E6F052007E7EC9 /* scancodes_linux.h in Headers */,
+				0420497E11E6F052007E7EC9 /* scancodes_win32.h in Headers */,
+				0420497F11E6F052007E7EC9 /* scancodes_xfree86.h in Headers */,
+				8CB0A76D11F6A84800CBA2DE /* SDL_x11clipboard.h in Headers */,
+				8CB0A77811F6A87F00CBA2DE /* SDL_gesture.h in Headers */,
+				8CB0A77911F6A87F00CBA2DE /* SDL_touch.h in Headers */,
+				8CB0A77E11F6A8E700CBA2DE /* SDL_gesture_c.h in Headers */,
+				8CB0A78011F6A8E700CBA2DE /* SDL_touch_c.h in Headers */,
+				8CB0A78811F6A90B00CBA2DE /* SDL_eventtouch.h in Headers */,
 				4537737D1207C4CE002F0F45 /* SDL_shape_internals.h in Headers */,
 				453773821207C518002F0F45 /* SDL_shape.h in Headers */,
 				453773891207C5A2002F0F45 /* SDL_cocoashape.h in Headers */,
@@ -1868,6 +1968,16 @@
 				00A6EBDB1078D569001EEA06 /* SDL_revision.h in Headers */,
 				04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */,
 				006E95B211952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
+				04DEA57311E6006A00386CAC /* SDL_input.h in Headers */,
+				04DEA57B11E600A600386CAC /* SDL_cocoaclipboard.h in Headers */,
+				044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */,
+				0420496311E6EFD3007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
+				0420498011E6F052007E7EC9 /* blank_cursor.h in Headers */,
+				0420498111E6F052007E7EC9 /* default_cursor.h in Headers */,
+				0420498211E6F052007E7EC9 /* scancodes_darwin.h in Headers */,
+				0420498311E6F052007E7EC9 /* scancodes_linux.h in Headers */,
+				0420498411E6F052007E7EC9 /* scancodes_win32.h in Headers */,
+				0420498511E6F052007E7EC9 /* scancodes_xfree86.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2060,7 +2170,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# The underlying scripts require calling hg to get revision info.\n# Since hg may not be in the standard Xcode path, I am sourcing .bashrc\n# But I don't know what to do if people are using other shells.\nsource ~/.bashrc\nsh ../../build-scripts/updaterev.sh\n";
+			shellScript = "# The underlying scripts require calling hg to get revision info.\n# Since hg may not be in the standard Xcode path, I am sourcing .bashrc\n# But I don't know what to do if people are using other shells.\nif test -f ~/.bash_profile; then source ~/.bash_profile; fi\nif test -f ~/.bashrc; then source ~/.bashrc; fi\nsh ../../build-scripts/updaterev.sh\n";
 		};
 		0083103E1072EA5700A531F1 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -2227,6 +2337,13 @@
 				04DB838D10FD8C81000519B5 /* SDL_drawrect.c in Sources */,
 				04F2AF661104AC0800D6DDF7 /* SDL_assert.c in Sources */,
 				006E95B111952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
+				04DEA57511E6009000386CAC /* SDL_clipboard.c in Sources */,
+				04DEA57A11E600A600386CAC /* SDL_cocoaclipboard.m in Sources */,
+				0420496211E6EFD3007E7EC9 /* SDL_clipboardevents.c in Sources */,
+				8CB0A76C11F6A84800CBA2DE /* SDL_x11clipboard.c in Sources */,
+				8CB0A77F11F6A8E700CBA2DE /* SDL_gesture.c in Sources */,
+				8CB0A78111F6A8E700CBA2DE /* SDL_touch.c in Sources */,
+				8CB0A78711F6A90B00CBA2DE /* SDL_eventtouch.c in Sources */,
 				4537737E1207C4CE002F0F45 /* SDL_shape.c in Sources */,
 				4537738A1207C5A2002F0F45 /* SDL_cocoashape.m in Sources */,
 				453773921207C6E9002F0F45 /* SDL_x11shape.c in Sources */,
@@ -2346,6 +2463,9 @@
 				04DB838F10FD8C81000519B5 /* SDL_drawrect.c in Sources */,
 				04F2AF671104AC0800D6DDF7 /* SDL_assert.c in Sources */,
 				006E95B311952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
+				04DEA57611E6009000386CAC /* SDL_clipboard.c in Sources */,
+				04DEA57C11E600A600386CAC /* SDL_cocoaclipboard.m in Sources */,
+				0420496411E6EFD3007E7EC9 /* SDL_clipboardevents.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Xcode/SDL/testsdl-Info.plist	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>${MACOSX_DEPLOYMENT_TARGET}</string>
+	<key>NSMainNibFile</key>
+	<string>SDLMain</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/config.cfg	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,1 @@
+ANDROID_NDK=/home/paul/Projects/gsoc/sdk/android-ndk-r4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/AndroidManifest.xml	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.libsdl.app"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name" android:icon="@drawable/icon">
+        <activity android:name="SDLActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/build.properties	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+# 
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/build.xml	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="SDLApp" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked in in Version
+         Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The build.properties file can be created by you and is never touched
+         by the 'android' tool. This is the place to change some of the default property values
+         used by the Ant rules.
+         Here are some properties you may want to change/update:
+
+         application.package
+             the name of your application package as defined in the manifest. Used by the
+             'uninstall' rule.
+         source.dir
+             the name of the source directory. Default is 'src'.
+         out.dir
+             the name of the output directory. Default is 'bin'.
+
+         Properties related to the SDK location or the project target should be updated
+          using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems.
+
+         -->
+    <property file="build.properties" />
+
+    <!-- The default.properties file is created and updated by the 'android' tool, as well
+         as ADT.
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems. -->
+    <property file="default.properties" />
+
+    <!-- Custom Android task to deal with the project target, and import the proper rules.
+         This requires ant 1.6.0 or above. -->
+    <path id="android.antlibs">
+        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+    </path>
+
+    <taskdef name="setup"
+        classname="com.android.ant.SetupTask"
+        classpathref="android.antlibs" />
+
+    <!-- Execute the Android Setup task that will setup some properties specific to the target,
+         and import the build rules files.
+
+         The rules file is imported from
+            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+         To customize some build steps for your project:
+         - copy the content of the main node <project> from android_rules.xml
+         - paste it in this build.xml below the <setup /> task.
+         - disable the import by changing the setup task below to <setup import="false" />
+
+         This will ensure that the properties are setup correctly but that your customized
+         build steps are used.
+    -->
+    <setup />
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/default.properties	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/jni/Android.mk	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,18 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := sdlapp
+SDL := ../../../
+
+LOCAL_CFLAGS := -DANDROID_NDK \
+                -DDISABLE_IMPORTGL \
+                -I$(SDL)/include
+
+LOCAL_SRC_FILES := \
+    android-support.cpp \
+    lesson05.c \
+
+LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lSDL -lgcc -L$(SDL)
+
+include $(BUILD_SHARED_LIBRARY)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/jni/android-support.cpp	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ This file links the Java side of Android with libsdl
+*******************************************************************************/
+#include <jni.h>
+#include <sys/time.h>
+#include <time.h>
+#include <android/log.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <pthread.h>
+
+#define DEBUG
+
+
+/*******************************************************************************
+                               Globals
+*******************************************************************************/
+static long _getTime(void){
+	struct timeval  now;
+	gettimeofday(&now, NULL);
+	return (long)(now.tv_sec*1000 + now.tv_usec/1000);
+}
+
+JNIEnv* mEnv = NULL;
+JNIEnv* mAudioThreadEnv = NULL; //See the note below for why this is necessary
+JavaVM* mVM = NULL;
+
+//Main activity
+jclass mActivityInstance;
+
+//method signatures
+jmethodID midCreateGLContext;
+jmethodID midFlipBuffers;
+jmethodID midEnableFeature;
+jmethodID midUpdateAudio;
+
+extern "C" int SDL_main();
+extern "C" int Android_OnKeyDown(int keycode);
+extern "C" int Android_OnKeyUp(int keycode);
+extern "C" void Android_SetScreenResolution(int width, int height);
+extern "C" void Android_OnResize(int width, int height, int format);
+extern "C" int SDL_SendQuit();
+extern "C" void Android_EnableFeature(int featureid, bool enabled);
+
+//If we're not the active app, don't try to render
+bool bRenderingEnabled = false;
+
+//Feature IDs
+static const int FEATURE_AUDIO = 1;
+static const int FEATURE_ACCEL = 2;
+
+//Accelerometer data storage
+float fLastAccelerometer[3];
+
+
+/*******************************************************************************
+                 Functions called by JNI
+*******************************************************************************/	
+
+//Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved){
+
+    JNIEnv* env = NULL;
+    jint result = -1;
+
+    if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
+        return result;
+    }
+
+    mEnv = env;
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "JNI: OnLoad");
+
+    jclass cls = mEnv->FindClass ("org/libsdl/app/SDLActivity"); 
+    mActivityInstance = cls;
+    midCreateGLContext = mEnv->GetStaticMethodID(cls,"createGLContext","()V");
+    midFlipBuffers = mEnv->GetStaticMethodID(cls,"flipBuffers","()V");
+    midEnableFeature = mEnv->GetStaticMethodID(cls,"enableFeature","(II)V");
+    midUpdateAudio = mEnv->GetStaticMethodID(cls,"updateAudio","([B)V");
+
+    if(!midCreateGLContext || !midFlipBuffers || !midEnableFeature ||
+        !midUpdateAudio){
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: Bad mids\n");
+    }else{
+#ifdef DEBUG
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: Good mids\n");
+#endif
+    }
+    
+    return JNI_VERSION_1_4;
+}
+
+//Start up the SDL app
+extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit( JNIEnv* env, 
+                                                                jobject obj ){ 
+                                                                   
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: Native Init");
+
+	mEnv = env;
+	bRenderingEnabled = true;
+
+	Android_EnableFeature(FEATURE_ACCEL, true);
+
+    SDL_main();
+}
+
+//Keydown
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(JNIEnv* env, 
+               jobject obj, jint keycode){
+    
+    int r = Android_OnKeyDown(keycode);
+#ifdef DEBUG
+    __android_log_print(ANDROID_LOG_INFO, "SDL", 
+                        "SDL: native key down %d, %d\n", keycode, r);
+#endif
+                        
+}
+
+//Keyup
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(JNIEnv* env, 
+               jobject obj, jint keycode){
+    
+    int r = Android_OnKeyUp(keycode);
+#ifdef DEBUG
+    __android_log_print(ANDROID_LOG_INFO, "SDL", 
+                        "SDL: native key up %d, %d\n", keycode, r);
+#endif
+                        
+}
+
+//Touch
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(JNIEnv* env, 
+               jobject obj, jint action, jfloat x, jfloat y, jfloat p){
+
+#ifdef DEBUG
+    __android_log_print(ANDROID_LOG_INFO, "SDL", 
+                        "SDL: native touch event %d @ %f/%f, pressure %f\n", 
+                        action, x, y, p);
+#endif
+
+    //TODO: Pass this off to the SDL multitouch stuff
+                        
+}
+
+//Quit
+extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit( JNIEnv*  env, 
+                                                                jobject obj ){    
+
+    //Stop rendering as we're no longer in the foreground
+	bRenderingEnabled = false;
+
+    //Inject a SDL_QUIT event
+    int r = SDL_SendQuit();
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: Native quit %d", r);        
+}
+
+//Screen size
+extern "C" void Java_org_libsdl_app_SDLActivity_nativeSetScreenSize(
+                JNIEnv*  env, jobject obj, jint width, jint height){
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL", 
+                        "SDL: Set screen size on init: %d/%d\n", width, height);
+    Android_SetScreenResolution(width, height);
+                        
+}
+
+//Resize
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize(
+                                        JNIEnv*  env, jobject obj, jint width, 
+                                        jint height, jint format){
+    Android_OnResize(width, height, format);
+}
+
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
+                                        JNIEnv*  env, jobject obj,
+                                        jfloat x, jfloat y, jfloat z){
+    fLastAccelerometer[0] = x;
+    fLastAccelerometer[1] = y;
+    fLastAccelerometer[2] = z;   
+}
+
+
+
+/*******************************************************************************
+             Functions called by SDL into Java
+*******************************************************************************/
+extern "C" void Android_CreateContext(){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: sdl_create_context()\n");
+
+	bRenderingEnabled = true;
+
+    mEnv->CallStaticVoidMethod(mActivityInstance, midCreateGLContext ); 
+}
+
+extern "C" void Android_Render(){
+
+    if(!bRenderingEnabled){
+        return;
+    }
+
+    //When we get here, we've accumulated a full frame    
+    mEnv->CallStaticVoidMethod(mActivityInstance, midFlipBuffers ); 
+}
+
+extern "C" void Android_EnableFeature(int featureid, bool enabled){
+
+    mEnv->CallStaticVoidMethod(mActivityInstance, midEnableFeature, 
+                                featureid, (int)enabled); 
+}
+
+extern "C" void Android_UpdateAudioBuffer(unsigned char *buf, int len){
+
+    //Annoyingly we can't just call into Java from any thread. Because the audio
+    //callback is dispatched from the SDL audio thread (that wasn't made from
+    //java, we have to do some magic here to let the JVM know about the thread.
+    //Because everything it touches on the Java side is static anyway, it's 
+    //not a big deal, just annoying.
+    if(!mAudioThreadEnv){
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: Need to set up audio thread env\n");
+
+        mVM->AttachCurrentThread(&mAudioThreadEnv, NULL);
+
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: ok\n");
+    }
+    
+    jbyteArray arr = mAudioThreadEnv->NewByteArray(len);
+
+    //blah. We probably should rework this so we avoid the copy. 
+    mAudioThreadEnv->SetByteArrayRegion(arr, 0, len, (jbyte *)buf);
+    
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: copied\n");
+
+    mAudioThreadEnv->CallStaticVoidMethod(  mActivityInstance, 
+                                            midUpdateAudio, arr );
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: invoked\n");
+    
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/jni/lesson05.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,574 @@
+/*
+ * This code was created by Jeff Molofee '99 
+ * (ported to Linux/SDL by Ti Leggett '01)
+ *
+ * If you've found this code useful, please let me know.
+ *
+ * Visit Jeff at http://nehe.gamedev.net/
+ * 
+ * or for port-specific comments, questions, bugreports etc. 
+ * email to leggett@eecs.tulane.edu
+ */
+ 
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <signal.h>
+
+#include <android/log.h>
+
+
+#ifdef ANDROID
+#include <GLES/gl.h>
+#else
+#include <GL/gl.h>
+#include <GL/glu.h>
+#endif
+#include "SDL.h"
+
+/* screen width, height, and bit depth */
+#define SCREEN_WIDTH  320
+#define SCREEN_HEIGHT 430
+#define SCREEN_BPP     16
+
+/* Define our booleans */
+#define TRUE  1
+#define FALSE 0
+
+/* This is our SDL surface */
+SDL_Surface *surface;
+
+int rotation = 0;
+
+
+/**************************************
+	gluperspective implementation
+**************************************/
+void gluPerspective(double fovy, double aspect, double zNear, double zFar){
+	glMatrixMode(GL_PROJECTION);
+	glLoadIdentity();
+	double xmin, xmax, ymin, ymax;
+	ymax = zNear * tan(fovy * M_PI / 360.0);
+	ymin = -ymax;
+	xmin = ymin * aspect;
+	xmax = ymax * aspect;
+	glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar);
+}
+
+
+/**************************************
+	  glulookat implementation
+**************************************/
+void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez,
+          GLfloat centerx, GLfloat centery, GLfloat centerz,
+          GLfloat upx, GLfloat upy, GLfloat upz)
+{
+    GLfloat m[16];
+    GLfloat x[3], y[3], z[3];
+    GLfloat mag;
+    
+    /* Make rotation matrix */
+    
+    /* Z vector */
+    z[0] = eyex - centerx;
+    z[1] = eyey - centery;
+    z[2] = eyez - centerz;
+    mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]);
+    if (mag) {          /* mpichler, 19950515 */
+        z[0] /= mag;
+        z[1] /= mag;
+        z[2] /= mag;
+    }
+    
+    /* Y vector */
+    y[0] = upx;
+    y[1] = upy;
+    y[2] = upz;
+    
+    /* X vector = Y cross Z */
+    x[0] = y[1] * z[2] - y[2] * z[1];
+    x[1] = -y[0] * z[2] + y[2] * z[0];
+    x[2] = y[0] * z[1] - y[1] * z[0];
+    
+    /* Recompute Y = Z cross X */
+    y[0] = z[1] * x[2] - z[2] * x[1];
+    y[1] = -z[0] * x[2] + z[2] * x[0];
+    y[2] = z[0] * x[1] - z[1] * x[0];
+    
+    /* mpichler, 19950515 */
+    /* cross product gives area of parallelogram, which is < 1.0 for
+     * non-perpendicular unit-length vectors; so normalize x, y here
+     */
+    
+    mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
+    if (mag) {
+        x[0] /= mag;
+        x[1] /= mag;
+        x[2] /= mag;
+    }
+    
+    mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
+    if (mag) {
+        y[0] /= mag;
+        y[1] /= mag;
+        y[2] /= mag;
+    }
+    
+#define M(row,col)  m[col*4+row]
+    M(0, 0) = x[0];
+    M(0, 1) = x[1];
+    M(0, 2) = x[2];
+    M(0, 3) = 0.0;
+    M(1, 0) = y[0];
+    M(1, 1) = y[1];
+    M(1, 2) = y[2];
+    M(1, 3) = 0.0;
+    M(2, 0) = z[0];
+    M(2, 1) = z[1];
+    M(2, 2) = z[2];
+    M(2, 3) = 0.0;
+    M(3, 0) = 0.0;
+    M(3, 1) = 0.0;
+    M(3, 2) = 0.0;
+    M(3, 3) = 1.0;
+#undef M
+    glMultMatrixf(m);
+    
+    /* Translate Eye to Origin */
+    glTranslatef(-eyex, -eyey, -eyez);
+    
+}
+
+
+
+
+
+/* function to release/destroy our resources and restoring the old desktop */
+void Quit( int returnCode )
+{
+    /* clean up the window */
+    SDL_Quit( );
+
+    /* and exit appropriately */
+    exit( returnCode );
+}
+
+/* function to reset our viewport after a window resize */
+int resizeWindow( int width, int height )
+{
+    /* Height / width ration */
+    GLfloat ratio;
+ 
+    /* Protect against a divide by zero */
+   if ( height == 0 )
+	height = 1;
+
+    ratio = ( GLfloat )width / ( GLfloat )height;
+
+    /* Setup our viewport. */
+    glViewport( 0, 0, ( GLsizei )width, ( GLsizei )height );
+
+    /* change to the projection matrix and set our viewing volume. */
+    glMatrixMode( GL_PROJECTION );
+    glLoadIdentity( );
+
+    /* Set our perspective */
+    gluPerspective( 45.0f, ratio, 0.1f, 100.0f );
+
+    /* Make sure we're chaning the model view and not the projection */
+    glMatrixMode( GL_MODELVIEW );
+
+    /* Reset The View */
+    glLoadIdentity( );
+
+    return( TRUE );
+}
+
+/* function to handle key press events */
+void handleKeyPress( SDL_keysym *keysym )
+{
+    switch ( keysym->sym )
+	{
+	case SDLK_ESCAPE:
+	    /* ESC key was pressed */
+	    Quit( 0 );
+	    break;
+	case SDLK_F1:
+	    /* F1 key was pressed
+	     * this toggles fullscreen mode
+	     */
+	    SDL_WM_ToggleFullScreen( surface );
+	    break;
+    case SDLK_LEFT:
+        rotation -= 30;
+        break;
+
+    case SDLK_RIGHT:
+        rotation += 30;
+        break;
+        
+	default:
+	    break;
+	}
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL","Keycode: %d, %d, %d\n", keysym->sym, SDLK_LEFT, SDLK_RIGHT);
+
+    return;
+}
+
+/* general OpenGL initialization function */
+int initGL( GLvoid )
+{
+
+    /* Enable smooth shading */
+    glShadeModel( GL_SMOOTH );
+
+    /* Set the background black */
+    glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
+
+    /* Depth buffer setup */
+    //glClearDepth( 1.0f );
+
+    /* Enables Depth Testing */
+    glEnable( GL_DEPTH_TEST );
+
+    /* The Type Of Depth Test To Do */
+    glDepthFunc( GL_LEQUAL );
+
+    /* Really Nice Perspective Calculations */
+    glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
+
+    return( TRUE );
+}
+
+/* Here goes our drawing code */
+int drawGLScene( GLvoid )
+{
+      
+	static int Frames = 0;
+	static int T0 = 0;
+	
+    glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+
+    glClearColorx(0,0,0,255);
+    glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(45, (float)SCREEN_WIDTH / SCREEN_HEIGHT, 0.5f, 150);
+
+    glMatrixMode(GL_MODELVIEW);
+
+    glLoadIdentity();
+
+	//Camera
+	gluLookAt(0,0,5, 0,0,0, 0,1,0);
+			
+	//Draw a triangle
+	//glRotatef(iRot, 0, 1, 0);
+
+	glRotatef( rotation, 0.0f, 1.0f, 0.0f );
+
+
+	glEnableClientState (GL_VERTEX_ARRAY);
+	glEnableClientState (GL_COLOR_ARRAY);
+	
+	/* Rotate The Triangle On The Y axis ( NEW ) */
+    //glRotatef( Frames % 360, 0.0f, 1.0f, 0.0f );
+
+    /* GLES variant of drawing a triangle */
+    const GLfloat triVertices[][9] = {
+      {     /* Front Triangle */
+	 0.0f,  1.0f,  0.0f,               /* Top Of Triangle               */
+	-1.0f, -1.0f,  1.0f,               /* Left Of Triangle              */
+	 1.0f, -1.0f,  1.0f                /* Right Of Triangle             */
+      }, {  /* Right Triangle */
+	 0.0f,  1.0f,  0.0f,               /* Top Of Triangle               */
+	 1.0f, -1.0f,  1.0f,               /* Left Of Triangle              */
+	 1.0f, -1.0f, -1.0f                /* Right Of Triangle             */
+      }, {  /* Back Triangle */
+	 0.0f,  1.0f,  0.0f,               /* Top Of Triangle               */
+	 1.0f, -1.0f, -1.0f,               /* Left Of Triangle              */
+	-1.0f, -1.0f, -1.0f                /* Right Of Triangle             */
+      }, {  /* Left Triangle */
+	 0.0f,  1.0f,  0.0f,               /* Top Of Triangle               */
+	-1.0f, -1.0f, -1.0f,               /* Left Of Triangle              */
+	-1.0f, -1.0f,  1.0f                /* Right Of Triangle             */
+      }
+    };
+
+    /* unlike GL, GLES does not support RGB. We have to use RGBA instead */
+    const GLfloat triColors[][12] = {
+      {     /* Front triangle */
+        1.0f, 0.0f, 0.0f, 1.0f,            /* Red                           */
+	0.0f, 1.0f, 0.0f, 1.0f,            /* Green                         */
+	0.0f, 0.0f, 1.0f, 1.0f             /* Blue                          */
+      }, {  /* Right triangle */
+        1.0f, 0.0f, 0.0f, 1.0f,            /* Red                           */
+	0.0f, 0.0f, 1.0f, 1.0f,            /* Blue                          */
+	0.0f, 1.0f, 0.0f, 1.0f             /* Green                         */
+      }, {  /* Back triangle */
+        1.0f, 0.0f, 0.0f, 1.0f,            /* Red                           */
+	0.0f, 1.0f, 0.0f, 1.0f,            /* Green                         */
+	0.0f, 0.0f, 1.0f, 1.0f             /* Blue                          */
+      }, {  /* Left triangle */
+        1.0f, 0.0f, 0.0f, 1.0f,            /* Red                           */
+	0.0f, 0.0f, 1.0f, 1.0f,            /* Blue                          */
+	0.0f, 1.0f, 0.0f, 1.0f             /* Green                         */
+      }
+    };
+
+    glEnableClientState(GL_COLOR_ARRAY);
+
+    int tri=0;
+
+    /* Loop through all Triangles */
+    for(tri=0;tri<sizeof(triVertices)/(9*sizeof(GLfloat));tri++) 
+    {
+      glVertexPointer(3, GL_FLOAT, 0, triVertices[tri]);
+      glColorPointer(4, GL_FLOAT, 0, triColors[tri]);
+      
+      glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+    }
+		
+    //__android_log_print(ANDROID_LOG_INFO, "SDL", "render %d", Frames++);
+
+    /* Draw it to the screen */
+    SDL_GL_SwapBuffers( );
+
+    /* Gather our frames per second */
+    Frames++;
+    {
+	GLint t = SDL_GetTicks();
+	if (t - T0 >= 5000) {
+	    GLfloat seconds = (t - T0) / 1000.0;
+	    GLfloat fps = Frames / seconds;
+	    __android_log_print(ANDROID_LOG_INFO, "SDL","%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
+	    T0 = t;
+	    Frames = 0;
+	}
+    }
+
+    rotation++;
+
+    return( TRUE );
+}
+
+
+struct
+{
+    SDL_AudioSpec spec;
+    Uint8 *sound;               /* Pointer to wave data */
+    Uint32 soundlen;            /* Length of wave data */
+    int soundpos;               /* Current play position */
+} wave;
+
+void SDLCALL
+fillerup(void *unused, Uint8 * stream, int len)
+{
+    __android_log_print(ANDROID_LOG_INFO, "SDL","FILLERUP\n");
+    
+    Uint8 *waveptr;
+    int waveleft;
+
+    /* Set up the pointers */
+    waveptr = wave.sound + wave.soundpos;
+    waveleft = wave.soundlen - wave.soundpos;
+
+    /* Go! */
+    while (waveleft <= len) {
+        SDL_memcpy(stream, waveptr, waveleft);
+        stream += waveleft;
+        len -= waveleft;
+        waveptr = wave.sound;
+        waveleft = wave.soundlen;
+        wave.soundpos = 0;
+    }
+    SDL_memcpy(stream, waveptr, len);
+    wave.soundpos += len;
+}
+
+void testAudio(){
+
+    const char *file = "/sdcard/sample.wav";
+
+    /* Load the SDL library */
+    if (SDL_Init(SDL_INIT_AUDIO) < 0) {
+        __android_log_print(ANDROID_LOG_INFO, "SDL","Couldn't initialize SDL Audio: %s\n", SDL_GetError());
+        return;
+    }else{
+        __android_log_print(ANDROID_LOG_INFO, "SDL","Init audio ok\n");
+    }
+
+    /* Load the wave file into memory */
+    if (SDL_LoadWAV(file, &wave.spec, &wave.sound, &wave.soundlen) == NULL) {
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "Couldn't load %s: %s\n", file, SDL_GetError());
+        return;
+    }
+
+    wave.spec.callback = fillerup;
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL","Loaded: %d\n", wave.soundlen);
+
+
+    /* Initialize fillerup() variables */
+    if (SDL_OpenAudio(&wave.spec, NULL) < 0) {
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "Couldn't open audio: %s\n", SDL_GetError());
+        SDL_FreeWAV(wave.sound);
+        return;
+    }
+
+     __android_log_print(ANDROID_LOG_INFO, "SDL","Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
+
+    /* Let the audio run */
+    SDL_PauseAudio(0);
+
+     __android_log_print(ANDROID_LOG_INFO, "SDL","Playing\n");
+    
+    while (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING){
+         //__android_log_print(ANDROID_LOG_INFO, "SDL","Still playing\n");
+        SDL_Delay(100);
+    }
+
+     __android_log_print(ANDROID_LOG_INFO, "SDL","Closing down\n");
+
+    /* Clean up on signal */
+    SDL_CloseAudio();
+    SDL_FreeWAV(wave.sound);
+}
+
+int SDL_main( int argc, char **argv )
+{
+
+	__android_log_print(ANDROID_LOG_INFO, "SDL","entry\n");
+
+    /* Flags to pass to SDL_SetVideoMode */
+    int videoFlags;
+    /* main loop variable */
+    int done = FALSE;
+    /* used to collect events */
+    SDL_Event event;
+    /* this holds some info about our display */
+    const SDL_VideoInfo *videoInfo;
+    /* whether or not the window is active */
+    int isActive = TRUE;
+
+    /* initialize SDL */
+    if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
+	{
+	    __android_log_print(ANDROID_LOG_INFO, "SDL", "Video initialization failed: %s\n",
+		     SDL_GetError( ) );
+	    Quit( 1 );
+	}
+
+    /* Fetch the video info */
+    videoInfo = SDL_GetVideoInfo( );
+
+    if ( !videoInfo )
+	{
+	    __android_log_print(ANDROID_LOG_INFO, "SDL", "Video query failed: %s\n",
+		     SDL_GetError( ) );
+	    Quit( 1 );
+	}
+
+    /* the flags to pass to SDL_SetVideoMode */
+    videoFlags  = SDL_OPENGL;          /* Enable OpenGL in SDL */
+    videoFlags |= SDL_GL_DOUBLEBUFFER; /* Enable double buffering */
+    videoFlags |= SDL_HWPALETTE;       /* Store the palette in hardware */
+    videoFlags |= SDL_RESIZABLE;       /* Enable window resizing */
+
+    /* This checks to see if surfaces can be stored in memory */
+    if ( videoInfo->hw_available )
+	videoFlags |= SDL_HWSURFACE;
+    else
+	videoFlags |= SDL_SWSURFACE;
+
+    /* This checks if hardware blits can be done */
+    if ( videoInfo->blit_hw )
+	videoFlags |= SDL_HWACCEL;
+
+    /* Sets up OpenGL double buffering */
+    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+    /* get a SDL surface */
+    surface = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP,
+				videoFlags );
+
+    /* Verify there is a surface */
+    if ( !surface )
+	{
+	    __android_log_print(ANDROID_LOG_INFO, "SDL",  "Video mode set failed: %s\n", SDL_GetError( ) );
+	    Quit( 1 );
+	}
+
+	__android_log_print(ANDROID_LOG_INFO, "SDL","Made a video mode!\n");
+
+    /* initialize OpenGL */
+    initGL( );
+
+    /* resize the initial window */
+    resizeWindow( SCREEN_WIDTH, SCREEN_HEIGHT );
+
+
+    //testAudio();
+
+
+    /* wait for events */ 
+    while ( !done )
+	{
+	    /* handle the events in the queue */
+
+	    while ( SDL_PollEvent( &event ) )
+		{
+		    switch( event.type )
+			{
+			case SDL_ACTIVEEVENT:
+			    /* Something's happend with our focus
+			     * If we lost focus or we are iconified, we
+			     * shouldn't draw the screen
+			     */
+			    if ( event.active.gain == 0 )
+				isActive = FALSE;
+			    else
+				isActive = TRUE;
+			    break;			    
+			case SDL_VIDEORESIZE:
+			    /* handle resize event */
+			    surface = SDL_SetVideoMode( event.resize.w,
+							event.resize.h,
+							16, videoFlags );
+			    if ( !surface )
+				{
+				    __android_log_print(ANDROID_LOG_INFO, "SDL","Could not get a surface after resize: %s\n", SDL_GetError( ) );
+				    Quit( 1 );
+				}
+			    resizeWindow( event.resize.w, event.resize.h );
+			    break;
+			case SDL_KEYDOWN:
+			    /* handle key presses */
+			    handleKeyPress( &event.key.keysym );
+			    break;
+			case SDL_QUIT:
+			    /* handle quit requests */
+			    done = TRUE;
+			    __android_log_print(ANDROID_LOG_INFO, "SDL","App is shutting down\n");
+			    break;
+			default:
+			    break;
+			}
+		}
+
+	    /* draw the scene */
+	    if ( isActive )
+		drawGLScene( );
+	}
+
+    /* clean ourselves up and exit */
+    Quit( 0 );
+
+    /* Should never get here */
+    return( 0 );
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/local.properties	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/home/paul/Projects/gsoc/sdk/android-sdk-linux_86
Binary file android/project/res/drawable-hdpi/icon.png has changed
Binary file android/project/res/drawable-ldpi/icon.png has changed
Binary file android/project/res/drawable-mdpi/icon.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/res/layout/main.xml	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="Hello World, SDLActivity"
+    />
+</LinearLayout>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/res/values/strings.xml	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">SDLActivity</string>
+</resources>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/project/src/org/libsdl/app/SDLActivity.java	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,388 @@
+package org.libsdl.app;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+import javax.microedition.khronos.egl.*;
+
+import android.app.*;
+import android.content.*;
+import android.view.*;
+import android.os.*;
+import android.util.Log;
+import android.graphics.*;
+import android.text.method.*;
+import android.text.*;
+import android.media.*;
+import android.hardware.*;
+import android.content.*;
+
+import java.lang.*;
+
+
+/**
+    SDL Activity
+*/
+public class SDLActivity extends Activity {
+
+    //Main components
+    private static SDLActivity mSingleton;
+    private static SDLSurface mSurface;
+
+    //Audio
+    private static AudioTrack mAudioTrack;
+    private static boolean bAudioIsEnabled;
+
+    //Sensors
+    private static boolean bAccelIsEnabled;
+
+    //feature IDs. Must match up on the C side as well.
+    private static int FEATURE_AUDIO = 1;
+    private static int FEATURE_ACCEL = 2;
+
+    //Load the .so
+    static {
+        System.loadLibrary("sdlapp");
+    }
+
+    //Setup
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        
+        //So we can call stuff from static callbacks
+        mSingleton = this;
+
+        //Set up the surface
+        mSurface = new SDLSurface(getApplication());
+        setContentView(mSurface);
+        SurfaceHolder holder = mSurface.getHolder();
+        holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
+        
+    }
+
+    //Audio
+    public static boolean initAudio(){        
+
+        //blah. Hardcoded things are bad. FIXME when we have more sound stuff
+        //working properly. 
+        mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,
+                    11025,
+                    AudioFormat.CHANNEL_CONFIGURATION_MONO,
+                    AudioFormat.ENCODING_PCM_8BIT,
+                    2048,
+                    AudioTrack.MODE_STREAM);   
+        bAudioIsEnabled = true;     
+        return true;
+    }
+
+    //Accel
+    public static boolean initAccel(){
+        mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
+        bAccelIsEnabled = true;
+        return true;
+    }
+    
+    public static boolean closeAccel(){
+        mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
+        bAccelIsEnabled = false;
+        return true;
+    }
+    
+
+    //Events
+    protected void onPause() {
+        super.onPause();
+    }
+
+    protected void onResume() {
+        super.onResume();
+    }
+
+    
+
+
+
+    //C functions we call
+    public static native void nativeInit();
+    public static native void nativeQuit();
+    public static native void nativeSetScreenSize(int width, int height);
+    public static native void onNativeKeyDown(int keycode);
+    public static native void onNativeKeyUp(int keycode);
+    public static native void onNativeTouch(int action, float x, 
+                                            float y, float p);
+    public static native void onNativeResize(int x, int y, int format);
+    public static native void onNativeAccel(float x, float y, float z);
+
+
+
+    //Java functions called from C
+    private static void createGLContext(){
+        mSurface.initEGL();
+    }
+
+    public static void flipBuffers(){
+        mSurface.flipEGL();
+    }
+
+    public static void updateAudio(byte [] buf){
+    
+        if(mAudioTrack == null){
+            return;
+        }
+        
+        mAudioTrack.write(buf, 0, buf.length);
+        mAudioTrack.play();
+        
+        Log.v("SDL","Played some audio");
+    }
+
+    public static void enableFeature(int featureid, int enabled){
+         Log.v("SDL","Feature " + featureid + " = " + enabled);
+
+        //Yuck. This is all horribly inelegent. If it gets to more than a few
+        //'features' I'll rip this out and make something nicer, I promise :)
+        if(featureid == FEATURE_AUDIO){
+            if(enabled == 1){
+                initAudio();
+            }else{
+                //We don't have one of these yet...
+                //closeAudio(); 
+            }
+        }
+
+        else if(featureid == FEATURE_ACCEL){
+            if(enabled == 1){
+                initAccel();
+            }else{
+                closeAccel();
+            }
+        }
+    }
+
+
+
+
+
+    
+    
+}
+
+/**
+    Simple nativeInit() runnable
+*/
+class SDLRunner implements Runnable{
+    public void run(){
+        //SDLActivity.initAudio();
+        
+        //Runs SDL_main()
+        SDLActivity.nativeInit();
+
+        Log.v("SDL","SDL thread terminated");
+    }
+}
+
+
+/**
+    SDLSurface. This is what we draw on, so we need to know when it's created
+    in order to do anything useful. 
+
+    Because of this, that's where we set up the SDL thread
+*/
+class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, 
+    View.OnKeyListener, View.OnTouchListener, SensorEventListener  {
+
+    //This is what SDL runs in. It invokes SDL_main(), eventually
+    private Thread mSDLThread;    
+    
+    //EGL private objects
+    private EGLContext  mEGLContext;
+    private EGLSurface  mEGLSurface;
+    private EGLDisplay  mEGLDisplay;
+
+    //Sensors
+    private static SensorManager mSensorManager;
+
+    //Startup    
+    public SDLSurface(Context context) {
+        super(context);
+        getHolder().addCallback(this); 
+    
+        setFocusable(true);
+        setFocusableInTouchMode(true);
+        requestFocus();
+        setOnKeyListener(this); 
+        setOnTouchListener(this);   
+        
+        mSensorManager = (SensorManager)context.getSystemService("sensor");  
+    }
+
+    //Called when we have a valid drawing surface
+    public void surfaceCreated(SurfaceHolder holder) {
+        Log.v("SDL","Surface created"); 
+
+        int width = getWidth();
+        int height = getHeight();
+
+        //Set the width and height variables in C before we start SDL so we have
+        //it available on init
+        SDLActivity.nativeSetScreenSize(width, height);
+
+        //Now start up the C app thread
+        mSDLThread = new Thread(new SDLRunner(), "SDLThread"); 
+		mSDLThread.start();       
+    }
+
+    //Called when we lose the surface
+    public void surfaceDestroyed(SurfaceHolder holder) {
+        Log.v("SDL","Surface destroyed");
+        
+        SDLActivity.nativeQuit();
+
+        //Now wait for the SDL thread to quit
+        try{
+            mSDLThread.wait();
+        }catch(Exception e){
+            Log.v("SDL","Problem stopping thread: " + e);
+        }
+    }
+
+    //Called when the surface is resized
+    public void surfaceChanged(SurfaceHolder holder, int format, 
+                                int width, int height) {
+        Log.v("SDL","Surface resized");
+        
+        SDLActivity.onNativeResize(width, height, format);
+    }
+
+    //unused
+    public void onDraw(Canvas canvas) {}
+
+    
+    //EGL functions
+    public boolean initEGL(){
+        Log.v("SDL","Starting up");
+
+        try{
+
+            EGL10 egl = (EGL10)EGLContext.getEGL();
+
+            EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
+
+            int[] version = new int[2];
+            egl.eglInitialize(dpy, version);
+
+            int[] configSpec = {
+                    //EGL10.EGL_DEPTH_SIZE,   16,
+                    EGL10.EGL_NONE
+            };
+            EGLConfig[] configs = new EGLConfig[1];
+            int[] num_config = new int[1];
+            egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config);
+            EGLConfig config = configs[0];
+
+            EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, null);
+
+            EGLSurface surface = egl.eglCreateWindowSurface(dpy, config, this, null);
+
+            egl.eglMakeCurrent(dpy, surface, surface, ctx);
+
+            mEGLContext = ctx;
+            mEGLDisplay = dpy;
+            mEGLSurface = surface;
+            
+            
+        }catch(Exception e){
+            Log.v("SDL", e + "");
+            for(StackTraceElement s : e.getStackTrace()){
+                Log.v("SDL", s.toString());
+            }
+        }
+        Log.v("SDL","Done making!");
+
+        return true;
+    }
+
+    //EGL buffer flip
+    public void flipEGL(){      
+        try{
+        
+            EGL10 egl = (EGL10)EGLContext.getEGL();
+            GL10 gl = (GL10)mEGLContext.getGL();
+
+            egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
+
+            //drawing here
+
+            egl.eglWaitGL();
+
+            egl.eglSwapBuffers(mEGLDisplay, mEGLSurface);
+
+            
+        }catch(Exception e){
+            Log.v("SDL", "flipEGL(): " + e);
+
+            for(StackTraceElement s : e.getStackTrace()){
+                Log.v("SDL", s.toString());
+            }
+        }
+    }
+
+
+  
+    //Key events
+    public boolean onKey(View  v, int keyCode, KeyEvent event){
+
+        if(event.getAction() == KeyEvent.ACTION_DOWN){
+            SDLActivity.onNativeKeyDown(keyCode);
+            return true;
+        }
+        
+        else if(event.getAction() == KeyEvent.ACTION_UP){
+            SDLActivity.onNativeKeyUp(keyCode);
+            return true;
+        }
+        
+        return false;
+    }
+
+    //Touch events
+    public boolean onTouch(View v, MotionEvent event){
+    
+        int action = event.getAction();
+        float x = event.getX();
+        float y = event.getY();
+        float p = event.getPressure();
+
+        //TODO: Anything else we need to pass?        
+        SDLActivity.onNativeTouch(action, x, y, p);
+        return true;
+    }
+
+    //Sensor events
+    public void enableSensor(int sensortype, boolean enabled){
+        //TODO: This uses getDefaultSensor - what if we have >1 accels?
+        if(enabled){
+            mSensorManager.registerListener(this, 
+                            mSensorManager.getDefaultSensor(sensortype), 
+                            SensorManager.SENSOR_DELAY_GAME, null);
+        }else{
+            mSensorManager.unregisterListener(this, 
+                            mSensorManager.getDefaultSensor(sensortype));
+        }
+    }
+    
+    public void onAccuracyChanged(Sensor sensor, int accuracy){
+        //TODO
+    }
+
+    public void onSensorChanged(SensorEvent event){
+        if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){
+            SDLActivity.onNativeAccel(  event.values[0],
+                                        event.values[1],
+                                        event.values[2] );
+        }
+    }
+
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/scripts/acc.sh	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,15 @@
+#!/bin/bash
+ANDROID_NDK="/home/paul/Projects/gsoc/sdk/android-ndk-r4"
+TOOLS_PATH="$ANDROID_NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin"
+
+export PATH=$TOOLS_PATH:$PATH
+
+CC="arm-eabi-gcc"
+
+#cflags
+ACC_C="	-I$ANDROID_NDK/build/platforms/android-8/common/include \
+		-I$ANDROID_NDK/build/platforms/android-8/arch-arm/usr/include \
+		-DANDROID -DANDROID_NDK -c"
+		
+		
+$CC $CFLAGS $ACC_C $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/android/scripts/ald.sh	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,20 @@
+#!/bin/bash
+ANDROID_NDK="/home/paul/Projects/gsoc/sdk/android-ndk-r4"
+TOOLS_PATH="$ANDROID_NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin"
+ADDITIONAL_LIBS=`dirname "$0"`/android_libs/
+
+export PATH=$TOOLS_PATH:$PATH
+
+LD="arm-eabi-ld"
+
+#ldflags
+ACC_L="	-rpath-link=$ANDROID_NDK/build/platforms/android-8/arch-arm/usr/lib/ \
+		-dynamic-linker=/system/bin/linker \
+		-lc -nostdlib \
+ 		$ANDROID_NDK/build/platforms/android-8/arch-arm/usr/lib/crtbegin_static.o \
+ 		-L$ANDROID_NDK/build/platforms/android-8/arch-arm/usr/lib/ \
+ 		-L$ANDROID_NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1 \
+ 		-L$ADDITIONAL_LIBS "
+		
+$LD $ACC_L $LDFLAGS $@ -lgcc
+
--- a/configure.in	Sun Aug 22 12:43:27 2010 -0700
+++ b/configure.in	Sun Aug 22 13:45:56 2010 -0700
@@ -1005,6 +1005,8 @@
 dnl Find the X11 include and library directories
 CheckX11()
 {
+
+
     AC_ARG_ENABLE(video-x11,
 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
                   , enable_video_x11=yes)
@@ -1039,6 +1041,8 @@
                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
                     xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
                     xss_lib='/usr/X11R6/lib/libXss.6.dylib'
+                    xdamage_lib='/usr/X11R6/lib/libXdamage.1.dylib'
+                    xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib'
                     ;;
                 *-*-osf*)
                     x11_lib='libX11.so'
@@ -1055,6 +1059,8 @@
                     xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
                     xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
                     xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xdamage_lib=[`find_lib "libXdamage.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xfixes_lib=[`find_lib "libXfixes.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
                     ;;
             esac
 
@@ -1141,16 +1147,13 @@
                                 ])
                 if test x$have_xrandr_h_hdr = xyes; then
                     if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
-                        echo "-- dynamic libXrender -> $xrender_lib"
                         echo "-- dynamic libXrandr -> $xrandr_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
                         AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
                         definitely_enable_video_x11_xrandr=yes
                     else
-                        AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
                         AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
-                        if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
+                        if test x$have_xrandr_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
                             definitely_enable_video_x11_xrandr=yes
                         fi
                     fi
@@ -1212,7 +1215,69 @@
             if test x$definitely_enable_video_x11_scrnsaver = xyes; then
                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_SCRNSAVER)
             fi
-
+            AC_ARG_ENABLE(video-x11-xrender,
+AC_HELP_STRING([--enable-video-x11-xrender], [enable X11 Xrender extension [[default=yes]]]),
+                            , enable_video_x11_xrender=yes)
+            if test x$enable_video_x11_xrender = xyes; then
+                AC_CHECK_HEADER(X11/extensions/Xrender.h,
+                                have_xrender_h_hdr=yes,
+                                have_xrender_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_xrender_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xrender_lib != x ; then
+                        echo "-- dynamic libXrender -> $xrender_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
+                        definitely_enable_video_x11_xrender=yes
+                    else
+                        AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
+                        if test x$have_xrender_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrender"
+                            definitely_enable_video_x11_xrender=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xrender = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRENDER)
+            fi
+            AC_ARG_ENABLE(video-x11-xdamage-xfixes,
+AC_HELP_STRING([--enable-video-x11-xdamage-xfixes], [enable X11 Xdamage and Xfixes extensions [[default=yes]]]),
+                            , enable_video_x11_xdamage=yes)
+            if test x$enable_video_x11_xdamage = xyes && test x$definitely_enable_video_x11_xrender = xyes ; then
+                AC_CHECK_HEADER(X11/extensions/Xdamage.h,
+                                have_xdamage_h_hdr=yes,
+                                have_xdamage_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                AC_CHECK_HEADER(X11/extensions/Xfixes.h,
+                                have_xfixes_h_hdr=yes,
+                                have_xfixes_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_xdamage_h_hdr = xyes && test x$have_xfixes_h_hdr = xyes ; then
+                    if test x$enable_x11_shared = xyes && test x$xdamage_lib != x && test x$xfixes_lib != x ; then
+                        echo "-- dynamic libXdamage -> $xdamage_lib"
+                        echo "-- dynamic libXfixes -> $xfixes_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE, "$xdamage_lib")
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES, "$xfixes_lib")
+                        definitely_enable_video_x11_xdamage=yes
+                        definitely_enable_video_x11_xfixes=yes
+                    else
+                        AC_CHECK_LIB(Xdamage, XDamageQueryExtension, have_xdamage_lib=yes)
+                        AC_CHECK_LIB(Xfixes, XFixesQueryExtension, have_xfixes_lib=yes)
+                        if test x$have_xdamage_lib = xyes && test x$have_xfixes_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXdamage -lXfixes"
+                            definitely_enable_video_x11_xdamage=yes
+                            definitely_enable_video_x11_xfixes=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xdamage = xyes && test x$definitely_enable_video_x11_xfixes = xyes ; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDAMAGE)
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XFIXES)
+            fi
             AC_ARG_ENABLE(render-x11,
 AC_HELP_STRING([--enable-render-x11], [enable the X11 render driver [[default=yes]]]),
                                 , enable_render_x11=yes)
@@ -1930,7 +1995,7 @@
     AC_MSG_CHECKING(Windows CE)
     have_wince=no
     AC_TRY_COMPILE([
-#ifndef _WIN32_WCE
+#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
 #error This is not Windows CE
 #endif
     ],[
@@ -2401,6 +2466,12 @@
             SOURCES="$SOURCES $srcdir/src/atomic/win32/*.c"
             have_atomic=yes
         fi
+        # Set up dummy files for the joystick for now
+        if test x$enable_joystick = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_DUMMY)
+            SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+            have_joystick=yes
+        fi
         # Set up files for the thread library
         if test x$enable_threads = xyes; then
             AC_DEFINE(SDL_THREAD_WIN32)
@@ -2424,16 +2495,26 @@
         fi
         # Set up the system libraries we need
         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer"
+
+	# mingw32ce library
+	case "$host" in
+    	    *-mingw32ce)
+    		EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmingwex"
+    		;;
+    	    *)
+        	;;
+	esac
+
         # The Win32 platform requires special setup
         SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
-        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
-        SDL_LIBS="-lSDLmain $SDL_LIBS"
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
+        EXTRA_LDFLAGS="-lSDLmain $EXTRA_LDFLAGS"
         ;;
     *-*-cygwin* | *-*-mingw32*)
         ARCH=win32
         if test "$build" != "$host"; then # cross-compiling
             # Default cross-compile location
-            ac_default_prefix=/usr/local/cross-tools/i386-mingw32
+            ac_default_prefix=/usr/local/cross-tools/$host
         else
             # Look for the location of the tools and install there
             if test "$BUILD_PREFIX" != ""; then
--- a/include/SDL.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL.h	Sun Aug 22 13:45:56 2010 -0700
@@ -78,6 +78,7 @@
 #include "SDL_stdinc.h"
 #include "SDL_atomic.h"
 #include "SDL_audio.h"
+#include "SDL_clipboard.h"
 #include "SDL_cpuinfo.h"
 #include "SDL_endian.h"
 #include "SDL_error.h"
@@ -138,16 +139,16 @@
 extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
 
 /**
- *  This function returns mask of the specified subsystems which have
- *  been initialized.
+ *  This function returns a mask of the specified subsystems which have
+ *  previously been initialized.
  *  
  *  If \c 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.
+ *  This function cleans up all initialized subsystems. You should
+ *  call it upon all exit conditions.
  */
 extern DECLSPEC void SDLCALL SDL_Quit(void);
 
--- a/include/SDL_atomic.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_atomic.h	Sun Aug 22 13:45:56 2010 -0700
@@ -118,7 +118,7 @@
  *  
  *  \return The value before it was decremented.
  *  
- *  \param ptr Address of the value to fetch and drement
+ *  \param ptr Address of the value to fetch and decrement
  */
 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_clipboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,76 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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_clipboard.h
+ *
+ * Include file for SDL clipboard handling
+ */
+
+#ifndef _SDL_clipboard_h
+#define _SDL_clipboard_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/* Function prototypes */
+
+/**
+ * \brief Put UTF-8 text into the clipboard
+ *
+ * \sa SDL_GetClipboardText()
+ */
+extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
+
+/**
+ * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
+ *
+ * \sa SDL_SetClipboardText()
+ */
+extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
+
+/**
+ * \brief Returns whether the clipboard has text
+ *
+ * \sa SDL_GetClipboardText()
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_clipboard_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_compat.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_compat.h	Sun Aug 22 13:45:56 2010 -0700
@@ -324,6 +324,7 @@
 #define SDL_RenderPoint SDL_RenderDrawPoint
 #define SDL_RenderLine SDL_RenderDrawLine
 #define SDL_RenderFill(X)  (X) ? SDL_RenderFillRect(X) : SDL_RenderClear()
+#define SDL_KillThread(X)
 
 extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
 
--- a/include/SDL_config.h.in	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_config.h.in	Sun Aug 22 13:45:56 2010 -0700
@@ -272,12 +272,17 @@
 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES
 #undef SDL_VIDEO_DRIVER_X11_VIDMODE
 #undef SDL_VIDEO_DRIVER_X11_XINERAMA
 #undef SDL_VIDEO_DRIVER_X11_XRANDR
 #undef SDL_VIDEO_DRIVER_X11_XINPUT
 #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
 #undef SDL_VIDEO_DRIVER_X11_XV
+#undef SDL_VIDEO_DRIVER_X11_XRENDER
+#undef SDL_VIDEO_DRIVER_X11_XDAMAGE
+#undef SDL_VIDEO_DRIVER_X11_XFIXES
 #undef SDL_VIDEO_DRIVER_X11_XSHAPE
 
 #undef SDL_VIDEO_RENDER_D3D
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_config_android.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,145 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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_android_h
+#define _SDL_config_android_h
+
+#include "SDL_platform.h"
+
+/**
+ *  \file SDL_config_android.h
+ *  
+ *  This is a configuration that can be used to build SDL for Android
+ */
+
+#include <stdarg.h>
+
+/*
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+*/
+
+
+#define HAVE_ALLOCA_H		1
+#define HAVE_SYS_TYPES_H	1
+#define HAVE_STDIO_H	1
+#define STDC_HEADERS	1
+#define HAVE_STRING_H	1
+#define HAVE_INTTYPES_H	1
+#define HAVE_STDINT_H	1
+#define HAVE_CTYPE_H	1
+#define HAVE_MATH_H	1
+#define HAVE_SIGNAL_H	1
+
+/* C library functions */
+#define HAVE_MALLOC	1
+#define HAVE_CALLOC	1
+#define HAVE_REALLOC	1
+#define HAVE_FREE	1
+#define HAVE_ALLOCA	1
+#define HAVE_GETENV	1
+#define HAVE_SETENV	1
+#define HAVE_PUTENV	1
+#define HAVE_SETENV	1
+#define HAVE_UNSETENV	1
+#define HAVE_QSORT	1
+#define HAVE_ABS	1
+#define HAVE_BCOPY	1
+#define HAVE_MEMSET	1
+#define HAVE_MEMCPY	1
+#define HAVE_MEMMOVE	1
+#define HAVE_MEMCMP	1
+#define HAVE_STRLEN	1
+#define HAVE_STRLCPY	1
+#define HAVE_STRLCAT	1
+#define HAVE_STRDUP	1
+#define HAVE_STRCHR	1
+#define HAVE_STRRCHR	1
+#define HAVE_STRSTR	1
+#define HAVE_STRTOL	1
+#define HAVE_STRTOUL	1
+#define HAVE_STRTOLL	1
+#define HAVE_STRTOULL	1
+#define HAVE_STRTOD	1
+#define HAVE_ATOI	1
+#define HAVE_ATOF	1
+#define HAVE_STRCMP	1
+#define HAVE_STRNCMP	1
+#define HAVE_STRCASECMP	1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF	1
+#define HAVE_SNPRINTF	1
+#define HAVE_VSNPRINTF	1
+#define HAVE_CEIL	1
+#define HAVE_COPYSIGN	1
+#define HAVE_COS	1
+#define HAVE_COSF	1
+#define HAVE_FABS	1
+#define HAVE_FLOOR	1
+#define HAVE_LOG	1
+#define HAVE_POW	1
+#define HAVE_SCALBN	1
+#define HAVE_SIN	1
+#define HAVE_SINF	1
+#define HAVE_SQRT	1
+#define HAVE_SIGACTION	1
+#define HAVE_SETJMP	1
+#define HAVE_NANOSLEEP	1
+#define HAVE_SYSCONF	1
+
+#define SIZEOF_VOIDP 4
+
+typedef unsigned int size_t;
+//typedef unsigned long uintptr_t;
+
+#define SDL_AUDIO_DRIVER_ANDROID	1
+
+#define SDL_CDROM_DISABLED 1
+
+#define SDL_HAPTIC_DISABLED 1
+
+#define SDL_JOYSTICK_ANDROID 1
+
+#define SDL_LOADSO_DISABLED 1
+
+/* Enable various threading systems */
+#define SDL_THREAD_PTHREAD	1
+#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX	1
+
+/* Enable various timer systems */
+#define SDL_TIMER_UNIX	1
+
+#define SDL_VIDEO_DRIVER_ANDROID 1
+
+#define HAVE_STDIO_H 1
+#define HAVE_SYS_TYPES_H 1
+
+#define HAVE_M_PI 1
+
+#define SDL_VIDEO_RENDER_OGL_ES 1
+
+#endif /* _SDL_config_minimal_h */
+
--- a/include/SDL_config_iphoneos.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_config_iphoneos.h	Sun Aug 22 13:45:56 2010 -0700
@@ -145,12 +145,9 @@
 #define SDL_POWER_UIKIT 1
 
 /* enable iPhone keyboard support */
-#define SDL_IPHONE_KEYBOARD 0
+#define SDL_IPHONE_KEYBOARD 1
 
-/* Enable emulation of multiple mice through multi-touch */
-#define SDL_IPHONE_MULTIPLE_MICE 1
-
-/* Set max recognized G-force from acceleromter
+/* Set max recognized G-force from accelerometer
    See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
  */
 #define SDL_IPHONE_MAX_GFORCE 5.0
--- a/include/SDL_config_pandora.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_config_pandora.h	Sun Aug 22 13:45:56 2010 -0700
@@ -28,6 +28,12 @@
 /* General platform specific identifiers */
 #include "SDL_platform.h"
 
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
+#define SIZEOF_VOIDP 4
+#endif
+
 #define SDL_HAS_64BIT_TYPE 1
 #define SDL_BYTEORDER 1234
 
--- a/include/SDL_endian.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_endian.h	Sun Aug 22 13:45:56 2010 -0700
@@ -40,6 +40,10 @@
 /*@}*/
 
 #ifndef SDL_BYTEORDER           /* Not defined in SDL_config.h? */
+#ifdef __linux__
+#include <endian.h>
+#define SDL_BYTEORDER  __BYTE_ORDER
+#else /* __linux __ */
 #if defined(__hppa__) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MISPEB__)) || \
@@ -49,6 +53,7 @@
 #else
 #define SDL_BYTEORDER	SDL_LIL_ENDIAN
 #endif
+#endif /* __linux __ */
 #endif /* !SDL_BYTEORDER */
 
 
--- a/include/SDL_events.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_events.h	Sun Aug 22 13:45:56 2010 -0700
@@ -36,6 +36,8 @@
 #include "SDL_mouse.h"
 #include "SDL_joystick.h"
 #include "SDL_quit.h"
+#include "SDL_gesture.h"
+#include "SDL_touch.h"
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -75,9 +77,13 @@
     SDL_MOUSEBUTTONUP,          /**< Mouse button released */
     SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
 
-    /* Tablet events */
-    SDL_PROXIMITYIN    = 0x500, /**< Proximity In event */
-    SDL_PROXIMITYOUT,           /**< Proximity Out event */
+    /* Tablet or multiple mice input device events */
+    SDL_INPUTMOTION    = 0x500, /**< Input moved */
+    SDL_INPUTBUTTONDOWN,        /**< Input button pressed */
+    SDL_INPUTBUTTONUP,          /**< Input button released */
+    SDL_INPUTWHEEL,             /**< Input wheel motion */
+    SDL_INPUTPROXIMITYIN,       /**< Input pen entered proximity */
+    SDL_INPUTPROXIMITYOUT,      /**< Input pen left proximity */
 
     /* Joystick events */
     SDL_JOYAXISMOTION  = 0x600, /**< Joystick axis motion */
@@ -86,11 +92,28 @@
     SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
     SDL_JOYBUTTONUP,            /**< Joystick button released */
 
+    /* Touch events */
+    SDL_FINGERDOWN      = 0x700,
+    SDL_FINGERUP,
+    SDL_FINGERMOTION,
+    SDL_TOUCHBUTTONDOWN,
+    SDL_TOUCHBUTTONUP,    
+
+    /* Gesture events */
+    SDL_DOLLARGESTURE   = 0x800,
+    SDL_DOLLARRECORD,
+    SDL_MULTIGESTURE,
+
+    /* Clipboard events */
+
+    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
+
     /* Obsolete events */
     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
     SDL_EVENT_COMPAT2,
     SDL_EVENT_COMPAT3,
 
+
     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
      */
@@ -124,10 +147,10 @@
 {
     Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
     Uint32 windowID;    /**< The window with keyboard focus, if any */
-    Uint8 which;        /**< The keyboard device index */
     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
-    Uint8 padding1;
+    Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 padding2;
+    Uint8 padding3;
     SDL_keysym keysym;  /**< The key that was pressed or released */
 } SDL_KeyboardEvent;
 
@@ -139,7 +162,6 @@
 {
     Uint32 type;                                /**< ::SDL_TEXTEDITING */
     Uint32 windowID;                            /**< The window with keyboard focus, if any */
-    Uint8 which;                                /**< The keyboard device index */
     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
     int start;                                  /**< The start cursor of selected editing text */
     int length;                                 /**< The length of selected editing text */
@@ -154,10 +176,6 @@
 {
     Uint32 type;                              /**< ::SDL_TEXTINPUT */
     Uint32 windowID;                          /**< The window with keyboard focus, if any */
-    Uint8 which;                              /**< The keyboard device index */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
 } SDL_TextInputEvent;
 
@@ -168,20 +186,12 @@
 {
     Uint32 type;        /**< ::SDL_MOUSEMOTION */
     Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint8 which;        /**< The mouse device index */
     Uint8 state;        /**< The current button state */
     Uint8 padding1;
     Uint8 padding2;
+    Uint8 padding3;
     int x;              /**< X coordinate, relative to window */
     int y;              /**< Y coordinate, relative to window */
-    int z;              /**< Z coordinate, for future use */
-    int pressure;       /**< Pressure reported by tablets */
-    int pressure_max;   /**< Maximum value of the pressure reported by the device */
-    int pressure_min;   /**< Minimum value of the pressure reported by the device */
-    int rotation;       /**< For future use */
-    int tilt_x;         /**< For future use */
-    int tilt_y;         /**< For future use */
-    int cursor;         /**< The cursor being used in the event */
     int xrel;           /**< The relative motion in the X direction */
     int yrel;           /**< The relative motion in the Y direction */
 } SDL_MouseMotionEvent;
@@ -193,10 +203,10 @@
 {
     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
     Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint8 which;        /**< The mouse device index */
     Uint8 button;       /**< The mouse button index */
     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
     Uint8 padding1;
+    Uint8 padding2;
     int x;              /**< X coordinate, relative to window */
     int y;              /**< Y coordinate, relative to window */
 } SDL_MouseButtonEvent;
@@ -208,31 +218,11 @@
 {
     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
     Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint8 which;        /**< The mouse device index */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
     int x;              /**< The amount scrolled horizontally */
     int y;              /**< The amount scrolled vertically */
 } SDL_MouseWheelEvent;
 
 /**
- * \brief Tablet pen proximity event
- */
-typedef struct SDL_ProximityEvent
-{
-    Uint32 type;        /**< ::SDL_PROXIMITYIN or ::SDL_PROXIMITYOUT */
-    Uint32 windowID;    /**< The associated window */
-    Uint8 which;
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
-    int cursor;
-    int x;
-    int y;
-} SDL_ProximityEvent;
-
-/**
  *  \brief Joystick axis motion event structure (event.jaxis.*)
  */
 typedef struct SDL_JoyAxisEvent
@@ -289,6 +279,79 @@
     Uint8 padding1;
 } SDL_JoyButtonEvent;
 
+
+/**
+ *  \brief Touch finger motion/finger event structure (event.tmotion.*)
+ */
+typedef struct SDL_TouchFingerEvent
+{
+    Uint32 type;        /**< ::SDL_FINGERMOTION OR 
+			   SDL_FINGERDOWN OR SDL_FINGERUP*/
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    SDL_TouchID touchId;        /**< The touch device id */
+    SDL_FingerID fingerId;
+    Uint8 state;        /**< The current button state */
+    Uint8 padding1;
+    Uint8 padding2;
+    Uint8 padding3;
+    Uint16 x;
+    Uint16 y;
+    Sint16 dx;
+    Sint16 dy;
+    Uint16 pressure;
+} SDL_TouchFingerEvent;
+
+
+/**
+ *  \brief Touch finger motion/finger event structure (event.tmotion.*)
+ */
+typedef struct SDL_TouchButtonEvent
+{
+    Uint32 type;        /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    SDL_TouchID touchId;        /**< The touch device index */
+    Uint8 state;        /**< The current button state */
+    Uint8 button;        /**< The button changing state */
+    Uint8 padding1;
+    Uint8 padding2;
+} SDL_TouchButtonEvent;
+
+
+
+/**
+ *  \brief Multiple Finger Gesture Event
+ */
+typedef struct SDL_MultiGestureEvent
+{
+    Uint32 type;        /**< ::SDL_MULTIGESTURE */
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    SDL_TouchID touchId;        /**< The touch device index */
+    float dTheta;
+    float dDist;
+    float x;  //currently 0...1. Change to screen coords?
+    float y;  
+    Uint16 numFingers;
+    Uint16 padding;
+} SDL_MultiGestureEvent;
+
+typedef struct SDL_DollarGestureEvent
+{
+    Uint32 type;        /**< ::SDL_DOLLARGESTURE */
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    SDL_TouchID touchId;        /**< The touch device index */
+    SDL_GestureID gestureId;
+    Uint32 numFingers;
+    float error;
+  /*
+    //TODO: Enable to give location?
+    float x;  //currently 0...1. Change to screen coords?
+    float y;  
+  */
+} SDL_DollarGestureEvent;
+
+
+
+
 /**
  *  \brief The "quit requested" event
  */
@@ -371,7 +434,10 @@
     SDL_QuitEvent quit;             /**< Quit request event data */
     SDL_UserEvent user;             /**< Custom event data */
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
-    SDL_ProximityEvent proximity;   /**< Proximity In or Out event */
+    SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
+    SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
+    SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/
+    SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/
 
     /** Temporarily here for backwards compatibility */
     /*@{*/
@@ -409,12 +475,12 @@
  *  the back of the event queue.
  *  
  *  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
- *  of the event queue, matching \c mask, will be returned and will not
- *  be removed from the queue.
+ *  of the event queue, within the specified minimum and maximum type,
+ *  will be returned and will not be removed from the queue.
  *  
  *  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front 
- *  of the event queue, matching \c mask, will be returned and will be
- *  removed from the queue.
+ *  of the event queue, within the specified minimum and maximum type,
+ *  will be returned and will be removed from the queue.
  *  
  *  \return The number of events actually stored, or -1 if there was an error.
  *  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_gesture.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,92 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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_gesture.h
+ *  
+ *  Include file for SDL gesture event handling.
+ */
+
+#ifndef _SDL_gesture_h
+#define _SDL_gesture_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+
+#include "SDL_touch.h"
+
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+typedef Sint64 SDL_GestureID;
+
+/* Function prototypes */
+
+/**
+ *  \brief Begin Recording a gesture on the specified touch, or all touches (-1)
+ *
+ *
+ */
+extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
+
+
+/**
+ *  \brief Save all currently loaded Dollar Gesture templates
+ *
+ *
+ */
+extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src);
+
+/**
+ *  \brief Save a currently loaded Dollar Gesture template
+ *
+ *
+ */
+extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src);
+
+
+/**
+ *  \brief Load Dollar Gesture templates from a file
+ *
+ *
+ */
+extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_gesture_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_input.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,88 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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_input.h
+ *  
+ *  Include file for lowlevel SDL input device handling.
+ *
+ *  This talks about individual devices, and not the system cursor. If you
+ *  just want to know when the user moves the pointer somewhere in your
+ *  window, this is NOT the API you want. This one handles things like
+ *  multi-touch, drawing tablets, and multiple, separate mice.
+ *
+ *  The other API is in SDL_mouse.h
+ */
+
+#ifndef _SDL_input_h
+#define _SDL_input_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
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+
+/* Function prototypes */
+
+/* !!! FIXME: real documentation
+ * - Redetect devices
+ * - This invalidates all existing device information from previous queries!
+ * - There is an implicit (re)detect upon SDL_Init().
+ */
+extern DECLSPEC int SDLCALL SDL_RedetectInputDevices(void);
+
+/**
+ *  \brief Get the number of mouse input devices available.
+ */
+extern DECLSPEC int SDLCALL SDL_GetNumInputDevices(void);
+
+/**
+ *  \brief Gets the name of a device with the given index.
+ *  
+ *  \param index is the index of the device, whose name is to be returned.
+ *  
+ *  \return the name of the device with the specified index
+ */
+extern DECLSPEC const char *SDLCALL SDL_GetInputDeviceName(int index);
+
+
+extern DECLSPEC int SDLCALL SDL_IsDeviceDisconnected(int index);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mouse_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_keyboard.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_keyboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -32,6 +32,7 @@
 #include "SDL_stdinc.h"
 #include "SDL_error.h"
 #include "SDL_keysym.h"
+#include "SDL_video.h"
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -55,25 +56,12 @@
 /* Function prototypes */
 
 /**
- *  \brief Get the number of keyboard input devices available.
- *  
- *  \sa SDL_SelectKeyboard()
+ *  \brief Get the window which currently has keyboard focus.
  */
-extern DECLSPEC int SDLCALL SDL_GetNumKeyboards(void);
+extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
 
 /**
- *  \brief Set the index of the currently selected keyboard.
- *  
- *  \return The index of the previously selected keyboard.
- *  
- *  \note You can query the currently selected keyboard by passing an index of -1.
- *  
- *  \sa SDL_GetNumKeyboards()
- */
-extern DECLSPEC int SDLCALL SDL_SelectKeyboard(int index);
-
-/**
- *  \brief Get a snapshot of the current state of the selected keyboard.
+ *  \brief Get a snapshot of the current state of the keyboard.
  *  
  *  \param numkeys if non-NULL, receives the length of the returned array.
  *  
@@ -90,20 +78,20 @@
 extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
 
 /**
- *  \brief Get the current key modifier state for the selected keyboard.
+ *  \brief Get the current key modifier state for the keyboard.
  */
 extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
 
 /**
- *  \brief Set the current key modifier state for the selected keyboard.
+ *  \brief Set the current key modifier state for the keyboard.
  *  
  *  \note This does not change the keyboard state, only the key modifier flags.
  */
 extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
 
 /**
- *  \brief Get the key code corresponding to the given scancode according to the
- *         current keyboard layout.
+ *  \brief Get the key code corresponding to the given scancode according
+ *         to the current keyboard layout.
  *  
  *  See ::SDLKey for details.
  *  
--- a/include/SDL_mouse.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_mouse.h	Sun Aug 22 13:45:56 2010 -0700
@@ -24,6 +24,22 @@
  *  \file SDL_mouse.h
  *  
  *  Include file for SDL mouse event handling.
+ *
+ *  Please note that this ONLY discusses "mice" with the notion of the
+ *  desktop GUI. You (usually) have one system cursor, and the OS hides
+ *  the hardware details from you. If you plug in 10 mice, all ten move that
+ *  one cursor. For many applications and games, this is perfect, and this
+ *  API has served hundreds of SDL programs well since its birth.
+ *
+ *  It's not the whole picture, though. If you want more lowlevel control,
+ *  SDL offers a different API, that gives you visibility into each input
+ *  device, multi-touch interfaces, etc.
+ *
+ *  Those two APIs are incompatible, and you usually should not use both
+ *  at the same time. But for legacy purposes, this API refers to a "mouse"
+ *  when it actually means the system pointer and not a physical mouse.
+ *
+ *  The other API is in SDL_input.h
  */
 
 #ifndef _SDL_mouse_h
@@ -43,45 +59,50 @@
 
 typedef struct SDL_Cursor SDL_Cursor;   /* Implementation dependent */
 
+
 /* Function prototypes */
 
 /**
- *  \brief Get the number of mouse input devices available.
- *  
- *  \sa SDL_SelectMouse()
+ *  \brief Get the window which currently has mouse focus.
  */
-extern DECLSPEC int SDLCALL SDL_GetNumMice(void);
+extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
 
 /**
- *  \brief Gets the name of a mouse with the given index.
- *  
- *  \param index is the index of the mouse, which name is to be returned.
+ *  \brief Retrieve the current state of the mouse.
  *  
- *  \return the name of the mouse with the specified index
+ *  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 cursor position relative to the focus window for the currently
+ *  selected mouse.  You can pass NULL for either x or y.
  */
-extern DECLSPEC char *SDLCALL SDL_GetMouseName(int index);
+extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
 
 /**
- *  \brief Set the index of the currently selected mouse.
- *  
- *  \return The index of the previously selected mouse.
- *  
- *  \note You can query the currently selected mouse by passing an index of -1.
- *  
- *  \sa SDL_GetNumMice()
+ *  \brief Retrieve the relative 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 int SDLCALL SDL_SelectMouse(int index);
+extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
 
 /**
- *  \brief Get the window which currently has focus for the specified mouse.
+ *  \brief Moves the mouse to the given position within the window.
+ *  
+ *  \param window The window to move the mouse into, or NULL for the current mouse focus
+ *  \param x The x coordinate within the window
+ *  \param y The y coordinate within the window
+ *  
+ *  \note This function generates a mouse motion event
  */
-extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocusWindow(int index);
+extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
+                                                   int x, int y);
 
 /**
- *  \brief Set relative mouse mode for the specified mouse.
+ *  \brief Set relative mouse mode.
  *  
  *  \param enabled Whether or not to enable relative mode
- *  
+ *
  *  \return 0 on success, or -1 if relative mode is not supported.
  *  
  *  While the mouse is in relative mode, the cursor is hidden, and the
@@ -93,51 +114,18 @@
  *  
  *  \sa SDL_GetRelativeMouseMode()
  */
-extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(int index,
-                                                     SDL_bool enabled);
+extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
 
 /**
- *  \brief Query whether relative mouse mode is enabled for the specified mouse.
+ *  \brief Query whether relative mouse mode is enabled.
  *  
  *  \sa SDL_SetRelativeMouseMode()
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(int index);
-
-/**
- *  \brief Retrieve the current state of the specified 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 cursor position relative to the focus window for the currently
- *  selected mouse.  You can pass NULL for either x or y.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
+extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
 
 /**
- *  \brief Retrieve the state of the specified 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 index, int *x,
-                                                        int *y);
-
-/**
- *  \brief Moves the currently selected mouse to the given position within the window.
- *  
- *  \param window The window to move the mouse into, or NULL for the current mouse focus
- *  \param x The x coordinate within the window
- *  \param y The y coordinate within the window
- *  
- *  \note This function generates a mouse motion event
- */
-extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
-                                                   int x, int y);
-
-/**
- *  \brief Create a cursor for the currently selected mouse, using the
- *         specified bitmap data and mask (in MSB format).
+ *  \brief Create a cursor, using the specified bitmap data and
+ *         mask (in MSB format).
  *  
  *  The cursor width must be a multiple of 8 bits.
  *  
@@ -148,7 +136,7 @@
  *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
  *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
  *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black 
-                                           if not. </td></tr>
+ *                                         if not. </td></tr>
  *  </table>
  *  
  *  \sa SDL_FreeCursor()
@@ -159,14 +147,12 @@
                                                      int hot_y);
 
 /**
- *  \brief Set the active cursor for the currently selected mouse.
- *  
- *  \note The cursor must have been created for the selected mouse.
+ *  \brief Set the active cursor.
  */
 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
 
 /**
- *  \brief Return the active cursor for the currently selected mouse.
+ *  \brief Return the active cursor.
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
 
@@ -178,8 +164,7 @@
 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
 
 /**
- *  \brief Toggle whether or not the cursor is shown for the currently selected 
- *         mouse.
+ *  \brief Toggle whether or not the cursor is shown.
  *  
  *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current 
  *                state.
@@ -189,38 +174,6 @@
 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 
 /**
- *  \brief Gets the number of cursors a pointing device supports.
- *  
- *  Useful for tablet users. Useful only under Windows.
- *  
- *  \param index is the index of the pointing device, which number of cursors we
- *               want to receive.
- *  
- *  \return the number of cursors supported by the pointing device. On Windows
- *          if a device is a tablet it returns a number >=1. Normal mice always 
- *          return 1.
- *  
- *  On Linux every device reports one cursor.
- */
-extern DECLSPEC int SDLCALL SDL_GetCursorsNumber(int index);
-
-/**
- *  \brief Returns the index of the current cursor used by a specific pointing
- *         device.
- *  
- *  Useful only under Windows.
- *  
- *  \param index is the index of the pointing device, which cursor index we want
- *               to receive.
- *  
- *  \return the index of the cursor currently used by a specific pointing 
- *          device.  Always 0 under Linux. On Windows if the device isn't a 
- *          tablet it returns 0.  If the device is the tablet it returns the 
- *          cursor index.  0 - stylus, 1 - eraser, 2 - cursor.
- */
-extern DECLSPEC int SDLCALL SDL_GetCurrentCursor(int index);
-
-/**
  *  Used as a mask when testing buttons in buttonstate.
  *   - Button 1:  Left mouse button
  *   - Button 2:  Middle mouse button
--- a/include/SDL_mutex.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_mutex.h	Sun Aug 22 13:45:56 2010 -0700
@@ -194,7 +194,7 @@
  *  
  *  \return 0 when it is signaled, or -1 on error.
  */
-extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mut);
+extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
 
 /**
  *  Waits for at most \c ms milliseconds, and returns 0 if the condition
--- a/include/SDL_opengl.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_opengl.h	Sun Aug 22 13:45:56 2010 -0700
@@ -80,7 +80,7 @@
 #endif
 
 /*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
+** Copyright (c) 2007-2010 The Khronos Group Inc.
 ** 
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
@@ -103,10 +103,9 @@
 */
 
 /* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated $Date$ */
+/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */
 /* Current version at http://www.opengl.org/registry/ */
-#define GL_GLEXT_VERSION 54
-
+#define GL_GLEXT_VERSION 64
 /* Function declaration macros - to move into glplatform.h */
 
 #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -849,7 +848,7 @@
 /* Reuse tokens from ARB_copy_buffer */
 /* reuse GL_COPY_READ_BUFFER */
 /* reuse GL_COPY_WRITE_BUFFER */
-/* Would reuse tokens from ARB_draw_instanced, but it has none */
+/* Reuse tokens from ARB_draw_instanced (none) */
 /* Reuse tokens from ARB_uniform_buffer_object */
 /* reuse GL_UNIFORM_BUFFER */
 /* reuse GL_UNIFORM_BUFFER_BINDING */
@@ -910,8 +909,8 @@
 /* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
 /* Reuse tokens from ARB_depth_clamp */
 /* reuse GL_DEPTH_CLAMP */
-/* Would reuse tokens from ARB_draw_elements_base_vertex, but it has none */
-/* Would reuse tokens from ARB_fragment_coord_conventions, but it has none */
+/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
+/* Reuse tokens from ARB_fragment_coord_conventions (none) */
 /* Reuse tokens from ARB_provoking_vertex */
 /* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
 /* reuse GL_FIRST_VERTEX_CONVENTION */
@@ -961,6 +960,167 @@
 /* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
 #endif
 
+#ifndef GL_VERSION_3_3
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
+/* Reuse tokens from ARB_blend_func_extended */
+/* reuse GL_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_ALPHA */
+/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
+/* Reuse tokens from ARB_explicit_attrib_location (none) */
+/* Reuse tokens from ARB_occlusion_query2 */
+/* reuse GL_ANY_SAMPLES_PASSED */
+/* Reuse tokens from ARB_sampler_objects */
+/* reuse GL_SAMPLER_BINDING */
+/* Reuse tokens from ARB_shader_bit_encoding (none) */
+/* Reuse tokens from ARB_texture_rgb10_a2ui */
+/* reuse GL_RGB10_A2UI */
+/* Reuse tokens from ARB_texture_swizzle */
+/* reuse GL_TEXTURE_SWIZZLE_R */
+/* reuse GL_TEXTURE_SWIZZLE_G */
+/* reuse GL_TEXTURE_SWIZZLE_B */
+/* reuse GL_TEXTURE_SWIZZLE_A */
+/* reuse GL_TEXTURE_SWIZZLE_RGBA */
+/* Reuse tokens from ARB_timer_query */
+/* reuse GL_TIME_ELAPSED */
+/* reuse GL_TIMESTAMP */
+/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
+/* reuse GL_INT_2_10_10_10_REV */
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_SAMPLE_SHADING                 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE       0x8C37
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_TEXTURE_CUBE_MAP_ARRAY         0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY   0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY         0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW  0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY     0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
+/* Reuse tokens from ARB_texture_query_lod (none) */
+/* Reuse tokens from ARB_draw_buffers_blend (none) */
+/* Reuse tokens from ARB_draw_indirect */
+/* reuse GL_DRAW_INDIRECT_BUFFER */
+/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
+/* Reuse tokens from ARB_gpu_shader5 */
+/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+/* Reuse tokens from ARB_gpu_shader_fp64 */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+/* Reuse tokens from ARB_shader_subroutine */
+/* reuse GL_ACTIVE_SUBROUTINES */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
+/* reuse GL_MAX_SUBROUTINES */
+/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
+/* reuse GL_COMPATIBLE_SUBROUTINES */
+/* Reuse tokens from ARB_tessellation_shader */
+/* reuse GL_PATCHES */
+/* reuse GL_PATCH_VERTICES */
+/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
+/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
+/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
+/* reuse GL_TESS_GEN_MODE */
+/* reuse GL_TESS_GEN_SPACING */
+/* reuse GL_TESS_GEN_VERTEX_ORDER */
+/* reuse GL_TESS_GEN_POINT_MODE */
+/* reuse GL_ISOLINES */
+/* reuse GL_FRACTIONAL_ODD */
+/* reuse GL_FRACTIONAL_EVEN */
+/* reuse GL_MAX_PATCH_VERTICES */
+/* reuse GL_MAX_TESS_GEN_LEVEL */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_CONTROL_SHADER */
+/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
+/* Reuse tokens from ARB_transform_feedback2 */
+/* reuse GL_TRANSFORM_FEEDBACK */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
+/* Reuse tokens from ARB_transform_feedback3 */
+/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_VERSION_4_1
+/* Reuse tokens from ARB_ES2_compatibility */
+/* reuse GL_FIXED */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+/* reuse GL_LOW_FLOAT */
+/* reuse GL_MEDIUM_FLOAT */
+/* reuse GL_HIGH_FLOAT */
+/* reuse GL_LOW_INT */
+/* reuse GL_MEDIUM_INT */
+/* reuse GL_HIGH_INT */
+/* reuse GL_SHADER_COMPILER */
+/* reuse GL_NUM_SHADER_BINARY_FORMATS */
+/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
+/* reuse GL_MAX_VARYING_VECTORS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+/* Reuse tokens from ARB_get_program_binary */
+/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+/* reuse GL_PROGRAM_BINARY_LENGTH */
+/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
+/* reuse GL_PROGRAM_BINARY_FORMATS */
+/* Reuse tokens from ARB_separate_shader_objects */
+/* reuse GL_VERTEX_SHADER_BIT */
+/* reuse GL_FRAGMENT_SHADER_BIT */
+/* reuse GL_GEOMETRY_SHADER_BIT */
+/* reuse GL_TESS_CONTROL_SHADER_BIT */
+/* reuse GL_TESS_EVALUATION_SHADER_BIT */
+/* reuse GL_ALL_SHADER_BITS */
+/* reuse GL_PROGRAM_SEPARABLE */
+/* reuse GL_ACTIVE_PROGRAM */
+/* reuse GL_PROGRAM_PIPELINE_BINDING */
+/* Reuse tokens from ARB_shader_precision (none) */
+/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
+/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
+/* reuse GL_MAX_VIEWPORTS */
+/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
+/* reuse GL_VIEWPORT_BOUNDS_RANGE */
+/* reuse GL_LAYER_PROVOKING_VERTEX */
+/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
+/* reuse GL_UNDEFINED_VERTEX */
+#endif
+
 #ifndef GL_ARB_multitexture
 #define GL_TEXTURE0_ARB                   0x84C0
 #define GL_TEXTURE1_ARB                   0x84C1
@@ -1758,29 +1918,302 @@
 #endif
 
 #ifndef GL_ARB_sample_shading
-#define GL_SAMPLE_SHADING                 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE       0x8C37
+#define GL_SAMPLE_SHADING_ARB             0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_ARB   0x8C37
 #endif
 
 #ifndef GL_ARB_texture_cube_map_array
-#define GL_TEXTURE_CUBE_MAP_ARRAY         0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY   0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY         0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW  0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY     0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
+#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB     0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB     0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
 #endif
 
 #ifndef GL_ARB_texture_gather
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
 #endif
 
 #ifndef GL_ARB_texture_query_lod
 #endif
 
+#ifndef GL_ARB_shading_language_include
+#define GL_SHADER_INCLUDE_ARB             0x8DAE
+#define GL_NAMED_STRING_LENGTH_ARB        0x8DE9
+#define GL_NAMED_STRING_TYPE_ARB          0x8DEA
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_SRC1_COLOR                     0x88F9
+/* reuse GL_SRC1_ALPHA */
+#define GL_ONE_MINUS_SRC1_COLOR           0x88FA
+#define GL_ONE_MINUS_SRC1_ALPHA           0x88FB
+#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS   0x88FC
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ANY_SAMPLES_PASSED             0x8C2F
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_SAMPLER_BINDING                0x8919
+#endif
+
+#ifndef GL_ARB_shader_bit_encoding
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_RGB10_A2UI                     0x906F
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#define GL_TEXTURE_SWIZZLE_R              0x8E42
+#define GL_TEXTURE_SWIZZLE_G              0x8E43
+#define GL_TEXTURE_SWIZZLE_B              0x8E44
+#define GL_TEXTURE_SWIZZLE_A              0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA           0x8E46
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_TIME_ELAPSED                   0x88BF
+#define GL_TIMESTAMP                      0x8E28
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
+#define GL_INT_2_10_10_10_REV             0x8D9F
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_DRAW_INDIRECT_BUFFER           0x8F3F
+#define GL_DRAW_INDIRECT_BUFFER_BINDING   0x8F43
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_GEOMETRY_SHADER_INVOCATIONS    0x887F
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
+#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2                    0x8FFC
+#define GL_DOUBLE_VEC3                    0x8FFD
+#define GL_DOUBLE_VEC4                    0x8FFE
+#define GL_DOUBLE_MAT2                    0x8F46
+#define GL_DOUBLE_MAT3                    0x8F47
+#define GL_DOUBLE_MAT4                    0x8F48
+#define GL_DOUBLE_MAT2x3                  0x8F49
+#define GL_DOUBLE_MAT2x4                  0x8F4A
+#define GL_DOUBLE_MAT3x2                  0x8F4B
+#define GL_DOUBLE_MAT3x4                  0x8F4C
+#define GL_DOUBLE_MAT4x2                  0x8F4D
+#define GL_DOUBLE_MAT4x3                  0x8F4E
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ACTIVE_SUBROUTINES             0x8DE5
+#define GL_ACTIVE_SUBROUTINE_UNIFORMS     0x8DE6
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
+#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH   0x8E48
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
+#define GL_MAX_SUBROUTINES                0x8DE7
+#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
+#define GL_NUM_COMPATIBLE_SUBROUTINES     0x8E4A
+#define GL_COMPATIBLE_SUBROUTINES         0x8E4B
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_PATCHES                        0x000E
+#define GL_PATCH_VERTICES                 0x8E72
+#define GL_PATCH_DEFAULT_INNER_LEVEL      0x8E73
+#define GL_PATCH_DEFAULT_OUTER_LEVEL      0x8E74
+#define GL_TESS_CONTROL_OUTPUT_VERTICES   0x8E75
+#define GL_TESS_GEN_MODE                  0x8E76
+#define GL_TESS_GEN_SPACING               0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER          0x8E78
+#define GL_TESS_GEN_POINT_MODE            0x8E79
+/* reuse GL_TRIANGLES */
+/* reuse GL_QUADS */
+#define GL_ISOLINES                       0x8E7A
+/* reuse GL_EQUAL */
+#define GL_FRACTIONAL_ODD                 0x8E7B
+#define GL_FRACTIONAL_EVEN                0x8E7C
+/* reuse GL_CCW */
+/* reuse GL_CW */
+#define GL_MAX_PATCH_VERTICES             0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL             0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS      0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
+#define GL_TESS_EVALUATION_SHADER         0x8E87
+#define GL_TESS_CONTROL_SHADER            0x8E88
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+/* reuse GL_RGB32F */
+/* reuse GL_RGB32UI */
+/* reuse GL_RGB32I */
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
+#define GL_MAX_VERTEX_STREAMS             0x8E71
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_FIXED                          0x140C
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH          0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
+#define GL_PROGRAM_BINARY_FORMATS         0x87FF
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_VERTEX_SHADER_BIT              0x00000001
+#define GL_FRAGMENT_SHADER_BIT            0x00000002
+#define GL_GEOMETRY_SHADER_BIT            0x00000004
+#define GL_TESS_CONTROL_SHADER_BIT        0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT     0x00000010
+#define GL_ALL_SHADER_BITS                0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE              0x8258
+#define GL_ACTIVE_PROGRAM                 0x8259
+#define GL_PROGRAM_PIPELINE_BINDING       0x825A
+#endif
+
+#ifndef GL_ARB_shader_precision
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+/* reuse GL_RGB32I */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+#endif
+
+#ifndef GL_ARB_viewport_array
+/* reuse GL_SCISSOR_BOX */
+/* reuse GL_VIEWPORT */
+/* reuse GL_DEPTH_RANGE */
+/* reuse GL_SCISSOR_TEST */
+#define GL_MAX_VIEWPORTS                  0x825B
+#define GL_VIEWPORT_SUBPIXEL_BITS         0x825C
+#define GL_VIEWPORT_BOUNDS_RANGE          0x825D
+#define GL_LAYER_PROVOKING_VERTEX         0x825E
+#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
+#define GL_UNDEFINED_VERTEX               0x8260
+/* reuse GL_FIRST_VERTEX_CONVENTION */
+/* reuse GL_LAST_VERTEX_CONVENTION */
+/* reuse GL_PROVOKING_VERTEX */
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_SYNC_CL_EVENT_ARB              0x8240
+#define GL_SYNC_CL_EVENT_COMPLETE_ARB     0x8241
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB   0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION_ARB    0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM_ARB  0x8245
+#define GL_DEBUG_SOURCE_API_ARB           0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB   0x8249
+#define GL_DEBUG_SOURCE_APPLICATION_ARB   0x824A
+#define GL_DEBUG_SOURCE_OTHER_ARB         0x824B
+#define GL_DEBUG_TYPE_ERROR_ARB           0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY_ARB     0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE_ARB     0x8250
+#define GL_DEBUG_TYPE_OTHER_ARB           0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB   0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB  0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_ARB      0x9145
+#define GL_DEBUG_SEVERITY_HIGH_ARB        0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_ARB      0x9147
+#define GL_DEBUG_SEVERITY_LOW_ARB         0x9148
+#endif
+
+#ifndef GL_ARB_robustness
+/* reuse GL_NO_ERROR */
+#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GL_LOSE_CONTEXT_ON_RESET_ARB      0x8252
+#define GL_GUILTY_CONTEXT_RESET_ARB       0x8253
+#define GL_INNOCENT_CONTEXT_RESET_ARB     0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_ARB      0x8255
+#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GL_NO_RESET_NOTIFICATION_ARB      0x8261
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#endif
+
 #ifndef GL_EXT_abgr
 #define GL_ABGR_EXT                       0x8000
 #endif
@@ -3602,9 +4035,9 @@
 #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
+#define GL_ELEMENT_ARRAY_APPLE            0x8A0C
+#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8A0D
+#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x8A0E
 #endif
 
 #ifndef GL_APPLE_fence
@@ -3621,6 +4054,7 @@
 #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_CLIENT_APPLE           0x85B4
 #define GL_STORAGE_CACHED_APPLE           0x85BE
 #define GL_STORAGE_SHARED_APPLE           0x85BF
 #endif
@@ -4125,6 +4559,12 @@
 #define GL_SEPARATE_ATTRIBS_NV            0x8C8D
 #define GL_TRANSFORM_FEEDBACK_BUFFER_NV   0x8C8E
 #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#define GL_LAYER_NV                       0x8DAA
+#define GL_NEXT_BUFFER_NV                 -2
+#define GL_SKIP_COMPONENTS4_NV            -3
+#define GL_SKIP_COMPONENTS3_NV            -4
+#define GL_SKIP_COMPONENTS2_NV            -5
+#define GL_SKIP_COMPONENTS1_NV            -6
 #endif
 
 #ifndef GL_EXT_bindable_uniform
@@ -4310,7 +4750,7 @@
 #define GL_LUMINANCE16_SNORM              0x9019
 #define GL_LUMINANCE16_ALPHA16_SNORM      0x901A
 #define GL_INTENSITY16_SNORM              0x901B
-/* reuse GL_R_SNORM */
+/* reuse GL_RED_SNORM */
 /* reuse GL_RG_SNORM */
 /* reuse GL_RGB_SNORM */
 /* reuse GL_RGBA_SNORM */
@@ -4385,6 +4825,274 @@
 #define GL_UNPACK_ROW_BYTES_APPLE         0x8A16
 #endif
 
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE                  0x8A1F
+/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
+/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_VIDEO_BUFFER_NV                0x9020
+#define GL_VIDEO_BUFFER_BINDING_NV        0x9021
+#define GL_FIELD_UPPER_NV                 0x9022
+#define GL_FIELD_LOWER_NV                 0x9023
+#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV   0x9024
+#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
+#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
+#define GL_LAST_VIDEO_CAPTURE_STATUS_NV   0x9027
+#define GL_VIDEO_BUFFER_PITCH_NV          0x9028
+#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
+#define GL_VIDEO_COLOR_CONVERSION_MAX_NV  0x902A
+#define GL_VIDEO_COLOR_CONVERSION_MIN_NV  0x902B
+#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
+#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
+#define GL_PARTIAL_SUCCESS_NV             0x902E
+#define GL_SUCCESS_NV                     0x902F
+#define GL_FAILURE_NV                     0x9030
+#define GL_YCBYCR8_422_NV                 0x9031
+#define GL_YCBAYCR8A_4224_NV              0x9032
+#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV  0x9033
+#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
+#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV  0x9035
+#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
+#define GL_Z4Y12Z4CB12Z4CR12_444_NV       0x9037
+#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV   0x9038
+#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV  0x9039
+#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
+#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
+#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
+#endif
+
+#ifndef GL_NV_copy_image
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_ACTIVE_PROGRAM_EXT             0x8B8D
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_BUFFER_GPU_ADDRESS_NV          0x8F1D
+#define GL_GPU_ADDRESS_NV                 0x8F34
+#define GL_MAX_SHADER_BUFFER_ADDRESS_NV   0x8F35
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
+#define GL_ELEMENT_ARRAY_UNIFIED_NV       0x8F1F
+#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
+#define GL_VERTEX_ARRAY_ADDRESS_NV        0x8F21
+#define GL_NORMAL_ARRAY_ADDRESS_NV        0x8F22
+#define GL_COLOR_ARRAY_ADDRESS_NV         0x8F23
+#define GL_INDEX_ARRAY_ADDRESS_NV         0x8F24
+#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
+#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV     0x8F26
+#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
+#define GL_FOG_COORD_ARRAY_ADDRESS_NV     0x8F28
+#define GL_ELEMENT_ARRAY_ADDRESS_NV       0x8F29
+#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV  0x8F2A
+#define GL_VERTEX_ARRAY_LENGTH_NV         0x8F2B
+#define GL_NORMAL_ARRAY_LENGTH_NV         0x8F2C
+#define GL_COLOR_ARRAY_LENGTH_NV          0x8F2D
+#define GL_INDEX_ARRAY_LENGTH_NV          0x8F2E
+#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV  0x8F2F
+#define GL_EDGE_FLAG_ARRAY_LENGTH_NV      0x8F30
+#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
+#define GL_FOG_COORD_ARRAY_LENGTH_NV      0x8F32
+#define GL_ELEMENT_ARRAY_LENGTH_NV        0x8F33
+#define GL_DRAW_INDIRECT_UNIFIED_NV       0x8F40
+#define GL_DRAW_INDIRECT_ADDRESS_NV       0x8F41
+#define GL_DRAW_INDIRECT_LENGTH_NV        0x8F42
+#endif
+
+#ifndef GL_NV_texture_barrier
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_MAX_IMAGE_UNITS_EXT            0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
+#define GL_IMAGE_BINDING_NAME_EXT         0x8F3A
+#define GL_IMAGE_BINDING_LEVEL_EXT        0x8F3B
+#define GL_IMAGE_BINDING_LAYERED_EXT      0x8F3C
+#define GL_IMAGE_BINDING_LAYER_EXT        0x8F3D
+#define GL_IMAGE_BINDING_ACCESS_EXT       0x8F3E
+#define GL_IMAGE_1D_EXT                   0x904C
+#define GL_IMAGE_2D_EXT                   0x904D
+#define GL_IMAGE_3D_EXT                   0x904E
+#define GL_IMAGE_2D_RECT_EXT              0x904F
+#define GL_IMAGE_CUBE_EXT                 0x9050
+#define GL_IMAGE_BUFFER_EXT               0x9051
+#define GL_IMAGE_1D_ARRAY_EXT             0x9052
+#define GL_IMAGE_2D_ARRAY_EXT             0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY_EXT       0x9054
+#define GL_IMAGE_2D_MULTISAMPLE_EXT       0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
+#define GL_INT_IMAGE_1D_EXT               0x9057
+#define GL_INT_IMAGE_2D_EXT               0x9058
+#define GL_INT_IMAGE_3D_EXT               0x9059
+#define GL_INT_IMAGE_2D_RECT_EXT          0x905A
+#define GL_INT_IMAGE_CUBE_EXT             0x905B
+#define GL_INT_IMAGE_BUFFER_EXT           0x905C
+#define GL_INT_IMAGE_1D_ARRAY_EXT         0x905D
+#define GL_INT_IMAGE_2D_ARRAY_EXT         0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT   0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT   0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D_EXT      0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D_EXT      0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D_EXT      0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT    0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT  0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
+#define GL_MAX_IMAGE_SAMPLES_EXT          0x906D
+#define GL_IMAGE_BINDING_FORMAT_EXT       0x906E
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT  0x00000002
+#define GL_UNIFORM_BARRIER_BIT_EXT        0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT  0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
+#define GL_COMMAND_BARRIER_BIT_EXT        0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT   0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT  0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT_EXT    0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
+#define GL_ALL_BARRIER_BITS_EXT           0xFFFFFFFF
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2_EXT                0x8FFC
+#define GL_DOUBLE_VEC3_EXT                0x8FFD
+#define GL_DOUBLE_VEC4_EXT                0x8FFE
+#define GL_DOUBLE_MAT2_EXT                0x8F46
+#define GL_DOUBLE_MAT3_EXT                0x8F47
+#define GL_DOUBLE_MAT4_EXT                0x8F48
+#define GL_DOUBLE_MAT2x3_EXT              0x8F49
+#define GL_DOUBLE_MAT2x4_EXT              0x8F4A
+#define GL_DOUBLE_MAT3x2_EXT              0x8F4B
+#define GL_DOUBLE_MAT3x4_EXT              0x8F4C
+#define GL_DOUBLE_MAT4x2_EXT              0x8F4D
+#define GL_DOUBLE_MAT4x3_EXT              0x8F4E
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
+#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
+#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
+#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV  0x8F45
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#define GL_INT64_NV                       0x140E
+#define GL_UNSIGNED_INT64_NV              0x140F
+#define GL_INT8_NV                        0x8FE0
+#define GL_INT8_VEC2_NV                   0x8FE1
+#define GL_INT8_VEC3_NV                   0x8FE2
+#define GL_INT8_VEC4_NV                   0x8FE3
+#define GL_INT16_NV                       0x8FE4
+#define GL_INT16_VEC2_NV                  0x8FE5
+#define GL_INT16_VEC3_NV                  0x8FE6
+#define GL_INT16_VEC4_NV                  0x8FE7
+#define GL_INT64_VEC2_NV                  0x8FE9
+#define GL_INT64_VEC3_NV                  0x8FEA
+#define GL_INT64_VEC4_NV                  0x8FEB
+#define GL_UNSIGNED_INT8_NV               0x8FEC
+#define GL_UNSIGNED_INT8_VEC2_NV          0x8FED
+#define GL_UNSIGNED_INT8_VEC3_NV          0x8FEE
+#define GL_UNSIGNED_INT8_VEC4_NV          0x8FEF
+#define GL_UNSIGNED_INT16_NV              0x8FF0
+#define GL_UNSIGNED_INT16_VEC2_NV         0x8FF1
+#define GL_UNSIGNED_INT16_VEC3_NV         0x8FF2
+#define GL_UNSIGNED_INT16_VEC4_NV         0x8FF3
+#define GL_UNSIGNED_INT64_VEC2_NV         0x8FF5
+#define GL_UNSIGNED_INT64_VEC3_NV         0x8FF6
+#define GL_UNSIGNED_INT64_VEC4_NV         0x8FF7
+#define GL_FLOAT16_NV                     0x8FF8
+#define GL_FLOAT16_VEC2_NV                0x8FF9
+#define GL_FLOAT16_VEC3_NV                0x8FFA
+#define GL_FLOAT16_VEC4_NV                0x8FFB
+/* reuse GL_PATCHES */
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
+/* reuse GL_READ_WRITE */
+/* reuse GL_WRITE_ONLY */
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV   0x86D8
+#define GL_TESS_CONTROL_PROGRAM_NV        0x891E
+#define GL_TESS_EVALUATION_PROGRAM_NV     0x891F
+#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
+#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+/* reuse GL_INT64_NV */
+/* reuse GL_UNSIGNED_INT64_NV */
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_COVERAGE_SAMPLES_NV            0x80A9
+#define GL_COLOR_SAMPLES_NV               0x8E20
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_DATA_BUFFER_AMD                0x9151
+#define GL_PERFORMANCE_MONITOR_AMD        0x9152
+#define GL_QUERY_OBJECT_AMD               0x9153
+#define GL_VERTEX_ARRAY_OBJECT_AMD        0x9154
+#define GL_SAMPLER_OBJECT_AMD             0x9155
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD  0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_AMD      0x9145
+#define GL_DEBUG_SEVERITY_HIGH_AMD        0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_AMD      0x9147
+#define GL_DEBUG_SEVERITY_LOW_AMD         0x9148
+#define GL_DEBUG_CATEGORY_API_ERROR_AMD   0x9149
+#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
+#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
+#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
+#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
+#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
+#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
+#define GL_DEBUG_CATEGORY_OTHER_AMD       0x9150
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_SURFACE_STATE_NV               0x86EB
+#define GL_SURFACE_REGISTERED_NV          0x86FD
+#define GL_SURFACE_MAPPED_NV              0x8700
+#define GL_WRITE_DISCARD_NV               0x88BE
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#endif
+
 
 /*************************************************************/
 
@@ -4447,7 +5155,7 @@
 typedef long int int32_t;
 typedef long long int int64_t;
 typedef unsigned long long int uint64_t;
-#elif defined(_WIN32) && (defined(__GNUC__) || defined(__WATCOMC__))
+#elif defined(_WIN32) && defined(__GNUC__)
 #include <stdint.h>
 #elif defined(_WIN32)
 typedef __int32 int32_t;
@@ -4464,21 +5172,39 @@
 typedef uint64_t GLuint64EXT;
 #endif
 
-#ifndef ARB_sync
+#ifndef GL_ARB_sync
 typedef int64_t GLint64;
 typedef uint64_t GLuint64;
 typedef struct __GLsync *GLsync;
 #endif
 
+#ifndef GL_ARB_cl_event
+/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
+struct _cl_context;
+struct _cl_event;
+#endif
+
+#ifndef GL_ARB_debug_output
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_AMD_debug_output
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+typedef GLintptr GLvdpauSurfaceNV;
+#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 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);
+GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY glBlendEquation (GLenum mode);
+GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
 typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
@@ -4491,38 +5217,38 @@
 #ifndef GL_VERSION_1_2_DEPRECATED
 #define GL_VERSION_1_2_DEPRECATED 1
 #ifdef GL_GLEXT_PROTOTYPES
-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 glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogram (GLenum target);
+GLAPI void APIENTRY glResetMinmax (GLenum target);
 #endif /* GL_GLEXT_PROTOTYPES */
 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);
@@ -4561,15 +5287,15 @@
 #ifndef GL_VERSION_1_3
 #define GL_VERSION_1_3 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum);
-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 *);
+GLAPI void APIENTRY glActiveTexture (GLenum texture);
+GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
 typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
@@ -4585,43 +5311,43 @@
 #ifndef GL_VERSION_1_3_DEPRECATED
 #define GL_VERSION_1_3_DEPRECATED 1
 #ifdef GL_GLEXT_PROTOTYPES
-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 glClientActiveTexture (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
 typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
@@ -4665,16 +5391,16 @@
 #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 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 glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const 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);
@@ -4685,44 +5411,44 @@
 #ifndef GL_VERSION_1_4_DEPRECATED
 #define GL_VERSION_1_4_DEPRECATED 1
 #ifdef GL_GLEXT_PROTOTYPES
-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 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 *);
+GLAPI void APIENTRY glFogCoordf (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoordd (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
 typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
@@ -4767,25 +5493,25 @@
 #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* *);
+GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
+GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQuery (GLenum target);
+GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
+GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
 typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
@@ -4811,104 +5537,104 @@
 #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 void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY glCompileShader (GLuint shader);
 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 *);
+GLAPI GLuint APIENTRY glCreateShader (GLenum type);
+GLAPI void APIENTRY glDeleteProgram (GLuint program);
+GLAPI void APIENTRY glDeleteShader (GLuint shader);
+GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
+GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
+GLAPI void APIENTRY glLinkProgram (GLuint program);
+GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+GLAPI void APIENTRY glUseProgram (GLuint program);
+GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glValidateProgram (GLuint program);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
 #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 PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, 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);
@@ -5003,12 +5729,12 @@
 #ifndef GL_VERSION_2_1
 #define GL_VERSION_2_1 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
@@ -5025,64 +5751,64 @@
 /* ARB_map_buffer_range */
 /* ARB_vertex_array_object */
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *);
-GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glEnablei (GLenum, GLuint);
-GLAPI void APIENTRY glDisablei (GLenum, GLuint);
-GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint);
-GLAPI void APIENTRY glBeginTransformFeedback (GLenum);
+GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
+GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
 GLAPI void APIENTRY glEndTransformFeedback (void);
-GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
-GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum);
-GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
-GLAPI void APIENTRY glClampColor (GLenum, GLenum);
-GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum);
+GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
+GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
 GLAPI void APIENTRY glEndConditionalRender (void);
-GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *);
-GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint);
-GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *);
-GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *);
-GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *);
-GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glUniform1ui (GLint, GLuint);
-GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *);
-GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *);
-GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *);
-GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *);
-GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *);
-GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint);
-GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint);
+GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
 typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
@@ -5150,10 +5876,10 @@
 /* ARB_copy_buffer */
 /* ARB_uniform_buffer_object */
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
-GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint);
+GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
@@ -5169,56 +5895,109 @@
 /* ARB_sync */
 /* ARB_texture_multisample */
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetInteger64i_v (GLenum, GLuint, GLint64 *);
-GLAPI void APIENTRY glGetBufferParameteri64v (GLenum, GLenum, GLint64 *);
-GLAPI void APIENTRY glProgramParameteri (GLuint, GLenum, GLint);
-GLAPI void APIENTRY glFramebufferTexture (GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTextureFace (GLenum, GLenum, GLuint, GLint, GLenum);
+GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
 typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
 typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_VERSION_3_3
+#define GL_VERSION_3_3 1
+/* OpenGL 3.3 also reuses entry points from these extensions: */
+/* ARB_blend_func_extended */
+/* ARB_sampler_objects */
+/* ARB_explicit_attrib_location, but it has none */
+/* ARB_occlusion_query2 (no entry points) */
+/* ARB_shader_bit_encoding (no entry points) */
+/* ARB_texture_rgb10_a2ui (no entry points) */
+/* ARB_texture_swizzle (no entry points) */
+/* ARB_timer_query */
+/* ARB_vertex_type_2_10_10_10_rev */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_VERSION_4_0 1
+/* OpenGL 4.0 also reuses entry points from these extensions: */
+/* ARB_texture_query_lod (no entry points) */
+/* ARB_draw_indirect */
+/* ARB_gpu_shader5 (no entry points) */
+/* ARB_gpu_shader_fp64 */
+/* ARB_shader_subroutine */
+/* ARB_tessellation_shader */
+/* ARB_texture_buffer_object_rgb32 (no entry points) */
+/* ARB_texture_cube_map_array (no entry points) */
+/* ARB_texture_gather (no entry points) */
+/* ARB_transform_feedback2 */
+/* ARB_transform_feedback3 */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShading (GLclampf value);
+GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+#ifndef GL_VERSION_4_1
+#define GL_VERSION_4_1 1
+/* OpenGL 4.1 also reuses entry points from these extensions: */
+/* ARB_ES2_compatibility */
+/* ARB_get_program_binary */
+/* ARB_separate_shader_objects */
+/* ARB_shader_precision (no entry points) */
+/* ARB_vertex_attrib_64bit */
+/* ARB_viewport_array */
 #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 *);
+GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
 typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
@@ -5259,10 +6038,10 @@
 #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 *);
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
 typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
@@ -5273,7 +6052,7 @@
 #ifndef GL_ARB_multisample
 #define GL_ARB_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
 #endif
@@ -5289,13 +6068,13 @@
 #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 *);
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
 #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);
@@ -5313,8 +6092,8 @@
 #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 *);
+GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
@@ -5323,16 +6102,16 @@
 #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);
+GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
+GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
+GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
+GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
+GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
+GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
+GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
+GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
+GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexBlendARB (GLint count);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
 typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
@@ -5349,11 +6128,11 @@
 #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 *);
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
 typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
@@ -5393,22 +6172,22 @@
 #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 *);
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
 typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
@@ -5431,68 +6210,68 @@
 #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);
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
 typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
@@ -5566,17 +6345,17 @@
 #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* *);
+GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
+GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
 typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
@@ -5594,14 +6373,14 @@
 #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 *);
+GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
+GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQueryARB (GLenum target);
+GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
 typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
@@ -5616,45 +6395,45 @@
 #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 void APIENTRY glDeleteObjectARB (GLhandleARB obj);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
 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 *);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
 typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
@@ -5700,9 +6479,9 @@
 #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 *);
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
 #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);
@@ -5732,7 +6511,7 @@
 #ifndef GL_ARB_draw_buffers
 #define GL_ARB_draw_buffers 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
 #endif
@@ -5744,7 +6523,7 @@
 #ifndef GL_ARB_color_buffer_float
 #define GL_ARB_color_buffer_float 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
 #endif
@@ -5768,8 +6547,8 @@
 #ifndef GL_ARB_draw_instanced
 #define GL_ARB_draw_instanced 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
+GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
@@ -5778,26 +6557,26 @@
 #ifndef GL_ARB_framebuffer_object
 #define GL_ARB_framebuffer_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint);
-GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *);
-GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *);
-GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint);
-GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *);
-GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum);
-GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGenerateMipmap (GLenum);
-GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
-GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmap (GLenum target);
+GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
 typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
@@ -5828,10 +6607,10 @@
 #ifndef GL_ARB_geometry_shader4
 #define GL_ARB_geometry_shader4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint);
-GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum);
+GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
 typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
@@ -5846,7 +6625,7 @@
 #ifndef GL_ARB_instanced_arrays
 #define GL_ARB_instanced_arrays 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
 #endif
@@ -5854,8 +6633,8 @@
 #ifndef GL_ARB_map_buffer_range
 #define GL_ARB_map_buffer_range 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
-GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr);
+GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
 typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
@@ -5864,7 +6643,7 @@
 #ifndef GL_ARB_texture_buffer_object
 #define GL_ARB_texture_buffer_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
 #endif
@@ -5880,10 +6659,10 @@
 #ifndef GL_ARB_vertex_array_object
 #define GL_ARB_vertex_array_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArray (GLuint);
-GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsVertexArray (GLuint);
+GLAPI void APIENTRY glBindVertexArray (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
 typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
@@ -5894,13 +6673,13 @@
 #ifndef GL_ARB_uniform_buffer_object
 #define GL_ARB_uniform_buffer_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *);
-GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *);
-GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
+GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
 typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
@@ -5918,7 +6697,7 @@
 #ifndef GL_ARB_copy_buffer
 #define GL_ARB_copy_buffer 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
+GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
 #endif
@@ -5934,10 +6713,10 @@
 #ifndef GL_ARB_draw_elements_base_vertex
 #define GL_ARB_draw_elements_base_vertex 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLint);
-GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei, GLint);
-GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei, const GLint *);
+GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
+GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
 typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
@@ -5952,7 +6731,7 @@
 #ifndef GL_ARB_provoking_vertex
 #define GL_ARB_provoking_vertex 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertex (GLenum);
+GLAPI void APIENTRY glProvokingVertex (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
 #endif
@@ -5964,13 +6743,13 @@
 #ifndef GL_ARB_sync
 #define GL_ARB_sync 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glFenceSync (GLenum, GLbitfield);
-GLAPI GLboolean APIENTRY glIsSync (GLsync);
-GLAPI void APIENTRY glDeleteSync (GLsync);
-GLAPI GLenum APIENTRY glClientWaitSync (GLsync, GLbitfield, GLuint64);
-GLAPI void APIENTRY glWaitSync (GLsync, GLbitfield, GLuint64);
-GLAPI void APIENTRY glGetInteger64v (GLenum, GLint64 *);
-GLAPI void APIENTRY glGetSynciv (GLsync, GLenum, GLsizei, GLsizei *, GLint *);
+GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
+GLAPI void APIENTRY glDeleteSync (GLsync sync);
+GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
 typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
@@ -5984,10 +6763,10 @@
 #ifndef GL_ARB_texture_multisample
 #define GL_ARB_texture_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage2DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLboolean);
-GLAPI void APIENTRY glTexImage3DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean);
-GLAPI void APIENTRY glGetMultisamplefv (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glSampleMaski (GLuint, GLbitfield);
+GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
 typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
@@ -6002,23 +6781,23 @@
 #ifndef GL_ARB_draw_buffers_blend
 #define GL_ARB_draw_buffers_blend 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationi (GLuint, GLenum);
-GLAPI void APIENTRY glBlendEquationSeparatei (GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glBlendFunci (GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glBlendFuncSeparatei (GLuint, GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
 #endif
 
 #ifndef GL_ARB_sample_shading
 #define GL_ARB_sample_shading 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShading (GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
+GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
 #endif
 
 #ifndef GL_ARB_texture_cube_map_array
@@ -6033,6 +6812,586 @@
 #define GL_ARB_texture_query_lod 1
 #endif
 
+#ifndef GL_ARB_shading_language_include
+#define GL_ARB_shading_language_include 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_ARB_texture_compression_bptc 1
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_ARB_blend_func_extended 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#define GL_ARB_explicit_attrib_location 1
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ARB_occlusion_query2 1
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_ARB_sampler_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
+GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
+GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
+typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
+typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
+typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_ARB_texture_rgb10_a2ui 1
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#define GL_ARB_texture_swizzle 1
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_ARB_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
+GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+#define GL_ARB_vertex_type_2_10_10_10_rev 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_ARB_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
+GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_ARB_gpu_shader5 1
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+#define GL_ARB_gpu_shader_fp64 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
+GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ARB_shader_subroutine 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
+GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
+GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
+typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_ARB_tessellation_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
+GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+#define GL_ARB_texture_buffer_object_rgb32 1
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_ARB_transform_feedback2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedback (void);
+GLAPI void APIENTRY glResumeTransformFeedback (void);
+GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_ARB_transform_feedback3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
+GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
+GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
+GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
+typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_ARB_ES2_compatibility 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReleaseShaderCompiler (void);
+GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f);
+GLAPI void APIENTRY glClearDepthf (GLclampf d);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
+typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d);
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#define GL_ARB_get_program_binary 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_ARB_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings);
+GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
+GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings);
+typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+#define GL_ARB_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_viewport_array
+#define GL_ARB_viewport_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
+GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v);
+GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f);
+GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
+typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_ARB_cl_event 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_ARB_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif
+
+#ifndef GL_ARB_robustness
+#define GL_ARB_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
+GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
+GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
+GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
+GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
+GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
+typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
+typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
+typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#define GL_ARB_shader_stencil_export 1
+#endif
+
 #ifndef GL_EXT_abgr
 #define GL_EXT_abgr 1
 #endif
@@ -6040,7 +7399,7 @@
 #ifndef GL_EXT_blend_color
 #define GL_EXT_blend_color 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
 #endif
@@ -6048,7 +7407,7 @@
 #ifndef GL_EXT_polygon_offset
 #define GL_EXT_polygon_offset 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
 #endif
@@ -6060,8 +7419,8 @@
 #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 *);
+GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
 #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);
@@ -6070,8 +7429,8 @@
 #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 *);
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
 #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);
@@ -6080,8 +7439,8 @@
 #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 *);
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
 #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);
@@ -6090,11 +7449,11 @@
 #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);
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
 #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);
@@ -6106,16 +7465,16 @@
 #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);
+GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
 #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);
@@ -6132,19 +7491,19 @@
 #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 *);
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
 #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);
@@ -6168,13 +7527,13 @@
 #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 *);
+GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
 #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);
@@ -6188,7 +7547,7 @@
 #ifndef GL_SGIX_pixel_texture
 #define GL_SGIX_pixel_texture 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
 #endif
@@ -6196,12 +7555,12 @@
 #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 *);
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
@@ -6214,8 +7573,8 @@
 #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 *);
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage4DSGIS (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 /* 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);
@@ -6232,12 +7591,12 @@
 #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 *);
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
 typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
@@ -6250,8 +7609,8 @@
 #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 *);
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
 typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
@@ -6260,8 +7619,8 @@
 #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 *);
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
 typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
@@ -6278,8 +7637,8 @@
 #ifndef GL_SGIS_multisample
 #define GL_SGIS_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
 typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
@@ -6292,15 +7651,15 @@
 #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 *);
+GLAPI void APIENTRY glArrayElementEXT (GLint i);
+GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
+GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
 #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);
@@ -6340,7 +7699,7 @@
 #ifndef GL_EXT_blend_minmax
 #define GL_EXT_blend_minmax 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
 #endif
@@ -6368,10 +7727,10 @@
 #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 *);
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
 typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
@@ -6386,8 +7745,8 @@
 #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 *);
+GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
@@ -6396,8 +7755,8 @@
 #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 *);
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
 typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
@@ -6407,11 +7766,11 @@
 #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 glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
 GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
 typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
@@ -6428,7 +7787,7 @@
 #ifndef GL_SGIX_framezoom
 #define GL_SGIX_framezoom 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
 #endif
@@ -6444,10 +7803,10 @@
 #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);
+GLAPI void APIENTRY glDeformationMap3dSGIX (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);
+GLAPI void APIENTRY glDeformationMap3fSGIX (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);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
 #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);
@@ -6458,7 +7817,7 @@
 #ifndef GL_SGIX_reference_plane
 #define GL_SGIX_reference_plane 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
 #endif
@@ -6478,8 +7837,8 @@
 #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 *);
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
 typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
@@ -6492,12 +7851,12 @@
 #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 *);
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
@@ -6518,8 +7877,8 @@
 #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);
+GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
 #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);
@@ -6532,7 +7891,7 @@
 #ifndef GL_PGI_misc_hints
 #define GL_PGI_misc_hints 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
 #endif
@@ -6540,10 +7899,10 @@
 #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 *);
+GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
 #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);
@@ -6558,12 +7917,12 @@
 #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 *);
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
 typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
@@ -6596,7 +7955,7 @@
 #ifndef GL_EXT_index_material
 #define GL_EXT_index_material 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
 #endif
@@ -6604,7 +7963,7 @@
 #ifndef GL_EXT_index_func
 #define GL_EXT_index_func 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
 #endif
@@ -6616,7 +7975,7 @@
 #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 glLockArraysEXT (GLint first, GLsizei count);
 GLAPI void APIENTRY glUnlockArraysEXT (void);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
@@ -6626,8 +7985,8 @@
 #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 *);
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
 typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
@@ -6640,24 +7999,24 @@
 #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);
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
 typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
@@ -6690,7 +8049,7 @@
 #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 *);
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
 #endif
@@ -6706,9 +8065,9 @@
 #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);
+GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
+GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
 typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
@@ -6726,12 +8085,12 @@
 #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);
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
 typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
@@ -6752,10 +8111,10 @@
 #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* *);
+GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
 typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
@@ -6770,10 +8129,10 @@
 #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 *);
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
@@ -6796,23 +8155,23 @@
 #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 *);
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
 typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
@@ -6836,7 +8195,7 @@
 #ifndef GL_EXT_texture_perturb_normal
 #define GL_EXT_texture_perturb_normal 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
 #endif
@@ -6844,21 +8203,21 @@
 #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);
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const 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 *);
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
 typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
@@ -6874,28 +8233,28 @@
 #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 *);
+GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
+GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
 typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
@@ -6948,14 +8307,14 @@
 #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);
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
 typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
@@ -6970,13 +8329,13 @@
 #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* *);
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
 typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
@@ -6990,46 +8349,46 @@
 #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 *);
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (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);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (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);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
 #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);
@@ -7076,7 +8435,7 @@
 #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);
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
 #endif
@@ -7084,7 +8443,7 @@
 #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);
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
 #endif
@@ -7128,9 +8487,9 @@
 #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 *);
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
 typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
@@ -7145,7 +8504,7 @@
 #define GL_NV_vertex_array_range 1
 #ifdef GL_GLEXT_PROTOTYPES
 GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
 typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
@@ -7154,19 +8513,19 @@
 #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 *);
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
 typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
@@ -7210,30 +8569,30 @@
 #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 *);
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
 typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
@@ -7268,8 +8627,8 @@
 #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);
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
 #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);
@@ -7278,14 +8637,14 @@
 #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);
+GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
 #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);
@@ -7324,7 +8683,7 @@
 #ifndef GL_3DFX_tbuffer
 #define GL_3DFX_tbuffer 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
 #endif
@@ -7332,8 +8691,8 @@
 #ifndef GL_EXT_multisample
 #define GL_EXT_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
 typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
@@ -7358,7 +8717,7 @@
 #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);
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
 #endif
@@ -7366,7 +8725,7 @@
 #ifndef GL_SGIX_igloo_interface
 #define GL_SGIX_igloo_interface 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
 #endif
@@ -7382,13 +8741,13 @@
 #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);
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
+GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
+GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
 typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
@@ -7402,15 +8761,15 @@
 #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);
+GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
 #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);
@@ -7430,8 +8789,8 @@
 #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 *);
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
 #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);
@@ -7460,70 +8819,70 @@
 #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 *);
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
+GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
+GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
 typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
@@ -7618,10 +8977,10 @@
 #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 *);
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
 typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
@@ -7632,20 +8991,20 @@
 #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 GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
 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 *);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
+GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glColorFragmentOp3ATI (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);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
 typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
@@ -7666,8 +9025,8 @@
 #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);
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
@@ -7676,18 +9035,18 @@
 #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 *);
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
 typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
@@ -7708,46 +9067,46 @@
 #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 *);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
+GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
+GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
+GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
+GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
+GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
+GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
+GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
 typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
@@ -7796,51 +9155,51 @@
 #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);
+GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
 typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
@@ -7892,9 +9251,9 @@
 #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);
+GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
 typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
@@ -7904,7 +9263,7 @@
 #ifndef GL_SUN_mesh_array
 #define GL_SUN_mesh_array 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
 #endif
@@ -7924,13 +9283,13 @@
 #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 glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
 GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
 typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
@@ -7944,8 +9303,8 @@
 #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 *);
+GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
@@ -7966,7 +9325,7 @@
 #ifndef GL_EXT_stencil_two_side
 #define GL_EXT_stencil_two_side 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
 #endif
@@ -7982,11 +9341,11 @@
 #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);
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
 typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
@@ -7998,14 +9357,14 @@
 #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);
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
 typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
@@ -8020,10 +9379,10 @@
 #ifndef GL_APPLE_vertex_array_object
 #define GL_APPLE_vertex_array_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
 typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
@@ -8034,9 +9393,9 @@
 #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);
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
 typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
@@ -8054,7 +9413,7 @@
 #ifndef GL_ATI_draw_buffers
 #define GL_ATI_draw_buffers 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
 #endif
@@ -8082,12 +9441,12 @@
 #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 *);
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
 #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);
@@ -8100,52 +9459,52 @@
 #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 *);
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
 typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
@@ -8198,8 +9557,8 @@
 #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);
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
 typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
@@ -8209,7 +9568,7 @@
 #define GL_NV_primitive_restart 1
 #ifdef GL_GLEXT_PROTOTYPES
 GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
 typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
@@ -8226,8 +9585,8 @@
 #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);
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
 typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
@@ -8236,8 +9595,8 @@
 #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);
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
 #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);
@@ -8246,9 +9605,9 @@
 #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 *);
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
 #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);
@@ -8262,7 +9621,7 @@
 #ifndef GL_EXT_depth_bounds_test
 #define GL_EXT_depth_bounds_test 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
 #endif
@@ -8274,7 +9633,7 @@
 #ifndef GL_EXT_blend_equation_separate
 #define GL_EXT_blend_equation_separate 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
 #endif
@@ -8310,23 +9669,23 @@
 #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);
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
 typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
@@ -8350,7 +9709,7 @@
 #ifndef GL_GREMEDY_string_marker
 #define GL_GREMEDY_string_marker 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
 #endif
@@ -8362,7 +9721,7 @@
 #ifndef GL_EXT_stencil_clear_tag
 #define GL_EXT_stencil_clear_tag 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
 #endif
@@ -8374,7 +9733,7 @@
 #ifndef GL_EXT_framebuffer_blit
 #define GL_EXT_framebuffer_blit 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 #endif
@@ -8382,7 +9741,7 @@
 #ifndef GL_EXT_framebuffer_multisample
 #define GL_EXT_framebuffer_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
 #endif
@@ -8394,8 +9753,8 @@
 #ifndef GL_EXT_timer_query
 #define GL_EXT_timer_query 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
-GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
 typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
@@ -8404,8 +9763,8 @@
 #ifndef GL_EXT_gpu_program_parameters
 #define GL_EXT_gpu_program_parameters 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
 typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
@@ -8414,8 +9773,8 @@
 #ifndef GL_APPLE_flush_buffer_range
 #define GL_APPLE_flush_buffer_range 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr);
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
 typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
@@ -8424,22 +9783,22 @@
 #ifndef GL_NV_gpu_program4
 #define GL_NV_gpu_program4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *);
-GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *);
-GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *);
-GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *);
-GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *);
-GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *);
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
 typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
@@ -8462,10 +9821,10 @@
 #ifndef GL_NV_geometry_program4
 #define GL_NV_geometry_program4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint);
-GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum);
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
 typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
@@ -8476,7 +9835,7 @@
 #ifndef GL_EXT_geometry_shader4
 #define GL_EXT_geometry_shader4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
 #endif
@@ -8484,29 +9843,29 @@
 #ifndef GL_NV_vertex_program4
 #define GL_NV_vertex_program4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint);
-GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
 typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
@@ -8536,17 +9895,17 @@
 #ifndef GL_EXT_gpu_shader4
 #define GL_EXT_gpu_shader4 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *);
-GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *);
-GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *);
-GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint);
-GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
 typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
@@ -8564,8 +9923,8 @@
 #ifndef GL_EXT_draw_instanced
 #define GL_EXT_draw_instanced 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
 typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
@@ -8582,7 +9941,7 @@
 #ifndef GL_EXT_texture_buffer_object
 #define GL_EXT_texture_buffer_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
 #endif
@@ -8602,9 +9961,9 @@
 #ifndef GL_NV_depth_buffer_float
 #define GL_NV_depth_buffer_float 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble);
-GLAPI void APIENTRY glClearDepthdNV (GLdouble);
-GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble);
+GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
 typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
@@ -8618,7 +9977,7 @@
 #ifndef GL_NV_framebuffer_multisample_coverage
 #define GL_NV_framebuffer_multisample_coverage 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
 #endif
@@ -8634,9 +9993,9 @@
 #ifndef GL_NV_parameter_buffer_object
 #define GL_NV_parameter_buffer_object 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
 typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
@@ -8646,12 +10005,12 @@
 #ifndef GL_EXT_draw_buffers2
 #define GL_EXT_draw_buffers2 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *);
-GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint);
-GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint);
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
 typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
@@ -8664,17 +10023,18 @@
 #ifndef GL_NV_transform_feedback
 #define GL_NV_transform_feedback 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum);
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
 GLAPI void APIENTRY glEndTransformFeedbackNV (void);
-GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum);
-GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
-GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr);
-GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLchar* *, GLenum);
-GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *);
-GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
+GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
 typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
@@ -8682,19 +10042,20 @@
 typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
 typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
 typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
 typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
 typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
 typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
 typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
 #endif
 
 #ifndef GL_EXT_bindable_uniform
 #define GL_EXT_bindable_uniform 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint);
-GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint);
-GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint);
+GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
 typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
@@ -8704,12 +10065,12 @@
 #ifndef GL_EXT_texture_integer
 #define GL_EXT_texture_integer 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *);
-GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *);
-GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
 typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
@@ -8730,7 +10091,7 @@
 #ifndef GL_NV_conditional_render
 #define GL_NV_conditional_render 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum);
+GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
 GLAPI void APIENTRY glEndConditionalRenderNV (void);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
@@ -8740,12 +10101,12 @@
 #ifndef GL_NV_present_video
 #define GL_NV_present_video 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint);
-GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *);
-GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *);
-GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *);
+GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
 typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
@@ -8758,13 +10119,13 @@
 #ifndef GL_EXT_transform_feedback
 #define GL_EXT_transform_feedback 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum);
+GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
 GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
-GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
-GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr);
-GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
+GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
 typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
@@ -8778,192 +10139,212 @@
 #ifndef GL_EXT_direct_state_access
 #define GL_EXT_direct_state_access 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield);
-GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield);
-GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum);
-GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMatrixPopEXT (GLenum);
-GLAPI void APIENTRY glMatrixPushEXT (GLenum);
-GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *);
-GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint);
-GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *);
-GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint);
-GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *);
-GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint);
-GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint);
-GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint);
-GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *);
-GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *);
-GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *);
-GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *);
-GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *);
-GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *);
-GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *);
-GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat);
-GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint);
-GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint);
-GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *);
-GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum);
-GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *);
-GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum);
-GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint);
-GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *);
-GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *);
-GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *);
-GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum);
-GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum);
-GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum);
-GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum);
-GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *);
-GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum);
-GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum);
-GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint);
-GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
+GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);
+GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
+GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
+GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
+GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
+GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
+GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
+GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
 typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
@@ -9125,6 +10506,9 @@
 typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
 typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
 typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
+typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
 typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
 typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
 typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
@@ -9151,6 +10535,23 @@
 typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
 typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
 typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
 #endif
 
 #ifndef GL_EXT_vertex_array_bgra
@@ -9164,9 +10565,9 @@
 #ifndef GL_NV_explicit_multisample
 #define GL_NV_explicit_multisample 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield);
-GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint);
+GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
+GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
 typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
@@ -9176,13 +10577,13 @@
 #ifndef GL_NV_transform_feedback2
 #define GL_NV_transform_feedback2 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint);
+GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
 GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
 GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
-GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint);
+GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
 typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
@@ -9200,23 +10601,23 @@
 #ifndef GL_AMD_performance_monitor
 #define GL_AMD_performance_monitor 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *);
-GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *);
-GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *);
-GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *);
-GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *);
-GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint);
-GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint);
-GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *);
+GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
 typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
 typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
 typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
 typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
 typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
 typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
@@ -9232,8 +10633,8 @@
 #ifndef GL_AMD_vertex_shader_tesselator
 #define GL_AMD_vertex_shader_tesselator 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTessellationFactorAMD (GLfloat);
-GLAPI void APIENTRY glTessellationModeAMD (GLenum);
+GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
+GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
 typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
@@ -9242,7 +10643,7 @@
 #ifndef GL_EXT_provoking_vertex
 #define GL_EXT_provoking_vertex 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertexEXT (GLenum);
+GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
 #endif
@@ -9254,10 +10655,10 @@
 #ifndef GL_AMD_draw_buffers_blend
 #define GL_AMD_draw_buffers_blend 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint, GLenum);
-GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
 typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
@@ -9268,8 +10669,8 @@
 #ifndef GL_APPLE_texture_range
 #define GL_APPLE_texture_range 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureRangeAPPLE (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum, GLenum, GLvoid* *);
+GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);
+GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
 typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);
@@ -9282,13 +10683,13 @@
 #ifndef GL_APPLE_vertex_program_evaluators
 #define GL_APPLE_vertex_program_evaluators 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint, GLenum);
-GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint, GLenum);
-GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint, GLenum);
-GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
-GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
-GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
-GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
 typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
@@ -9306,9 +10707,9 @@
 #ifndef GL_APPLE_object_purgeable
 #define GL_APPLE_object_purgeable 1
 #ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum, GLuint, GLenum);
-GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum, GLuint, GLenum);
-GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum, GLuint, GLenum, GLint *);
+GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
 #endif /* GL_GLEXT_PROTOTYPES */
 typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
 typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
@@ -9319,6 +10720,380 @@
 #define GL_APPLE_row_bytes 1
 #endif
 
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_NV_video_capture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif
+
+#ifndef GL_NV_copy_image
+#define GL_NV_copy_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
+GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#define GL_NV_parameter_buffer_object2 1
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_NV_shader_buffer_load 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
+GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
+GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
+GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
+GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
+GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
+GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
+GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
+GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
+typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_NV_vertex_buffer_unified_memory 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
+GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
+#endif
+
+#ifndef GL_NV_texture_barrier
+#define GL_NV_texture_barrier 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureBarrierNV (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#define GL_AMD_shader_stencil_export 1
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+#define GL_AMD_seamless_cubemap_per_texture 1
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#define GL_AMD_conservative_depth 1
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_EXT_shader_image_load_store 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+#define GL_EXT_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_NV_gpu_program5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#define GL_NV_gpu_shader5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
+GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
+GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
+GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_NV_shader_buffer_store 1
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_NV_tessellation_program5 1
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+#define GL_NV_vertex_attrib_integer_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_NV_multisample_coverage 1
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_AMD_name_gen_delete 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
+GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
+GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
+typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
+typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_AMD_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_NV_vdpau_interop 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+GLAPI void APIENTRY glVDPAUFiniNV (void);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
+GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
+typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#define GL_AMD_transform_feedback3_lines_triangles 1
+#endif
+
 
 #ifdef __cplusplus
 }
--- a/include/SDL_pixels.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_pixels.h	Sun Aug 22 13:45:56 2010 -0700
@@ -112,8 +112,7 @@
     SDL_PACKEDLAYOUT_1010102
 };
 
-#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
-    ((A) | ((B) << 8) | ((C) << 16) | ((D) << 24))
+#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
 
 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
     ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
--- a/include/SDL_platform.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_platform.h	Sun Aug 22 13:45:56 2010 -0700
@@ -65,6 +65,11 @@
 #undef __LINUX__
 #define __LINUX__	1
 #endif
+#if defined(ANDROID)
+#undef __ANDROID__
+#undef __LINUX__ /*do we need to do this?*/
+#define __ANDROID__ 1
+#endif
 
 #if defined(__APPLE__)
 /* lets us know what version of Mac OS X we're compiling on */
--- a/include/SDL_stdinc.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_stdinc.h	Sun Aug 22 13:45:56 2010 -0700
@@ -101,6 +101,13 @@
 #endif
 /*@}*//*Cast operators*/
 
+/* Define a four character code as a Uint32 */
+#define SDL_FOURCC(A, B, C, D) \
+    ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
+     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
+     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
+     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
+
 /**
  *  \name Basic data types
  */
@@ -167,9 +174,10 @@
 SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
 SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
 SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
-#ifndef __NINTENDODS__          /* TODO: figure out why the following happens:
-                                   include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
-                                   include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
+#if !defined(__NINTENDODS__) && !defined(__ANDROID__)
+/* TODO: figure out why the following happens:
+ include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
+ include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
 SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
 SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
 #endif
@@ -188,7 +196,8 @@
 
 /** \cond */
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#ifndef __NINTENDODS__          /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
+#if !defined(__NINTENDODS__) && !defined(__ANDROID__) 
+   /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
 typedef enum
 {
     DUMMY_ENUM_VALUE
@@ -463,6 +472,19 @@
 extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string);
 #endif
 
+#ifdef HAVE_WCSLCPY
+#define SDL_wcslcpy      wcslcpy
+#else
+extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_WCSLCAT
+#define SDL_wcslcat      wcslcat
+#else
+extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen);
+#endif
+
+
 #ifdef HAVE_STRLCPY
 #define SDL_strlcpy     strlcpy
 #else
@@ -470,6 +492,9 @@
                                            size_t maxlen);
 #endif
 
+extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(char *dst, const char *src,
+                                            size_t dst_bytes);
+
 #ifdef HAVE_STRLCAT
 #define SDL_strlcat    strlcat
 #else
--- a/include/SDL_syswm.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_syswm.h	Sun Aug 22 13:45:56 2010 -0700
@@ -106,24 +106,6 @@
         {
             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.
-             *  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);
-            /*@}*/
-
-            /**
-             *  Introduced in SDL 1.0.2.
-             */
-            /*@{*/
-            Window fswindow;    /**< The X11 fullscreen window */
-            Window wmwindow;    /**< The X11 managed input window */
-            /*@}*/
         } x11;
     } info;
 };
@@ -231,7 +213,7 @@
 /**
  *  \brief This function allows access to driver-dependent window information.
  *  
- *  \param windowID The window about which information is being requested
+ *  \param window The window about which information is being requested
  *  \param info This structure must be initialized with the SDL version, and is 
  *              then filled in with information about the given window.
  *  
--- a/include/SDL_thread.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_thread.h	Sun Aug 22 13:45:56 2010 -0700
@@ -149,16 +149,6 @@
  */
 extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
 
-/**
- *  \deprecated This function is here for binary compatibility with legacy apps,
- *              but in SDL 1.3 and later, it's a no-op.
- *  
- *  You cannot forcibly kill a thread in a safe manner on many platforms. You 
- *  should instead find a way to alert your thread that it is time to terminate,
- *  and then have it gracefully exit on its own. Do not ever call this function!
- */
-extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread);
-
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_touch.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,125 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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_touch.h
+ *  
+ *  Include file for SDL touch event handling.
+ */
+
+#ifndef _SDL_touch_h
+#define _SDL_touch_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
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+
+typedef Sint64 SDL_TouchID;
+typedef Sint64 SDL_FingerID;
+
+
+struct SDL_Finger {
+  SDL_FingerID id;
+  Uint16 x;
+  Uint16 y;
+  Uint16 pressure;
+  Uint16 xdelta;
+  Uint16 ydelta;
+  Uint16 last_x, last_y,last_pressure;  /* the last reported coordinates */
+  SDL_bool down;
+};
+
+typedef struct SDL_Touch SDL_Touch;
+typedef struct SDL_Finger SDL_Finger;
+
+
+struct SDL_Touch {
+  
+  /* Free the touch when it's time */
+  void (*FreeTouch) (SDL_Touch * touch);
+  
+  /* data common for tablets */
+  float pressure_max, pressure_min;
+  float x_max,x_min;
+  float y_max,y_min;
+  Uint16 xres,yres,pressureres;
+  float native_xres,native_yres,native_pressureres;
+  float tilt;                   /* for future use */
+  float rotation;               /* for future use */
+  
+  /* Data common to all touch */
+  SDL_TouchID id;
+  SDL_Window *focus;
+  
+  char *name;
+  Uint8 buttonstate;
+  SDL_bool relative_mode;
+  SDL_bool flush_motion;
+
+  int num_fingers;
+  int max_fingers;
+  SDL_Finger** fingers;
+    
+  void *driverdata;
+};
+
+
+
+/* Function prototypes */
+
+/**
+ *  \brief Get the touch object at the given id.
+ *
+ *
+ */
+  extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
+
+
+
+/**
+ *  \brief Get the finger object of the given touch, at the given id.
+ *
+ *
+ */
+  extern 
+  DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mouse_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_version.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_version.h	Sun Aug 22 13:45:56 2010 -0700
@@ -112,12 +112,11 @@
 
 /**
  *  \brief Get the version of SDL that is linked against your program.
- *  
- *  If you are using a shared library (DLL) version of SDL, then it is
- *  possible that it will be different than the version you compiled against.
  *
- *  This is a real function; the macro SDL_VERSION() tells you what version
- *  of SDL you compiled against:
+ *  If you are linking to SDL dynamically, then it is possible that the
+ *  current version will be different than the version you compiled against.
+ *  This function returns the current version, while SDL_VERSION() is a
+ *  macro that tells you what version you compiled with.
  *  
  *  \code
  *  SDL_version compiled;
@@ -140,8 +139,9 @@
 /**
  *  \brief Get the code revision of SDL that is linked against your program.
  *
- *  This is an arbitrary string (a hash value, actually), and is only useful
- *  in comparing against other revisions. It is NOT an incrementing number.
+ *  Returns an arbitrary string (a hash value) uniquely identifying the
+ *  exact revision of the SDL library in use, and is only useful in comparing
+ *  against other revisions. It is NOT an incrementing number.
  */
 extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
 
--- a/include/SDL_video.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/include/SDL_video.h	Sun Aug 22 13:45:56 2010 -0700
@@ -88,7 +88,6 @@
  *  \sa SDL_SetWindowTitle()
  *  \sa SDL_ShowWindow()
  */
-struct SDL_Window;
 typedef struct SDL_Window SDL_Window;
 
 /**
@@ -190,7 +189,7 @@
     Uint32 blend_modes;         /**< A mask of supported blend modes */
     Uint32 scale_modes;         /**< A mask of supported scale modes */
     Uint32 num_texture_formats; /**< The number of available texture formats */
-    Uint32 texture_formats[20]; /**< The available texture formats */
+    Uint32 texture_formats[50]; /**< The available texture formats */
     int max_texture_width;      /**< The maximimum texture width */
     int max_texture_height;     /**< The maximimum texture height */
 } SDL_RendererInfo;
--- a/src/SDL.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/SDL.c	Sun Aug 22 13:45:56 2010 -0700
@@ -25,21 +25,15 @@
 
 #include "SDL.h"
 #include "SDL_fatal.h"
-#include "SDL_assert.h"
+#include "SDL_assert_c.h"
+#include "haptic/SDL_haptic_c.h"
+#include "joystick/SDL_joystick_c.h"
 
 #if !SDL_VIDEO_DISABLED
 #include "video/SDL_leaks.h"
 #endif
 
 /* Initialization/Cleanup routines */
-#if !SDL_JOYSTICK_DISABLED
-extern int SDL_JoystickInit(void);
-extern void SDL_JoystickQuit(void);
-#endif
-#if !SDL_HAPTIC_DISABLED
-extern int SDL_HapticInit(void);
-extern int SDL_HapticQuit(void);
-#endif
 #if !SDL_TIMERS_DISABLED
 extern void SDL_StartTicks(void);
 extern int SDL_TimerInit(void);
@@ -50,8 +44,6 @@
 extern int SDL_HelperWindowDestroy(void);
 #endif
 
-extern int SDL_AssertionsInit(void);
-extern void SDL_AssertionsQuit(void);
 
 /* The initialized subsystems */
 static Uint32 SDL_initialized = 0;
--- a/src/SDL_assert.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/SDL_assert.c	Sun Aug 22 13:45:56 2010 -0700
@@ -22,6 +22,7 @@
 
 #include "SDL.h"
 #include "SDL_assert.h"
+#include "SDL_assert_c.h"
 #include "video/SDL_sysvideo.h"
 
 #ifdef _WINDOWS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/SDL_assert_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,26 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+
+extern int SDL_AssertionsInit(void);
+extern void SDL_AssertionsQuit(void);
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/SDL_compat.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/SDL_compat.c	Sun Aug 22 13:45:56 2010 -0700
@@ -277,16 +277,13 @@
     case SDL_MOUSEWHEEL:
         {
             Uint8 button;
-            int selected;
             int x, y;
 
             if (event->wheel.y == 0) {
                 break;
             }
 
-            selected = SDL_SelectMouse(event->wheel.which);
             SDL_GetMouseState(&x, &y);
-            SDL_SelectMouse(selected);
 
             if (event->wheel.y > 0) {
                 button = SDL_BUTTON_WHEELUP;
@@ -294,7 +291,6 @@
                 button = SDL_BUTTON_WHEELDOWN;
             }
 
-            fake.button.which = event->wheel.which;
             fake.button.button = button;
             fake.button.x = x;
             fake.button.y = y;
@@ -421,7 +417,7 @@
     }
 }
 
-int
+static int
 SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
 {
     int w, h;
@@ -1754,7 +1750,6 @@
     return previous;
 }
 
-
 int
 SDL_putenv(const char *_var)
 {
--- a/src/SDL_error.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/SDL_error.c	Sun Aug 22 13:45:56 2010 -0700
@@ -26,10 +26,11 @@
 #include "SDL_error.h"
 #include "SDL_error_c.h"
 
+/*#define DEBUG_ERROR*/
+
 /* Routine to get the thread-specific error variable */
 #if SDL_THREADS_DISABLED
-/* !!! FIXME: what does this comment mean? Victim of Search and Replace? */
-/* The  SDL_arraysize(The ),default (non-thread-safe) global error variable */
+/* The default (non-thread-safe) global error variable */
 static SDL_error SDL_global_error;
 #define SDL_GetErrBuf()	(&SDL_global_error)
 #else
@@ -116,7 +117,7 @@
 /* This function has a bit more overhead than most error functions
    so that it supports internationalization and thread-safe errors.
 */
-char *
+static char *
 SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
 {
     SDL_error *error;
--- a/src/SDL_error_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/SDL_error_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -58,4 +58,5 @@
 } SDL_error;
 
 #endif /* _SDL_error_c_h */
+
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/audio/SDL_audio.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/audio/SDL_audio.c	Sun Aug 22 13:45:56 2010 -0700
@@ -69,19 +69,20 @@
 extern AudioBootStrap DART_bootstrap;
 extern AudioBootStrap NDSAUD_bootstrap;
 extern AudioBootStrap FUSIONSOUND_bootstrap;
+extern AudioBootStrap ANDROIDAUD_bootstrap;
 
 
 /* Available audio drivers */
 static const AudioBootStrap *const bootstrap[] = {
-#if SDL_AUDIO_DRIVER_BSD
-    &BSD_AUDIO_bootstrap,
-#endif
 #if SDL_AUDIO_DRIVER_PULSEAUDIO
     &PULSEAUDIO_bootstrap,
 #endif
 #if SDL_AUDIO_DRIVER_ALSA
     &ALSA_bootstrap,
 #endif
+#if SDL_AUDIO_DRIVER_BSD
+    &BSD_AUDIO_bootstrap,
+#endif
 #if SDL_AUDIO_DRIVER_OSS
     &DSP_bootstrap,
     &DMA_bootstrap,
@@ -137,6 +138,9 @@
 #if SDL_AUDIO_DRIVER_FUSIONSOUND
     &FUSIONSOUND_bootstrap,
 #endif
+#if SDL_AUDIO_DRIVER_ANDROID
+    &ANDROIDAUD_bootstrap,
+#endif
     NULL
 };
 
@@ -257,7 +261,7 @@
 
 /* Streaming functions (for when the input and output buffer sizes are different) */
 /* Write [length] bytes from buf into the streamer */
-void
+static void
 SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
 {
     int i;
@@ -269,7 +273,7 @@
 }
 
 /* Read [length] bytes out of the streamer into buf */
-void
+static void
 SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
 {
     int i;
@@ -280,14 +284,15 @@
     }
 }
 
-int
+static int
 SDL_StreamLength(SDL_AudioStreamer * stream)
 {
     return (stream->write_pos - stream->read_pos) % stream->max_len;
 }
 
 /* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */
-int
+#if 0
+static int
 SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
 {
     /* First try to allocate the buffer */
@@ -305,9 +310,10 @@
 
     return 0;
 }
+#endif
 
 /* Deinitialize the stream simply by freeing the buffer */
-void
+static void
 SDL_StreamDeinit(SDL_AudioStreamer * stream)
 {
     if (stream->buffer != NULL) {
@@ -316,6 +322,8 @@
 }
 
 
+#include <android/log.h>
+
 /* The general mixing thread function */
 int SDLCALL
 SDL_RunAudio(void *devicep)
--- a/src/audio/SDL_audiodev.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/audio/SDL_audiodev.c	Sun Aug 22 13:45:56 2010 -0700
@@ -28,6 +28,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h> /* For close() */
 
 #include "SDL_stdinc.h"
 #include "SDL_audiodev_c.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audio/android/SDL_androidaudio.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,140 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+
+    This file written by Ryan C. Gordon (icculus@icculus.org)
+*/
+#include "SDL_config.h"
+
+/* Output audio to Android */
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "SDL_androidaudio.h"
+
+extern void Android_UpdateAudioBuffer(unsigned char *buf, int len);
+
+#include <android/log.h>
+
+static int
+AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture)
+{
+    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
+    int valid_datatype = 0;
+    
+    //TODO: Sample rates etc
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "AndroidAudio Open\n");
+
+    this->hidden = SDL_malloc(sizeof(*(this->hidden)));
+    if (!this->hidden) {
+        SDL_OutOfMemory();
+        return 0;
+    }
+    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+    while ((!valid_datatype) && (test_format)) {
+        this->spec.format = test_format;
+        switch (test_format) {
+        case AUDIO_S8:
+            /*case AUDIO_S16LSB: */
+            valid_datatype = 1;
+            break;
+        default:
+            test_format = SDL_NextAudioFormat();
+            break;
+        }
+    }
+    
+    return 1;
+}
+
+static void
+AndroidAUD_PlayDevice(_THIS)
+{
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "AndroidAudio Play\n");
+    
+
+    //playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
+    
+#if 0
+
+//    sound->rate = 22050; /* sample rate = 22050Hz */
+//    sound->vol = 127;    /* volume [0..127] for [min..max] */
+//    sound->pan = 64;     /* balance [0..127] for [left..right] */
+//    sound->format = 0;   /* 0 for 16-bit, 1 for 8-bit */
+//    playSound(sound);
+#endif
+}
+
+
+static Uint8 *
+AndroidAUD_GetDeviceBuf(_THIS)
+{
+     //__android_log_print(ANDROID_LOG_INFO, "SDL", "****** get device buf\n");
+
+     
+    //    sound->data = this->hidden->mixbuf;/* pointer to raw audio data */
+//    sound->len = this->hidden->mixlen; /* size of raw data pointed to above */
+
+
+    Android_UpdateAudioBuffer(this->hidden->mixbuf, this->hidden->mixlen);
+    
+    return this->hidden->mixbuf;        /* is this right? */
+}
+
+static void
+AndroidAUD_WaitDevice(_THIS)
+{
+    /* stub */
+     __android_log_print(ANDROID_LOG_INFO, "SDL", "****** wait device buf\n");
+}
+
+static void
+AndroidAUD_CloseDevice(_THIS)
+{
+    /* stub */
+     __android_log_print(ANDROID_LOG_INFO, "SDL", "****** close device buf\n");
+}
+
+static int
+AndroidAUD_Init(SDL_AudioDriverImpl * impl)
+{
+    /* Set the function pointers */
+    impl->OpenDevice = AndroidAUD_OpenDevice;
+    impl->PlayDevice = AndroidAUD_PlayDevice;
+    impl->WaitDevice = AndroidAUD_WaitDevice;
+    impl->GetDeviceBuf = AndroidAUD_GetDeviceBuf;
+    impl->CloseDevice = AndroidAUD_CloseDevice;
+
+    /* and the capabilities */
+    impl->HasCaptureSupport = 0; //TODO
+    impl->OnlyHasDefaultOutputDevice = 1;
+    impl->OnlyHasDefaultInputDevice = 1;
+
+    __android_log_print(ANDROID_LOG_INFO, "SDL","Audio init\n");
+
+    return 1;   /* this audio target is available. */
+}
+
+AudioBootStrap ANDROIDAUD_bootstrap = {
+    "android", "SDL Android audio driver", AndroidAUD_Init, 0       /*1? */
+};
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audio/android/SDL_androidaudio.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,42 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_androidaudio_h
+#define _SDL_androidaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS	SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData
+{
+    /* The file descriptor for the audio device */
+    Uint8 *mixbuf;
+    Uint32 mixlen;
+    Uint32 write_delay;
+    Uint32 initial_calls;
+};
+
+#endif /* _SDL_androidaudio_h */
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/audio/windx5/directx.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/audio/windx5/directx.h	Sun Aug 22 13:45:56 2010 -0700
@@ -2,10 +2,6 @@
 #ifndef _directx_h
 #define _directx_h
 
-#ifdef __GNUC__
-#define NONAMELESSUNION
-#endif
-
 /* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
 
 #define WIN32_LEAN_AND_MEAN
--- a/src/cpuinfo/SDL_cpuinfo.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/cpuinfo/SDL_cpuinfo.c	Sun Aug 22 13:45:56 2010 -0700
@@ -335,7 +335,7 @@
 }
 
 /* Oh, such a sweet sweet trick, just not very useful. :) */
-const char *
+static const char *
 SDL_GetCPUType()
 {
     static char SDL_CPUType[48];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_clipboardevents.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,47 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* Clipboard event handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "SDL_clipboardevents_c.h"
+
+
+int
+SDL_SendClipboardUpdate(void)
+{
+    int posted;
+
+    /* Post the event, if desired */
+    posted = 0;
+    if (SDL_GetEventState(SDL_CLIPBOARDUPDATE) == SDL_ENABLE) {
+        SDL_Event event;
+        event.type = SDL_CLIPBOARDUPDATE;
+
+        posted = (SDL_PushEvent(&event) > 0);
+    }
+    return (posted);
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_clipboardevents_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,31 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_clipboardevents_c_h
+#define _SDL_clipboardevents_c_h
+
+extern int SDL_SendClipboardUpdate(void);
+
+#endif /* _SDL_clipboardevents_c_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/events/SDL_events.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_events.c	Sun Aug 22 13:45:56 2010 -0700
@@ -92,11 +92,13 @@
 static __inline__ SDL_bool
 SDL_ShouldPollJoystick()
 {
+#if !SDL_JOYSTICK_DISABLED
     if (SDL_numjoysticks &&
         (!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] ||
          SDL_JoystickEventState(SDL_QUERY))) {
         return SDL_TRUE;
     }
+#endif
     return SDL_FALSE;
 }
 
@@ -254,6 +256,7 @@
     retcode = 0;
     retcode += SDL_KeyboardInit();
     retcode += SDL_MouseInit();
+    retcode += SDL_TouchInit();
     retcode += SDL_QuitInit();
     if (retcode < 0) {
         /* We don't expect them to fail, but... */
@@ -492,6 +495,10 @@
     if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0, 0) <= 0) {
         return -1;
     }
+
+    SDL_GestureProcessEvent(event);
+    
+
     return 1;
 }
 
--- a/src/events/SDL_events_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_events_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -26,8 +26,9 @@
 #include "SDL_thread.h"
 #include "SDL_mouse_c.h"
 #include "SDL_keyboard_c.h"
+#include "SDL_touch_c.h"
 #include "SDL_windowevents_c.h"
-
+#include "SDL_gesture_c.h"
 /* Start and stop the event processing loop */
 extern int SDL_StartEventLoop(Uint32 flags);
 extern void SDL_StopEventLoop(void);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_gesture.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,643 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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    Founation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General mouse handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "SDL_gesture_c.h"
+
+//TODO: Replace with malloc
+
+#define MAXPATHSIZE 1024
+
+ 
+
+
+#define DOLLARNPOINTS 64
+#define DOLLARSIZE 256
+
+#define ENABLE_DOLLAR
+
+//PHI = ((sqrt(5)-1)/2)
+#define PHI 0.618033989 
+
+typedef struct {
+  float x,y;
+} SDL_FloatPoint;
+
+typedef struct {
+  float length;
+  
+  int numPoints;
+  SDL_FloatPoint p[MAXPATHSIZE];
+} SDL_DollarPath;
+
+typedef struct {
+  SDL_FloatPoint path[DOLLARNPOINTS];
+  unsigned long hash;
+} SDL_DollarTemplate;
+
+typedef struct {
+  SDL_GestureID id;
+  SDL_FloatPoint res;
+  SDL_FloatPoint centroid;
+  SDL_DollarPath dollarPath;
+  Uint16 numDownFingers;
+
+  int numDollarTemplates;
+  SDL_DollarTemplate *dollarTemplate;
+
+  SDL_bool recording;
+} SDL_GestureTouch;
+
+SDL_GestureTouch *SDL_gestureTouch;
+int SDL_numGestureTouches = 0;
+SDL_bool recordAll;
+
+void SDL_PrintPath(SDL_FloatPoint *path) {
+  int i;
+  printf("Path:");
+  for(i=0;i<DOLLARNPOINTS;i++) {
+    printf(" (%f,%f)",path[i].x,path[i].y);
+  }
+  printf("\n");
+}
+
+int SDL_RecordGesture(SDL_TouchID touchId) {
+  int i;
+  if(touchId < 0) recordAll = SDL_TRUE;
+  for(i = 0;i < SDL_numGestureTouches; i++) {
+    if((touchId < 0) || (SDL_gestureTouch[i].id == touchId)) {
+      SDL_gestureTouch[i].recording = SDL_TRUE;
+      if(touchId >= 0)
+	return 1;
+    }      
+  }
+  return (touchId < 0);
+}
+
+unsigned long SDL_HashDollar(SDL_FloatPoint* points) {
+  unsigned long hash = 5381;
+  int i;
+  for(i = 0;i < DOLLARNPOINTS; i++) { 
+    hash = ((hash<<5) + hash) + points[i].x;
+    hash = ((hash<<5) + hash) + points[i].y;
+  }
+  return hash;
+}
+
+
+static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src) {
+  if(src == NULL) return 0;
+
+  int i;
+  
+  //No Longer storing the Hash, rehash on load
+  //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0;
+  
+  if(SDL_RWwrite(src,templ->path,
+		 sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) 
+    return 0;
+
+  return 1;
+}
+
+
+int SDL_SaveAllDollarTemplates(SDL_RWops *src) {  
+  int i,j,rtrn = 0;
+  for(i = 0; i < SDL_numGestureTouches; i++) {
+    SDL_GestureTouch* touch = &SDL_gestureTouch[i];
+    for(j = 0;j < touch->numDollarTemplates; j++) {
+	rtrn += SaveTemplate(&touch->dollarTemplate[i],src);
+    }
+  }
+  return rtrn;  
+}
+
+int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src) {
+  int i,j;
+  for(i = 0; i < SDL_numGestureTouches; i++) {
+    SDL_GestureTouch* touch = &SDL_gestureTouch[i];
+    for(j = 0;j < touch->numDollarTemplates; j++) {
+      if(touch->dollarTemplate[i].hash == gestureId) {
+	return SaveTemplate(&touch->dollarTemplate[i],src);
+      }
+    }
+  }
+  SDL_SetError("Unknown gestureId");
+  return -1;
+}
+
+//path is an already sampled set of points
+//Returns the index of the gesture on success, or -1
+static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch,SDL_FloatPoint* path) {
+  if(inTouch == NULL) {
+    if(SDL_numGestureTouches == 0) return -1;
+    int i = 0;
+    for(i = 0;i < SDL_numGestureTouches; i++) {
+      inTouch = &SDL_gestureTouch[i];
+
+      SDL_DollarTemplate* dollarTemplate = 
+	SDL_realloc(inTouch->dollarTemplate,
+		    (inTouch->numDollarTemplates + 1) * 
+		    sizeof(SDL_DollarTemplate));
+      if(!dollarTemplate) {
+	SDL_OutOfMemory();
+	return -1;
+      }
+	
+      inTouch->dollarTemplate = dollarTemplate;
+
+      SDL_DollarTemplate *templ = 
+	&inTouch->dollarTemplate[inTouch->numDollarTemplates];
+      memcpy(templ->path,path,DOLLARNPOINTS*sizeof(SDL_FloatPoint));
+      templ->hash = SDL_HashDollar(templ->path);
+      inTouch->numDollarTemplates++;    
+    }
+    return inTouch->numDollarTemplates - 1;
+  } else {
+    SDL_DollarTemplate* dollarTemplate = 
+      SDL_realloc(inTouch->dollarTemplate,
+		  (inTouch->numDollarTemplates + 1) * 
+		  sizeof(SDL_DollarTemplate));
+    if(!dollarTemplate) {
+      SDL_OutOfMemory();
+      return -1;
+    }
+    
+    inTouch->dollarTemplate = dollarTemplate;
+
+    SDL_DollarTemplate *templ = 
+      &inTouch->dollarTemplate[inTouch->numDollarTemplates];
+    memcpy(templ->path,path,DOLLARNPOINTS*sizeof(SDL_FloatPoint));
+    templ->hash = SDL_HashDollar(templ->path);
+    inTouch->numDollarTemplates++;
+    return inTouch->numDollarTemplates - 1;
+  }
+  return -1;
+}
+
+int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) {
+  if(src == NULL) return 0;
+  int i,loaded = 0;
+  SDL_GestureTouch *touch = NULL;
+  if(touchId >= 0) {
+    for(i = 0;i < SDL_numGestureTouches; i++)
+      if(SDL_gestureTouch[i].id == touchId)
+	touch = &SDL_gestureTouch[i];
+    if(touch == NULL) return -1;
+  }
+
+  while(1) {
+    SDL_DollarTemplate templ;
+
+    if(SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < 
+       DOLLARNPOINTS) break;
+
+    if(touchId >= 0) {
+      printf("Adding loaded gesture to 1 touch\n");
+      if(SDL_AddDollarGesture(touch,templ.path)) loaded++;
+    }
+    else {
+      printf("Adding to: %i touches\n",SDL_numGestureTouches);
+      for(i = 0;i < SDL_numGestureTouches; i++) {
+	touch = &SDL_gestureTouch[i];
+	printf("Adding loaded gesture to + touches\n");
+	//TODO: What if this fails?
+	SDL_AddDollarGesture(touch,templ.path);	
+      }
+      loaded++;
+    }
+  }
+
+  return loaded; 
+}
+
+
+float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
+  //  SDL_FloatPoint p[DOLLARNPOINTS];
+  float dist = 0;
+  SDL_FloatPoint p;
+  int i;
+  for(i = 0; i < DOLLARNPOINTS; i++) {
+    p.x = points[i].x * cos(ang) - points[i].y * sin(ang);
+    p.y = points[i].x * sin(ang) + points[i].y * cos(ang);
+    dist += sqrt((p.x-templ[i].x)*(p.x-templ[i].x)+
+		 (p.y-templ[i].y)*(p.y-templ[i].y));
+  }
+  return dist/DOLLARNPOINTS;
+  
+}
+
+float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
+  //------------BEGIN DOLLAR BLACKBOX----------------//
+  //-TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT-//
+  //-"http://depts.washington.edu/aimgroup/proj/dollar/"-//
+  float ta = -M_PI/4;
+  float tb = M_PI/4;
+  float dt = M_PI/90;
+  float x1 = PHI*ta + (1-PHI)*tb;
+  float f1 = dollarDifference(points,templ,x1);
+  float x2 = (1-PHI)*ta + PHI*tb;
+  float f2 = dollarDifference(points,templ,x2);
+  while(abs(ta-tb) > dt) {
+    if(f1 < f2) {
+      tb = x2;
+      x2 = x1;
+      f2 = f1;
+      x1 = PHI*ta + (1-PHI)*tb;
+      f1 = dollarDifference(points,templ,x1);
+    }
+    else {
+      ta = x1;
+      x1 = x2;
+      f1 = f2;
+      x2 = (1-PHI)*ta + PHI*tb;
+      f2 = dollarDifference(points,templ,x2);
+    }
+  }
+  /*
+  if(f1 <= f2)
+    printf("Min angle (x1): %f\n",x1);
+  else if(f1 >  f2)
+    printf("Min angle (x2): %f\n",x2);
+  */
+  return SDL_min(f1,f2);  
+}
+
+//DollarPath contains raw points, plus (possibly) the calculated length
+int dollarNormalize(SDL_DollarPath path,SDL_FloatPoint *points) {
+  int i;
+  //Calculate length if it hasn't already been done
+  if(path.length <= 0) {
+    for(i=1;i<path.numPoints;i++) {
+      float dx = path.p[i  ].x - 
+	         path.p[i-1].x;
+      float dy = path.p[i  ].y - 
+	         path.p[i-1].y;
+      path.length += sqrt(dx*dx+dy*dy);
+    }
+  }
+
+  //Resample
+  float interval = path.length/(DOLLARNPOINTS - 1);
+  float dist = interval;
+
+  int numPoints = 0;
+  SDL_FloatPoint centroid; 
+  centroid.x = 0;centroid.y = 0;
+  
+  //printf("(%f,%f)\n",path.p[path.numPoints-1].x,path.p[path.numPoints-1].y);
+  for(i = 1;i < path.numPoints;i++) {
+    float d = sqrt((path.p[i-1].x-path.p[i].x)*(path.p[i-1].x-path.p[i].x)+
+		   (path.p[i-1].y-path.p[i].y)*(path.p[i-1].y-path.p[i].y));
+    //printf("d = %f dist = %f/%f\n",d,dist,interval);
+    while(dist + d > interval) {
+      points[numPoints].x = path.p[i-1].x + 
+	((interval-dist)/d)*(path.p[i].x-path.p[i-1].x);
+      points[numPoints].y = path.p[i-1].y + 
+	((interval-dist)/d)*(path.p[i].y-path.p[i-1].y);
+      centroid.x += points[numPoints].x;
+      centroid.y += points[numPoints].y;
+      numPoints++;
+
+      dist -= interval;
+    }
+    dist += d;
+  }
+  if(numPoints < DOLLARNPOINTS-1) {
+    printf("ERROR: NumPoints = %i\n",numPoints); 
+    return 0;
+  }
+  //copy the last point
+  points[DOLLARNPOINTS-1] = path.p[path.numPoints-1];
+  numPoints = DOLLARNPOINTS;
+
+  centroid.x /= numPoints;
+  centroid.y /= numPoints;
+ 
+  //printf("Centroid (%f,%f)",centroid.x,centroid.y);
+  //Rotate Points so point 0 is left of centroid and solve for the bounding box
+  float xmin,xmax,ymin,ymax;
+  xmin = centroid.x;
+  xmax = centroid.x;
+  ymin = centroid.y;
+  ymax = centroid.y;
+  
+  float ang = atan2(centroid.y - points[0].y,
+		    centroid.x - points[0].x);
+
+  for(i = 0;i<numPoints;i++) {					       
+    float px = points[i].x;
+    float py = points[i].y;
+    points[i].x = (px - centroid.x)*cos(ang) - 
+                  (py - centroid.y)*sin(ang) + centroid.x;
+    points[i].y = (px - centroid.x)*sin(ang) + 
+                  (py - centroid.y)*cos(ang) + centroid.y;
+
+
+    if(points[i].x < xmin) xmin = points[i].x;
+    if(points[i].x > xmax) xmax = points[i].x; 
+    if(points[i].y < ymin) ymin = points[i].y;
+    if(points[i].y > ymax) ymax = points[i].y;
+  }
+
+  //Scale points to DOLLARSIZE, and translate to the origin
+  float w = xmax-xmin;
+  float h = ymax-ymin;
+
+  for(i=0;i<numPoints;i++) {
+    points[i].x = (points[i].x - centroid.x)*DOLLARSIZE/w;
+    points[i].y = (points[i].y - centroid.y)*DOLLARSIZE/h;
+  }  
+  return numPoints;
+}
+
+float dollarRecognize(SDL_DollarPath path,int *bestTempl,SDL_GestureTouch* touch) {
+	
+	SDL_FloatPoint points[DOLLARNPOINTS];
+	int numPoints = dollarNormalize(path,points);
+	//SDL_PrintPath(points);
+	int i;
+	
+	int bestDiff = 10000;
+	*bestTempl = -1;
+	for(i = 0;i < touch->numDollarTemplates;i++) {
+		int diff = bestDollarDifference(points,touch->dollarTemplate[i].path);
+		if(diff < bestDiff) {bestDiff = diff; *bestTempl = i;}
+	}
+	return bestDiff;
+}
+
+int SDL_GestureAddTouch(SDL_Touch* touch) {  
+  SDL_GestureTouch *gestureTouch = SDL_realloc(SDL_gestureTouch,
+					       (SDL_numGestureTouches + 1) *
+					       sizeof(SDL_GestureTouch));
+
+  if(!gestureTouch) {
+    SDL_OutOfMemory();
+    return -1;
+  }
+
+  SDL_gestureTouch = gestureTouch;
+
+  SDL_gestureTouch[SDL_numGestureTouches].res.x = touch->xres;
+  SDL_gestureTouch[SDL_numGestureTouches].res.y = touch->yres;
+  SDL_gestureTouch[SDL_numGestureTouches].numDownFingers = 0;
+
+  SDL_gestureTouch[SDL_numGestureTouches].res.x = touch->xres;
+  SDL_gestureTouch[SDL_numGestureTouches].id = touch->id;
+
+  SDL_gestureTouch[SDL_numGestureTouches].numDollarTemplates = 0;
+
+  SDL_gestureTouch[SDL_numGestureTouches].recording = SDL_FALSE;
+
+  SDL_numGestureTouches++;
+  return 0;
+}
+
+int SDL_GestureRemoveTouch(SDL_TouchID id) {
+  int i;
+  for(i = 0;i < SDL_numGestureTouches; i++) {
+    if(SDL_gestureTouch[i].id == id) {
+      SDL_numGestureTouches--;
+      SDL_gestureTouch[i] = SDL_gestureTouch[SDL_numGestureTouches];
+      return 1;
+    }
+  }
+  return -1;
+}
+
+
+SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
+  int i;
+  for(i = 0;i < SDL_numGestureTouches; i++) {
+    //printf("%i ?= %i\n",SDL_gestureTouch[i].id,id);
+    if(SDL_gestureTouch[i].id == id) return &SDL_gestureTouch[i];
+  }
+  return NULL;
+}
+
+int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
+  SDL_Event event;
+  event.mgesture.type = SDL_MULTIGESTURE;
+  event.mgesture.touchId = touch->id;
+  event.mgesture.x = touch->centroid.x;
+  event.mgesture.y = touch->centroid.y;
+  event.mgesture.dTheta = dTheta;
+  event.mgesture.dDist = dDist;  
+  event.mgesture.numFingers = touch->numDownFingers;
+  return SDL_PushEvent(&event) > 0;
+}
+
+int SDL_SendGestureDollar(SDL_GestureTouch* touch,
+			  SDL_GestureID gestureId,float error) {
+  SDL_Event event;
+  event.dgesture.type = SDL_DOLLARGESTURE;
+  event.dgesture.touchId = touch->id;
+  /*
+    //TODO: Add this to give location of gesture?
+  event.mgesture.x = touch->centroid.x;
+  event.mgesture.y = touch->centroid.y;
+  */
+  event.dgesture.gestureId = gestureId;
+  event.dgesture.error = error;  
+  //A finger came up to trigger this event.
+  event.dgesture.numFingers = touch->numDownFingers + 1; 
+  return SDL_PushEvent(&event) > 0;
+}
+
+
+int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) {
+  SDL_Event event;
+  event.dgesture.type = SDL_DOLLARRECORD;
+  event.dgesture.touchId = touch->id;
+  event.dgesture.gestureId = gestureId;
+  return SDL_PushEvent(&event) > 0;
+}
+
+
+void SDL_GestureProcessEvent(SDL_Event* event)
+{
+  if(event->type == SDL_FINGERMOTION || 
+     event->type == SDL_FINGERDOWN ||
+     event->type == SDL_FINGERUP) {
+    SDL_GestureTouch* inTouch = SDL_GetGestureTouch(event->tfinger.touchId);
+    
+    //Shouldn't be possible
+    if(inTouch == NULL) return;
+    
+    //printf("@ (%i,%i) with res: (%i,%i)\n",(int)event->tfinger.x,
+    //	   (int)event->tfinger.y,
+    //   (int)inTouch->res.x,(int)inTouch->res.y);
+
+    
+    float x = ((float)event->tfinger.x)/(float)inTouch->res.x;
+    float y = ((float)event->tfinger.y)/(float)inTouch->res.y;   
+
+
+    //Finger Up
+    if(event->type == SDL_FINGERUP) {
+      inTouch->numDownFingers--;
+      
+#ifdef ENABLE_DOLLAR
+      if(inTouch->recording) {
+	inTouch->recording = SDL_FALSE;
+	SDL_FloatPoint path[DOLLARNPOINTS];
+	dollarNormalize(inTouch->dollarPath,path);
+	//SDL_PrintPath(path);
+	int index;
+	if(recordAll) {
+	  index = SDL_AddDollarGesture(NULL,path);
+	  int i;
+	  for(i = 0;i < SDL_numGestureTouches; i++)
+	    SDL_gestureTouch[i].recording = SDL_FALSE;
+	}
+	else {
+	  index = SDL_AddDollarGesture(inTouch,path);
+	}
+	
+	if(index >= 0) {
+	  SDL_SendDollarRecord(inTouch,inTouch->dollarTemplate[index].hash);
+	}
+	else {
+	  SDL_SendDollarRecord(inTouch,-1);
+	}
+      }
+      else {	
+	int bestTempl;
+	float error;
+	error = dollarRecognize(inTouch->dollarPath,
+				&bestTempl,inTouch);
+	if(bestTempl >= 0){
+	  //Send Event
+	  unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash;
+	  SDL_SendGestureDollar(inTouch,gestureId,error);
+	  //printf ("%s\n",);("Dollar error: %f\n",error);
+	}
+      }
+#endif 
+      //inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers];
+      if(inTouch->numDownFingers > 0) {
+	inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers+1)-
+			       x)/inTouch->numDownFingers;
+	inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers+1)-
+			       y)/inTouch->numDownFingers;
+      }
+    }
+    else if(event->type == SDL_FINGERMOTION) {
+      float dx = ((float)event->tfinger.dx)/(float)inTouch->res.x;
+      float dy = ((float)event->tfinger.dy)/(float)inTouch->res.y;
+      //printf("dx,dy: (%f,%f)\n",dx,dy); 
+#ifdef ENABLE_DOLLAR
+      SDL_DollarPath* path = &inTouch->dollarPath;
+      if(path->numPoints < MAXPATHSIZE) {
+	path->p[path->numPoints].x = inTouch->centroid.x;
+	path->p[path->numPoints].y = inTouch->centroid.y;
+	float pathDx = 
+	  (path->p[path->numPoints].x-path->p[path->numPoints-1].x);
+	float pathDy = 
+	  (path->p[path->numPoints].y-path->p[path->numPoints-1].y);
+	path->length += sqrt(pathDx*pathDx + pathDy*pathDy);
+	path->numPoints++;
+      }
+#endif
+      SDL_FloatPoint lastP;
+      lastP.x = x - dx;
+      lastP.y = y - dy;
+      SDL_FloatPoint lastCentroid;
+      lastCentroid = inTouch->centroid;
+      
+      inTouch->centroid.x += dx/inTouch->numDownFingers;
+      inTouch->centroid.y += dy/inTouch->numDownFingers;
+      //printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y);
+      if(inTouch->numDownFingers > 1) {
+	SDL_FloatPoint lv; //Vector from centroid to last x,y position
+	SDL_FloatPoint v; //Vector from centroid to current x,y position
+	//lv = inTouch->gestureLast[j].cv;
+	lv.x = lastP.x - lastCentroid.x;
+	lv.y = lastP.y - lastCentroid.y;
+	float lDist = sqrt(lv.x*lv.x + lv.y*lv.y);
+	//printf("lDist = %f\n",lDist);
+	v.x = x - inTouch->centroid.x;
+	v.y = y - inTouch->centroid.y;
+	//inTouch->gestureLast[j].cv = v;
+	float Dist = sqrt(v.x*v.x+v.y*v.y);
+	// cos(dTheta) = (v . lv)/(|v| * |lv|)
+	
+	//Normalize Vectors to simplify angle calculation
+	lv.x/=lDist;
+	lv.y/=lDist;
+	v.x/=Dist;
+	v.y/=Dist;
+	float dtheta = atan2(lv.x*v.y - lv.y*v.x,lv.x*v.x + lv.y*v.y);
+	
+	float dDist = (Dist - lDist);
+	if(lDist == 0) {dDist = 0;dtheta = 0;} //To avoid impossible values
+	
+	//inTouch->gestureLast[j].dDist = dDist;
+	//inTouch->gestureLast[j].dtheta = dtheta;
+	
+	//printf("dDist = %f, dTheta = %f\n",dDist,dtheta);
+	//gdtheta = gdtheta*.9 + dtheta*.1;
+	//gdDist  =  gdDist*.9 +  dDist*.1
+	//knob.r += dDist/numDownFingers;
+	//knob.ang += dtheta;
+	//printf("thetaSum = %f, distSum = %f\n",gdtheta,gdDist);
+	//printf("id: %i dTheta = %f, dDist = %f\n",j,dtheta,dDist);
+	SDL_SendGestureMulti(inTouch,dtheta,dDist);
+      }
+      else {
+	//inTouch->gestureLast[j].dDist = 0;
+	//inTouch->gestureLast[j].dtheta = 0;
+	//inTouch->gestureLast[j].cv.x = 0;
+	//inTouch->gestureLast[j].cv.y = 0;
+      }
+      //inTouch->gestureLast[j].f.p.x = x;
+      //inTouch->gestureLast[j].f.p.y = y;
+      //break;
+      //pressure?
+    }
+    
+    if(event->type == SDL_FINGERDOWN) {
+
+      inTouch->numDownFingers++;
+      inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+ 
+			     x)/inTouch->numDownFingers;
+      inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers - 1)+
+			     y)/inTouch->numDownFingers;
+      //printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
+      //     inTouch->centroid.x,inTouch->centroid.y);
+
+#ifdef ENABLE_DOLLAR
+      inTouch->dollarPath.length = 0;
+      inTouch->dollarPath.p[0].x = x;
+      inTouch->dollarPath.p[0].y = y;
+      inTouch->dollarPath.numPoints = 1;
+#endif
+    }
+  }
+}
+
+  /* vi: set ts=4 sw=4 expandtab: */
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_gesture_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,35 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_gesture_c_h
+#define _SDL_gesture_c_h
+
+extern void SDL_GestureProcessEvent(SDL_Event* event);
+
+extern int SDL_RecordGesture(SDL_TouchID touchId);
+
+extern int SDL_GestureAddTouch(SDL_Touch* touch);
+
+#endif /* _SDL_gesture_c_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/events/SDL_keyboard.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_keyboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -30,9 +30,19 @@
 
 
 /* Global keyboard information */
-static int SDL_num_keyboards;
-static int SDL_current_keyboard;
-static SDL_Keyboard **SDL_keyboards;
+
+typedef struct SDL_Keyboard SDL_Keyboard;
+
+struct SDL_Keyboard
+{
+    /* Data common to all keyboards */
+    SDL_Window *focus;
+    Uint16 modstate;
+    Uint8 keystate[SDL_NUM_SCANCODES];
+    SDLKey keymap[SDL_NUM_SCANCODES];
+};
+
+static SDL_Keyboard SDL_keyboard;
 
 static const SDLKey SDL_default_keymap[SDL_NUM_SCANCODES] = {
     0, 0, 0, 0,
@@ -541,78 +551,22 @@
 int
 SDL_KeyboardInit(void)
 {
+    SDL_Keyboard *keyboard = &SDL_keyboard;
+
+    /* Set the default keymap */
+    SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
     return (0);
 }
 
-SDL_Keyboard *
-SDL_GetKeyboard(int index)
-{
-    if (index < 0 || index >= SDL_num_keyboards) {
-        return NULL;
-    }
-    return SDL_keyboards[index];
-}
-
-int
-SDL_AddKeyboard(const SDL_Keyboard * keyboard, int index)
+void
+SDL_ResetKeyboard(void)
 {
-    SDL_Keyboard **keyboards;
-
-    /* Add the keyboard to the list of keyboards */
-    if (index < 0 || index >= SDL_num_keyboards || SDL_keyboards[index]) {
-        keyboards =
-            (SDL_Keyboard **) SDL_realloc(SDL_keyboards,
-                                          (SDL_num_keyboards +
-                                           1) * sizeof(*keyboards));
-        if (!keyboards) {
-            SDL_OutOfMemory();
-            return -1;
-        }
-
-        SDL_keyboards = keyboards;
-        index = SDL_num_keyboards++;
-    }
-    SDL_keyboards[index] =
-        (SDL_Keyboard *) SDL_malloc(sizeof(*SDL_keyboards[index]));
-    if (!SDL_keyboards[index]) {
-        SDL_OutOfMemory();
-        return -1;
-    }
-    *SDL_keyboards[index] = *keyboard;
-
-    return index;
-}
-
-void
-SDL_DelKeyboard(int index)
-{
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
-
-    if (!keyboard) {
-        return;
-    }
-
-    if (keyboard->FreeKeyboard) {
-        keyboard->FreeKeyboard(keyboard);
-    }
-    SDL_free(keyboard);
-
-    SDL_keyboards[index] = NULL;
-}
-
-void
-SDL_ResetKeyboard(int index)
-{
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
     SDL_scancode scancode;
 
-    if (!keyboard) {
-        return;
-    }
-
     for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
         if (keyboard->keystate[scancode] == SDL_PRESSED) {
-            SDL_SendKeyboardKey(index, SDL_RELEASED, scancode);
+            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
         }
     }
 }
@@ -624,13 +578,9 @@
 }
 
 void
-SDL_SetKeymap(int index, int start, SDLKey * keys, int length)
+SDL_SetKeymap(int start, SDLKey * keys, int length)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
-
-    if (!keyboard) {
-        return;
-    }
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
     if (start < 0 || start + length > SDL_NUM_SCANCODES) {
         return;
@@ -645,33 +595,23 @@
     SDL_scancode_names[scancode] = name;
 }
 
-void
-SDL_SetKeyboardFocus(int index, SDL_Window * window)
+SDL_Window *
+SDL_GetKeyboardFocus(void)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
-    int i;
-    SDL_bool focus;
+    SDL_Keyboard *keyboard = &SDL_keyboard;
+
+    return keyboard->focus;
+}
 
-    if (!keyboard) {
-        return;
-    }
+void
+SDL_SetKeyboardFocus(SDL_Window * window)
+{
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
     /* See if the current window has lost focus */
     if (keyboard->focus && keyboard->focus != window) {
-        focus = SDL_FALSE;
-        for (i = 0; i < SDL_num_keyboards; ++i) {
-            if (i != index) {
-                SDL_Keyboard *check = SDL_GetKeyboard(i);
-                if (check && check->focus == keyboard->focus) {
-                    focus = SDL_TRUE;
-                    break;
-                }
-            }
-        }
-        if (!focus) {
-            SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
-                                0, 0);
-        }
+        SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
+                            0, 0);
     }
 
     keyboard->focus = window;
@@ -687,14 +627,15 @@
 }
 
 int
-SDL_SendKeyboardKey(int index, Uint8 state, SDL_scancode scancode)
+SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
     int posted;
     Uint16 modstate;
     Uint32 type;
+    Uint8 repeat;
 
-    if (!keyboard || !scancode) {
+    if (!scancode) {
         return 0;
     }
 #if 0
@@ -792,7 +733,8 @@
     }
 
     /* Drop events that don't change state */
-    if (keyboard->keystate[scancode] == state) {
+    repeat = (state && keyboard->keystate[scancode]);
+    if (keyboard->keystate[scancode] == state && !repeat) {
 #if 0
         printf("Keyboard event didn't change state - dropped!\n");
 #endif
@@ -807,8 +749,8 @@
     if (SDL_GetEventState(type) == SDL_ENABLE) {
         SDL_Event event;
         event.key.type = type;
-        event.key.which = (Uint8) index;
         event.key.state = state;
+        event.key.repeat = repeat;
         event.key.keysym.scancode = scancode;
         event.key.keysym.sym = keyboard->keymap[scancode];
         event.key.keysym.mod = modstate;
@@ -820,12 +762,13 @@
 }
 
 int
-SDL_SendKeyboardText(int index, const char *text)
+SDL_SendKeyboardText(const char *text)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
     int posted;
 
-    if (!keyboard) {
+    /* Don't post text events for unprintable characters */
+    if ((unsigned char)*text < ' ' || *text == 127) {
         return 0;
     }
 
@@ -835,8 +778,7 @@
         SDL_Event event;
         event.text.type = SDL_TEXTINPUT;
         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
-        event.text.which = (Uint8) index;
-        SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
+        SDL_utf8strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
         posted = (SDL_PushEvent(&event) > 0);
     }
@@ -844,25 +786,20 @@
 }
 
 int
-SDL_SendEditingText(int index, const char *text, int start, int length)
+SDL_SendEditingText(const char *text, int start, int length)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
     int posted;
 
-    if (!keyboard) {
-        return 0;
-    }
-
     /* Post the event, if desired */
     posted = 0;
     if (SDL_GetEventState(SDL_TEXTEDITING) == SDL_ENABLE) {
         SDL_Event event;
         event.edit.type = SDL_TEXTEDITING;
         event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0;
-        event.text.which = (Uint8) index;
         event.edit.start = start;
         event.edit.length = length;
-        SDL_strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text));
+        SDL_utf8strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text));
         posted = (SDL_PushEvent(&event) > 0);
     }
     return (posted);
@@ -871,93 +808,49 @@
 void
 SDL_KeyboardQuit(void)
 {
-    int i;
-
-    for (i = 0; i < SDL_num_keyboards; ++i) {
-        SDL_DelKeyboard(i);
-    }
-    SDL_num_keyboards = 0;
-    SDL_current_keyboard = 0;
-
-    if (SDL_keyboards) {
-        SDL_free(SDL_keyboards);
-        SDL_keyboards = NULL;
-    }
-}
-
-int
-SDL_GetNumKeyboards(void)
-{
-    return SDL_num_keyboards;
-}
-
-int
-SDL_SelectKeyboard(int index)
-{
-    if (index >= 0 && index < SDL_num_keyboards) {
-        SDL_current_keyboard = index;
-    }
-    return SDL_current_keyboard;
 }
 
 Uint8 *
 SDL_GetKeyboardState(int *numkeys)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(SDL_current_keyboard);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
     if (numkeys != (int *) 0) {
         *numkeys = SDL_NUM_SCANCODES;
     }
-
-    if (!keyboard) {
-        return NULL;
-    }
     return keyboard->keystate;
 }
 
 SDLMod
 SDL_GetModState(void)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(SDL_current_keyboard);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
-    if (!keyboard) {
-        return KMOD_NONE;
-    }
     return keyboard->modstate;
 }
 
 void
 SDL_SetModState(SDLMod modstate)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(SDL_current_keyboard);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
-    if (!keyboard) {
-        return;
-    }
     keyboard->modstate = modstate;
 }
 
 SDLKey
 SDL_GetKeyFromScancode(SDL_scancode scancode)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(SDL_current_keyboard);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
 
-    if (!keyboard) {
-        return SDLK_UNKNOWN;
-    }
     return keyboard->keymap[scancode];
 }
 
 SDL_scancode
 SDL_GetScancodeFromKey(SDLKey key)
 {
-    SDL_Keyboard *keyboard = SDL_GetKeyboard(SDL_current_keyboard);
+    SDL_Keyboard *keyboard = &SDL_keyboard;
     SDL_scancode scancode;
 
-    if (!keyboard) {
-        return SDL_SCANCODE_UNKNOWN;
-    }
-
     for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES;
          ++scancode) {
         if (keyboard->keymap[scancode] == key) {
--- a/src/events/SDL_keyboard_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_keyboard_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -27,44 +27,17 @@
 #include "SDL_keysym.h"
 #include "SDL_events.h"
 
-typedef struct SDL_Keyboard SDL_Keyboard;
-
-struct SDL_Keyboard
-{
-    /* Free the keyboard when it's time */
-    void (*FreeKeyboard) (SDL_Keyboard * keyboard);
-
-    /* Data common to all keyboards */
-    SDL_Window *focus;
-    Uint16 modstate;
-    Uint8 keystate[SDL_NUM_SCANCODES];
-    SDLKey keymap[SDL_NUM_SCANCODES];
-
-    void *driverdata;
-};
-
 /* Initialize the keyboard subsystem */
 extern int SDL_KeyboardInit(void);
 
-/* Get the keyboard at an index */
-extern SDL_Keyboard *SDL_GetKeyboard(int index);
-
-/* Add a keyboard, possibly reattaching at a particular index (or -1),
-   returning the index of the keyboard, or -1 if there was an error.
- */
-extern int SDL_AddKeyboard(const SDL_Keyboard * keyboard, int index);
-
-/* Remove a keyboard at an index, clearing the slot for later */
-extern void SDL_DelKeyboard(int index);
-
-/* Clear the state of a keyboard at an index */
-extern void SDL_ResetKeyboard(int index);
+/* Clear the state of the keyboard */
+extern void SDL_ResetKeyboard(void);
 
 /* Get the default keymap */
 extern void SDL_GetDefaultKeymap(SDLKey * keymap);
 
-/* Set the mapping of scancode to key codes for this keyboard */
-extern void SDL_SetKeymap(int index, int start, SDLKey * keys, int length);
+/* Set the mapping of scancode to key codes */
+extern void SDL_SetKeymap(int start, SDLKey * keys, int length);
 
 /* Set a platform-dependent key name, overriding the default platform-agnostic
    name. Encoded as UTF-8. The string is not copied, thus the pointer given to
@@ -73,16 +46,16 @@
 extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name);
 
 /* Set the keyboard focus window */
-extern void SDL_SetKeyboardFocus(int index, SDL_Window * window);
+extern void SDL_SetKeyboardFocus(SDL_Window * window);
 
-/* Send a keyboard event for a keyboard at an index */
-extern int SDL_SendKeyboardKey(int index, Uint8 state, SDL_scancode scancode);
+/* Send a keyboard key event */
+extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode);
 
-/* Send keyboard text input for a keyboard at an index */
-extern int SDL_SendKeyboardText(int index, const char *text);
+/* Send keyboard text input */
+extern int SDL_SendKeyboardText(const char *text);
 
 /* Send editing text for selected range from start to end */
-extern int SDL_SendEditingText(int index, const char *text, int start, int end);
+extern int SDL_SendEditingText(const char *text, int start, int end);
 
 /* Shutdown the keyboard subsystem */
 extern void SDL_KeyboardQuit(void);
--- a/src/events/SDL_mouse.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_mouse.c	Sun Aug 22 13:45:56 2010 -0700
@@ -29,9 +29,44 @@
 #include "../video/SDL_sysvideo.h"
 
 
-static int SDL_num_mice = 0;
-static int SDL_current_mouse = -1;
-static SDL_Mouse **SDL_mice = NULL;
+/* Global mouse information */
+
+typedef struct SDL_Mouse SDL_Mouse;
+
+struct SDL_Mouse
+{
+    /* Create a cursor from a surface */
+    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
+
+    /* Show the specified cursor, or hide if cursor is NULL */
+    int (*ShowCursor) (SDL_Cursor * cursor);
+
+    /* This is called when a mouse motion event occurs */
+    void (*MoveCursor) (SDL_Cursor * cursor);
+
+    /* Free a window manager cursor */
+    void (*FreeCursor) (SDL_Cursor * cursor);
+
+    /* Warp the mouse to (x,y) */
+    void (*WarpMouse) (SDL_Mouse * mouse, SDL_Window * window, int x, int y);
+
+    /* Data common to all mice */
+    SDL_Window *focus;
+    int x;
+    int y;
+    int xdelta;
+    int ydelta;
+    int last_x, last_y;         /* the last reported x and y coordinates */
+    Uint8 buttonstate;
+    SDL_bool relative_mode;
+
+    SDL_Cursor *cursors;
+    SDL_Cursor *def_cursor;
+    SDL_Cursor *cur_cursor;
+    SDL_bool cursor_shown;
+};
+
+static SDL_Mouse SDL_mouse;
 
 
 /* Public functions */
@@ -41,368 +76,52 @@
     return (0);
 }
 
-SDL_Mouse *
-SDL_GetMouse(int index)
+void
+SDL_ResetMouse(void)
 {
-    if (index < 0 || index >= SDL_num_mice) {
-        return NULL;
-    }
-    return SDL_mice[index];
-}
-
-static int
-SDL_GetMouseIndexId(int id)
-{
-    int index;
-    SDL_Mouse *mouse;
-
-    for (index = 0; index < SDL_num_mice; ++index) {
-        mouse = SDL_GetMouse(index);
-        if (mouse->id == id) {
-            return index;
-        }
-    }
-    return -1;
+    /* FIXME */
 }
 
-int
-SDL_AddMouse(const SDL_Mouse * mouse, char *name, int pressure_max,
-             int pressure_min, int ends)
+SDL_Window *
+SDL_GetMouseFocus(void)
 {
-    SDL_Mouse **mice;
-    int selected_mouse;
-    int index;
-    size_t length;
-
-    if (SDL_GetMouseIndexId(mouse->id) != -1) {
-        SDL_SetError("Mouse ID already in use");
-    }
-
-    /* Add the mouse to the list of mice */
-    mice = (SDL_Mouse **) SDL_realloc(SDL_mice,
-                                      (SDL_num_mice + 1) * sizeof(*mice));
-    if (!mice) {
-        SDL_OutOfMemory();
-        return -1;
-    }
-
-    SDL_mice = mice;
-    index = SDL_num_mice++;
-
-    SDL_mice[index] = (SDL_Mouse *) SDL_malloc(sizeof(*SDL_mice[index]));
-    if (!SDL_mice[index]) {
-        SDL_OutOfMemory();
-        return -1;
-    }
-    *SDL_mice[index] = *mouse;
+    SDL_Mouse *mouse = &SDL_mouse;
 
-    /* we're setting the mouse properties */
-    length = 0;
-    length = SDL_strlen(name);
-    SDL_mice[index]->focus = 0;
-    SDL_mice[index]->name = SDL_malloc((length + 2) * sizeof(char));
-    SDL_strlcpy(SDL_mice[index]->name, name, length + 1);
-    SDL_mice[index]->pressure_max = pressure_max;
-    SDL_mice[index]->pressure_min = pressure_min;
-    SDL_mice[index]->cursor_shown = SDL_TRUE;
-    selected_mouse = SDL_SelectMouse(index);
-    SDL_mice[index]->cur_cursor = NULL;
-    SDL_mice[index]->def_cursor =
-        SDL_CreateCursor(default_cdata, default_cmask, DEFAULT_CWIDTH,
-                         DEFAULT_CHEIGHT, DEFAULT_CHOTX, DEFAULT_CHOTY);
-    SDL_SetCursor(SDL_mice[index]->def_cursor);
-    /* we're assuming that all mice are in the computer sensing zone */
-    SDL_mice[index]->proximity = SDL_TRUE;
-    /* we're assuming that all mice are working in the absolute position mode
-       thanx to that, the users that don't want to use many mice don't have to
-       worry about anything */
-    SDL_mice[index]->relative_mode = SDL_FALSE;
-    SDL_mice[index]->current_end = 0;
-    SDL_mice[index]->total_ends = ends;
-    SDL_SelectMouse(selected_mouse);
-
-    return index;
-}
-
-void
-SDL_DelMouse(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return;
-    }
-
-    mouse->def_cursor = NULL;
-    SDL_free(mouse->name);
-    while (mouse->cursors) {
-        SDL_FreeCursor(mouse->cursors);
-    }
-
-    if (mouse->FreeMouse) {
-        mouse->FreeMouse(mouse);
-    }
-    SDL_free(mouse);
-
-    SDL_mice[index] = NULL;
-}
-
-void
-SDL_ResetMouse(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return;
-    }
-
-    /* FIXME */
+    return mouse->focus;
 }
 
 void
-SDL_MouseQuit(void)
-{
-    int i;
-
-    for (i = 0; i < SDL_num_mice; ++i) {
-        SDL_DelMouse(i);
-    }
-    SDL_num_mice = 0;
-    SDL_current_mouse = -1;
-
-    if (SDL_mice) {
-        SDL_free(SDL_mice);
-        SDL_mice = NULL;
-    }
-}
-
-int
-SDL_GetNumMice(void)
-{
-    return SDL_num_mice;
-}
-
-int
-SDL_SelectMouse(int index)
-{
-    if (index >= 0 && index < SDL_num_mice) {
-        SDL_current_mouse = index;
-    }
-    return SDL_current_mouse;
-}
-
-SDL_Window *
-SDL_GetMouseFocusWindow(int index)
+SDL_SetMouseFocus(SDL_Window * window)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return 0;
-    }
-    return mouse->focus;
-}
-
-static int SDLCALL
-FlushMouseMotion(void *param, SDL_Event * event)
-{
-    if (event->type == SDL_MOUSEMOTION
-        && event->motion.which == (Uint8) SDL_current_mouse) {
-        return 0;
-    } else {
-        return 1;
-    }
-}
-
-int
-SDL_SetRelativeMouseMode(int index, SDL_bool enabled)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return -1;
-    }
-
-    /* Flush pending mouse motion */
-    mouse->flush_motion = SDL_TRUE;
-    SDL_PumpEvents();
-    mouse->flush_motion = SDL_FALSE;
-    SDL_FilterEvents(FlushMouseMotion, mouse);
-
-    /* Set the relative mode */
-    mouse->relative_mode = enabled;
-
-    /* Update cursor visibility */
-    SDL_SetCursor(NULL);
+    SDL_Mouse *mouse = &SDL_mouse;
 
-    if (!enabled) {
-        /* Restore the expected mouse position */
-        SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
-    }
-    return 0;
-}
-
-SDL_bool
-SDL_GetRelativeMouseMode(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return SDL_FALSE;
-    }
-    return mouse->relative_mode;
-}
-
-Uint8
-SDL_GetMouseState(int *x, int *y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
-
-    if (!mouse) {
-        if (x) {
-            *x = 0;
-        }
-        if (y) {
-            *y = 0;
-        }
-        return 0;
-    }
-
-    if (x) {
-        *x = mouse->x;
-    }
-    if (y) {
-        *y = mouse->y;
-    }
-    return mouse->buttonstate;
-}
-
-Uint8
-SDL_GetRelativeMouseState(int index, int *x, int *y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        if (x) {
-            *x = 0;
-        }
-        if (y) {
-            *y = 0;
-        }
-        return 0;
-    }
-
-    if (x) {
-        *x = mouse->xdelta;
-    }
-    if (y) {
-        *y = mouse->ydelta;
-    }
-    mouse->xdelta = 0;
-    mouse->ydelta = 0;
-    return mouse->buttonstate;
-}
-
-void
-SDL_SetMouseFocus(int id, SDL_Window * window)
-{
-    int index = SDL_GetMouseIndexId(id);
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-    int i;
-    SDL_bool focus;
-
-    if (!mouse || (mouse->focus == window)) {
+    if (mouse->focus == window) {
         return;
     }
 
     /* See if the current window has lost focus */
     if (mouse->focus) {
-        focus = SDL_FALSE;
-        for (i = 0; i < SDL_num_mice; ++i) {
-            SDL_Mouse *check;
-            if (i != index) {
-                check = SDL_GetMouse(i);
-                if (check && check->focus == mouse->focus) {
-                    focus = SDL_TRUE;
-                    break;
-                }
-            }
-        }
-        if (!focus) {
-            SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_LEAVE, 0, 0);
-        }
+        SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_LEAVE, 0, 0);
     }
 
     mouse->focus = window;
 
     if (mouse->focus) {
-        focus = SDL_FALSE;
-        for (i = 0; i < SDL_num_mice; ++i) {
-            SDL_Mouse *check;
-            if (i != index) {
-                check = SDL_GetMouse(i);
-                if (check && check->focus == mouse->focus) {
-                    focus = SDL_TRUE;
-                    break;
-                }
-            }
-        }
-        if (!focus) {
-            SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_ENTER, 0, 0);
-        }
+        SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_ENTER, 0, 0);
     }
 }
 
 int
-SDL_SendProximity(int id, int x, int y, int type)
+SDL_SendMouseMotion(SDL_Window * window, int relative, int x, int y)
 {
-    int index = SDL_GetMouseIndexId(id);
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-    int posted = 0;
-
-    if (!mouse) {
-        return 0;
-    }
-
-    mouse->last_x = x;
-    mouse->last_y = y;
-    if (SDL_GetEventState(type) == SDL_ENABLE) {
-        SDL_Event event;
-        event.proximity.which = (Uint8) index;
-        event.proximity.x = x;
-        event.proximity.y = y;
-        event.proximity.cursor = mouse->current_end;
-        event.proximity.type = type;
-        /* FIXME: is this right? */
-        event.proximity.windowID = mouse->focus ? mouse->focus->id : 0;
-        posted = (SDL_PushEvent(&event) > 0);
-        if (type == SDL_PROXIMITYIN) {
-            mouse->proximity = SDL_TRUE;
-        } else {
-            mouse->proximity = SDL_FALSE;
-        }
-    }
-    return posted;
-}
-
-int
-SDL_SendMouseMotion(int id, int relative, int x, int y, int pressure)
-{
-    int index = SDL_GetMouseIndexId(id);
-    SDL_Mouse *mouse = SDL_GetMouse(index);
+    SDL_Mouse *mouse = &SDL_mouse;
     int posted;
     int xrel;
     int yrel;
     int x_max = 0, y_max = 0;
 
-    if (!mouse || mouse->flush_motion) {
-        return 0;
-    }
-
-    /* if the mouse is out of proximity we don't to want to have any motion from it */
-    if (mouse->proximity == SDL_FALSE) {
-        mouse->last_x = x;
-        mouse->last_y = y;
-        return 0;
+    if (window) {
+        SDL_SetMouseFocus(window);
     }
 
     /* the relative motion is calculated regarding the system cursor last position */
@@ -451,35 +170,26 @@
 
     mouse->xdelta += xrel;
     mouse->ydelta += yrel;
-    mouse->pressure = pressure;
 
+#if 0 /* FIXME */
     /* Move the mouse cursor, if needed */
     if (mouse->cursor_shown && !mouse->relative_mode &&
         mouse->MoveCursor && mouse->cur_cursor) {
         mouse->MoveCursor(mouse->cur_cursor);
     }
+#endif
 
     /* Post the event, if desired */
     posted = 0;
-    if (SDL_GetEventState(SDL_MOUSEMOTION) == SDL_ENABLE &&
-        mouse->proximity == SDL_TRUE) {
+    if (SDL_GetEventState(SDL_MOUSEMOTION) == SDL_ENABLE) {
         SDL_Event event;
         event.motion.type = SDL_MOUSEMOTION;
-        event.motion.which = (Uint8) index;
+        event.motion.windowID = mouse->focus ? mouse->focus->id : 0;
         event.motion.state = mouse->buttonstate;
         event.motion.x = mouse->x;
         event.motion.y = mouse->y;
-        event.motion.z = mouse->z;
-        event.motion.pressure = mouse->pressure;
-        event.motion.pressure_max = mouse->pressure_max;
-        event.motion.pressure_min = mouse->pressure_min;
-        event.motion.rotation = 0;
-        event.motion.tilt_x = 0;
-        event.motion.tilt_y = 0;
-        event.motion.cursor = mouse->current_end;
         event.motion.xrel = xrel;
         event.motion.yrel = yrel;
-        event.motion.windowID = mouse->focus ? mouse->focus->id : 0;
         posted = (SDL_PushEvent(&event) > 0);
     }
     mouse->last_x = mouse->x;
@@ -488,15 +198,14 @@
 }
 
 int
-SDL_SendMouseButton(int id, Uint8 state, Uint8 button)
+SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button)
 {
-    int index = SDL_GetMouseIndexId(id);
-    SDL_Mouse *mouse = SDL_GetMouse(index);
+    SDL_Mouse *mouse = &SDL_mouse;
     int posted;
     Uint32 type;
 
-    if (!mouse) {
-        return 0;
+    if (window) {
+        SDL_SetMouseFocus(window);
     }
 
     /* Figure out which event to perform */
@@ -527,7 +236,6 @@
     if (SDL_GetEventState(type) == SDL_ENABLE) {
         SDL_Event event;
         event.type = type;
-        event.button.which = (Uint8) index;
         event.button.state = state;
         event.button.button = button;
         event.button.x = mouse->x;
@@ -539,12 +247,16 @@
 }
 
 int
-SDL_SendMouseWheel(int index, int x, int y)
+SDL_SendMouseWheel(SDL_Window * window, int x, int y)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(index);
+    SDL_Mouse *mouse = &SDL_mouse;
     int posted;
 
-    if (!mouse || (!x && !y)) {
+    if (window) {
+        SDL_SetMouseFocus(window);
+    }
+
+    if (!x && !y) {
         return 0;
     }
 
@@ -553,53 +265,107 @@
     if (SDL_GetEventState(SDL_MOUSEWHEEL) == SDL_ENABLE) {
         SDL_Event event;
         event.type = SDL_MOUSEWHEEL;
-        event.wheel.which = (Uint8) index;
+        event.wheel.windowID = mouse->focus ? mouse->focus->id : 0;
         event.wheel.x = x;
         event.wheel.y = y;
-        event.wheel.windowID = mouse->focus ? mouse->focus->id : 0;
         posted = (SDL_PushEvent(&event) > 0);
     }
     return posted;
 }
 
 void
+SDL_MouseQuit(void)
+{
+}
+
+Uint8
+SDL_GetMouseState(int *x, int *y)
+{
+    SDL_Mouse *mouse = &SDL_mouse;
+
+    if (x) {
+        *x = mouse->x;
+    }
+    if (y) {
+        *y = mouse->y;
+    }
+    return mouse->buttonstate;
+}
+
+Uint8
+SDL_GetRelativeMouseState(int *x, int *y)
+{
+    SDL_Mouse *mouse = &SDL_mouse;
+
+    if (x) {
+        *x = mouse->xdelta;
+    }
+    if (y) {
+        *y = mouse->ydelta;
+    }
+    mouse->xdelta = 0;
+    mouse->ydelta = 0;
+    return mouse->buttonstate;
+}
+
+void
 SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
-
-    if (!mouse) {
-        return;
-    }
+    SDL_Mouse *mouse = &SDL_mouse;
 
     if (mouse->WarpMouse) {
         mouse->WarpMouse(mouse, window, x, y);
     } else {
-        SDL_SetMouseFocus(SDL_current_mouse, window);
-        SDL_SendMouseMotion(SDL_current_mouse, 0, x, y, 0);
+        SDL_SendMouseMotion(window, 0, x, y);
     }
 }
 
+int
+SDL_SetRelativeMouseMode(SDL_bool enabled)
+{
+    SDL_Mouse *mouse = &SDL_mouse;
+
+    /* Flush pending mouse motion */
+    SDL_FlushEvent(SDL_MOUSEMOTION);
+
+    /* Set the relative mode */
+    mouse->relative_mode = enabled;
+
+    if (!enabled) {
+        /* Restore the expected mouse position */
+        SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
+    }
+
+    /* Update cursor visibility */
+    SDL_SetCursor(NULL);
+
+    return 0;
+}
+
+SDL_bool
+SDL_GetRelativeMouseMode()
+{
+    SDL_Mouse *mouse = &SDL_mouse;
+
+    return mouse->relative_mode;
+}
+
 SDL_Cursor *
 SDL_CreateCursor(const Uint8 * data, const Uint8 * mask,
                  int w, int h, int hot_x, int hot_y)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
+    SDL_Mouse *mouse = &SDL_mouse;
     SDL_Surface *surface;
     SDL_Cursor *cursor;
     int x, y;
     Uint32 *pixel;
-    Uint8 datab, maskb;
+    Uint8 datab = 0, maskb = 0;
     const Uint32 black = 0xFF000000;
     const Uint32 white = 0xFFFFFFFF;
     const Uint32 transparent = 0x00000000;
 
-    if (!mouse) {
-        SDL_SetError("No mice are initialized");
-        return NULL;
-    }
-
     if (!mouse->CreateCursor) {
-        SDL_SetError("Current mouse doesn't have cursor support");
+        SDL_SetError("Cursors are not currently supported");
         return NULL;
     }
 
@@ -638,7 +404,6 @@
 
     cursor = mouse->CreateCursor(surface, hot_x, hot_y);
     if (cursor) {
-        cursor->mouse = mouse;
         cursor->next = mouse->cursors;
         mouse->cursors = cursor;
     }
@@ -655,12 +420,7 @@
 void
 SDL_SetCursor(SDL_Cursor * cursor)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
-
-    if (!mouse) {
-        SDL_SetError("No mice are initialized");
-        return;
-    }
+    SDL_Mouse *mouse = &SDL_mouse;
 
     /* Set the new cursor */
     if (cursor) {
@@ -694,7 +454,7 @@
 SDL_Cursor *
 SDL_GetCursor(void)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
+    SDL_Mouse *mouse = &SDL_mouse;
 
     if (!mouse) {
         return NULL;
@@ -705,13 +465,12 @@
 void
 SDL_FreeCursor(SDL_Cursor * cursor)
 {
-    SDL_Mouse *mouse;
+    SDL_Mouse *mouse = &SDL_mouse;
     SDL_Cursor *curr, *prev;
 
     if (!cursor) {
         return;
     }
-    mouse = cursor->mouse;
 
     if (cursor == mouse->def_cursor) {
         return;
@@ -740,7 +499,7 @@
 int
 SDL_ShowCursor(int toggle)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
+    SDL_Mouse *mouse = &SDL_mouse;
     SDL_bool shown;
 
     if (!mouse) {
@@ -761,47 +520,4 @@
     return shown;
 }
 
-char *
-SDL_GetMouseName(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-    if (!mouse) {
-        return NULL;
-    }
-    return mouse->name;
-}
-
-void
-SDL_ChangeEnd(int id, int end)
-{
-    int index = SDL_GetMouseIndexId(id);
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (mouse) {
-        mouse->current_end = end;
-    }
-}
-
-int
-SDL_GetCursorsNumber(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return -1;
-    }
-    return mouse->total_ends;
-}
-
-int
-SDL_GetCurrentCursor(int index)
-{
-    SDL_Mouse *mouse = SDL_GetMouse(index);
-
-    if (!mouse) {
-        return -1;
-    }
-    return mouse->current_end;
-}
-
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/events/SDL_mouse_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/SDL_mouse_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -24,108 +24,33 @@
 #ifndef _SDL_mouse_c_h
 #define _SDL_mouse_c_h
 
-typedef struct SDL_Mouse SDL_Mouse;
-
 struct SDL_Cursor
 {
-    SDL_Mouse *mouse;
     SDL_Cursor *next;
     void *driverdata;
 };
 
-struct SDL_Mouse
-{
-    /* Create a cursor from a surface */
-    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
-
-    /* Show the specified cursor, or hide if cursor is NULL */
-    int (*ShowCursor) (SDL_Cursor * cursor);
-
-    /* This is called when a mouse motion event occurs */
-    void (*MoveCursor) (SDL_Cursor * cursor);
-
-    /* Free a window manager cursor */
-    void (*FreeCursor) (SDL_Cursor * cursor);
-
-    /* Warp the mouse to (x,y) */
-    void (*WarpMouse) (SDL_Mouse * mouse, SDL_Window * window, int x,
-                       int y);
-
-    /* Free the mouse when it's time */
-    void (*FreeMouse) (SDL_Mouse * mouse);
-
-    /* data common for tablets */
-    int pressure;
-    int pressure_max;
-    int pressure_min;
-    int tilt;                   /* for future use */
-    int rotation;               /* for future use */
-    int total_ends;
-    int current_end;
-
-    /* Data common to all mice */
-    int id;
-    SDL_Window *focus;
-    int which;
-    int x;
-    int y;
-    int z;                      /* for future use */
-    int xdelta;
-    int ydelta;
-    int last_x, last_y;         /* the last reported x and y coordinates */
-    char *name;
-    Uint8 buttonstate;
-    SDL_bool relative_mode;
-    SDL_bool proximity;
-    SDL_bool flush_motion;
-
-    SDL_Cursor *cursors;
-    SDL_Cursor *def_cursor;
-    SDL_Cursor *cur_cursor;
-    SDL_bool cursor_shown;
-
-    void *driverdata;
-};
-
 /* Initialize the mouse subsystem */
 extern int SDL_MouseInit(void);
 
-/* Get the mouse at an index */
-extern SDL_Mouse *SDL_GetMouse(int index);
-
-/* Add a mouse, possibly reattaching at a particular index (or -1),
-   returning the index of the mouse, or -1 if there was an error.
- */
-extern int SDL_AddMouse(const SDL_Mouse * mouse, char *name,
-                        int pressure_max, int pressure_min, int ends);
-
-/* Remove a mouse at an index, clearing the slot for later */
-extern void SDL_DelMouse(int index);
-
-/* Clear the button state of a mouse at an index */
-extern void SDL_ResetMouse(int index);
+/* Clear the mouse state */
+extern void SDL_ResetMouse(void);
 
 /* Set the mouse focus window */
-extern void SDL_SetMouseFocus(int id, SDL_Window * window);
+extern void SDL_SetMouseFocus(SDL_Window * window);
 
-/* Send a mouse motion event for a mouse */
-extern int SDL_SendMouseMotion(int id, int relative, int x, int y, int z);
+/* Send a mouse motion event */
+extern int SDL_SendMouseMotion(SDL_Window * window, int relative, int x, int y);
 
-/* Send a mouse button event for a mouse */
-extern int SDL_SendMouseButton(int id, Uint8 state, Uint8 button);
+/* Send a mouse button event */
+extern int SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button);
 
-/* Send a mouse wheel event for a mouse */
-extern int SDL_SendMouseWheel(int id, int x, int y);
-
-/* Send a proximity event for a mouse */
-extern int SDL_SendProximity(int id, int x, int y, int type);
+/* Send a mouse wheel event */
+extern int SDL_SendMouseWheel(SDL_Window * window, int x, int y);
 
 /* Shutdown the mouse subsystem */
 extern void SDL_MouseQuit(void);
 
-/* FIXME: Where do these functions go in this header? */
-extern void SDL_ChangeEnd(int id, int end);
-
 #endif /* _SDL_mouse_c_h */
 
 /* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_touch.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,555 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* General touch handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "../video/SDL_sysvideo.h"
+
+#include <stdio.h>
+
+
+static int SDL_num_touch = 0;
+static SDL_Touch **SDL_touchPads = NULL;
+
+
+/* Public functions */
+int
+SDL_TouchInit(void)
+{
+  return (0);
+}
+
+SDL_Touch *
+SDL_GetTouch(SDL_TouchID id)
+{
+    int index = SDL_GetTouchIndexId(id);
+    if (index < 0 || index >= SDL_num_touch) {
+        return NULL;
+    }
+    return SDL_touchPads[index];
+}
+
+SDL_Touch *
+SDL_GetTouchIndex(int index)
+{
+    if (index < 0 || index >= SDL_num_touch) {
+        return NULL;
+    }
+    return SDL_touchPads[index];
+}
+
+int
+SDL_GetFingerIndexId(SDL_Touch* touch,SDL_FingerID fingerid)
+{
+    int i;
+    for(i = 0;i < touch->num_fingers;i++)
+	if(touch->fingers[i]->id == fingerid)
+	    return i;
+    return -1;
+}
+
+
+SDL_Finger *
+SDL_GetFinger(SDL_Touch* touch,SDL_FingerID id)
+{
+    int index = SDL_GetFingerIndexId(touch,id);
+    if(index < 0 || index >= touch->num_fingers)
+	return NULL;
+    return touch->fingers[index];
+}
+
+
+int
+SDL_GetTouchIndexId(SDL_TouchID id)
+{
+    int index;
+    SDL_Touch *touch;
+
+    for (index = 0; index < SDL_num_touch; ++index) {
+        touch = SDL_touchPads[index];
+        if (touch->id == id) {
+            return index;
+        }
+    }
+    return -1;
+}
+
+int
+SDL_AddTouch(const SDL_Touch * touch, char *name)
+{
+    SDL_Touch **touchPads;
+    int index,length;
+
+    if (SDL_GetTouchIndexId(touch->id) != -1) {
+        SDL_SetError("Touch ID already in use");
+    }
+
+    /* Add the touch to the list of touch */
+    touchPads = (SDL_Touch **) SDL_realloc(SDL_touchPads,
+                                      (SDL_num_touch + 1) * sizeof(*touch));
+    if (!touchPads) {
+        SDL_OutOfMemory();
+        return -1;
+    }
+
+    SDL_touchPads = touchPads;
+    index = SDL_num_touch++;
+
+    SDL_touchPads[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchPads[index]));
+    if (!SDL_touchPads[index]) {
+        SDL_OutOfMemory();
+        return -1;
+    }
+    *SDL_touchPads[index] = *touch;
+
+    /* we're setting the touch properties */
+    length = 0;
+    length = SDL_strlen(name);
+    SDL_touchPads[index]->focus = 0;
+    SDL_touchPads[index]->name = SDL_malloc((length + 2) * sizeof(char));
+    SDL_strlcpy(SDL_touchPads[index]->name, name, length + 1);   
+
+    SDL_touchPads[index]->num_fingers = 0;
+    SDL_touchPads[index]->max_fingers = 1;
+    SDL_touchPads[index]->fingers = (SDL_Finger **) SDL_malloc(sizeof(SDL_Finger*));
+    SDL_touchPads[index]->fingers[0] = NULL;
+    SDL_touchPads[index]->buttonstate = 0;
+    SDL_touchPads[index]->relative_mode = SDL_FALSE;
+    SDL_touchPads[index]->flush_motion = SDL_FALSE;
+    
+    SDL_touchPads[index]->xres = (1<<(16-1));
+    SDL_touchPads[index]->yres = (1<<(16-1));
+    //Do I want this here? Probably
+    SDL_GestureAddTouch(SDL_touchPads[index]);
+
+    return index;
+}
+
+void
+SDL_DelTouch(SDL_TouchID id)
+{
+    int index = SDL_GetTouchIndexId(id);
+    SDL_Touch *touch = SDL_GetTouch(id);
+
+    if (!touch) {
+        return;
+    }
+
+    
+    SDL_free(touch->name);
+ 
+    if (touch->FreeTouch) {
+        touch->FreeTouch(touch);
+    }
+    SDL_free(touch);
+
+    SDL_num_touch--;
+    SDL_touchPads[index] = SDL_touchPads[SDL_num_touch];
+}
+
+void
+SDL_TouchQuit(void)
+{
+    int i;
+
+    for (i = SDL_num_touch-1; i > 0 ; --i) {
+        SDL_DelTouch(i);
+    }
+    SDL_num_touch = 0;
+
+    if (SDL_touchPads) {
+        SDL_free(SDL_touchPads);
+        SDL_touchPads = NULL;
+    }
+}
+
+int
+SDL_GetNumTouch(void)
+{
+    return SDL_num_touch;
+}
+SDL_Window *
+SDL_GetTouchFocusWindow(SDL_TouchID id)
+{
+    SDL_Touch *touch = SDL_GetTouch(id);
+
+    if (!touch) {
+        return 0;
+    }
+    return touch->focus;
+}
+
+void
+SDL_SetTouchFocus(SDL_TouchID id, SDL_Window * window)
+{
+    int index = SDL_GetTouchIndexId(id);
+    SDL_Touch *touch = SDL_GetTouch(id);
+    int i;
+    SDL_bool focus;
+
+    if (!touch || (touch->focus == window)) {
+        return;
+    }
+
+    /* See if the current window has lost focus */
+    if (touch->focus) {
+        focus = SDL_FALSE;
+        for (i = 0; i < SDL_num_touch; ++i) {
+            SDL_Touch *check;
+            if (i != index) {
+                check = SDL_touchPads[i];
+                if (check && check->focus == touch->focus) {
+                    focus = SDL_TRUE;
+                    break;
+                }
+            }
+        }
+        if (!focus) {
+            SDL_SendWindowEvent(touch->focus, SDL_WINDOWEVENT_LEAVE, 0, 0);
+        }
+    }
+
+    touch->focus = window;
+
+    if (touch->focus) {
+        focus = SDL_FALSE;
+        for (i = 0; i < SDL_num_touch; ++i) {
+            SDL_Touch *check;
+            if (i != index) {
+                check = SDL_touchPads[i];
+                if (check && check->focus == touch->focus) {
+                    focus = SDL_TRUE;
+                    break;
+                }
+            }
+        }
+        if (!focus) {
+            SDL_SendWindowEvent(touch->focus, SDL_WINDOWEVENT_ENTER, 0, 0);
+        }
+    }
+}
+
+int 
+SDL_AddFinger(SDL_Touch* touch,SDL_Finger *finger)
+{
+    int index;
+    SDL_Finger **fingers;
+    //printf("Adding Finger...\n");
+    if (SDL_GetFingerIndexId(touch,finger->id) != -1) {
+        SDL_SetError("Finger ID already in use");
+	}
+
+    /* Add the touch to the list of touch */
+    if(touch->num_fingers  >= touch->max_fingers){
+		//printf("Making room for it!\n");
+		fingers = (SDL_Finger **) SDL_realloc(touch->fingers,
+  						   (touch->num_fingers + 1) * sizeof(SDL_Finger *));
+		touch->max_fingers = touch->num_fingers+1;
+		if (!fingers) {
+			SDL_OutOfMemory();
+			return -1;
+		} else {
+			touch->max_fingers = touch->num_fingers+1;
+			touch->fingers = fingers;
+		}
+	}
+
+    index = touch->num_fingers;
+    //printf("Max_Fingers: %i Index: %i\n",touch->max_fingers,index);
+
+    touch->fingers[index] = (SDL_Finger *) SDL_malloc(sizeof(SDL_Finger));
+    if (!touch->fingers[index]) {
+        SDL_OutOfMemory();
+        return -1;
+    }
+    *(touch->fingers[index]) = *finger;
+    touch->num_fingers++;
+
+    return index;
+}
+
+int
+SDL_DelFinger(SDL_Touch* touch,SDL_FingerID fingerid)
+{
+    int index = SDL_GetFingerIndexId(touch,fingerid);
+    SDL_Finger* finger = SDL_GetFinger(touch,fingerid);
+
+    if (!finger) {
+        return -1;
+    }
+ 
+
+    SDL_free(finger);
+    touch->num_fingers--;
+    touch->fingers[index] = touch->fingers[touch->num_fingers];
+    return 0;
+}
+
+
+int
+SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, 
+		   float xin, float yin, float pressurein)
+{
+    int posted;
+    SDL_Touch* touch = SDL_GetTouch(id);
+
+    if(!touch) {
+      return SDL_TouchNotFoundError(id);
+    }
+
+    
+    //scale to Integer coordinates
+    Uint16 x = (xin+touch->x_min)*(touch->xres)/(touch->native_xres);
+    Uint16 y = (yin+touch->y_min)*(touch->yres)/(touch->native_yres);
+    Uint16 pressure = (yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres);
+    
+    SDL_Finger *finger = SDL_GetFinger(touch,fingerid);
+    if(down) {
+	if(finger == NULL) {
+	    SDL_Finger nf;
+	    nf.id = fingerid;
+	    nf.x = x;
+	    nf.y = y;
+	    nf.pressure = pressure;
+	    nf.xdelta = 0;
+	    nf.ydelta = 0;
+	    nf.last_x = x;
+	    nf.last_y = y;
+	    nf.last_pressure = pressure;
+	    nf.down = SDL_FALSE;
+	    if(SDL_AddFinger(touch,&nf) < 0) return 0;
+	    finger = SDL_GetFinger(touch,fingerid);
+	}
+	else if(finger->down) return 0;
+	if(xin < touch->x_min || yin < touch->y_min) return 0; //should defer if only a partial input
+	posted = 0;
+	if (SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
+	    SDL_Event event;
+	    event.tfinger.type = SDL_FINGERDOWN;
+	    event.tfinger.touchId = id;
+	    event.tfinger.x = x;
+	    event.tfinger.y = y;
+	    event.tfinger.pressure = pressure;
+	    event.tfinger.state = touch->buttonstate;
+	    event.tfinger.windowID = touch->focus ? touch->focus->id : 0;
+	    event.tfinger.fingerId = fingerid;
+	    posted = (SDL_PushEvent(&event) > 0);
+	}
+	if(posted) finger->down = SDL_TRUE;
+	return posted;
+    }
+    else {
+        if(finger == NULL) {printf("Finger not found...\n");return 0;}      
+	posted = 0;
+	if (SDL_GetEventState(SDL_FINGERUP) == SDL_ENABLE) {
+	    SDL_Event event;
+	    event.tfinger.type = SDL_FINGERUP;
+	    event.tfinger.touchId =  id;
+	    event.tfinger.state = touch->buttonstate;
+	    event.tfinger.windowID = touch->focus ? touch->focus->id : 0;
+	    event.tfinger.fingerId = fingerid;
+	    //I don't trust the coordinates passed on fingerUp
+	    event.tfinger.x = finger->x; 
+	    event.tfinger.y = finger->y;
+	    event.tfinger.dx = 0;
+	    event.tfinger.dy = 0;
+
+	    if(SDL_DelFinger(touch,fingerid) < 0) return 0;
+	    posted = (SDL_PushEvent(&event) > 0);
+	}	
+	return posted;
+    }
+}
+
+int
+SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative, 
+		    float xin, float yin, float pressurein)
+{
+    int index = SDL_GetTouchIndexId(id);
+    SDL_Touch *touch = SDL_GetTouch(id);
+    SDL_Finger *finger = SDL_GetFinger(touch,fingerid);
+    int posted;
+    Sint16 xrel, yrel;
+    float x_max = 0, y_max = 0;
+    
+    if (!touch) {
+      return SDL_TouchNotFoundError(id);
+    }
+
+    //scale to Integer coordinates
+    Uint16 x = (xin+touch->x_min)*(touch->xres)/(touch->native_xres);
+    Uint16 y = (yin+touch->y_min)*(touch->yres)/(touch->native_yres);
+    Uint16 pressure = (yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres);
+    if(touch->flush_motion) {
+	return 0;
+    }
+    
+    if(finger == NULL || !finger->down) {
+	return SDL_SendFingerDown(id,fingerid,SDL_TRUE,xin,yin,pressurein);	
+    } else {
+	/* the relative motion is calculated regarding the last position */
+	if (relative) {
+	    xrel = x;
+	    yrel = y;
+	    x = (finger->last_x + x);
+	    y = (finger->last_y + y);
+	} else {
+	    if(xin < touch->x_min) x = finger->last_x; /*If movement is only in one axis,*/
+	    if(yin < touch->y_min) y = finger->last_y; /*The other is marked as -1*/
+	    if(pressurein < touch->pressure_min) pressure = finger->last_pressure;
+	    xrel = x - finger->last_x;
+	    yrel = y - finger->last_y;
+	    //printf("xrel,yrel (%i,%i)\n",(int)xrel,(int)yrel);
+	}
+	
+	/* Drop events that don't change state */
+	if (!xrel && !yrel) {
+#if 0
+	    printf("Touch event didn't change state - dropped!\n");
+#endif
+	    return 0;
+	}
+	
+	/* Update internal touch coordinates */
+	
+	finger->x = x;
+	finger->y = y;
+	
+	/*Should scale to window? Normalize? Maintain Aspect?*/
+	//SDL_GetWindowSize(touch->focus, &x_max, &y_max);
+	
+	/* make sure that the pointers find themselves inside the windows */
+	/* only check if touch->xmax is set ! */
+	/*
+	  if (x_max && touch->x > x_max) {
+	  touch->x = x_max;
+	  } else if (touch->x < 0) {
+	  touch->x = 0;
+	  }
+	  
+	  if (y_max && touch->y > y_max) {
+	  touch->y = y_max;
+	  } else if (touch->y < 0) {
+	  touch->y = 0;
+	  }
+	*/
+	finger->xdelta = xrel;
+	finger->ydelta = yrel;
+	finger->pressure = pressure;
+	
+	
+	
+	/* Post the event, if desired */
+	posted = 0;
+	if (SDL_GetEventState(SDL_FINGERMOTION) == SDL_ENABLE) {
+	    SDL_Event event;
+	    event.tfinger.type = SDL_FINGERMOTION;
+	    event.tfinger.touchId = id;
+	    event.tfinger.fingerId = fingerid;
+	    event.tfinger.x = x;
+	    event.tfinger.y = y;
+	    event.tfinger.dx = xrel;
+	    event.tfinger.dy = yrel;	    
+		
+	    event.tfinger.pressure = pressure;
+	    event.tfinger.state = touch->buttonstate;
+	    event.tfinger.windowID = touch->focus ? touch->focus->id : 0;
+	    posted = (SDL_PushEvent(&event) > 0);
+	}
+	finger->last_x = finger->x;
+	finger->last_y = finger->y;
+	finger->last_pressure = finger->pressure;
+	return posted;
+    }
+}
+int
+SDL_SendTouchButton(SDL_TouchID id, Uint8 state, Uint8 button)
+{
+    SDL_Touch *touch = SDL_GetTouch(id);
+    int posted;
+    Uint32 type;
+
+    
+    if (!touch) {
+      return SDL_TouchNotFoundError(id);
+    }
+
+    /* Figure out which event to perform */
+    switch (state) {
+    case SDL_PRESSED:
+        if (touch->buttonstate & SDL_BUTTON(button)) {
+            /* Ignore this event, no state change */
+            return 0;
+        }
+        type = SDL_TOUCHBUTTONDOWN;
+        touch->buttonstate |= SDL_BUTTON(button);
+        break;
+    case SDL_RELEASED:
+        if (!(touch->buttonstate & SDL_BUTTON(button))) {
+            /* Ignore this event, no state change */
+            return 0;
+        }
+        type = SDL_TOUCHBUTTONUP;
+        touch->buttonstate &= ~SDL_BUTTON(button);
+        break;
+    default:
+        /* Invalid state -- bail */
+        return 0;
+    }
+
+    /* Post the event, if desired */
+    posted = 0;
+    if (SDL_GetEventState(type) == SDL_ENABLE) {
+        SDL_Event event;
+        event.type = type;
+        event.tbutton.touchId = touch->id;
+        event.tbutton.state = state;
+        event.tbutton.button = button;
+        event.tbutton.windowID = touch->focus ? touch->focus->id : 0;
+        posted = (SDL_PushEvent(&event) > 0);
+    }
+    return posted;
+}
+
+char *
+SDL_GetTouchName(SDL_TouchID id)
+{
+    SDL_Touch *touch = SDL_GetTouch(id);
+    if (!touch) {
+        return NULL;
+    }
+    return touch->name;
+}
+
+int SDL_TouchNotFoundError(SDL_TouchID id) {
+  printf("ERROR: Cannot send touch on non-existent device with id: %li make sure SDL_AddTouch has been called\n",id);
+  printf("ERROR: There are %i touches installed with Id's:\n",SDL_num_touch);
+  int i;
+  for(i=0;i < SDL_num_touch;i++) {
+    printf("ERROR: %li\n",SDL_touchPads[i]->id);
+  }
+  return 0;
+}
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/events/SDL_touch_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,79 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+#include "../../include/SDL_touch.h"
+
+#ifndef _SDL_touch_c_h
+#define _SDL_touch_c_h
+
+
+
+/* Initialize the touch subsystem */
+extern int SDL_TouchInit(void);
+
+/*Get the touch at an index */
+extern SDL_Touch *SDL_GetTouchIndex(int index);
+
+/* Get the touch with id = id */
+extern SDL_Touch *SDL_GetTouch(SDL_TouchID id);
+
+/*Get the finger at an index */
+extern SDL_Finger *SDL_GetFingerIndex(SDL_Touch *touch, int index);
+
+/* Get the finger with id = id */
+extern SDL_Finger *SDL_GetFinger(SDL_Touch *touch,SDL_FingerID id);
+
+
+/* Add a touch, possibly reattaching at a particular index (or -1),
+   returning the index of the touch, or -1 if there was an error. */
+extern int SDL_AddTouch(const SDL_Touch * touch, char *name);
+                     
+
+/* Remove a touch at an index, clearing the slot for later */
+extern void SDL_DelTouch(SDL_TouchID id);
+
+/* Set the touch focus window */
+extern void SDL_SetTouchFocus(SDL_TouchID id, SDL_Window * window);
+
+/* Send a touch motion event for a touch */
+extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
+			       int relative, float x, float y, float z);
+
+/* Send a touch down/up event for a touch */
+extern int SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, 
+			      SDL_bool down, float x, float y, float pressure);
+
+/* Send a touch button event for a touch */
+extern int SDL_SendTouchButton(SDL_TouchID id, Uint8 state, Uint8 button);
+
+/* Shutdown the touch subsystem */
+extern void SDL_TouchQuit(void);
+
+/* Get the index of a touch device */
+extern int SDL_GetTouchIndexId(SDL_TouchID id);
+
+/* Print a debug message for a nonexistent touch */
+extern int SDL_TouchNotFoundError(SDL_TouchID id);
+
+#endif /* _SDL_touch_c_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/events/scancodes_win32.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/scancodes_win32.h	Sun Aug 22 13:45:56 2010 -0700
@@ -203,14 +203,14 @@
     /*  173, 0xad */    SDL_SCANCODE_AUDIOMUTE,
     /*  174, 0xae */    SDL_SCANCODE_VOLUMEDOWN,
     /*  175, 0xaf */    SDL_SCANCODE_VOLUMEUP,
-    /*  176, 0xb0 */    SDL_SCANCODE_UNKNOWN,
-    /*  177, 0xb1 */    SDL_SCANCODE_KP_000,
-    /*  178, 0xb2 */    SDL_SCANCODE_KP_EQUALS,
-    /*  179, 0xb3 */    SDL_SCANCODE_KP_00,
-    /*  180, 0xb4 */    SDL_SCANCODE_UNKNOWN,
-    /*  181, 0xb5 */    SDL_SCANCODE_UNKNOWN,
-    /*  182, 0xb6 */    SDL_SCANCODE_UNKNOWN,
-    /*  183, 0xb7 */    SDL_SCANCODE_UNKNOWN,
+    /*  176, 0xb0 */    SDL_SCANCODE_AUDIONEXT,
+    /*  177, 0xb1 */    SDL_SCANCODE_AUDIOPREV,
+    /*  178, 0xb2 */    SDL_SCANCODE_AUDIOSTOP,
+    /*  179, 0xb3 */    SDL_SCANCODE_AUDIOPLAY,
+    /*  180, 0xb4 */    SDL_SCANCODE_MAIL,
+    /*  181, 0xb5 */    SDL_SCANCODE_MEDIASELECT,
+    /*  182, 0xb6 */    SDL_SCANCODE_UNKNOWN, /* VK_LAUNCH_APP1 */
+    /*  183, 0xb7 */    SDL_SCANCODE_UNKNOWN, /* VK_LAUNCH_APP2 */
     /*  184, 0xb8 */    SDL_SCANCODE_UNKNOWN,
     /*  185, 0xb9 */    SDL_SCANCODE_UNKNOWN,
     /*  186, 0xba */    SDL_SCANCODE_SEMICOLON,
--- a/src/events/scancodes_xfree86.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/events/scancodes_xfree86.h	Sun Aug 22 13:45:56 2010 -0700
@@ -262,24 +262,24 @@
     /*  81 */   SDL_SCANCODE_KP_3,
     /*  82 */   SDL_SCANCODE_KP_0,
     /*  83 */   SDL_SCANCODE_KP_PERIOD,
-    /*  84 */   SDL_SCANCODE_SYSREQ,		/* ???? */
-    /*  85 */   SDL_SCANCODE_MODE,			/* ???? */
+    /*  84 */   SDL_SCANCODE_SYSREQ,    /* ???? */
+    /*  85 */   SDL_SCANCODE_MODE,      /* ???? */
     /*  86 */   SDL_SCANCODE_NONUSBACKSLASH,
     /*  87 */   SDL_SCANCODE_F11,
     /*  88 */   SDL_SCANCODE_F12,
     /*  89 */   SDL_SCANCODE_UNKNOWN,
-    /*  90 */   SDL_SCANCODE_UNKNOWN,
-    /*  91 */   SDL_SCANCODE_UNKNOWN,
-    /*  92 */   SDL_SCANCODE_UNKNOWN,
-    /*  93 */   SDL_SCANCODE_UNKNOWN,
-    /*  94 */   SDL_SCANCODE_UNKNOWN,
+    /*  90 */   SDL_SCANCODE_UNKNOWN,   /* Katakana */
+    /*  91 */   SDL_SCANCODE_UNKNOWN,   /* Hiragana */
+    /*  92 */   SDL_SCANCODE_UNKNOWN,   /* Henkan_Mode */
+    /*  93 */   SDL_SCANCODE_UNKNOWN,   /* Hiragana_Katakana */
+    /*  94 */   SDL_SCANCODE_UNKNOWN,   /* Muhenkan */
     /*  95 */   SDL_SCANCODE_UNKNOWN,
-    /*  96 */   SDL_SCANCODE_UNKNOWN,
+    /*  96 */   SDL_SCANCODE_KP_ENTER,
     /*  97 */   SDL_SCANCODE_RCTRL,
     /*  98 */   SDL_SCANCODE_KP_DIVIDE,
-    /*  99 */   SDL_SCANCODE_UNKNOWN,
-    /* 100 */   SDL_SCANCODE_RALT,	 /* ISO_Level3_Shift, ALTGR, RALT */
-    /* 101 */   SDL_SCANCODE_UNKNOWN,
+    /*  99 */   SDL_SCANCODE_PRINTSCREEN,
+    /* 100 */   SDL_SCANCODE_RALT,      /* ISO_Level3_Shift, ALTGR, RALT */
+    /* 101 */   SDL_SCANCODE_UNKNOWN,   /* Linefeed */
     /* 102 */   SDL_SCANCODE_HOME,
     /* 103 */   SDL_SCANCODE_UP,
     /* 104 */   SDL_SCANCODE_PAGEUP,
@@ -291,40 +291,132 @@
     /* 110 */   SDL_SCANCODE_INSERT,
     /* 111 */   SDL_SCANCODE_DELETE,
     /* 112 */   SDL_SCANCODE_UNKNOWN,
-    /* 113 */   SDL_SCANCODE_UNKNOWN,
-    /* 114 */   SDL_SCANCODE_UNKNOWN,
-    /* 115 */   SDL_SCANCODE_UNKNOWN,
-    /* 116 */   SDL_SCANCODE_UNKNOWN,
-    /* 117 */   SDL_SCANCODE_UNKNOWN,
-    /* 118 */   SDL_SCANCODE_UNKNOWN,
-    /* 119 */   SDL_SCANCODE_UNKNOWN,
-    /* 120 */   SDL_SCANCODE_UNKNOWN,
-    /* 121 */ 	SDL_SCANCODE_PAUSE,
-    /* 122 */   SDL_SCANCODE_UNKNOWN,
-    /* 123 */   SDL_SCANCODE_UNKNOWN,
+    /* 113 */   SDL_SCANCODE_MUTE,
+    /* 114 */   SDL_SCANCODE_VOLUMEDOWN,
+    /* 115 */   SDL_SCANCODE_VOLUMEUP,
+    /* 116 */   SDL_SCANCODE_POWER,
+    /* 117 */   SDL_SCANCODE_KP_EQUALS,
+    /* 118 */   SDL_SCANCODE_UNKNOWN,   /* plusminus */
+    /* 119 */   SDL_SCANCODE_PAUSE,
+    /* 120 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchA */
+    /* 121 */   SDL_SCANCODE_UNKNOWN,	/* KP_Decimal */
+    /* 122 */   SDL_SCANCODE_UNKNOWN,   /* Hangul */
+    /* 123 */   SDL_SCANCODE_UNKNOWN,   /* Hangul_Hanja */
     /* 124 */   SDL_SCANCODE_UNKNOWN,
-    /* 125 */  SDL_SCANCODE_LGUI,
-    /* 126 */  SDL_SCANCODE_RGUI,
-    /* 127 */  SDL_SCANCODE_APPLICATION,
-    /* 128 */  SDL_SCANCODE_UNKNOWN,
-    /* 129 */  SDL_SCANCODE_UNKNOWN,
-    /* 130 */  SDL_SCANCODE_UNKNOWN,
-    /* 131 */  SDL_SCANCODE_UNKNOWN,
-    /* 132 */  SDL_SCANCODE_UNKNOWN,
-    /* 133 */  SDL_SCANCODE_UNKNOWN,
-    /* 134 */  SDL_SCANCODE_UNKNOWN,
-    /* 135 */  SDL_SCANCODE_UNKNOWN,
-    /* 136 */  SDL_SCANCODE_UNKNOWN,
-    /* 137 */  SDL_SCANCODE_UNKNOWN,
-    /* 138 */  SDL_SCANCODE_UNKNOWN,
-    /* 139 */  SDL_SCANCODE_UNKNOWN,
-    /* 140 */  SDL_SCANCODE_UNKNOWN,
-    /* 141 */  SDL_SCANCODE_UNKNOWN,
-    /* 142 */  SDL_SCANCODE_UNKNOWN,
-    /* 143 */  SDL_SCANCODE_UNKNOWN,
-    /* 144 */  SDL_SCANCODE_UNKNOWN,
-    /* 145 */  SDL_SCANCODE_UNKNOWN,
-    /* 146 */  SDL_SCANCODE_UNKNOWN,
+    /* 125 */   SDL_SCANCODE_LGUI,
+    /* 126 */   SDL_SCANCODE_RGUI,
+    /* 127 */   SDL_SCANCODE_APPLICATION,
+    /* 128 */   SDL_SCANCODE_CANCEL,
+    /* 129 */   SDL_SCANCODE_AGAIN,
+    /* 130 */   SDL_SCANCODE_UNKNOWN,   /* SunProps */
+    /* 131 */   SDL_SCANCODE_UNDO,
+    /* 132 */   SDL_SCANCODE_UNKNOWN,   /* SunFront */
+    /* 133 */   SDL_SCANCODE_COPY,
+    /* 134 */   SDL_SCANCODE_UNKNOWN,   /* SunOpen */
+    /* 135 */   SDL_SCANCODE_PASTE,
+    /* 136 */   SDL_SCANCODE_FIND,
+    /* 137 */   SDL_SCANCODE_CUT,
+    /* 138 */   SDL_SCANCODE_HELP,
+    /* 139 */   SDL_SCANCODE_UNKNOWN,   /* XF86MenuKB */
+    /* 140 */   SDL_SCANCODE_CALCULATOR,
+    /* 141 */   SDL_SCANCODE_UNKNOWN,
+    /* 142 */   SDL_SCANCODE_SLEEP,
+    /* 143 */   SDL_SCANCODE_UNKNOWN,   /* XF86WakeUp */
+    /* 144 */   SDL_SCANCODE_UNKNOWN,   /* XF86Explorer */
+    /* 145 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
+    /* 146 */   SDL_SCANCODE_UNKNOWN,
+    /* 147 */   SDL_SCANCODE_UNKNOWN,   /* XF86Xfer */
+    /* 148 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch1 */
+    /* 149 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch2 */
+    /* 150 */   SDL_SCANCODE_WWW,
+    /* 151 */   SDL_SCANCODE_UNKNOWN,   /* XF86DOS */
+    /* 152 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScreenSaver */
+    /* 153 */   SDL_SCANCODE_UNKNOWN,
+    /* 154 */   SDL_SCANCODE_UNKNOWN,   /* XF86RotateWindows */
+    /* 155 */   SDL_SCANCODE_MAIL,
+    /* 156 */   SDL_SCANCODE_UNKNOWN,   /* XF86Favorites */
+    /* 157 */   SDL_SCANCODE_COMPUTER,
+    /* 158 */   SDL_SCANCODE_AC_BACK,
+    /* 159 */   SDL_SCANCODE_AC_FORWARD,
+    /* 160 */   SDL_SCANCODE_UNKNOWN,
+    /* 161 */   SDL_SCANCODE_EJECT,
+    /* 162 */   SDL_SCANCODE_EJECT,
+    /* 163 */   SDL_SCANCODE_AUDIONEXT,
+    /* 164 */   SDL_SCANCODE_AUDIOPLAY,
+    /* 165 */   SDL_SCANCODE_AUDIOPREV,
+    /* 166 */   SDL_SCANCODE_AUDIOSTOP,
+    /* 167 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioRecord */
+    /* 168 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioRewind */
+    /* 169 */   SDL_SCANCODE_UNKNOWN,   /* XF86Phone */
+    /* 170 */   SDL_SCANCODE_UNKNOWN,
+    /* 171 */   SDL_SCANCODE_UNKNOWN,   /* XF86Tools */
+    /* 172 */   SDL_SCANCODE_AC_HOME,
+    /* 173 */   SDL_SCANCODE_AC_REFRESH,
+    /* 174 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
+    /* 175 */   SDL_SCANCODE_UNKNOWN,
+    /* 176 */   SDL_SCANCODE_UNKNOWN,
+    /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
+    /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
+    /* 179 */   SDL_SCANCODE_UNKNOWN,   /* parenleft */
+    /* 180 */   SDL_SCANCODE_UNKNOWN,   /* parenright */
+    /* 181 */   SDL_SCANCODE_UNKNOWN,   /* XF86New */
+    /* 182 */   SDL_SCANCODE_AGAIN,
+    /* 183 */   SDL_SCANCODE_UNKNOWN,   /* XF86Tools */
+    /* 184 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch5 */
+    /* 185 */   SDL_SCANCODE_UNKNOWN,   /* XF86MenuKB */
+    /* 186 */   SDL_SCANCODE_UNKNOWN,
+    /* 187 */   SDL_SCANCODE_UNKNOWN,
+    /* 188 */   SDL_SCANCODE_UNKNOWN,
+    /* 189 */   SDL_SCANCODE_UNKNOWN,
+    /* 190 */   SDL_SCANCODE_UNKNOWN,
+    /* 191 */   SDL_SCANCODE_UNKNOWN,
+    /* 192 */   SDL_SCANCODE_UNKNOWN,   /* XF86TouchpadToggle */
+    /* 193 */   SDL_SCANCODE_UNKNOWN,
+    /* 194 */   SDL_SCANCODE_UNKNOWN,
+    /* 195 */   SDL_SCANCODE_MODE,
+    /* 196 */   SDL_SCANCODE_UNKNOWN,
+    /* 197 */   SDL_SCANCODE_UNKNOWN,
+    /* 198 */   SDL_SCANCODE_UNKNOWN,
+    /* 199 */   SDL_SCANCODE_UNKNOWN,
+    /* 200 */   SDL_SCANCODE_AUDIOPLAY,
+    /* 201 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioPause */
+    /* 202 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch3 */
+    /* 203 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch4 */
+    /* 204 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchB */
+    /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
+    /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
+    /* 207 */   SDL_SCANCODE_AUDIOPLAY,
+    /* 208 */   SDL_SCANCODE_AUDIONEXT,
+    /* 209 */   SDL_SCANCODE_UNKNOWN,
+    /* 210 */   SDL_SCANCODE_PRINTSCREEN,
+    /* 211 */   SDL_SCANCODE_UNKNOWN,
+    /* 212 */   SDL_SCANCODE_UNKNOWN,   /* XF86WebCam */
+    /* 213 */   SDL_SCANCODE_UNKNOWN,
+    /* 214 */   SDL_SCANCODE_UNKNOWN,
+    /* 215 */   SDL_SCANCODE_MAIL,
+    /* 216 */   SDL_SCANCODE_UNKNOWN,
+    /* 217 */   SDL_SCANCODE_AC_SEARCH,
+    /* 218 */   SDL_SCANCODE_UNKNOWN,
+    /* 219 */   SDL_SCANCODE_UNKNOWN,   /* XF86Finance */
+    /* 220 */   SDL_SCANCODE_UNKNOWN,
+    /* 221 */   SDL_SCANCODE_UNKNOWN,   /* XF86Shop */
+    /* 222 */   SDL_SCANCODE_UNKNOWN,
+    /* 223 */   SDL_SCANCODE_STOP,
+    /* 224 */   SDL_SCANCODE_BRIGHTNESSDOWN,
+    /* 225 */   SDL_SCANCODE_BRIGHTNESSUP,
+    /* 226 */   SDL_SCANCODE_MEDIASELECT,
+    /* 227 */   SDL_SCANCODE_DISPLAYSWITCH,
+    /* 228 */   SDL_SCANCODE_KBDILLUMTOGGLE,
+    /* 229 */   SDL_SCANCODE_KBDILLUMDOWN,
+    /* 230 */   SDL_SCANCODE_KBDILLUMUP,
+    /* 231 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
+    /* 232 */   SDL_SCANCODE_UNKNOWN,   /* XF86Reply */
+    /* 233 */   SDL_SCANCODE_UNKNOWN,   /* XF86MailForward */
+    /* 234 */   SDL_SCANCODE_UNKNOWN,   /* XF86Save */
+    /* 235 */   SDL_SCANCODE_UNKNOWN,   /* XF86Documents */
+    /* 236 */   SDL_SCANCODE_UNKNOWN,   /* XF86Battery */
+    /* 237 */   SDL_SCANCODE_UNKNOWN,   /* XF86Bluetooth */
+    /* 238 */   SDL_SCANCODE_UNKNOWN,   /* XF86WLAN */
 };
 
 /* *INDENT-ON* */
--- a/src/file/cocoa/SDL_rwopsbundlesupport.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/file/cocoa/SDL_rwopsbundlesupport.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,8 @@
 #ifdef __APPLE__
 #import <Foundation/Foundation.h>
 
+#include "SDL_rwopsbundlesupport.h"
+
 /* For proper OS X applications, the resources are contained inside the application bundle.
  So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
  Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
--- a/src/haptic/SDL_haptic.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/haptic/SDL_haptic.c	Sun Aug 22 13:45:56 2010 -0700
@@ -22,6 +22,7 @@
 #include "SDL_config.h"
 
 #include "SDL_syshaptic.h"
+#include "SDL_haptic_c.h"
 #include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/haptic/SDL_haptic_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,26 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+
+extern int SDL_HapticInit(void);
+extern void SDL_HapticQuit(void);
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/haptic/linux/SDL_syshaptic.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/haptic/linux/SDL_syshaptic.c	Sun Aug 22 13:45:56 2010 -0700
@@ -254,8 +254,6 @@
 static int
 SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd)
 {
-    const char *name;
-
     /* Allocate the hwdata */
     haptic->hwdata = (struct haptic_hwdata *)
         SDL_malloc(sizeof(*haptic->hwdata));
--- a/src/haptic/nds/SDL_syshaptic.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/haptic/nds/SDL_syshaptic.c	Sun Aug 22 13:45:56 2010 -0700
@@ -43,35 +43,35 @@
 } NDS_HapticData;
 
 
-
void
-NDS_EZF_OpenNorWrite() 
+void
+NDS_EZF_OpenNorWrite() 
 {
-    
GBA_BUS[0x0FF0000] = 0xD200;
-    
GBA_BUS[0x0000000] = 0x1500;
-    
GBA_BUS[0x0010000] = 0xD200;
-    
GBA_BUS[0x0020000] = 0x1500;
-    
GBA_BUS[0x0E20000] = 0x1500;
-    
GBA_BUS[0x0FE0000] = 0x1500;
-
} 


void
+    GBA_BUS[0x0FF0000] = 0xD200;
+    GBA_BUS[0x0000000] = 0x1500;
+    GBA_BUS[0x0010000] = 0xD200;
+    GBA_BUS[0x0020000] = 0x1500;
+    GBA_BUS[0x0E20000] = 0x1500;
+    GBA_BUS[0x0FE0000] = 0x1500;
+} 

void
 
-NDS_EZF_CloseNorWrite() 
+NDS_EZF_CloseNorWrite() 
 {
-    
GBA_BUS[0x0FF0000] = 0xD200;
-    
GBA_BUS[0x0000000] = 0x1500;
-    
GBA_BUS[0x0010000] = 0xD200;
-    
GBA_BUS[0x0020000] = 0x1500;
-    
GBA_BUS[0x0E20000] = 0xD200;
-    
GBA_BUS[0x0FE0000] = 0x1500;
-
}
+    GBA_BUS[0x0FF0000] = 0xD200;
+    GBA_BUS[0x0000000] = 0x1500;
+    GBA_BUS[0x0010000] = 0xD200;
+    GBA_BUS[0x0020000] = 0x1500;
+    GBA_BUS[0x0E20000] = 0xD200;
+    GBA_BUS[0x0FE0000] = 0x1500;
+}
 
 void
 NDS_EZF_ChipReset()
 {
-    
GBA_BUS[0x0000] = 0x00F0;
-    
GBA_BUS[0x1000] = 0x00F0;
-} 
uint32 NDS_EZF_IsPresent() 
+    GBA_BUS[0x0000] = 0x00F0;
+    GBA_BUS[0x1000] = 0x00F0;
+} uint32 NDS_EZF_IsPresent() 
 {
-    
vuint16 id1, id2;
+    vuint16 id1, id2;
 
     NDS_EZF_OpenNorWrite();
 
@@ -81,35 +81,35 @@
     GBA_BUS[0x1555] = 0x00AA;
     GBA_BUS[0x12AA] = 0x0055;
     GBA_BUS[0x1555] = 0x0090;
-    
id1 = GBA_BUS[0x0001];
-    
id2 = GBA_BUS[0x1001];
-    
if ((id1 != 0x227E) || (id2 != 0x227E)) {
+    id1 = GBA_BUS[0x0001];
+    id2 = GBA_BUS[0x1001];
+    if ((id1 != 0x227E) || (id2 != 0x227E)) {
         NDS_EZF_CloseNorWrite();
-        
return 0;
+        return 0;
     }
-    

id1 = GBA_BUS[0x000E];
-    
id2 = GBA_BUS[0x100E];
+    id1 = GBA_BUS[0x000E];
+    id2 = GBA_BUS[0x100E];
 
     NDS_EZF_CloseNorWrite();
-    
if (id1 == 0x2218 && id2 == 0x2218) {
-        
return 1;
+    if (id1 == 0x2218 && id2 == 0x2218) {
+        return 1;
     }
-    
return 0;
-
}
-
void
-NDS_EZF_SetShake(u8 pos) 
+    return 0;
+}
+void
+NDS_EZF_SetShake(u8 pos) 
 {
     u16 data = ((pos % 3) | 0x00F0);
-    
GBA_BUS[0x0FF0000] = 0xD200;
-    
GBA_BUS[0x0000000] = 0x1500;
-    
GBA_BUS[0x0010000] = 0xD200;
-    
GBA_BUS[0x0020000] = 0x1500;
-    
GBA_BUS[0x0F10000] = data;
-    
GBA_BUS[0x0FE0000] = 0x1500;
+    GBA_BUS[0x0FF0000] = 0xD200;
+    GBA_BUS[0x0000000] = 0x1500;
+    GBA_BUS[0x0010000] = 0xD200;
+    GBA_BUS[0x0020000] = 0x1500;
+    GBA_BUS[0x0F10000] = data;
+    GBA_BUS[0x0FE0000] = 0x1500;
 
     GBA_BUS[0] = 0x0000;        /* write any value for vibration. */
     GBA_BUS[0] = 0x0002;
-
}
+}
 
 static int
 SDL_SYS_LogicError(void)
--- a/src/joystick/SDL_joystick_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/joystick/SDL_joystick_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -27,6 +27,10 @@
 /* The number of available joysticks on the system */
 extern Uint8 SDL_numjoysticks;
 
+/* Initialization and shutdown functions */
+extern int SDL_JoystickInit(void);
+extern void SDL_JoystickQuit(void);
+
 /* Internal event queueing functions */
 extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
                                    Uint8 axis, Sint16 value);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/joystick/android/SDL_sysjoystick.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,106 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_ANDROID
+
+/* This is the system specific header for the SDL joystick API */
+#include <stdio.h>              /* For the definition of NULL */
+
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+extern float fLastAccelerometer[3];
+
+const char *accelerometerName = "Android accelerometer";
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks.  Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int
+SDL_SYS_JoystickInit(void)
+{
+    SDL_numjoysticks = 1;
+    
+return (1);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *
+SDL_SYS_JoystickName(int index)
+{
+    if (!index)
+        return accelerometerName;
+    SDL_SetError("No joystick available with that index");
+    return (NULL);
+}
+
+/* Function to open a joystick for use.
+   The joystick to open is specified by the index field of the joystick.
+   This should fill the nbuttons and naxes fields of the joystick structure.
+   It returns 0, or -1 if there is an error.
+ */
+int
+SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
+{
+    joystick->nbuttons = 0;
+    joystick->nhats = 0;
+    joystick->nballs = 0;
+    joystick->naxes = 3;
+    joystick->name = accelerometerName;
+    return 0;
+}
+
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+    void
+SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
+{
+    int i=0; 
+    for(i=0;i<3;i++){
+        SDL_PrivateJoystickAxis(joystick, i, fLastAccelerometer[i]);
+    }
+}
+
+/* Function to close a joystick after use */
+void
+SDL_SYS_JoystickClose(SDL_Joystick * joystick)
+{
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void
+SDL_SYS_JoystickQuit(void)
+{
+}
+
+#endif /* SDL_JOYSTICK_NDS */
--- a/src/joystick/bsd/SDL_sysjoystick.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Sun Aug 22 13:45:56 2010 -0700
@@ -59,7 +59,7 @@
 #include <libusbhid.h>
 #endif
 
-#ifdef __FREEBSD__
+#ifdef defined(__FREEBSD__) || defined(__FreeBSD_kernel__)
 #ifndef __DragonFly__
 #include <osreldate.h>
 #endif
@@ -78,7 +78,7 @@
 #define MAX_JOY_JOYS	2
 #define MAX_JOYS	(MAX_UHID_JOYS + MAX_JOY_JOYS)
 
-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
+#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) && false
 struct usb_ctl_report {
     int     ucr_report;
     u_char  ucr_data[1024]; /* filled data size will vary */
@@ -149,7 +149,7 @@
 static int report_alloc(struct report *, struct report_desc *, int);
 static void report_free(struct report *);
 
-#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
+#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) || defined(__FreeBSD_kernel__)
 #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
 #else
 #define REP_BUF_DATA(rep) ((rep)->buf->data)
@@ -308,7 +308,7 @@
         goto usberr;
     }
     rep = &hw->inreport;
-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
+#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__)
     rep->rid = hid_get_report_id(fd);
     if (rep->rid < 0) {
 #else
@@ -324,7 +324,7 @@
                      hw->path);
         goto usberr;
     }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
     hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
 #else
     hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
@@ -409,7 +409,7 @@
     int nbutton, naxe = -1;
     Sint32 v;
 
-#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
+#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
     struct joystick gameport;
     static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0;
 
@@ -466,7 +466,7 @@
     if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
         return;
     }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
     hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
 #else
     hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
--- a/src/joystick/nds/SDL_sysjoystick.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/joystick/nds/SDL_sysjoystick.c	Sun Aug 22 13:45:56 2010 -0700
@@ -45,7 +45,7 @@
 SDL_SYS_JoystickInit(void)
 {
     SDL_numjoysticks = 1;
-    
return (1);
+    return (1);
 }
 
 /* Function to get the device-dependent name of a joystick */
@@ -73,7 +73,7 @@
     return 0;
 }
 
-
+
 /* Function to update the state of a joystick - called as a device poll.
  * This function shouldn't update the joystick structure directly,
  * but instead should call SDL_PrivateJoystick*() to deliver events
@@ -84,8 +84,8 @@
 {
     u32 keysd, keysu;
     int magnitude = 16384;
-    
-        /*scanKeys(); - this is done in PumpEvents, because touch uses it too */ 
+    
+        /*scanKeys(); - this is done in PumpEvents, because touch uses it too */ 
         keysd = keysDown();
     keysu = keysUp();
 
@@ -101,61 +101,61 @@
     if ((keysd & KEY_RIGHT)) {
         SDL_PrivateJoystickAxis(joystick, 0, magnitude);
     }
-    
if ((keysu & (KEY_UP | KEY_DOWN))) {
+    if ((keysu & (KEY_UP | KEY_DOWN))) {
         SDL_PrivateJoystickAxis(joystick, 1, 0);
     }
-    
if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
+    if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
         SDL_PrivateJoystickAxis(joystick, 0, 0);
     }
-    
if ((keysd & KEY_A)) {
+    if ((keysd & KEY_A)) {
         SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED);
     }
-    
if ((keysd & KEY_B)) {
+    if ((keysd & KEY_B)) {
         SDL_PrivateJoystickButton(joystick, 1, SDL_PRESSED);
     }
-    
if ((keysd & KEY_X)) {
+    if ((keysd & KEY_X)) {
         SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED);
     }
-    
if ((keysd & KEY_Y)) {
+    if ((keysd & KEY_Y)) {
         SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED);
     }
-    
if ((keysd & KEY_L)) {
+    if ((keysd & KEY_L)) {
         SDL_PrivateJoystickButton(joystick, 4, SDL_PRESSED);
     }
-    
if ((keysd & KEY_R)) {
+    if ((keysd & KEY_R)) {
         SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED);
     }
-    
if ((keysd & KEY_SELECT)) {
+    if ((keysd & KEY_SELECT)) {
         SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED);
     }
-    
if ((keysd & KEY_START)) {
+    if ((keysd & KEY_START)) {
         SDL_PrivateJoystickButton(joystick, 7, SDL_PRESSED);
     }
-    
if ((keysu & KEY_A)) {
+    if ((keysu & KEY_A)) {
         SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED);
     }
-    
if ((keysu & KEY_B)) {
+    if ((keysu & KEY_B)) {
         SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED);
     }
-    
if ((keysu & KEY_X)) {
+    if ((keysu & KEY_X)) {
         SDL_PrivateJoystickButton(joystick, 2, SDL_RELEASED);
     }
-    
if ((keysu & KEY_Y)) {
+    if ((keysu & KEY_Y)) {
         SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED);
     }
-    
if ((keysu & KEY_L)) {
+    if ((keysu & KEY_L)) {
         SDL_PrivateJoystickButton(joystick, 4, SDL_RELEASED);
     }
-    
if ((keysu & KEY_R)) {
+    if ((keysu & KEY_R)) {
         SDL_PrivateJoystickButton(joystick, 5, SDL_RELEASED);
     }
-    
if ((keysu & KEY_SELECT)) {
+    if ((keysu & KEY_SELECT)) {
         SDL_PrivateJoystickButton(joystick, 6, SDL_RELEASED);
     }
-    
if ((keysu & KEY_START)) {
+    if ((keysu & KEY_START)) {
         SDL_PrivateJoystickButton(joystick, 7, SDL_RELEASED);
     }
-
}
+}
 
 /* Function to close a joystick after use */
 void
--- a/src/main/dummy/SDL_dummy_main.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/main/dummy/SDL_dummy_main.c	Sun Aug 22 13:45:56 2010 -0700
@@ -12,7 +12,10 @@
 #else
 /* Nothing to do on this platform */
 int
-SDL_main_stub_symbol()
+SDL_main_stub_symbol(void);
+
+int
+SDL_main_stub_symbol(void)
 {
     return 0;
 }
--- a/src/main/win32/SDL_win32_main.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/main/win32/SDL_win32_main.c	Sun Aug 22 13:45:56 2010 -0700
@@ -71,6 +71,7 @@
                 ++argc;
             }
             /* Skip over word */
+            lastp = bufp;
             while (*bufp && (*bufp != '"' || *lastp == '\\')) {
                 lastp = bufp;
                 ++bufp;
--- a/src/stdlib/SDL_string.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/stdlib/SDL_string.c	Sun Aug 22 13:45:56 2010 -0700
@@ -29,6 +29,21 @@
 #define SDL_isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
 #define SDL_islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
 
+#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
+#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
+
+int UTF8_TrailingBytes(unsigned char c)
+{
+    if (c >= 0xC0 && c<= 0xDF)
+        return 1;
+    else if (c >= 0xE0 && c <= 0xEF)
+        return 2;
+    else if (c >= 0xF0 && c <= 0xF4)
+        return 3;
+    else
+        return 0;
+}
+
 #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
 static size_t
 SDL_ScanLong(const char *text, int radix, long *valuep)
@@ -348,6 +363,33 @@
 }
 #endif
 
+#ifndef HAVE_WCSLCPY
+size_t
+SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen)
+{
+    size_t srclen = SDL_wcslen(src);
+    if (maxlen > 0) {
+        size_t len = SDL_min(srclen, maxlen - 1);
+        SDL_memcpy(dst, src, len * sizeof(wchar_t));
+        dst[len] = '\0';
+    }
+    return srclen;
+}
+#endif
+
+#ifndef HAVE_WCSLCAT
+size_t
+SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen)
+{
+    size_t dstlen = SDL_wcslen(dst);
+    size_t srclen = SDL_wcslen(src);
+    if (dstlen < maxlen) {
+        SDL_wcslcpy(dst + dstlen, src, maxlen - dstlen);
+    }
+    return dstlen + srclen;
+}
+#endif
+
 #ifndef HAVE_STRLCPY
 size_t
 SDL_strlcpy(char *dst, const char *src, size_t maxlen)
@@ -362,6 +404,38 @@
 }
 #endif
 
+size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes)
+{
+    size_t src_bytes = SDL_strlen(src);
+    size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
+    int i = 0;
+    char trailing_bytes = 0;
+    if (bytes)
+    {
+        unsigned char c = (unsigned char)src[bytes - 1];
+        if (UTF8_IsLeadByte(c))
+            --bytes;
+        else if (UTF8_IsTrailingByte(c))
+        {
+            for (i = bytes - 1; i != 0; --i)
+            {
+                c = (unsigned char)src[i];
+                trailing_bytes = UTF8_TrailingBytes(c);
+                if (trailing_bytes)
+                {
+                    if (bytes - i != trailing_bytes + 1)
+                        bytes = i;
+
+                    break;
+                }
+            }
+        }
+        SDL_memcpy(dst, src, bytes);
+    }
+    dst[bytes] = '\0';
+    return bytes;
+}
+
 #ifndef HAVE_STRLCAT
 size_t
 SDL_strlcat(char *dst, const char *src, size_t maxlen)
--- a/src/thread/SDL_thread.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/thread/SDL_thread.c	Sun Aug 22 13:45:56 2010 -0700
@@ -38,7 +38,7 @@
 static SDL_Thread **SDL_Threads = NULL;
 static SDL_mutex *thread_lock = NULL;
 
-int
+static int
 SDL_ThreadsInit(void)
 {
     int retval;
@@ -56,7 +56,7 @@
    clean up threads here.  If any threads are still running after this call,
    they will no longer have access to any per-thread data.
  */
-void
+static void
 SDL_ThreadsQuit(void)
 {
     SDL_mutex *mutex;
@@ -305,10 +305,4 @@
     return id;
 }
 
-void
-SDL_KillThread(SDL_Thread * thread)
-{
-    /* This is a no-op in SDL 1.3 and later. */
-}
-
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/win32/SDL_syssem.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/thread/win32/SDL_syssem.c	Sun Aug 22 13:45:56 2010 -0700
@@ -39,7 +39,7 @@
 #else
     HANDLE id;
 #endif
-    Uint32 volatile count;
+    LONG volatile count;
 };
 
 
@@ -143,7 +143,7 @@
         SDL_SetError("Passed a NULL sem");
         return 0;
     }
-    return sem->count;
+    return (Uint32)sem->count;
 }
 
 int
--- a/src/timer/SDL_systimer.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/timer/SDL_systimer.h	Sun Aug 22 13:45:56 2010 -0700
@@ -38,4 +38,5 @@
 
 /* Stop a previously started timer */
 extern void SDL_SYS_StopTimer(void);
+
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/unix/SDL_systimer.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/timer/unix/SDL_systimer.c	Sun Aug 22 13:45:56 2010 -0700
@@ -31,6 +31,7 @@
 #include <errno.h>
 
 #include "SDL_timer.h"
+#include "../SDL_systimer.h"
 #include "../SDL_timer_c.h"
 
 /* The clock_gettime provides monotonous time, so we should use it if
--- a/src/video/SDL_blit_slow.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_blit_slow.c	Sun Aug 22 13:45:56 2010 -0700
@@ -23,6 +23,7 @@
 
 #include "SDL_video.h"
 #include "SDL_blit.h"
+#include "SDL_blit_slow.h"
 
 /* The ONE TRUE BLITTER
  * This puppy has to handle all the unoptimized cases - yes, it's slow.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/SDL_clipboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,76 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include "SDL_clipboard.h"
+#include "SDL_sysvideo.h"
+
+
+int
+SDL_SetClipboardText(const char *text)
+{
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
+
+    if (!text) {
+        text = "";
+    }
+    if (_this->SetClipboardText) {
+        return _this->SetClipboardText(_this, text);
+    } else {
+        _this->clipboard_text = SDL_strdup(text);
+        return 0;
+    }
+}
+
+char *
+SDL_GetClipboardText(void)
+{
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
+
+    if (_this->GetClipboardText) {
+        return _this->GetClipboardText(_this);
+    } else {
+        const char *text = _this->clipboard_text;
+        if (!text) {
+            text = "";
+        }
+        return SDL_strdup(text);
+    }
+}
+
+SDL_bool
+SDL_HasClipboardText(void)
+{
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
+
+    if (_this->HasClipboardText) {
+        return _this->HasClipboardText(_this);
+    } else {
+        if (_this->clipboard_text) {
+            return SDL_TRUE;
+        } else {
+            return SDL_FALSE;
+        }
+    }
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/SDL_renderer_gles.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_renderer_gles.c	Sun Aug 22 13:45:56 2010 -0700
@@ -822,20 +822,25 @@
                maybe it'd be a good idea to keep a temp buffer around
                for this purpose rather than allocating it each time
              */
-            temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
-            temp_ptr = temp_buffer;
-            for (i = 0; i < rect->h; i++) {
-                SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
-                temp_ptr += rect->w * bpp;
-                pixels += pitch;
+            if( rect->x == 0 && rect->w * bpp == pitch ) {
+                temp_buffer = pixels; /* Updating whole texture, no need to reformat */
+            } else {
+                temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
+                temp_ptr = temp_buffer;
+                for (i = 0; i < rect->h; i++) {
+                    SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
+                    temp_ptr += rect->w * bpp;
+                    pixels += pitch;
+                }
             }
 
             data->glTexSubImage2D(texturedata->type, 0, rect->x, rect->y,
                                   rect->w, rect->h, texturedata->format,
                                   texturedata->formattype, temp_buffer);
 
-            SDL_free(temp_buffer);
-
+            if( temp_buffer != pixels ) {
+                SDL_free(temp_buffer);
+            }
         }
         SDL_ClearDirtyRects(&texturedata->dirty);
     }
--- a/src/video/SDL_renderer_sw.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_renderer_sw.c	Sun Aug 22 13:45:56 2010 -0700
@@ -26,6 +26,7 @@
 #include "SDL_pixels_c.h"
 #include "SDL_rect_c.h"
 #include "SDL_yuv_sw_c.h"
+#include "SDL_renderer_sw.h"
 
 
 /* SDL surface based renderer implementation */
@@ -794,7 +795,6 @@
               const SDL_Rect * srcrect, const SDL_Rect * dstrect)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Window *window = renderer->window;
     int status;
 
     if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
--- a/src/video/SDL_stretch.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_stretch.c	Sun Aug 22 13:45:56 2010 -0700
@@ -80,7 +80,7 @@
 
     int i;
     int pos, inc;
-    unsigned char *eip;
+    unsigned char *eip, *fence;
     unsigned char load, store;
 
     /* See if we need to regenerate the copy buffer */
@@ -116,14 +116,21 @@
     pos = 0x10000;
     inc = (src_w << 16) / dst_w;
     eip = copy_row;
+    fence = copy_row + sizeof(copy_row)-2;
     for (i = 0; i < dst_w; ++i) {
         while (pos >= 0x10000L) {
+            if (eip == fence) {
+                return -1;
+            }
             if (bpp == 2) {
                 *eip++ = PREFIX16;
             }
             *eip++ = load;
             pos -= 0x10000L;
         }
+        if (eip == fence) {
+            return -1;
+        }
         if (bpp == 2) {
             *eip++ = PREFIX16;
         }
@@ -132,11 +139,6 @@
     }
     *eip++ = RETURN;
 
-    /* Verify that we didn't overflow (too late!!!) */
-    if (eip > (copy_row + sizeof(copy_row))) {
-        SDL_SetError("Copy buffer overflow");
-        return (-1);
-    }
 #ifdef HAVE_MPROTECT
     /* Make the code executable but not writeable */
     if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) {
@@ -151,7 +153,7 @@
 #endif /* USE_ASM_STRETCH */
 
 #define DEFINE_COPY_ROW(name, type)			\
-void name(type *src, int src_w, type *dst, int dst_w)	\
+static void name(type *src, int src_w, type *dst, int dst_w)	\
 {							\
 	int i;						\
 	int pos, inc;					\
@@ -175,7 +177,7 @@
 /* *INDENT-ON* */
 
 /* The ASM code doesn't handle 24-bpp stretch blits */
-void
+static void
 copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
 {
     int i;
--- a/src/video/SDL_surface.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_surface.c	Sun Aug 22 13:45:56 2010 -0700
@@ -851,7 +851,7 @@
     /* Enable alpha blending by default if the new surface has an
      * alpha channel or alpha modulation */
     if ((surface->format->Amask && format->Amask) ||
-        (copy_flags & SDL_COPY_MODULATE_ALPHA)) {
+        (copy_flags & (SDL_COPY_COLORKEY|SDL_COPY_MODULATE_ALPHA))) {
         SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND);
     }
     if ((copy_flags & SDL_COPY_RLE_DESIRED) || (flags & SDL_RLEACCEL)) {
--- a/src/video/SDL_sysvideo.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_sysvideo.h	Sun Aug 22 13:45:56 2010 -0700
@@ -336,6 +336,11 @@
     void (*StopTextInput) (_THIS);
     void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
 
+    /* Clipboard */
+    int (*SetClipboardText) (_THIS, const char *text);
+    char * (*GetClipboardText) (_THIS);
+    SDL_bool (*HasClipboardText) (_THIS);
+
     /* * * */
     /* Data common to all drivers */
     SDL_bool suspend_screensaver;
@@ -345,6 +350,7 @@
     Uint8 window_magic;
     Uint8 texture_magic;
     Uint32 next_object_id;
+    char * clipboard_text;
 
     /* * * */
     /* Data used by the GL drivers */
@@ -414,9 +420,6 @@
 #if SDL_VIDEO_DRIVER_SVGALIB
 extern VideoBootStrap SVGALIB_bootstrap;
 #endif
-#if SDL_VIDEO_DRIVER_GAPI
-extern VideoBootStrap GAPI_bootstrap;
-#endif
 #if SDL_VIDEO_DRIVER_WIN32
 extern VideoBootStrap WIN32_bootstrap;
 #endif
@@ -447,11 +450,14 @@
 #if SDL_VIDEO_DRIVER_PANDORA
 extern VideoBootStrap PND_bootstrap;
 #endif
+#if SDL_VIDEO_DRIVER_ANDROID
+extern VideoBootStrap Android_bootstrap;
+#endif
 
 #define SDL_CurrentDisplay	(&_this->displays[_this->current_display])
 #define SDL_CurrentRenderer	(SDL_CurrentDisplay->current_renderer)
 
-extern SDL_VideoDevice *SDL_GetVideoDevice();
+extern SDL_VideoDevice *SDL_GetVideoDevice(void);
 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
 extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
--- a/src/video/SDL_video.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/SDL_video.c	Sun Aug 22 13:45:56 2010 -0700
@@ -67,9 +67,6 @@
 #if SDL_VIDEO_DRIVER_SVGALIB
     &SVGALIB_bootstrap,
 #endif
-#if SDL_VIDEO_DRIVER_GAPI
-    &GAPI_bootstrap,
-#endif
 #if SDL_VIDEO_DRIVER_WIN32
     &WIN32_bootstrap,
 #endif
@@ -100,6 +97,9 @@
 #if SDL_VIDEO_DRIVER_PANDORA
     &PND_bootstrap,
 #endif
+#if SDL_VIDEO_DRIVER_ANDROID
+    &Android_bootstrap,
+#endif
     NULL
 };
 
@@ -304,7 +304,7 @@
 }
 
 SDL_VideoDevice *
-SDL_GetVideoDevice()
+SDL_GetVideoDevice(void)
 {
     return _this;
 }
@@ -718,16 +718,6 @@
 }
 
 int
-SDL_SetDisplayMode(const SDL_DisplayMode * mode)
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return -1;
-    }
-    return SDL_SetDisplayModeForDisplay(SDL_CurrentDisplay, mode);
-}
-
-int
 SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)
 {
     CHECK_WINDOW_MAGIC(window, -1);
@@ -2843,6 +2833,10 @@
         SDL_free(_this->displays);
         _this->displays = NULL;
     }
+    if (_this->clipboard_text) {
+        SDL_free(_this->clipboard_text);
+        _this->clipboard_text = NULL;
+    }
     _this->free(_this);
     _this = NULL;
 }
@@ -3277,7 +3271,7 @@
 void
 SDL_GL_DeleteContext(SDL_GLContext context)
 {
-    if (!_this || !context) {
+    if (!_this || !_this->gl_data || !context) {
         return;
     }
     _this->GL_MakeCurrent(_this, NULL, NULL);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidevents.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,85 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* Being a null driver, there's no event stream. We just define stubs for
+   most of the API. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_androidevents.h"
+
+void Android_InitEvents(){
+
+    SDL_Keyboard keyboard;
+
+    SDL_zero(keyboard);
+    SDL_AddKeyboard(&keyboard, -1);
+
+    SDLKey keymap[SDL_NUM_SCANCODES];
+
+    /* Add default scancode to key mapping */
+    SDL_GetDefaultKeymap(keymap);
+    SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
+
+
+}
+
+void
+Android_PumpEvents(_THIS)
+{
+
+    //scanKeys();
+    /* TODO: defer click-age */
+    /*
+    if (keysDown() & KEY_TOUCH) {
+        SDL_SendMouseButton(0, SDL_PRESSED, 0);
+    } else if (keysUp() & KEY_TOUCH) {
+        SDL_SendMouseButton(0, SDL_RELEASED, 0);
+    }
+    if (keysHeld() & KEY_TOUCH) {
+        touchPosition t = touchReadXY();
+        SDL_SendMouseMotion(0, 0, t.px, t.py, 1);       
+    }
+    */
+}
+
+
+void Android_OnResize(int width, int height, int format){
+
+}
+
+int
+Android_OnKeyDown(int keycode){
+    return SDL_SendKeyboardKey(0, SDL_PRESSED, (SDL_scancode)keycode);
+}
+
+int
+Android_OnKeyUp(int keycode){
+    return SDL_SendKeyboardKey(0, SDL_RELEASED, (SDL_scancode)keycode);
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidevents.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,29 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include "SDL_androidvideo.h"
+
+extern void Android_PumpEvents(_THIS);
+extern void Android_InitEvents();
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidgl.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,96 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* Android SDL video driver implementation
+*/
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_androidvideo.h"
+#include "SDL_androidevents.h"
+#include "SDL_androidrender.h"
+
+#include <android/log.h>
+
+#include <pthread.h>
+
+/*
+These things are in the JNI android support
+*/
+extern void Android_CreateContext();
+extern void Android_Render();
+
+/* GL functions */
+int Android_GL_LoadLibrary(_THIS, const char *path){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
+	return 0;
+}
+
+void *Android_GL_GetProcAddress(_THIS, const char *proc){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
+	return 0;
+}
+
+void Android_GL_UnloadLibrary(_THIS){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
+}
+
+/*
+int *Android_GL_GetVisual(_THIS, Display * display, int screen){
+	__android_log_print(ANDROID_LOG_INFO, "SDL","[STUB] GL_GetVisual\n");
+	return 0;
+}
+*/
+
+SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
+	Android_CreateContext();
+	return 1;
+}
+
+int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
+                              SDL_GLContext context){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_MakeCurrent\n");
+	return 0;
+}
+
+int Android_GL_SetSwapInterval(_THIS, int interval){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
+	return 0;
+}
+
+int Android_GL_GetSwapInterval(_THIS){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
+	return 0;
+}
+
+void Android_GL_SwapWindow(_THIS, SDL_Window * window){
+	Android_Render();
+}
+
+void Android_GL_DeleteContext(_THIS, SDL_GLContext context){
+	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidrender.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,344 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_yuv_sw_c.h"
+#include "../SDL_renderer_sw.h"
+
+
+/* SDL surface based renderer implementation */
+
+static SDL_Renderer *Android_CreateRenderer(SDL_Window * window,
+                                              Uint32 flags);
+static int Android_RenderDrawPoints(SDL_Renderer * renderer,
+                                      const SDL_Point * points, int count);
+static int Android_RenderDrawLines(SDL_Renderer * renderer,
+                                     const SDL_Point * points, int count);
+static int Android_RenderDrawRects(SDL_Renderer * renderer,
+                                     const SDL_Rect ** rects, int count);
+static int Android_RenderFillRects(SDL_Renderer * renderer,
+                                     const SDL_Rect ** rects, int count);
+static int Android_RenderCopy(SDL_Renderer * renderer,
+                                SDL_Texture * texture,
+                                const SDL_Rect * srcrect,
+                                const SDL_Rect * dstrect);
+static int Android_RenderReadPixels(SDL_Renderer * renderer,
+                                      const SDL_Rect * rect,
+                                      Uint32 format,
+                                      void * pixels, int pitch);
+static int Android_RenderWritePixels(SDL_Renderer * renderer,
+                                       const SDL_Rect * rect,
+                                       Uint32 format,
+                                       const void * pixels, int pitch);
+static void Android_RenderPresent(SDL_Renderer * renderer);
+static void Android_DestroyRenderer(SDL_Renderer * renderer);
+
+
+SDL_RenderDriver Android_RenderDriver = {
+    Android_CreateRenderer,
+    {
+     "dummy",
+     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
+      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
+      SDL_RENDERER_PRESENTDISCARD),
+     }
+};
+
+typedef struct
+{
+    int current_screen;
+    SDL_Surface *screens[3];
+} Android_RenderData;
+
+SDL_Renderer *
+Android_CreateRenderer(SDL_Window * window, Uint32 flags)
+{
+    SDL_VideoDisplay *display = window->display;
+    SDL_DisplayMode *displayMode = &display->current_mode;
+    SDL_Renderer *renderer;
+    Android_RenderData *data;
+    int i, n;
+    int bpp;
+    Uint32 Rmask, Gmask, Bmask, Amask;
+
+    if (!SDL_PixelFormatEnumToMasks
+        (displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
+        SDL_SetError("Unknown display format");
+        return NULL;
+    }
+
+    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
+    if (!renderer) {
+        SDL_OutOfMemory();
+        return NULL;
+    }
+
+    data = (Android_RenderData *) SDL_malloc(sizeof(*data));
+    if (!data) {
+        Android_DestroyRenderer(renderer);
+        SDL_OutOfMemory();
+        return NULL;
+    }
+    SDL_zerop(data);
+
+    renderer->RenderDrawPoints = Android_RenderDrawPoints;
+    renderer->RenderDrawLines = Android_RenderDrawLines;
+    renderer->RenderDrawRects = Android_RenderDrawRects;
+    renderer->RenderFillRects = Android_RenderFillRects;
+    renderer->RenderCopy = Android_RenderCopy;
+    renderer->RenderReadPixels = Android_RenderReadPixels;
+    renderer->RenderWritePixels = Android_RenderWritePixels;
+    renderer->RenderPresent = Android_RenderPresent;
+    renderer->DestroyRenderer = Android_DestroyRenderer;
+    renderer->info.name = Android_RenderDriver.info.name;
+    renderer->info.flags = 0;
+    renderer->window = window;
+    renderer->driverdata = data;
+    Setup_SoftwareRenderer(renderer);
+
+    if (flags & SDL_RENDERER_PRESENTFLIP2) {
+        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
+        n = 2;
+    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
+        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
+        n = 3;
+    } else {
+        renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
+        n = 1;
+    }
+    for (i = 0; i < n; ++i) {
+        data->screens[i] =
+            SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask,
+                                 Bmask, Amask);
+        if (!data->screens[i]) {
+            Android_DestroyRenderer(renderer);
+            return NULL;
+        }
+        SDL_SetSurfacePalette(data->screens[i], display->palette);
+    }
+    data->current_screen = 0;
+
+    return renderer;
+}
+
+static int
+Android_RenderDrawPoints(SDL_Renderer * renderer,
+                           const SDL_Point * points, int count)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Surface *target = data->screens[data->current_screen];
+
+    if (renderer->blendMode == SDL_BLENDMODE_NONE ||
+        renderer->blendMode == SDL_BLENDMODE_MASK) {
+        Uint32 color = SDL_MapRGBA(target->format,
+                                   renderer->r, renderer->g, renderer->b,
+                                   renderer->a);
+
+        return SDL_DrawPoints(target, points, count, color);
+    } else {
+        return SDL_BlendPoints(target, points, count, renderer->blendMode,
+                               renderer->r, renderer->g, renderer->b,
+                               renderer->a);
+    }
+}
+
+static int
+Android_RenderDrawLines(SDL_Renderer * renderer,
+                          const SDL_Point * points, int count)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Surface *target = data->screens[data->current_screen];
+
+    if (renderer->blendMode == SDL_BLENDMODE_NONE ||
+        renderer->blendMode == SDL_BLENDMODE_MASK) {
+        Uint32 color = SDL_MapRGBA(target->format,
+                                   renderer->r, renderer->g, renderer->b,
+                                   renderer->a);
+
+        return SDL_DrawLines(target, points, count, color);
+    } else {
+        return SDL_BlendLines(target, points, count, renderer->blendMode,
+                              renderer->r, renderer->g, renderer->b,
+                              renderer->a);
+    }
+}
+
+static int
+Android_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
+                          int count)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Surface *target = data->screens[data->current_screen];
+
+    if (renderer->blendMode == SDL_BLENDMODE_NONE ||
+        renderer->blendMode == SDL_BLENDMODE_MASK) {
+        Uint32 color = SDL_MapRGBA(target->format,
+                                   renderer->r, renderer->g, renderer->b,
+                                   renderer->a);
+
+        return SDL_DrawRects(target, rects, count, color);
+    } else {
+        return SDL_BlendRects(target, rects, count,
+                              renderer->blendMode,
+                              renderer->r, renderer->g, renderer->b,
+                              renderer->a);
+    }
+}
+
+static int
+Android_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
+                          int count)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Surface *target = data->screens[data->current_screen];
+
+    if (renderer->blendMode == SDL_BLENDMODE_NONE ||
+        renderer->blendMode == SDL_BLENDMODE_MASK) {
+        Uint32 color = SDL_MapRGBA(target->format,
+                                   renderer->r, renderer->g, renderer->b,
+                                   renderer->a);
+
+        return SDL_FillRects(target, rects, count, color);
+    } else {
+        return SDL_BlendFillRects(target, rects, count,
+                                  renderer->blendMode,
+                                  renderer->r, renderer->g, renderer->b,
+                                  renderer->a);
+    }
+}
+
+static int
+Android_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
+                     const SDL_Rect * srcrect, const SDL_Rect * dstrect)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
+
+    if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
+        SDL_Surface *target = data->screens[data->current_screen];
+        void *pixels =
+            (Uint8 *) target->pixels + dstrect->y * target->pitch +
+            dstrect->x * target->format->BytesPerPixel;
+        return SDL_SW_CopyYUVToRGB((SDL_SW_YUVTexture *) texture->driverdata,
+                                   srcrect, display->current_mode.format,
+                                   dstrect->w, dstrect->h, pixels,
+                                   target->pitch);
+    } else {
+        SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
+        SDL_Surface *target = data->screens[data->current_screen];
+        SDL_Rect real_srcrect = *srcrect;
+        SDL_Rect real_dstrect = *dstrect;
+
+        return SDL_LowerBlit(surface, &real_srcrect, target, &real_dstrect);
+    }
+}
+
+static int
+Android_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                           Uint32 format, void * pixels, int pitch)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
+    SDL_Surface *screen = data->screens[data->current_screen];
+    Uint32 screen_format = display->current_mode.format;
+    Uint8 *screen_pixels = (Uint8 *) screen->pixels +
+                            rect->y * screen->pitch +
+                            rect->x * screen->format->BytesPerPixel;
+    int screen_pitch = screen->pitch;
+
+    return SDL_ConvertPixels(rect->w, rect->h,
+                             screen_format, screen_pixels, screen_pitch,
+                             format, pixels, pitch);
+}
+
+static int
+Android_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                            Uint32 format, const void * pixels, int pitch)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
+    SDL_Surface *screen = data->screens[data->current_screen];
+    Uint32 screen_format = display->current_mode.format;
+    Uint8 *screen_pixels = (Uint8 *) screen->pixels +
+                            rect->y * screen->pitch +
+                            rect->x * screen->format->BytesPerPixel;
+    int screen_pitch = screen->pitch;
+
+    return SDL_ConvertPixels(rect->w, rect->h,
+                             format, pixels, pitch,
+                             screen_format, screen_pixels, screen_pitch);
+}
+
+static void
+Android_RenderPresent(SDL_Renderer * renderer)
+{
+    static int frame_number;
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+
+    /* Send the data to the display */
+    if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) {
+        char file[128];
+        SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
+                     renderer->window->id, ++frame_number);
+        SDL_SaveBMP(data->screens[data->current_screen], file);
+    }
+
+    /* Update the flipping chain, if any */
+    if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
+        data->current_screen = (data->current_screen + 1) % 2;
+    } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
+        data->current_screen = (data->current_screen + 1) % 3;
+    }
+}
+
+static void
+Android_DestroyRenderer(SDL_Renderer * renderer)
+{
+    Android_RenderData *data =
+        (Android_RenderData *) renderer->driverdata;
+    int i;
+
+    if (data) {
+        for (i = 0; i < SDL_arraysize(data->screens); ++i) {
+            if (data->screens[i]) {
+                SDL_FreeSurface(data->screens[i]);
+            }
+        }
+        SDL_free(data);
+    }
+    SDL_free(renderer);
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidrender.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,28 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* SDL surface based renderer implementation */
+
+extern SDL_RenderDriver Android_RenderDriver;
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidvideo.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,166 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+/* Android SDL video driver implementation
+*/
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_androidvideo.h"
+#include "SDL_androidevents.h"
+#include "SDL_androidrender.h"
+
+#define ANDROID_VID_DRIVER_NAME "Android"
+
+/* Initialization/Query functions */
+static int Android_VideoInit(_THIS);
+static int Android_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
+static void Android_VideoQuit(_THIS);
+
+/* GL functions (SDL_androidgl.c) */
+extern int Android_GL_LoadLibrary(_THIS, const char *path);
+extern void *Android_GL_GetProcAddress(_THIS, const char *proc);
+extern void Android_GL_UnloadLibrary(_THIS);
+//extern int *Android_GL_GetVisual(_THIS, Display * display, int screen);
+extern SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window);
+extern int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
+                              SDL_GLContext context);
+extern int Android_GL_SetSwapInterval(_THIS, int interval);
+extern int Android_GL_GetSwapInterval(_THIS);
+extern void Android_GL_SwapWindow(_THIS, SDL_Window * window);
+extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context);
+
+/* Android driver bootstrap functions */
+
+
+//These are filled in with real values in Android_SetScreenResolution on 
+//init (before SDL_Main())
+static int iScreenWidth = 320;
+static int iScreenHeight = 240;
+
+
+static int
+Android_Available(void)
+{
+    return 1;
+}
+
+static void
+Android_DeleteDevice(SDL_VideoDevice * device)
+{
+    SDL_free(device);
+}
+
+static SDL_VideoDevice *
+Android_CreateDevice(int devindex)
+{
+    printf("Creating video device\n");
+    SDL_VideoDevice *device;
+
+    /* Initialize all variables that we clean on shutdown */
+    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
+    if (!device) {
+        SDL_OutOfMemory();
+        if (device) {
+            SDL_free(device);
+        }
+        return (0);
+    }
+
+    /* Set the function pointers */
+    device->VideoInit = Android_VideoInit;
+    device->VideoQuit = Android_VideoQuit;
+    device->SetDisplayMode = Android_SetDisplayMode;
+    device->PumpEvents = Android_PumpEvents;
+   
+    device->free = Android_DeleteDevice;
+
+    /* GL pointers */
+    device->GL_LoadLibrary = Android_GL_LoadLibrary;
+    device->GL_GetProcAddress = Android_GL_GetProcAddress;
+    device->GL_UnloadLibrary = Android_GL_UnloadLibrary;
+    device->GL_CreateContext = Android_GL_CreateContext;
+    device->GL_MakeCurrent = Android_GL_MakeCurrent;
+    device->GL_SetSwapInterval = Android_GL_SetSwapInterval;
+    device->GL_GetSwapInterval = Android_GL_GetSwapInterval;
+    device->GL_SwapWindow = Android_GL_SwapWindow;
+    device->GL_DeleteContext = Android_GL_DeleteContext;
+
+    return device;
+}
+
+VideoBootStrap Android_bootstrap = {
+    ANDROID_VID_DRIVER_NAME, "SDL Android video driver",
+    Android_Available, Android_CreateDevice
+};
+
+
+int
+Android_VideoInit(_THIS)
+{
+    SDL_DisplayMode mode;
+
+    /* Use a fake 32-bpp desktop mode */
+    mode.format = SDL_PIXELFORMAT_RGB888;
+    mode.w = iScreenWidth;
+    mode.h = iScreenHeight;
+    mode.refresh_rate = 0;
+    mode.driverdata = NULL;
+    if (SDL_AddBasicVideoDisplay(&mode) < 0) {
+        return -1;
+    }
+    SDL_AddRenderDriver(&_this->displays[0], &Android_RenderDriver);
+
+    SDL_zero(mode);
+    SDL_AddDisplayMode(&_this->displays[0], &mode);
+
+    Android_InitEvents();
+
+    /* We're done! */
+    return 0;
+}
+
+static int
+Android_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
+{
+    return 0;
+}
+
+void
+Android_VideoQuit(_THIS)
+{
+}
+
+
+void Android_SetScreenResolution(int width, int height){
+    iScreenWidth = width;
+    iScreenHeight = height;   
+}
+
+
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/android/SDL_androidvideo.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,31 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_androidvideo_h
+#define _SDL_androidvideo_h
+
+#include "../SDL_sysvideo.h"
+
+#endif /* _SDL_ndsvideo_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/cocoa/SDL_cocoaclipboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,37 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_cocoaclipboard_h
+#define _SDL_cocoaclipboard_h
+
+/* Forward declaration */
+struct SDL_VideoData;
+
+extern int Cocoa_SetClipboardText(_THIS, const char *text);
+extern char *Cocoa_GetClipboardText(_THIS);
+extern SDL_bool Cocoa_HasClipboardText(_THIS);
+extern void Cocoa_CheckClipboardUpdate(struct SDL_VideoData * data);
+
+#endif /* _SDL_cocoaclipboard_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/cocoa/SDL_cocoaclipboard.m	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,140 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include "SDL_cocoavideo.h"
+#include "../../events/SDL_clipboardevents_c.h"
+
+static NSString *
+GetTextFormat(_THIS)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+    return NSStringPboardType;
+#else
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+
+    if (data->osversion >= 0x1060) {
+        return NSPasteboardTypeString;
+    } else {
+        return NSStringPboardType;
+    }
+#endif
+}
+
+int
+Cocoa_SetClipboardText(_THIS, const char *text)
+{
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    NSAutoreleasePool *pool;
+    NSPasteboard *pasteboard;
+    NSString *format = GetTextFormat(_this);
+
+    pool = [[NSAutoreleasePool alloc] init];
+
+    pasteboard = [NSPasteboard generalPasteboard];
+    data->clipboard_count = [pasteboard declareTypes:[NSArray arrayWithObject:format] owner:nil];
+    [pasteboard setString:[NSString stringWithUTF8String:text] forType:format];
+
+    [pool release];
+
+    return 0;
+}
+
+char *
+Cocoa_GetClipboardText(_THIS)
+{
+    NSAutoreleasePool *pool;
+    NSPasteboard *pasteboard;
+    NSString *format = GetTextFormat(_this);
+    NSString *available;
+    char *text;
+
+    pool = [[NSAutoreleasePool alloc] init];
+
+    pasteboard = [NSPasteboard generalPasteboard];
+    available = [pasteboard availableTypeFromArray: [NSArray arrayWithObject:format]];
+    if ([available isEqualToString:format]) {
+        NSString* string;
+        const char *utf8;
+
+        string = [pasteboard stringForType:format];
+        if (string == nil) {
+            utf8 = "";
+        } else {
+            utf8 = [string UTF8String];
+        }
+        text = SDL_strdup(utf8);
+    } else {
+        text = SDL_strdup("");
+    }
+
+    [pool release];
+
+    return text;
+}
+
+SDL_bool
+Cocoa_HasClipboardText(_THIS)
+{
+    NSAutoreleasePool *pool;
+    NSPasteboard *pasteboard;
+    NSString *format = GetTextFormat(_this);
+    NSString *available;
+    SDL_bool result;
+
+    pool = [[NSAutoreleasePool alloc] init];
+
+    pasteboard = [NSPasteboard generalPasteboard];
+    available = [pasteboard availableTypeFromArray: [NSArray arrayWithObject:format]];
+    if ([available isEqualToString:format]) {
+        result = SDL_TRUE;
+    } else {
+        result = SDL_FALSE;
+    }
+
+    [pool release];
+
+    return result;
+}
+
+void
+Cocoa_CheckClipboardUpdate(struct SDL_VideoData * data)
+{
+    NSAutoreleasePool *pool;
+    NSPasteboard *pasteboard;
+    NSInteger count;
+
+    pool = [[NSAutoreleasePool alloc] init];
+
+    pasteboard = [NSPasteboard generalPasteboard];
+    count = [pasteboard changeCount];
+    if (count != data->clipboard_count) {
+        if (data->clipboard_count) {
+            SDL_SendClipboardUpdate();
+        }
+        data->clipboard_count = count;
+    }
+
+    [pool release];
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/cocoa/SDL_cocoaevents.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoaevents.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -192,6 +192,9 @@
         if ( event == nil ) {
             break;
         }
+		
+	//printf("Type: %i, Subtype: %i\n",[event type],[event subtype]);
+		
         switch ([event type]) {
         case NSLeftMouseDown:
         case NSOtherMouseDown:
@@ -203,6 +206,7 @@
         case NSRightMouseDragged:
         case NSOtherMouseDragged: /* usually middle mouse dragged */
         case NSMouseMoved:
+	  printf("Mouse Type: %i, Subtype: %i\n",[event type],[event subtype]);
             Cocoa_HandleMouseEvent(_this, event);
             /* Pass through to NSApp to make sure everything stays in sync */
             [NSApp sendEvent:event];
@@ -217,6 +221,8 @@
             if (([event modifierFlags] & NSCommandKeyMask) || [event type] == NSFlagsChanged)
                [NSApp sendEvent: event];
             break;
+	case NSTabletPoint:
+	  printf("Tablet Event Received\n");
         default:
             [NSApp sendEvent:event];
             break;
--- a/src/video/cocoa/SDL_cocoakeyboard.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoakeyboard.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -62,20 +62,13 @@
     NSRange   _markedRange;
     NSRange   _selectedRange;
     SDL_Rect  _inputRect;
-    int       _keyboard;
 }
 - (void) doCommandBySelector:(SEL)myselector;
 - (void) setInputRect:(SDL_Rect *) rect;
-- (void) setKeyboard:(int) keyboard;
 @end
 
 @implementation SDLTranslatorResponder
 
-- (void) setKeyboard:(int) keyboard
-{
-    _keyboard = keyboard;
-}
-
 - (void) setInputRect:(SDL_Rect *) rect
 {
     _inputRect = *rect;
@@ -94,7 +87,7 @@
     else
         str = [aString UTF8String];
 
-    SDL_SendKeyboardText(_keyboard, str);
+    SDL_SendKeyboardText(str);
 }
 
 - (void) doCommandBySelector:(SEL) myselector
@@ -140,7 +133,7 @@
     _selectedRange = selRange;
     _markedRange = NSMakeRange(0, [aString length]);
 
-    SDL_SendEditingText(_keyboard, [aString UTF8String],
+    SDL_SendEditingText([aString UTF8String],
                         selRange.location, selRange.length);
 
     DEBUG_IME(@"setMarkedText: %@, (%d, %d)", _markedText,
@@ -151,6 +144,8 @@
 {
     [_markedText release];
     _markedText = nil;
+
+    SDL_SendEditingText("", 0, 0);
 }
 
 - (NSRect) firstRectForCharacterRange: (NSRange) theRange
@@ -204,7 +199,7 @@
  * differentiating between left and right versions of the keys.
  */
 static void
-DoUnsidedModifiers(int keyboard, unsigned short scancode,
+DoUnsidedModifiers(unsigned short scancode,
                    unsigned int oldMods, unsigned int newMods)
 {
     const int mapping[] = {
@@ -226,14 +221,14 @@
         if (oldMask && oldMask != newMask) {        /* modifier up event */
             /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
             if (bit == NSAlphaShiftKeyMask) {
-                SDL_SendKeyboardKey(keyboard, SDL_PRESSED, mapping[i]);
+                SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]);
             }
-            SDL_SendKeyboardKey(keyboard, SDL_RELEASED, mapping[i]);
+            SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]);
         } else if (newMask && oldMask != newMask) { /* modifier down event */
-            SDL_SendKeyboardKey(keyboard, SDL_PRESSED, mapping[i]);
+            SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]);
             /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
             if (bit == NSAlphaShiftKeyMask) {
-                SDL_SendKeyboardKey(keyboard, SDL_RELEASED, mapping[i]);
+                SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]);
             }
         }
     }
@@ -244,8 +239,7 @@
  * sides was made.
  */
 static void
-HandleNonDeviceModifier(int keyboard,
-                        unsigned int device_independent_mask,
+HandleNonDeviceModifier(unsigned int device_independent_mask,
                         unsigned int oldMods,
                         unsigned int newMods,
                         SDL_scancode scancode)
@@ -259,9 +253,9 @@
     newMask = newMods & device_independent_mask;
     
     if (oldMask && oldMask != newMask) {
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, scancode);
+        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
     } else if (newMask && oldMask != newMask) {
-        SDL_SendKeyboardKey(keyboard, SDL_PRESSED, scancode);
+        SDL_SendKeyboardKey(SDL_PRESSED, scancode);
     }
 }
 
@@ -269,8 +263,7 @@
  * This function sets the actual SDL_PrivateKeyboard event.
  */
 static void
-HandleModifierOneSide(int keyboard,
-                      unsigned int oldMods, unsigned int newMods,
+HandleModifierOneSide(unsigned int oldMods, unsigned int newMods,
                       SDL_scancode scancode, 
                       unsigned int sided_device_dependent_mask)
 {
@@ -287,9 +280,9 @@
      * find out which it is.
      */
     if (new_dep_mask && old_dep_mask != new_dep_mask) {
-        SDL_SendKeyboardKey(keyboard, SDL_PRESSED, scancode);
+        SDL_SendKeyboardKey(SDL_PRESSED, scancode);
     } else {
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, scancode);
+        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
     }
 }
 
@@ -298,8 +291,7 @@
  * e.g. left-shift vs right-shift. 
  */
 static void
-HandleModifierSide(int keyboard,
-                   int device_independent_mask, 
+HandleModifierSide(int device_independent_mask, 
                    unsigned int oldMods, unsigned int newMods, 
                    SDL_scancode left_scancode, 
                    SDL_scancode right_scancode,
@@ -316,7 +308,7 @@
      */
     if ((device_dependent_mask & newMods) == 0) {
         /* Revert to the old behavior */
-        HandleNonDeviceModifier(keyboard, device_independent_mask, oldMods, newMods, left_scancode);
+        HandleNonDeviceModifier(device_independent_mask, oldMods, newMods, left_scancode);
         return;
     }
 
@@ -329,10 +321,10 @@
          * change or if the bits don't both exist.
          */
         if (left_device_dependent_mask & diff_mod) {
-            HandleModifierOneSide(keyboard, oldMods, newMods, left_scancode, left_device_dependent_mask);
+            HandleModifierOneSide(oldMods, newMods, left_scancode, left_device_dependent_mask);
         }
         if (right_device_dependent_mask & diff_mod) {
-            HandleModifierOneSide(keyboard, oldMods, newMods, right_scancode, right_device_dependent_mask);
+            HandleModifierOneSide(oldMods, newMods, right_scancode, right_device_dependent_mask);
         }
     }
 }
@@ -343,8 +335,7 @@
  * can't still be down).
  */
 static void
-ReleaseModifierSide(int keyboard,
-                    unsigned int device_independent_mask, 
+ReleaseModifierSide(unsigned int device_independent_mask, 
                     unsigned int oldMods, unsigned int newMods,
                     SDL_scancode left_scancode, 
                     SDL_scancode right_scancode,
@@ -362,7 +353,7 @@
         /* In this case, we can't detect the keyboard, so use the left side 
          * to represent both, and release it. 
          */
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, left_scancode);
+        SDL_SendKeyboardKey(SDL_RELEASED, left_scancode);
         return;
     }
 
@@ -373,10 +364,10 @@
      * so I hope this doesn't cause other problems.
      */
     if ( left_device_dependent_mask & oldMods ) {
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, left_scancode);
+        SDL_SendKeyboardKey(SDL_RELEASED, left_scancode);
     }
     if ( right_device_dependent_mask & oldMods ) {
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, right_scancode);
+        SDL_SendKeyboardKey(SDL_RELEASED, right_scancode);
     }
 }
 
@@ -384,7 +375,7 @@
  * This function handles the CapsLock case.
  */
 static void
-HandleCapsLock(int keyboard, unsigned short scancode,
+HandleCapsLock(unsigned short scancode,
                unsigned int oldMods, unsigned int newMods)
 {
     unsigned int oldMask, newMask;
@@ -393,16 +384,16 @@
     newMask = newMods & NSAlphaShiftKeyMask;
 
     if (oldMask != newMask) {
-        SDL_SendKeyboardKey(keyboard, SDL_PRESSED, SDL_SCANCODE_CAPSLOCK);
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, SDL_SCANCODE_CAPSLOCK);
+        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK);
+        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK);
     }
 
     oldMask = oldMods & NSNumericPadKeyMask;
     newMask = newMods & NSNumericPadKeyMask;
 
     if (oldMask != newMask) {
-        SDL_SendKeyboardKey(keyboard, SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR);
-        SDL_SendKeyboardKey(keyboard, SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR);
+        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR);
+        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR);
     }
 }
 
@@ -410,7 +401,7 @@
  * correct side of the key.
  */
 static void
-DoSidedModifiers(int keyboard, unsigned short scancode,
+DoSidedModifiers(unsigned short scancode,
                  unsigned int oldMods, unsigned int newMods)
 {
 	/* Set up arrays for the key syms for the left and right side. */
@@ -435,7 +426,7 @@
     unsigned int i, bit;
 
     /* Handle CAPSLOCK separately because it doesn't have a left/right side */
-    HandleCapsLock(keyboard, scancode, oldMods, newMods);
+    HandleCapsLock(scancode, oldMods, newMods);
 
     /* Iterate through the bits, testing each against the old modifiers */
     for (i = 0, bit = NSShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
@@ -448,7 +439,7 @@
          * and right side keys may alternate or both may be pressed.
          */
         if (newMask) {
-            HandleModifierSide(keyboard, bit, oldMods, newMods,
+            HandleModifierSide(bit, oldMods, newMods,
                                left_mapping[i], right_mapping[i],
                                left_device_mapping[i], right_device_mapping[i]);
         }
@@ -456,7 +447,7 @@
             * the device dependent bits to release the correct keys.
             */
         else if (oldMask && oldMask != newMask) {
-            ReleaseModifierSide(keyboard, bit, oldMods, newMods,
+            ReleaseModifierSide(bit, oldMods, newMods,
                               left_mapping[i], right_mapping[i],
                               left_device_mapping[i], right_device_mapping[i]);
         }
@@ -477,9 +468,9 @@
      * left side and right side modifiers is available.
      */
     if (data->osversion >= 0x1030) {
-        DoSidedModifiers(data->keyboard, scancode, data->modifierFlags, modifierFlags);
+        DoSidedModifiers(scancode, data->modifierFlags, modifierFlags);
     } else {
-        DoUnsidedModifiers(data->keyboard, scancode, data->modifierFlags, modifierFlags);
+        DoUnsidedModifiers(scancode, data->modifierFlags, modifierFlags);
     }
     data->modifierFlags = modifierFlags;
 }
@@ -549,7 +540,7 @@
                 keymap[scancode] = s[0];
             }
         }
-        SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
         return;
     }
 
@@ -603,7 +594,7 @@
                 keymap[scancode] = c;
             }
         }
-        SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
         return;
     }
 #endif
@@ -613,10 +604,7 @@
 Cocoa_InitKeyboard(_THIS)
 {
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_Keyboard keyboard;
 
-    SDL_zero(keyboard);
-    data->keyboard = SDL_AddKeyboard(&keyboard, -1);
     UpdateKeymap(data);
     
     /* Set our own names for the platform-dependent but layout-independent keys */
@@ -645,8 +633,6 @@
             [[SDLTranslatorResponder alloc] initWithFrame: NSMakeRect(0.0, 0.0, 0.0, 0.0)];
     }
 
-    [data->fieldEdit setKeyboard: data->keyboard];
-
     if (![[data->fieldEdit superview] isEqual: parentView])
     {
         // DEBUG_IME(@"add fieldEdit to window contentView");
@@ -686,7 +672,9 @@
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
     unsigned short scancode = [event keyCode];
     SDL_scancode code;
+#if 0
     const char *text;
+#endif
 
     if ((scancode == 10 || scancode == 50) && KBGetLayoutType(LMGetKbdType()) == kKeyboardISO) {
         /* see comments in SDL_cocoakeys.h */
@@ -705,28 +693,28 @@
         if (![event isARepeat]) {
             /* See if we need to rebuild the keyboard layout */
             UpdateKeymap(data);
+        }
 
-            SDL_SendKeyboardKey(data->keyboard, SDL_PRESSED, code);
+        SDL_SendKeyboardKey(SDL_PRESSED, code);
 #if 1
-            if (code == SDL_SCANCODE_UNKNOWN) {
-                fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list <sdl@libsdl.org> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.\n", scancode);
-            }
+        if (code == SDL_SCANCODE_UNKNOWN) {
+            fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list <sdl@libsdl.org> or to Christian Walther <cwalther@gmx.ch>. Mac virtual key code is %d.\n", scancode);
+        }
 #endif
-        }
         if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
             /* FIXME CW 2007-08-16: only send those events to the field editor for which we actually want text events, not e.g. esc or function keys. Arrow keys in particular seem to produce crashes sometimes. */
             [data->fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]];
 #if 0
             text = [[event characters] UTF8String];
             if(text && *text) {
-                SDL_SendKeyboardText(data->keyboard, text);
+                SDL_SendKeyboardText(text);
                 [data->fieldEdit setString:@""];
             }
 #endif
         }
         break;
     case NSKeyUp:
-        SDL_SendKeyboardKey(data->keyboard, SDL_RELEASED, code);
+        SDL_SendKeyboardKey(SDL_RELEASED, code);
         break;
     case NSFlagsChanged:
         /* FIXME CW 2007-08-14: check if this whole mess that takes up half of this file is really necessary */
@@ -740,10 +728,6 @@
 void
 Cocoa_QuitKeyboard(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    NSAutoreleasePool *pool;
-
-    SDL_DelKeyboard(data->keyboard);
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/cocoa/SDL_cocoamodes.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoamodes.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
--- a/src/video/cocoa/SDL_cocoamouse.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoamouse.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -29,11 +29,6 @@
 void
 Cocoa_InitMouse(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_Mouse mouse;
-
-    SDL_zero(mouse);
-    data->mouse = SDL_AddMouse(&mouse, "Mouse", 0, 0, 1);
 }
 
 static int
@@ -54,11 +49,10 @@
 void
 Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_Mouse *mouse = SDL_GetMouse(data->mouse);
     int i;
-    NSPoint point;
+    NSPoint point = { 0, 0 };
     SDL_Window *window;
+    SDL_Window *focus = SDL_GetMouseFocus();
 
     /* See if there are any fullscreen windows that might handle this event */
     window = NULL;
@@ -73,44 +67,37 @@
             point = [NSEvent mouseLocation];
             point.x = point.x - bounds.x;
             point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - bounds.y;
-            if (point.x < 0 || point.x >= candidate->w ||
-                point.y < 0 || point.y >= candidate->h) {
-                /* The mouse is out of this fullscreen display */
-                if (mouse->focus == candidate) {
-                    SDL_SetMouseFocus(data->mouse, 0);
-                }
-            } else {
+            if ((point.x >= 0 && point.x < candidate->w) &&
+                (point.y >= 0 && point.y < candidate->h)) {
                 /* This is it! */
                 window = candidate;
                 break;
+            } else if (candidate == focus) {
+                SDL_SetMouseFocus(NULL);
             }
         }
     }
+
     if (!window) {
         return;
     }
 
-    /* Set the focus appropriately */
-    if (mouse->focus != window) {
-        SDL_SetMouseFocus(data->mouse, window);
-    }
-
     switch ([event type]) {
     case NSLeftMouseDown:
     case NSOtherMouseDown:
     case NSRightMouseDown:
-        SDL_SendMouseButton(data->mouse, SDL_PRESSED, ConvertMouseButtonToSDL([event buttonNumber]));
+        SDL_SendMouseButton(window, SDL_PRESSED, ConvertMouseButtonToSDL([event buttonNumber]));
         break;
     case NSLeftMouseUp:
     case NSOtherMouseUp:
     case NSRightMouseUp:
-        SDL_SendMouseButton(data->mouse, SDL_RELEASED, ConvertMouseButtonToSDL([event buttonNumber]));
+        SDL_SendMouseButton(window, SDL_RELEASED, ConvertMouseButtonToSDL([event buttonNumber]));
         break;
     case NSLeftMouseDragged:
     case NSRightMouseDragged:
     case NSOtherMouseDragged: /* usually middle mouse dragged */
     case NSMouseMoved:
-        SDL_SendMouseMotion(data->mouse, 0, (int)point.x, (int)point.y, 0);
+        SDL_SendMouseMotion(window, 0, (int)point.x, (int)point.y);
         break;
     default: /* just to avoid compiler warnings */
         break;
@@ -120,9 +107,6 @@
 void
 Cocoa_QuitMouse(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    SDL_DelMouse(data->mouse);
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/cocoa/SDL_cocoaopengl.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoaopengl.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
--- a/src/video/cocoa/SDL_cocoavideo.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoavideo.h	Sun Aug 22 13:45:56 2010 -0700
@@ -32,6 +32,7 @@
 #include "SDL_keysym.h"
 #include "../SDL_sysvideo.h"
 
+#include "SDL_cocoaclipboard.h"
 #include "SDL_cocoaevents.h"
 #include "SDL_cocoakeyboard.h"
 #include "SDL_cocoamodes.h"
@@ -57,10 +58,9 @@
 {
     SInt32 osversion;
     unsigned int modifierFlags;
-    int mouse;
-    int keyboard;
     void *key_layout;
     SDLTranslatorResponder *fieldEdit;
+    NSInteger clipboard_count;
     Uint32 screensaver_activity;
 } SDL_VideoData;
 
--- a/src/video/cocoa/SDL_cocoavideo.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoavideo.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -114,6 +114,10 @@
     device->StopTextInput = Cocoa_StopTextInput;
     device->SetTextInputRect = Cocoa_SetTextInputRect;
 
+    device->SetClipboardText = Cocoa_SetClipboardText;
+    device->GetClipboardText = Cocoa_GetClipboardText;
+    device->HasClipboardText = Cocoa_HasClipboardText;
+
     device->free = Cocoa_DeleteDevice;
 
     return device;
--- a/src/video/cocoa/SDL_cocoawindow.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoawindow.h	Sun Aug 22 13:45:56 2010 -0700
@@ -64,6 +64,20 @@
 -(void) rightMouseDragged:(NSEvent *) theEvent;
 -(void) otherMouseDragged:(NSEvent *) theEvent;
 -(void) scrollWheel:(NSEvent *) theEvent;
+-(void) touchesBeganWithEvent:(NSEvent *) theEvent;
+-(void) touchesMovedWithEvent:(NSEvent *) theEvent;
+-(void) touchesEndedWithEvent:(NSEvent *) theEvent;
+-(void) touchesCancelledWithEvent:(NSEvent *) theEvent;
+
+/* Touch event handling */
+typedef enum {
+    COCOA_TOUCH_DOWN,
+    COCOA_TOUCH_UP,
+    COCOA_TOUCH_MOVE,
+    COCOA_TOUCH_CANCELLED
+} cocoaTouchType;
+-(void) handleTouches:(cocoaTouchType)type withEvent:(NSEvent*) event;
+
 @end
 /* *INDENT-ON* */
 
--- a/src/video/cocoa/SDL_cocoawindow.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Aug 22 13:45:56 2010 -0700
@@ -1,6 +1,6 @@
 /*
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2010 Sam Lantinga
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -25,8 +25,8 @@
 #include "../SDL_sysvideo.h"
 #include "../../events/SDL_keyboard_c.h"
 #include "../../events/SDL_mouse_c.h"
+#include "../../events/SDL_touch_c.h"
 #include "../../events/SDL_windowevents_c.h"
-
 #include "SDL_cocoavideo.h"
 #include "SDL_cocoashape.h"
 
@@ -61,6 +61,7 @@
     [center addObserver:self selector:@selector(windowDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp];
 
     [_data->nswindow setAcceptsMouseMovedEvents:YES];
+    [[_data->nswindow contentView] setAcceptsTouchEvents:YES];
 }
 
 - (void)close
@@ -128,28 +129,24 @@
 
 - (void)windowDidBecomeKey:(NSNotification *)aNotification
 {
-    int index;
+    /* We're going to get keyboard events, since we're key. */
+    SDL_SetKeyboardFocus(_data->window);
 
-    /* We're going to get keyboard events, since we're key. */
-    index = _data->videodata->keyboard;
-    SDL_SetKeyboardFocus(index, _data->window);
+    /* Check to see if someone updated the clipboard */
+    Cocoa_CheckClipboardUpdate(_data->videodata);
 }
 
 - (void)windowDidResignKey:(NSNotification *)aNotification
 {
-    int index;
-    SDL_Mouse *mouse;
-
     /* Some other window will get mouse events, since we're not key. */
-    index = _data->videodata->mouse;
-    mouse = SDL_GetMouse(index);
-    if (mouse->focus == _data->window) {
-        SDL_SetMouseFocus(index, 0);
+    if (SDL_GetMouseFocus() == _data->window) {
+        SDL_SetMouseFocus(NULL);
     }
 
     /* Some other window will get keyboard events, since we're not key. */
-    index = _data->videodata->keyboard;
-    SDL_SetKeyboardFocus(index, 0);
+    if (SDL_GetKeyboardFocus() == _data->window) {
+        SDL_SetKeyboardFocus(NULL);
+    }
 }
 
 - (void)windowDidHide:(NSNotification *)aNotification
@@ -164,10 +161,8 @@
 
 - (void)mouseDown:(NSEvent *)theEvent
 {
-    int index;
     int button;
 
-    index = _data->videodata->mouse;
     switch ([theEvent buttonNumber]) {
     case 0:
         button = SDL_BUTTON_LEFT;
@@ -182,7 +177,7 @@
         button = [theEvent buttonNumber];
         break;
     }
-    SDL_SendMouseButton(index, SDL_PRESSED, button);
+    SDL_SendMouseButton(_data->window, SDL_PRESSED, button);
 }
 
 - (void)rightMouseDown:(NSEvent *)theEvent
@@ -197,10 +192,8 @@
 
 - (void)mouseUp:(NSEvent *)theEvent
 {
-    int index;
     int button;
 
-    index = _data->videodata->mouse;
     switch ([theEvent buttonNumber]) {
     case 0:
         button = SDL_BUTTON_LEFT;
@@ -215,7 +208,7 @@
         button = [theEvent buttonNumber];
         break;
     }
-    SDL_SendMouseButton(index, SDL_RELEASED, button);
+    SDL_SendMouseButton(_data->window, SDL_RELEASED, button);
 }
 
 - (void)rightMouseUp:(NSEvent *)theEvent
@@ -231,24 +224,17 @@
 - (void)mouseMoved:(NSEvent *)theEvent
 {
     SDL_Window *window = _data->window;
-    int index;
-    SDL_Mouse *mouse;
     NSPoint point;
 
-    index = _data->videodata->mouse;
-    mouse = SDL_GetMouse(index);
     point = [theEvent locationInWindow];
     point.y = window->h - point.y;
     if ( point.x < 0 || point.x >= window->w ||
          point.y < 0 || point.y >= window->h ) {
-        if (mouse->focus != 0) {
-            SDL_SetMouseFocus(index, 0);
+        if (SDL_GetMouseFocus() == window) {
+            SDL_SetMouseFocus(NULL);
         }
     } else {
-        if (mouse->focus != _data->window) {
-            SDL_SetMouseFocus(index, _data->window);
-        }
-        SDL_SendMouseMotion(index, 0, (int)point.x, (int)point.y, 0);
+        SDL_SendMouseMotion(window, 0, (int)point.x, (int)point.y);
     }
 }
 
@@ -269,10 +255,105 @@
 
 - (void)scrollWheel:(NSEvent *)theEvent
 {
-    int index;
+    float x = [theEvent deltaX];
+    float y = [theEvent deltaY];
+
+    if (x > 0) {
+        x += 0.9f;
+    } else if (x < 0) {
+        x -= 0.9f;
+    }
+    if (y > 0) {
+        y += 0.9f;
+    } else if (y < 0) {
+        y -= 0.9f;
+    }
+    SDL_SendMouseWheel(_data->window, (int)x, (int)y);
+}
+
+- (void)touchesBeganWithEvent:(NSEvent *) theEvent
+{
+    [self handleTouches:COCOA_TOUCH_DOWN withEvent:theEvent];
+}
+
+- (void)touchesMovedWithEvent:(NSEvent *) theEvent
+{
+    [self handleTouches:COCOA_TOUCH_MOVE withEvent:theEvent];
+}
+
+- (void)touchesEndedWithEvent:(NSEvent *) theEvent
+{
+    [self handleTouches:COCOA_TOUCH_UP withEvent:theEvent];
+}
+
+- (void)touchesCancelledWithEvent:(NSEvent *) theEvent
+{
+    [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
+}
+
+- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
+{
+    NSSet *touches = 0;
+    NSEnumerator *enumerator;
+    NSTouch *touch;
 
-    index = _data->videodata->mouse;
-    SDL_SendMouseWheel(index, (int)([theEvent deltaX]+0.9f), (int)([theEvent deltaY]+0.9f));
+    switch (type) {
+        case COCOA_TOUCH_DOWN:
+            touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:nil];
+            break;
+        case COCOA_TOUCH_UP:
+        case COCOA_TOUCH_CANCELLED:
+            touches = [event touchesMatchingPhase:NSTouchPhaseEnded inView:nil];
+            break;
+        case COCOA_TOUCH_MOVE:
+            touches = [event touchesMatchingPhase:NSTouchPhaseMoved inView:nil];
+            break;
+    }
+
+    enumerator = [touches objectEnumerator];
+    touch = (NSTouch*)[enumerator nextObject];
+    while (touch) {
+        SDL_TouchID touchId = (SDL_TouchID)[touch device];
+        if (!SDL_GetTouch(touchId)) {
+            SDL_Touch touch;
+
+            touch.id = touchId;
+            touch.x_min = 0;
+            touch.x_max = 1;
+            touch.native_xres = touch.x_max - touch.x_min;
+            touch.y_min = 0;
+            touch.y_max = 1;
+            touch.native_yres = touch.y_max - touch.y_min;
+            touch.pressure_min = 0;
+            touch.pressure_max = 1;
+            touch.native_pressureres = touch.pressure_max - touch.pressure_min;
+            
+            if (SDL_AddTouch(&touch, "") < 0) {
+                return;
+            }
+        } 
+
+        SDL_FingerID fingerId = (SDL_FingerID)[touch identity];
+        float x = [touch normalizedPosition].x;
+        float y = [touch normalizedPosition].y;
+	/* Make the origin the upper left instead of the lower left */
+	y = 1.0f - y;
+
+        switch (type) {
+        case COCOA_TOUCH_DOWN:
+            SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1);
+            break;
+        case COCOA_TOUCH_UP:
+        case COCOA_TOUCH_CANCELLED:
+            SDL_SendFingerDown(touchId, fingerId, SDL_FALSE, x, y, 1);
+            break;
+        case COCOA_TOUCH_MOVE:
+            SDL_SendTouchMotion(touchId, fingerId, SDL_FALSE, x, y, 1);
+            break;
+        }
+        
+        touch = (NSTouch*)[enumerator nextObject];
+    }
 }
 
 @end
@@ -363,9 +444,8 @@
         window->flags &= ~SDL_WINDOW_MINIMIZED;
     }
     if ([nswindow isKeyWindow]) {
-        int index = data->videodata->keyboard;
         window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_SetKeyboardFocus(index, data->window);
+        SDL_SetKeyboardFocus(data->window);
 
         if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
             /* FIXME */
@@ -387,8 +467,6 @@
     NSRect rect;
     SDL_Rect bounds;
     unsigned int style;
-    NSString *title;
-    int status;
 
     Cocoa_GetDisplayBounds(_this, display, &bounds);
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
@@ -454,7 +532,6 @@
     NSAutoreleasePool *pool;
     NSWindow *nswindow = (NSWindow *) data;
     NSString *title;
-    int status;
 
     pool = [[NSAutoreleasePool alloc] init];
 
@@ -627,7 +704,7 @@
 SDL_bool
 Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
 {
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
+    //NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
 
     if (info->version.major <= SDL_MAJOR_VERSION) {
         //info->window = nswindow;
--- a/src/video/directfb/SDL_DirectFB_WM.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_WM.c	Sun Aug 22 13:45:56 2010 -0700
@@ -27,6 +27,8 @@
 
 #include "SDL_DirectFB_video.h"
 
+#include "../../events/SDL_windowevents_c.h"
+
 #define COLOR_EXPAND(col) col.r, col.g, col.b, col.a
 
 static DFB_Theme theme_std = {
@@ -52,7 +54,7 @@
 };
 
 static void
-DrTriangle(IDirectFBSurface * s, int down, int x, int y, int w)
+DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w)
 {
     int x1, x2, x3;
     int y1, y2, y3;
@@ -76,7 +78,33 @@
 }
 
 static void
-DrCaption(IDirectFBSurface * s, int x, int y, char *text)
+LoadFont(_THIS, SDL_Window * window)
+{
+    SDL_DFB_DEVICEDATA(_this);
+    SDL_DFB_WINDOWDATA(window);
+
+	if (windata->font != NULL) {
+		SDL_DFB_RELEASE(windata->font);
+	    windata->font = NULL;
+	    SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
+	}
+	
+	if (windata->theme.font != NULL)
+	{
+        DFBFontDescription fdesc;
+
+		SDL_zero(fdesc);
+	    fdesc.flags = DFDESC_HEIGHT;
+	    fdesc.height = windata->theme.font_size;
+	    SDL_DFB_CHECK(devdata->
+	                  dfb->CreateFont(devdata->dfb, windata->theme.font,
+	                                  &fdesc, &windata->font));
+	    SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
+	}
+}
+
+static void
+DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text)
 {
     DFBSurfaceTextFlags flags;
 
@@ -86,7 +114,7 @@
 }
 
 void
-DirectFB_WM_RedrawLayout(SDL_Window * window)
+DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window)
 {
     SDL_DFB_WINDOWDATA(window);
     IDirectFBSurface *s = windata->window_surface;
@@ -99,6 +127,7 @@
     if (!windata->is_managed || (window->flags & SDL_WINDOW_FULLSCREEN))
         return;
 
+	LoadFont(_this, window);
     //s->SetDrawingFlags(s, DSDRAW_BLEND);
     s->SetColor(s, COLOR_EXPAND(t->frame_color));
     /* top */
@@ -122,16 +151,16 @@
     x = windata->size.w - t->right_size - w + d;
     y = t->top_size + d;
     s->SetColor(s, COLOR_EXPAND(t->close_color));
-    DrTriangle(s, 1, x, y, w - 2 * d);
+    DrawTriangle(s, 1, x, y, w - 2 * d);
     /* Max Button */
     s->SetColor(s, COLOR_EXPAND(t->max_color));
-    DrTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w,
+    DrawTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w,
                y, w - 2 * d);
 
     /* Caption */
     if (window->title) {
-        s->SetColor(s, COLOR_EXPAND(t->font_color));
-        DrCaption(s, (x - w) / 2, t->top_size + d, window->title);
+	    s->SetColor(s, COLOR_EXPAND(t->font_color));
+        DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title);
     }
     /* Icon */
     if (windata->icon) {
@@ -152,26 +181,25 @@
 DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch)
 {
     SDL_DFB_WINDOWDATA(window);
-    DFBResult ret;
 
-    ret = windata->window->GetSize(windata->window, cw, ch);
+    SDL_DFB_CHECK(windata->window->GetSize(windata->window, cw, ch));
     *cw -= windata->theme.left_size + windata->theme.right_size;
     *ch -=
         windata->theme.top_size + windata->theme.caption_size +
         windata->theme.bottom_size;
-    return ret;
+    return DFB_OK;
 }
 
 void
-DirectFB_WM_AdjustWindowLayout(SDL_Window * window)
+DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h)
 {
     SDL_DFB_WINDOWDATA(window);
 
     if (!windata->is_managed)
         windata->theme = theme_none;
-    else if (window->flags & SDL_WINDOW_FULLSCREEN) {
+    else if (flags & SDL_WINDOW_FULLSCREEN) {
         windata->theme = theme_none;
-    } else if (window->flags & SDL_WINDOW_MAXIMIZED) {
+    } else if (flags & SDL_WINDOW_MAXIMIZED) {
         windata->theme = theme_std;
         windata->theme.left_size = 0;
         windata->theme.right_size = 0;
@@ -183,12 +211,12 @@
 
     windata->client.x = windata->theme.left_size;
     windata->client.y = windata->theme.top_size + windata->theme.caption_size;
-    windata->client.w = window->w;
-    windata->client.h = window->h;
+    windata->client.w = w;
+    windata->client.h = h;
     windata->size.w =
-        window->w + windata->theme.left_size + windata->theme.right_size;
+        w + windata->theme.left_size + windata->theme.right_size;
     windata->size.h =
-        window->h + windata->theme.top_size +
+        h + windata->theme.top_size +
         windata->theme.caption_size + windata->theme.bottom_size;
 }
 
@@ -198,19 +226,16 @@
     SDL_DFB_WINDOWDATA(window);
     SDL_VideoDisplay *display = window->display;
 
-    windata->window->GetPosition(windata->window,
-                                 &windata->restore.x, &windata->restore.y);
-    windata->window->GetSize(windata->window, &windata->restore.w,
-                             &windata->restore.h);
+    SDL_DFB_CHECK(windata->window->GetPosition(windata->window,
+                                 &windata->restore.x, &windata->restore.y));
+    SDL_DFB_CHECK(windata->window->GetSize(windata->window, &windata->restore.w,
+                             &windata->restore.h));
 
-    /* Do this already here */
-    window->flags |= SDL_WINDOW_MAXIMIZED;
-    DirectFB_WM_AdjustWindowLayout(window);
+    DirectFB_WM_AdjustWindowLayout(window, window->flags | SDL_WINDOW_MAXIMIZED, display->current_mode.w, display->current_mode.h) ;
 
-    windata->window->MoveTo(windata->window, 0, 0);
-    windata->window->Resize(windata->window,
-                            display->current_mode.w, display->current_mode.h);
-    SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
+    SDL_DFB_CHECK(windata->window->MoveTo(windata->window, 0, 0));
+    SDL_DFB_CHECK(windata->window->Resize(windata->window,
+                            display->current_mode.w, display->current_mode.h));
 }
 
 void
@@ -218,15 +243,13 @@
 {
     SDL_DFB_WINDOWDATA(window);
 
-    /* Do this already here */
-    //window->flags &= ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED);
+    DirectFB_WM_AdjustWindowLayout(window, window->flags & ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED), 
+    	windata->restore.w, windata->restore.h);
 
-    DirectFB_WM_AdjustWindowLayout(window);
-    windata->window->MoveTo(windata->window, windata->restore.x,
-                            windata->restore.y);
-    windata->window->Resize(windata->window, windata->restore.w,
-                            windata->restore.h);
-    SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_RESTORED, 0, 0);
+    SDL_DFB_CHECK(windata->window->Resize(windata->window, windata->restore.w,
+                            windata->restore.h));
+    SDL_DFB_CHECK(windata->window->MoveTo(windata->window, windata->restore.x,
+                            windata->restore.y));
 }
 
 enum
@@ -291,7 +314,9 @@
 int
 DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
 {
+    SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
+	DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL);
 
     if (!windata->is_managed)
         return 0;
@@ -304,19 +329,26 @@
             case WM_POS_NONE:
                 return 0;
             case WM_POS_CLOSE:
-                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0,
+		        wm_grab = WM_POS_NONE;
+                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0,
                                     0);
                 return 1;
             case WM_POS_MAX:
+		        wm_grab = WM_POS_NONE;
                 if (window->flags & SDL_WINDOW_MAXIMIZED) {
-                    DirectFB_WM_RestoreWindow(_this, window);
+                	SDL_RestoreWindow(window);
                 } else {
-                    DirectFB_WM_MaximizeWindow(_this, window);
+                    SDL_MaximizeWindow(window);
                 }
                 return 1;
+            case WM_POS_CAPTION:
+                DirectFB_RaiseWindow(_this, window);
+                /* fall through */
             default:
                 wm_grab = pos;
-                windata->window->GrabPointer(windata->window);
+                if (gwindata != NULL)
+	                SDL_DFB_CHECK(gwindata->window->UngrabPointer(gwindata->window));
+                SDL_DFB_CHECK(windata->window->GrabPointer(windata->window));
                 wm_lastx = evt->cx;
                 wm_lasty = evt->cy;
             }
@@ -333,20 +365,22 @@
             int cw, ch;
 
             if (wm_grab & WM_POS_CAPTION)
-                windata->window->Move(windata->window, dx, dy);
-            if (wm_grab & WM_POS_RIGHT) {
-                windata->window->GetSize(windata->window, &cw, &ch);
-                windata->window->Resize(windata->window, cw + dx, ch);
-            }
-            if (wm_grab & WM_POS_BOTTOM) {
-                windata->window->GetSize(windata->window, &cw, &ch);
-                windata->window->Resize(windata->window, cw, ch + dy);
+                SDL_DFB_CHECK(windata->window->Move(windata->window, dx, dy));
+	        if (wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) {
+	            if ((wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM)
+	            	dx = 0;
+	            else if ((wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT)
+	            	dy = 0;
+                SDL_DFB_CHECK(windata->window->GetSize(windata->window, &cw, &ch));
+                SDL_DFB_CHECK(windata->window->Resize(windata->window, cw + dx, ch + dy));
             }
             wm_lastx = evt->cx;
             wm_lasty = evt->cy;
             return 1;
         }
-        windata->window->UngrabPointer(windata->window);
+        SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window));
+        if (gwindata != NULL)
+            SDL_DFB_CHECK(gwindata->window->GrabPointer(gwindata->window));
         wm_grab = WM_POS_NONE;
         break;
     case DWET_KEYDOWN:
--- a/src/video/directfb/SDL_DirectFB_WM.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_WM.h	Sun Aug 22 13:45:56 2010 -0700
@@ -41,10 +41,10 @@
     DFBColor max_color;
 };
 
-extern void DirectFB_WM_AdjustWindowLayout(SDL_Window * window);
+extern void DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h);
 extern void DirectFB_WM_MaximizeWindow(_THIS, SDL_Window * window);
 extern void DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window);
-extern void DirectFB_WM_RedrawLayout(SDL_Window * window);
+extern void DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window);
 
 extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window,
                                     DFBWindowEvent * evt);
--- a/src/video/directfb/SDL_DirectFB_dyn.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_dyn.c	Sun Aug 22 13:45:56 2010 -0700
@@ -31,7 +31,8 @@
 #define DFB_SYM(ret, name, args, al, func) ret (*name) args;
 static struct _SDL_DirectFB_Symbols
 {
-    DFB_SYMS const unsigned int *directfb_major_version;
+    DFB_SYMS 
+    const unsigned int *directfb_major_version;
     const unsigned int *directfb_minor_version;
     const unsigned int *directfb_micro_version;
 } SDL_DirectFB_Symbols;
--- a/src/video/directfb/SDL_DirectFB_events.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_events.c	Sun Aug 22 13:45:56 2010 -0700
@@ -32,9 +32,29 @@
 #include "../../events/scancodes_linux.h"
 #include "SDL_DirectFB_events.h"
 
+#if USE_MULTI_API
+#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p)
+#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(id, state, button)
+#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode)
+#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text)
+#else
+#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(w, relative, x, y)
+#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(w, state, button)
+#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode)
+#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text)
+#endif
+
+typedef struct _cb_data cb_data;
+struct _cb_data 
+{
+	DFB_DeviceData *devdata;	
+	int sys_ids;
+	int sys_kbd;
+};
+
 /* The translation tables from a DirectFB keycode to a SDL keysym */
 static SDLKey oskeymap[256];
-static int sys_ids;
+
 
 static SDL_keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt,
                                          SDL_keysym * keysym);
@@ -54,17 +74,13 @@
      *        This has simply no effect.
      */
 
-    SDL_Window *window = SDL_GetWindowFromID(id);
     SDL_VideoDisplay *display = window->display;
     DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-    int ret;
 
+	/* FIXME: should we handle the error */
     if (dispdata->vidIDinuse)
-        SDL_DFB_CHECKERR(dispdata->vidlayer->SwitchContext(dispdata->vidlayer,
+        SDL_DFB_CHECK(dispdata->vidlayer->SwitchContext(dispdata->vidlayer,
                                                            DFB_TRUE));
-
-  error:
-    return;
 #endif
 
 }
@@ -72,27 +88,36 @@
 static void
 FocusAllMice(_THIS, SDL_Window *window)
 {
+#if USE_MULTI_API
     SDL_DFB_DEVICEDATA(_this);
     int index;
 
     for (index = 0; index < devdata->num_mice; index++)
         SDL_SetMouseFocus(devdata->mouse_id[index], id);
+#else
+    SDL_SetMouseFocus(window);
+#endif
 }
 
 
 static void
 FocusAllKeyboards(_THIS, SDL_Window *window)
 {
+#if USE_MULTI_API
     SDL_DFB_DEVICEDATA(_this);
     int index;
 
     for (index = 0; index < devdata->num_keyboard; index++)
         SDL_SetKeyboardFocus(index, id);
+#else
+    SDL_SetKeyboardFocus(window);
+#endif
 }
 
 static void
 MotionAllMice(_THIS, int x, int y)
 {
+#if USE_MULTI_API
     SDL_DFB_DEVICEDATA(_this);
     int index;
 
@@ -102,6 +127,7 @@
         mouse->y = mouse->last_y = y;
         //SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0);
     }
+#endif
 }
 
 static int
@@ -150,9 +176,9 @@
         case DWET_BUTTONDOWN:
             if (ClientXY(p, &evt->x, &evt->y)) {
                 if (!devdata->use_linux_input) {
-                    SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x,
+                    SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0, evt->x,
                                         evt->y, 0);
-                    SDL_SendMouseButton(devdata->mouse_id[0],
+                    SDL_SendMouseButton_ex(p->sdl_window, devdata->mouse_id[0],
                                         SDL_PRESSED,
                                         DirectFB_TranslateButton
                                         (evt->button));
@@ -164,9 +190,9 @@
         case DWET_BUTTONUP:
             if (ClientXY(p, &evt->x, &evt->y)) {
                 if (!devdata->use_linux_input) {
-                    SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x,
+                    SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0, evt->x,
                                         evt->y, 0);
-                    SDL_SendMouseButton(devdata->mouse_id[0],
+                    SDL_SendMouseButton_ex(p->sdl_window, devdata->mouse_id[0],
                                         SDL_RELEASED,
                                         DirectFB_TranslateButton
                                         (evt->button));
@@ -177,10 +203,10 @@
             break;
         case DWET_MOTION:
             if (ClientXY(p, &evt->x, &evt->y)) {
-                SDL_Window *window = p->window;
+                SDL_Window *window = p->sdl_window;
                 if (!devdata->use_linux_input) {
                     if (!(flags & SDL_WINDOW_INPUT_GRABBED))
-                        SDL_SendMouseMotion(devdata->mouse_id[0], 0,
+                        SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0,
                                             evt->x, evt->y, 0);
                 } else {
                     /* relative movements are not exact! 
@@ -193,19 +219,19 @@
                     }
                 }
                 if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS))
-                    SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0,
+                    SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0,
                                         0);
             }
             break;
         case DWET_KEYDOWN:
             if (!devdata->use_linux_input) {
                 DirectFB_TranslateKey(_this, evt, &keysym);
-                SDL_SendKeyboardKey(0, SDL_PRESSED, keysym.scancode);
+                SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
                 if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
                     SDL_memcpy(text, &keysym.unicode, 4);
                     text[4] = 0;
                     if (*text) {
-                        SDL_SendKeyboardText(0, text);
+                        SDL_SendKeyboardText_ex(0, text);
                     }
                 }
             }
@@ -213,18 +239,18 @@
         case DWET_KEYUP:
             if (!devdata->use_linux_input) {
                 DirectFB_TranslateKey(_this, evt, &keysym);
-                SDL_SendKeyboardKey(0, SDL_RELEASED, keysym.scancode);
+                SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode);
             }
             break;
         case DWET_POSITION:
             if (ClientXY(p, &evt->x, &evt->y)) {
-                SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED,
+                SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
                                     evt->x, evt->y);
             }
             break;
         case DWET_POSITION_SIZE:
             if (ClientXY(p, &evt->x, &evt->y)) {
-                SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED,
+                SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
                                     evt->x, evt->y);
             }
             /* fall throught */
@@ -234,32 +260,32 @@
             evt->h -=
                 (p->theme.top_size + p->theme.bottom_size +
                  p->theme.caption_size);
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_RESIZED,
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_RESIZED,
                                 evt->w, evt->h);
             break;
         case DWET_CLOSE:
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_CLOSE, 0, 0);
             break;
         case DWET_GOTFOCUS:
-            DirectFB_SetContext(_this, p->window);
-            FocusAllKeyboards(_this, p->window);
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_GAINED,
+            DirectFB_SetContext(_this, p->sdl_window);
+            FocusAllKeyboards(_this, p->sdl_window);
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_GAINED,
                                 0, 0);
             break;
         case DWET_LOSTFOCUS:
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
             FocusAllKeyboards(_this, 0);
             break;
         case DWET_ENTER:
             /* SDL_DirectFB_ReshowCursor(_this, 0); */
-            FocusAllMice(_this, p->window);
+            FocusAllMice(_this, p->sdl_window);
             // FIXME: when do we really enter ?
             if (ClientXY(p, &evt->x, &evt->y))
                 MotionAllMice(_this, evt->x, evt->y);
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0, 0);
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0, 0);
             break;
         case DWET_LEAVE:
-            SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_LEAVE, 0, 0);
+            SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_LEAVE, 0, 0);
             FocusAllMice(_this, 0);
             /* SDL_DirectFB_ReshowCursor(_this, 1); */
             break;
@@ -271,7 +297,7 @@
 }
 
 static void
-ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt)
+ProcessInputEvent(_THIS, DFBInputEvent * ievt)
 {
     SDL_DFB_DEVICEDATA(_this);
     SDL_keysym keysym;
@@ -280,12 +306,12 @@
 
     if (!devdata->use_linux_input) {
         if (ievt->type == DIET_AXISMOTION) {
-            if ((grabbed_window >= 0) && (ievt->flags & DIEF_AXISREL)) {
+            if ((devdata->grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) {
                 if (ievt->axis == DIAI_X)
-                    SDL_SendMouseMotion(ievt->device_id, 1,
+                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1,
                                         ievt->axisrel, 0, 0);
                 else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
+                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0,
                                         ievt->axisrel, 0);
             }
         }
@@ -300,65 +326,69 @@
                 else if (ievt->axis == DIAI_Y)
                     last_y = ievt->axisabs;
                 if (!(ievt->flags & DIEF_FOLLOW)) {
+#if USE_MULTI_API
                     SDL_Mouse *mouse = SDL_GetMouse(ievt->device_id);
                     SDL_Window *window = SDL_GetWindowFromID(mouse->focus);
+#else
+                    SDL_Window *window = devdata->grabbed_window;
+#endif
                     if (window) {
                         DFB_WindowData *windata =
                             (DFB_WindowData *) window->driverdata;
                         int x, y;
 
                         windata->window->GetPosition(windata->window, &x, &y);
-                        SDL_SendMouseMotion(ievt->device_id, 0,
+                        SDL_SendMouseMotion_ex(window, ievt->device_id, 0,
                                             last_x - (x +
                                                       windata->client.x),
                                             last_y - (y +
                                                       windata->client.y), 0);
                     } else {
-                        SDL_SendMouseMotion(ievt->device_id, 0, last_x,
+                        SDL_SendMouseMotion_ex(window, ievt->device_id, 0, last_x,
                                             last_y, 0);
                     }
                 }
             } else if (ievt->flags & DIEF_AXISREL) {
                 if (ievt->axis == DIAI_X)
-                    SDL_SendMouseMotion(ievt->device_id, 1,
+                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1,
                                         ievt->axisrel, 0, 0);
                 else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
+                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0,
                                         ievt->axisrel, 0);
             }
             break;
         case DIET_KEYPRESS:
             kbd_idx = KbdIndex(_this, ievt->device_id);
             DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym);
-            SDL_SendKeyboardKey(kbd_idx, SDL_PRESSED, keysym.scancode);
+            SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
             if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
                 SDL_memcpy(text, &keysym.unicode, 4);
                 text[4] = 0;
                 if (*text) {
-                    SDL_SendKeyboardText(kbd_idx, text);
+                    SDL_SendKeyboardText_ex(kbd_idx, text);
                 }
             }
             break;
         case DIET_KEYRELEASE:
             kbd_idx = KbdIndex(_this, ievt->device_id);
             DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym);
-            SDL_SendKeyboardKey(kbd_idx, SDL_RELEASED, keysym.scancode);
+            SDL_SendKeyboardKey_ex(kbd_idx, SDL_RELEASED, keysym.scancode);
             break;
         case DIET_BUTTONPRESS:
             if (ievt->buttons & DIBM_LEFT)
-                SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 1);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 1);
             if (ievt->buttons & DIBM_MIDDLE)
-                SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 2);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 2);
             if (ievt->buttons & DIBM_RIGHT)
-                SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 3);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 3);
             break;
         case DIET_BUTTONRELEASE:
             if (!(ievt->buttons & DIBM_LEFT))
-                SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 1);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 1);
             if (!(ievt->buttons & DIBM_MIDDLE))
-                SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 2);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 2);
             if (!(ievt->buttons & DIBM_RIGHT))
-                SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 3);
+                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 3);
             break;
         default:
             break;              /* please gcc */
@@ -372,17 +402,10 @@
     SDL_DFB_DEVICEDATA(_this);
     DFB_WindowData *p;
     DFBInputEvent ievt;
-    SDL_Window *grabbed_window;
-
-    grabbed_window = NULL;
 
     for (p = devdata->firstwin; p != NULL; p = p->next) {
         DFBWindowEvent evt;
-        SDL_Window *w = SDL_GetWindowFromID(p->window);
-
-        if (w->flags & SDL_WINDOW_INPUT_GRABBED) {
-            grabbed_window = w;
-        }
+        SDL_Window *w = p->sdl_window;
 
         while (p->eventbuffer->GetEvent(p->eventbuffer,
                                         DFB_EVENT(&evt)) == DFB_OK) {
@@ -394,7 +417,7 @@
     /* Now get relative events in case we need them */
     while (devdata->events->GetEvent(devdata->events,
                                      DFB_EVENT(&ievt)) == DFB_OK) {
-        ProcessInputEvent(_this, grabbed_window, &ievt);
+        ProcessInputEvent(_this, &ievt);
     }
 }
 
@@ -599,56 +622,49 @@
 }
 
 static DFBEnumerationResult
-input_device_cb(DFBInputDeviceID device_id,
+EnumKeyboards(DFBInputDeviceID device_id,
                 DFBInputDeviceDescription desc, void *callbackdata)
 {
-    DFB_DeviceData *devdata = callbackdata;
+	cb_data *cb = callbackdata;
+    DFB_DeviceData *devdata = cb->devdata;
+#if USE_MULTI_API
     SDL_Keyboard keyboard;
+#endif
     SDLKey keymap[SDL_NUM_SCANCODES];
 
-    if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) {
-        SDL_zero(keyboard);
-        SDL_AddKeyboard(&keyboard, 0);
-        devdata->keyboard[0].id = device_id;
-        devdata->keyboard[0].is_generic = 0;
-        if (!strncmp("X11", desc.name, 3))
-            devdata->keyboard[0].is_generic = 1;
-
-        SDL_GetDefaultKeymap(keymap);
-        SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
-        devdata->num_keyboard++;
-
-        return DFENUM_CANCEL;
-    }
-    return DFENUM_OK;
-}
-
-static DFBEnumerationResult
-EnumKeyboards(DFBInputDeviceID device_id,
-              DFBInputDeviceDescription desc, void *callbackdata)
-{
-    DFB_DeviceData *devdata = callbackdata;
-    SDL_Keyboard keyboard;
-    SDLKey keymap[SDL_NUM_SCANCODES];
-
-    if (sys_ids) {
-        if (device_id >= 0x10)
-            return DFENUM_OK;
-    } else {
-        if (device_id < 0x10)
-            return DFENUM_OK;
-    }
+	if (!cb->sys_kbd) {
+		if (cb->sys_ids) {
+		    if (device_id >= 0x10)
+		        return DFENUM_OK;
+		} else {
+		    if (device_id < 0x10)
+		        return DFENUM_OK;
+		}
+	} else {
+		if (device_id != DIDID_KEYBOARD)
+		    return DFENUM_OK;
+	}
+	
     if ((desc.caps & DIDTF_KEYBOARD)) {
+#if USE_MULTI_API
         SDL_zero(keyboard);
         SDL_AddKeyboard(&keyboard, devdata->num_keyboard);
+#endif
         devdata->keyboard[devdata->num_keyboard].id = device_id;
         devdata->keyboard[devdata->num_keyboard].is_generic = 0;
         if (!strncmp("X11", desc.name, 3))
             devdata->keyboard[devdata->num_keyboard].is_generic = 1;
 
         SDL_GetDefaultKeymap(keymap);
+#if USE_MULTI_API
         SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES);
+#else
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
+#endif
         devdata->num_keyboard++;
+
+		if (cb->sys_kbd)
+	        return DFENUM_CANCEL;
     }
     return DFENUM_OK;
 }
@@ -657,33 +673,36 @@
 DirectFB_InitKeyboard(_THIS)
 {
     SDL_DFB_DEVICEDATA(_this);
-    int ret;
-
+	cb_data cb;    
+	
     DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap));
 
     devdata->num_keyboard = 0;
+    cb.devdata = devdata;
+    
     if (devdata->use_linux_input) {
-        sys_ids = 0;
+    	cb.sys_kbd = 0;
+        cb.sys_ids = 0;
         SDL_DFB_CHECK(devdata->dfb->
-                      EnumInputDevices(devdata->dfb, EnumKeyboards, devdata));
+                      EnumInputDevices(devdata->dfb, EnumKeyboards, &cb));
         if (devdata->num_keyboard == 0) {
-            sys_ids = 1;
+            cb.sys_ids = 1;
             SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
                                                          EnumKeyboards,
-                                                         devdata));
+                                                         &cb));
         }
     } else {
+    	cb.sys_kbd = 1;
         SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
-                                                     input_device_cb,
-                                                     devdata));
+                                                     EnumKeyboards,
+                                                     &cb));
     }
 }
 
 void
 DirectFB_QuitKeyboard(_THIS)
 {
-    SDL_DFB_DEVICEDATA(_this);
-    int ret;
+    //SDL_DFB_DEVICEDATA(_this);
 
     SDL_KeyboardQuit();
 
@@ -759,3 +778,4 @@
     }
 }
 #endif
+
--- a/src/video/directfb/SDL_DirectFB_modes.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_modes.c	Sun Aug 22 13:45:56 2010 -0700
@@ -40,112 +40,101 @@
     SDL_DisplayMode *modelist;
 };
 
-static int
-DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat, Uint32 * fmt)
+static const struct {
+    DFBSurfacePixelFormat dfb;
+    Uint32 sdl;
+} pixelformat_tab[] = 
 {
-    switch (pixelformat) {
-    case DSPF_ALUT44:
-        *fmt = SDL_PIXELFORMAT_INDEX4LSB;
-        break;
-    case DSPF_LUT8:
-        *fmt = SDL_PIXELFORMAT_INDEX8;
-        break;
-    case DSPF_RGB332:
-        *fmt = SDL_PIXELFORMAT_RGB332;
-        break;
-    case DSPF_ARGB4444:
-        *fmt = SDL_PIXELFORMAT_ARGB4444;
-        break;
-    case SDL_PIXELFORMAT_ARGB1555:
-        *fmt = SDL_PIXELFORMAT_ARGB1555;
-        break;
-    case DSPF_RGB16:
-        *fmt = SDL_PIXELFORMAT_RGB565;
-        break;
-    case DSPF_RGB24:
-        *fmt = SDL_PIXELFORMAT_RGB24;
-        break;
-    case DSPF_RGB32:
-        *fmt = SDL_PIXELFORMAT_RGB888;
-        break;
-    case DSPF_ARGB:
-        *fmt = SDL_PIXELFORMAT_ARGB8888;
-        break;
-    case DSPF_YV12:
-        *fmt = SDL_PIXELFORMAT_YV12;
-        break;                  /* Planar mode: Y + V + U  (3 planes) */
-    case DSPF_I420:
-        *fmt = SDL_PIXELFORMAT_IYUV;
-        break;                  /* Planar mode: Y + U + V  (3 planes) */
-    case DSPF_YUY2:
-        *fmt = SDL_PIXELFORMAT_YUY2;
-        break;                  /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
-    case DSPF_UYVY:
-        *fmt = SDL_PIXELFORMAT_UYVY;
-        break;                  /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
-    default:
-        return -1;
-    }
-    return 0;
+    { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 },              /* 8 bit LUT (8 bit color and alpha lookup from palette) */
+    { DSPF_RGB332, SDL_PIXELFORMAT_RGB332 },            /* 8 bit RGB (1 byte, red 3@5, green 3@2, blue 2@0) */
+    { DSPF_ARGB4444, SDL_PIXELFORMAT_ARGB4444 },        /* 16 bit ARGB (2 byte, alpha 4@12, red 4@8, green 4@4, blue 4@0) */
+    { DSPF_ARGB1555, SDL_PIXELFORMAT_ARGB1555 },        /* 16 bit ARGB (2 byte, alpha 1@15, red 5@10, green 5@5, blue 5@0) */
+    { DSPF_RGB16, SDL_PIXELFORMAT_RGB565 },             /* 16 bit RGB (2 byte, red 5@11, green 6@5, blue 5@0) */
+    { DSPF_RGB24, SDL_PIXELFORMAT_RGB24 },              /* 24 bit RGB (3 byte, red 8@16, green 8@8, blue 8@0) */
+    { DSPF_RGB32, SDL_PIXELFORMAT_RGB888 },             /* 24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */
+    { DSPF_ARGB, SDL_PIXELFORMAT_ARGB8888 },            /* 32 bit ARGB (4 byte, alpha 8@24, red 8@16, green 8@8, blue 8@0) */
+    { DSPF_RGB444, SDL_PIXELFORMAT_RGB444 },            /* 16 bit RGB (2 byte, nothing @12, red 4@8, green 4@4, blue 4@0) */
+    { DSPF_YV12, SDL_PIXELFORMAT_YV12 },                /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes) */
+    { DSPF_I420,SDL_PIXELFORMAT_IYUV },                 /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes) */
+    { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
+    { DSPF_UYVY, SDL_PIXELFORMAT_UYVY },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
+    { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 },            /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) */
+
+#if (DFB_VERSION_ATLEAST(1,2,0))
+    { DSPF_BGR555, SDL_PIXELFORMAT_BGR555 },            /* 16 bit BGR (2 byte, nothing @15, blue 5@10, green 5@5, red 5@0) */
+#else
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR555 },
+#endif
+
+    /* Pfff ... nonmatching formats follow */    
+    
+    { DSPF_ALUT44, SDL_PIXELFORMAT_UNKNOWN },           /* 8 bit ALUT (1 byte, alpha 4@4, color lookup 4@0) */
+ 	{ DSPF_A8, SDL_PIXELFORMAT_UNKNOWN },               /* 	8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */
+ 	{ DSPF_AiRGB, SDL_PIXELFORMAT_UNKNOWN },            /* 	32 bit ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */
+ 	{ DSPF_A1, SDL_PIXELFORMAT_UNKNOWN },               /* 	1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */
+ 	{ DSPF_NV12, SDL_PIXELFORMAT_UNKNOWN },             /* 	12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */
+ 	{ DSPF_NV16, SDL_PIXELFORMAT_UNKNOWN },             /* 	16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */
+ 	{ DSPF_ARGB2554, SDL_PIXELFORMAT_UNKNOWN },         /* 	16 bit ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */
+ 	{ DSPF_NV21, SDL_PIXELFORMAT_UNKNOWN },             /* 	12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */
+ 	{ DSPF_AYUV, SDL_PIXELFORMAT_UNKNOWN },             /* 	32 bit AYUV (4 byte, alpha 8@24, Y 8@16, Cb 8@8, Cr 8@0) */
+ 	{ DSPF_A4, SDL_PIXELFORMAT_UNKNOWN },               /* 	4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */
+ 	{ DSPF_ARGB1666, SDL_PIXELFORMAT_UNKNOWN },         /* 	1 bit alpha (3 byte/ alpha 1@18, red 6@16, green 6@6, blue 6@0) */
+ 	{ DSPF_ARGB6666, SDL_PIXELFORMAT_UNKNOWN },         /* 	6 bit alpha (3 byte/ alpha 6@18, red 6@16, green 6@6, blue 6@0) */
+ 	{ DSPF_RGB18, SDL_PIXELFORMAT_UNKNOWN },            /* 	6 bit RGB (3 byte/ red 6@16, green 6@6, blue 6@0) */
+ 	{ DSPF_LUT2, SDL_PIXELFORMAT_UNKNOWN },             /* 	2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */
+
+#if (DFB_VERSION_ATLEAST(1,3,0))
+ 	{ DSPF_RGBA4444, SDL_PIXELFORMAT_UNKNOWN },         /* 16 bit RGBA (2 byte, red 4@12, green 4@8, blue 4@4, alpha 4@0) */
+#endif
+
+#if (DFB_VERSION_ATLEAST(1,4,0))
+ 	{ DSPF_RGBA5551, SDL_PIXELFORMAT_UNKNOWN },         /* 	16 bit RGBA (2 byte, red 5@11, green 5@6, blue 5@1, alpha 1@0) */
+ 	{ DSPF_YUV444P, SDL_PIXELFORMAT_UNKNOWN },          /* 	24 bit full YUV planar (8 bit Y plane followed by an 8 bit Cb and an 8 bit Cr plane) */
+ 	{ DSPF_ARGB8565, SDL_PIXELFORMAT_UNKNOWN },         /* 	24 bit ARGB (3 byte, alpha 8@16, red 5@11, green 6@5, blue 5@0) */
+ 	{ DSPF_AVYU, SDL_PIXELFORMAT_UNKNOWN },             /* 	32 bit AVYU 4:4:4 (4 byte, alpha 8@24, Cr 8@16, Y 8@8, Cb 8@0) */
+ 	{ DSPF_VYU, SDL_PIXELFORMAT_UNKNOWN },              /* 	24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0)  */
+#endif
+ 	
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1MSB },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4LSB }, 
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4MSB },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR24 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR888 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_RGBA8888 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR8888 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGRA8888 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ARGB2101010 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR4444 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR1555 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR565 },
+    { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU },                        /**< Packed mode: Y0+V0+Y1+U0 (1 pla	*/
+};
+
+static Uint32
+DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat)
+{
+    int i;
+    
+    for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++)
+        if (pixelformat_tab[i].dfb == pixelformat)
+        {
+            return pixelformat_tab[i].sdl;
+        }
+    return SDL_PIXELFORMAT_UNKNOWN;
 }
 
 static DFBSurfacePixelFormat
 SDLToDFBPixelFormat(Uint32 format)
 {
-    switch (format) {
-    case SDL_PIXELFORMAT_INDEX4LSB:
-        return DSPF_ALUT44;
-    case SDL_PIXELFORMAT_INDEX8:
-        return DSPF_LUT8;
-    case SDL_PIXELFORMAT_RGB332:
-        return DSPF_RGB332;
-    case SDL_PIXELFORMAT_RGB555:
-        return DSPF_ARGB1555;
-    case SDL_PIXELFORMAT_ARGB4444:
-        return DSPF_ARGB4444;
-    case SDL_PIXELFORMAT_ARGB1555:
-        return DSPF_ARGB1555;
-    case SDL_PIXELFORMAT_RGB565:
-        return DSPF_RGB16;
-    case SDL_PIXELFORMAT_RGB24:
-        return DSPF_RGB24;
-    case SDL_PIXELFORMAT_RGB888:
-        return DSPF_RGB32;
-    case SDL_PIXELFORMAT_ARGB8888:
-        return DSPF_ARGB;
-    case SDL_PIXELFORMAT_YV12:
-        return DSPF_YV12;       /* Planar mode: Y + V + U  (3 planes) */
-    case SDL_PIXELFORMAT_IYUV:
-        return DSPF_I420;       /* Planar mode: Y + U + V  (3 planes) */
-    case SDL_PIXELFORMAT_YUY2:
-        return DSPF_YUY2;       /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
-    case SDL_PIXELFORMAT_UYVY:
-        return DSPF_UYVY;       /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
-    case SDL_PIXELFORMAT_YVYU:
-        return DSPF_UNKNOWN;    /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
-    case SDL_PIXELFORMAT_INDEX1LSB:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_INDEX1MSB:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_INDEX4MSB:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_RGB444:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_BGR24:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_BGR888:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_RGBA8888:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_ABGR8888:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_BGRA8888:
-        return DSPF_UNKNOWN;
-    case SDL_PIXELFORMAT_ARGB2101010:
-        return DSPF_UNKNOWN;
-    default:
-        return DSPF_UNKNOWN;
-    }
+    int i;
+    
+    for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++)
+        if (pixelformat_tab[i].sdl == format)
+        {
+            return pixelformat_tab[i].dfb;
+        }
+    return  DSPF_UNKNOWN;
 }
 
 static DFBEnumerationResult
@@ -164,7 +153,6 @@
         modedata->modelist[modedata->nummodes++] = mode;
     }
 
-    SDL_DFB_DEBUG("w %d h %d bpp %d\n", width, height, bpp);
     return DFENUM_OK;
 }
 
@@ -202,7 +190,6 @@
     SDL_DFB_DEVICEDATA(_this);
     DFBDisplayLayerConfig config;
     DFBDisplayLayerConfigFlags failed;
-    int ret;
 
     SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
                                                       DLSCL_ADMINISTRATIVE));
@@ -221,7 +208,7 @@
     if (failed == 0)
         SDL_AddDisplayMode(display, mode);
     else
-        SDL_DFB_DEBUG("Mode %d x %d not available: %x\n", mode->w,
+        SDL_DFB_ERR("Mode %d x %d not available: %x\n", mode->w,
                       mode->h, failed);
 
     return;
@@ -295,19 +282,21 @@
             dlc.pixelformat = DSPF_ARGB;
             dlc.options = DLOP_ALPHACHANNEL;
 
-            ret = layer->SetConfiguration(layer, &dlc);
-            if (ret) {
+            ret = SDL_DFB_CHECK(layer->SetConfiguration(layer, &dlc));
+            if (ret != DFB_OK) {
                 /* try AiRGB if the previous failed */
                 dlc.pixelformat = DSPF_AiRGB;
-                ret = layer->SetConfiguration(layer, &dlc);
+                SDL_DFB_CHECKERR(layer->SetConfiguration(layer, &dlc));
             }
         }
 
         /* Query layer configuration to determine the current mode and pixelformat */
         dlc.flags = DLCONF_ALL;
-        layer->GetConfiguration(layer, &dlc);
+        SDL_DFB_CHECKERR(layer->GetConfiguration(layer, &dlc));
 
-        if (DFBToSDLPixelFormat(dlc.pixelformat, &mode.format) != 0) {
+        mode.format = DFBToSDLPixelFormat(dlc.pixelformat);
+        
+        if (mode.format == SDL_PIXELFORMAT_UNKNOWN) {
             SDL_DFB_ERR("Unknown dfb pixelformat %x !\n", dlc.pixelformat);
             goto error;
         }
@@ -363,7 +352,6 @@
     SDL_DisplayMode mode;
     struct modes_callback_t data;
     int i;
-    int ret;
 
     data.nummodes = 0;
     /* Enumerate the available fullscreen modes */
@@ -403,7 +391,6 @@
     DFB_DisplayData *data = (DFB_DisplayData *) display->driverdata;
     DFBDisplayLayerConfig config, rconfig;
     DFBDisplayLayerConfigFlags fail = 0;
-    DFBResult ret;
 
     SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
                                                       DLSCL_ADMINISTRATIVE));
@@ -469,7 +456,6 @@
 {
     //DFB_DeviceData *devdata = (DFB_DeviceData *) _this->driverdata;
     SDL_DisplayMode tmode;
-    DFBResult ret;
     int i;
 
     for (i = 0; i < _this->num_displays; ++i) {
--- a/src/video/directfb/SDL_DirectFB_modes.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_modes.h	Sun Aug 22 13:45:56 2010 -0700
@@ -26,7 +26,7 @@
 
 #include "SDL_DirectFB_video.h"
 
-#define SDL_DFB_DISPLAYDATA(dev, win)  DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (dev)->displays[(win)->display].driverdata : NULL)
+#define SDL_DFB_DISPLAYDATA(dev, win)  DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (win)->display->driverdata : NULL)
 
 typedef struct _DFB_DisplayData DFB_DisplayData;
 struct _DFB_DisplayData
--- a/src/video/directfb/SDL_DirectFB_mouse.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_mouse.c	Sun Aug 22 13:45:56 2010 -0700
@@ -26,6 +26,7 @@
 #include "../SDL_sysvideo.h"
 #include "../../events/SDL_mouse_c.h"
 
+#if USE_MULTI_API
 static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface,
                                          int hot_x, int hot_y);
 static int DirectFB_ShowCursor(SDL_Cursor * cursor);
@@ -239,4 +240,23 @@
     /* nothing yet */
 }
 
+#else /* USE_MULTI_API */
+
+void
+DirectFB_InitMouse(_THIS)
+{
+    SDL_DFB_DEVICEDATA(_this);
+
+    devdata->num_mice = 1;
+}
+
+void
+DirectFB_QuitMouse(_THIS)
+{
+    //SDL_DFB_DEVICEDATA(_this);
+}
+
+
+#endif
+
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/directfb/SDL_DirectFB_opengl.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_opengl.c	Sun Aug 22 13:45:56 2010 -0700
@@ -30,6 +30,10 @@
     int gl_active;              /* to stop switching drivers while we have a valid context */
     int initialized;
     DirectFB_GLContext *firstgl;        /* linked list */
+    
+    /* OpenGL */
+    void (*glFinish) (void);
+    void (*glFlush) (void);
 };
 
 #define OPENGL_REQUIRS_DLOPEN
@@ -94,7 +98,7 @@
 int
 DirectFB_GL_LoadLibrary(_THIS, const char *path)
 {
-    SDL_DFB_DEVICEDATA(_this);
+    //SDL_DFB_DEVICEDATA(_this);
 
     void *handle = NULL;
 
@@ -122,9 +126,6 @@
 
     SDL_DFB_DEBUG("Loaded library: %s\n", path);
 
-    /* Unload the old driver and reset the pointers */
-    DirectFB_GL_UnloadLibrary(_this);
-
     _this->gl_config.dll_handle = handle;
     _this->gl_config.driver_loaded = 1;
     if (path) {
@@ -134,8 +135,8 @@
         *_this->gl_config.driver_path = '\0';
     }
 
-    devdata->glFinish = DirectFB_GL_GetProcAddress(_this, "glFinish");
-    devdata->glFlush = DirectFB_GL_GetProcAddress(_this, "glFlush");
+    _this->gl_data->glFinish = DirectFB_GL_GetProcAddress(_this, "glFinish");
+    _this->gl_data->glFlush = DirectFB_GL_GetProcAddress(_this, "glFlush");
 
     return 0;
 }
@@ -143,6 +144,7 @@
 static void
 DirectFB_GL_UnloadLibrary(_THIS)
 {
+ #if 0
     int ret;
 
     if (_this->gl_config.driver_loaded) {
@@ -153,6 +155,10 @@
         _this->gl_config.dll_handle = NULL;
         _this->gl_config.driver_loaded = 0;
     }
+#endif
+    /* Free OpenGL memory */
+    SDL_free(_this->gl_data);
+    _this->gl_data = NULL;
 }
 
 void *
@@ -167,11 +173,11 @@
 SDL_GLContext
 DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
 {
+    //SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
     DirectFB_GLContext *context;
-    int ret;
 
-    SDL_DFB_CALLOC(context, 1, sizeof(*context));
+    SDL_DFB_CALLOC(context, 1, sizeof(DirectFB_GLContext));
 
     SDL_DFB_CHECKERR(windata->surface->GetGL(windata->surface,
                                              &context->context));
@@ -179,11 +185,14 @@
     if (!context->context)
         return NULL;
 
-    SDL_DFB_CHECKERR(context->context->Unlock(context->context));
-
+    context->is_locked = 0;
+    context->sdl_window = window;
+    
     context->next = _this->gl_data->firstgl;
     _this->gl_data->firstgl = context;
 
+    SDL_DFB_CHECK(context->context->Unlock(context->context));
+
     if (DirectFB_GL_MakeCurrent(_this, window, context) < 0) {
         DirectFB_GL_DeleteContext(_this, context);
         return NULL;
@@ -198,28 +207,24 @@
 int
 DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
 {
-    SDL_DFB_WINDOWDATA(window);
+    //SDL_DFB_WINDOWDATA(window);
     DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
     DirectFB_GLContext *p;
 
-    int ret;
-
     for (p = _this->gl_data->firstgl; p; p = p->next)
-        p->context->Unlock(p->context);
-
-    if (windata) {
-        windata->gl_context = NULL;
-        /* Everything is unlocked, check for a resize */
-        DirectFB_AdjustWindowSurface(window);
+    {
+       if (p->is_locked) {
+         SDL_DFB_CHECKERR(p->context->Unlock(p->context));
+         p->is_locked = 0;
+       }
+        
     }
 
     if (ctx != NULL) {
         SDL_DFB_CHECKERR(ctx->context->Lock(ctx->context));
+        ctx->is_locked = 1;
     }
 
-    if (windata)
-        windata->gl_context = ctx;
-
     return 0;
   error:
     return -1;
@@ -242,28 +247,36 @@
 void
 DirectFB_GL_SwapWindow(_THIS, SDL_Window * window)
 {
-    SDL_DFB_DEVICEDATA(_this);
+    //SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
-    int ret;
     DFBRegion region;
+    DirectFB_GLContext *p;
 
     region.x1 = 0;
     region.y1 = 0;
     region.x2 = window->w;
     region.y2 = window->h;
 
+#if 0
     if (devdata->glFinish)
         devdata->glFinish();
     else if (devdata->glFlush)
         devdata->glFlush();
+#endif
 
-    if (1 || windata->gl_context) {
-        /* SDL_DFB_CHECKERR(windata->gl_context->context->Unlock(windata->gl_context->context)); */
-        SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface, &region,
-                                                DSFLIP_ONSYNC));
-        /* SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context)); */
+  	for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
+        if (p->sdl_window == window && p->is_locked)
+        {
+            SDL_DFB_CHECKERR(p->context->Unlock(p->context));
+            p->is_locked = 0;
+        }            
 
-    }
+    SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,NULL,  DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC ));
+
+    //if (windata->gl_context) {
+        //SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface,NULL, DSFLIP_ONSYNC)); 
+        //SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context));
+    //}
 
     return;
   error:
@@ -276,19 +289,58 @@
     DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
     DirectFB_GLContext *p;
 
-    ctx->context->Unlock(ctx->context);
-    ctx->context->Release(ctx->context);
+    if (ctx->is_locked)
+        SDL_DFB_CHECK(ctx->context->Unlock(ctx->context));
+    SDL_DFB_RELEASE(ctx->context);
 
-    p = _this->gl_data->firstgl;
-    while (p && p->next != ctx)
-        p = p->next;
+    for (p = _this->gl_data->firstgl; p && p->next != ctx; p = p->next)
+        ;
     if (p)
         p->next = ctx->next;
     else
         _this->gl_data->firstgl = ctx->next;
 
     SDL_DFB_FREE(ctx);
+}
 
+void
+DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window)
+{
+    DirectFB_GLContext *p;
+    
+	for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
+	    if (p->sdl_window == window)
+	    {
+	    	if (p->is_locked)
+	        	SDL_DFB_CHECK(p->context->Unlock(p->context));
+	        SDL_DFB_RELEASE(p->context);
+	    }
+}
+
+void
+DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window)
+{
+    DirectFB_GLContext *p;
+
+	for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
+	    if (p->sdl_window == window)
+	    {
+            SDL_DFB_WINDOWDATA(window);
+			SDL_DFB_CHECK(windata->surface->GetGL(windata->surface,
+	                                         &p->context));
+    		if (p->is_locked)
+            	SDL_DFB_CHECK(p->context->Lock(p->context));
+	        }
+}
+
+void
+DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window)
+{
+    DirectFB_GLContext *p;
+
+	for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
+		if (p->sdl_window == window)
+			DirectFB_GL_DeleteContext(_this, p);
 }
 
 #endif
--- a/src/video/directfb/SDL_DirectFB_opengl.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_opengl.h	Sun Aug 22 13:45:56 2010 -0700
@@ -32,6 +32,9 @@
 {
     IDirectFBGL *context;
     DirectFB_GLContext *next;
+    
+    SDL_Window *sdl_window;
+    int is_locked;
 };
 
 /* OpenGL functions */
@@ -48,6 +51,10 @@
 extern void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window);
 extern void DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context);
 
+extern void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window);
+extern void DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window);
+extern void DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window);
+
 #endif /* SDL_DIRECTFB_OPENGL */
 
 #endif /* _SDL_directfb_opengl_h */
--- a/src/video/directfb/SDL_DirectFB_render.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_render.c	Sun Aug 22 13:45:56 2010 -0700
@@ -72,6 +72,7 @@
 static void DirectFB_DirtyTexture(SDL_Renderer * renderer,
                                   SDL_Texture * texture, int numrects,
                                   const SDL_Rect * rects);
+static int DirectFB_SetDrawBlendMode(SDL_Renderer * renderer);
 static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer,
                                 const SDL_Point * points, int count);
 static int DirectFB_RenderDrawLines(SDL_Renderer * renderer,
@@ -194,20 +195,20 @@
                                            /**< No blending */
             data->blitFlags = DSBLIT_NOFX;
             data->drawFlags = DSDRAW_NOFX;
-            destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE);
-            destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO);
+            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE));
+            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO));
             break;
         case SDL_BLENDMODE_MASK:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
             data->drawFlags = DSDRAW_BLEND;
-            destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
-            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
+            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
+            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
             break;
         case SDL_BLENDMODE_BLEND:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
             data->drawFlags = DSDRAW_BLEND;
-            destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
-            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
+            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
+            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
             break;
         case SDL_BLENDMODE_ADD:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
@@ -216,16 +217,16 @@
             // It will be cheaper to copy the surface to
             // a temporay surface and premultiply 
             if (source && TextureHasAlpha(source))
-                destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
+                SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
             else
-                destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE);
-            destsurf->SetDstBlendFunction(destsurf, DSBF_ONE);
+                SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE));
+            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ONE));
             break;
         case SDL_BLENDMODE_MOD:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
             data->drawFlags = DSDRAW_BLEND;
-            destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR);
-            destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO);
+            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR));
+            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO));
             break;
         }
         data->lastBlendMode = blendMode;
@@ -250,7 +251,6 @@
     SDL_DFB_WINDOWSURFACE(data->window);
     IDirectFBPalette *surfpal;
 
-    int ret;
     int i;
     int ncolors;
     DFBColor entries[256];
@@ -283,7 +283,6 @@
     SDL_VideoDisplay *display = window->display;
     SDL_Renderer *renderer = NULL;
     DirectFB_RenderData *data = NULL;
-    DFBResult ret;
     DFBSurfaceCapabilities scaps;
     char *p;
 
@@ -306,10 +305,16 @@
     renderer->DirtyTexture = DirectFB_DirtyTexture;
     renderer->RenderDrawPoints = DirectFB_RenderDrawPoints;
     renderer->RenderDrawLines = DirectFB_RenderDrawLines;
+    /* SetDrawColor - no needed */
+    renderer->SetDrawBlendMode = DirectFB_SetDrawBlendMode;
     renderer->RenderFillRects = DirectFB_RenderFillRects;
     renderer->RenderDrawRects = DirectFB_RenderDrawRects;
+    /* RenderDrawEllipse - no reference implementation yet */
+    /* RenderFillEllipse - no reference implementation yet */
     renderer->RenderCopy = DirectFB_RenderCopy;
     renderer->RenderPresent = DirectFB_RenderPresent;
+    /* RenderReadPixels is difficult to implement */
+    /* RenderWritePixels is difficult to implement */
     renderer->DestroyTexture = DirectFB_DestroyTexture;
     renderer->DestroyRenderer = DirectFB_DestroyRenderer;
     renderer->info = DirectFB_RenderDriver.info;
@@ -324,7 +329,7 @@
     data->flipflags = DSFLIP_PIPELINE | DSFLIP_BLIT;
 
     if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        data->flipflags |= DSFLIP_WAITFORSYNC;
+        data->flipflags |= DSFLIP_WAITFORSYNC | DSFLIP_ONSYNC;
         renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
     } else
         data->flipflags |= DSFLIP_ONSYNC;
@@ -396,11 +401,9 @@
         return DSPF_UNKNOWN;
     case SDL_PIXELFORMAT_INDEX4MSB:
         return DSPF_UNKNOWN;
+#if (DFB_VERSION_ATLEAST(1,2,0))
     case SDL_PIXELFORMAT_RGB444:
-#if (DFB_VERSION_ATLEAST(1,2,0))
         return DSPF_RGB444;
-#else
-        return DSPF_UNKNOWN;
 #endif
     case SDL_PIXELFORMAT_BGR24:
         return DSPF_UNKNOWN;
@@ -423,11 +426,11 @@
 DirectFB_ActivateRenderer(SDL_Renderer * renderer)
 {
     SDL_DFB_RENDERERDATA(renderer);
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+    SDL_Window *window = renderer->window;
     SDL_DFB_WINDOWDATA(window);
 
     if (renddata->size_changed || windata->wm_needs_redraw) {
-        DirectFB_AdjustWindowSurface(window);
+//        DirectFB_AdjustWindowSurface(window);
     }
     return 0;
 }
@@ -445,13 +448,13 @@
 DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     SDL_DFB_RENDERERDATA(renderer);
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+    SDL_Window *window = renderer->window;
     SDL_VideoDisplay *display = window->display;
     SDL_DFB_DEVICEDATA(display->device);
     DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
     DirectFB_TextureData *data = texture->driverdata;
     DFBDisplayLayerConfig layconf;
-    int ret;
+    DFBResult ret;
 
     if (renddata->isyuvdirect && (dispdata->vidID >= 0)
         && (!dispdata->vidIDinuse)
@@ -472,7 +475,7 @@
                                                        DLSCL_EXCLUSIVE));
 
         if (devdata->use_yuv_underlays) {
-            ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1);
+            ret = SDL_DFB_CHECK(dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1));
             if (ret != DFB_OK)
                 SDL_DFB_DEBUG("Underlay Setlevel not supported\n");
         }
@@ -501,11 +504,10 @@
 static int
 DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
 {
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+    SDL_Window *window = renderer->window;
     SDL_VideoDisplay *display = window->display;
     SDL_DFB_DEVICEDATA(display->device);
     DirectFB_TextureData *data;
-    DFBResult ret;
     DFBSurfaceDescription dsc;
     DFBSurfacePixelFormat pixelformat;
 
@@ -600,8 +602,7 @@
                            int ncolors)
 {
     DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    DFBResult ret;
-
+ 
     if (SDL_ISPIXELFORMAT_INDEXED(data->format)
         && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
         DFBColor entries[256];
@@ -631,7 +632,6 @@
                            int firstcolor, int ncolors)
 {
     DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    DFBResult ret;
 
     if (SDL_ISPIXELFORMAT_INDEXED(data->format)
         && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
@@ -687,6 +687,23 @@
 }
 
 static int
+DirectFB_SetDrawBlendMode(SDL_Renderer * renderer)
+{
+    switch (renderer->blendMode) {
+    case SDL_BLENDMODE_NONE:
+    case SDL_BLENDMODE_MASK:
+    case SDL_BLENDMODE_BLEND:
+    case SDL_BLENDMODE_ADD:
+    case SDL_BLENDMODE_MOD:
+        return 0;
+    default:
+        SDL_Unsupported();
+        renderer->blendMode = SDL_BLENDMODE_NONE;
+        return -1;
+    }
+}
+
+static int
 DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
 #if (DFB_VERSION_ATLEAST(1,2,0))
@@ -720,7 +737,6 @@
                        const SDL_Rect * rect, const void *pixels, int pitch)
 {
     DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    DFBResult ret;
     Uint8 *dpixels;
     int dpitch;
     Uint8 *src, *dst;
@@ -772,7 +788,6 @@
 {
     DirectFB_TextureData *texturedata =
         (DirectFB_TextureData *) texture->driverdata;
-    DFBResult ret;
 
     if (markDirty) {
         SDL_AddDirtyRect(&texturedata->dirty, rect);
@@ -807,7 +822,7 @@
         (DirectFB_TextureData *) texture->driverdata;
 
     if (texturedata->display) {
-        texturedata->surface->Unlock(texturedata->surface);
+        SDL_DFB_CHECK(texturedata->surface->Unlock(texturedata->surface));
         texturedata->pixels = NULL;
     }
 }
@@ -830,7 +845,6 @@
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
 
-    DFBResult ret;
     Uint8 r, g, b, a;
 
     r = renderer->r;
@@ -866,7 +880,6 @@
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
-    DFBResult ret;
     int i;
 
     PrepareDraw(renderer);
@@ -882,7 +895,6 @@
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
-    DFBResult ret;
     int i;
 
     PrepareDraw(renderer);
@@ -904,7 +916,6 @@
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
-    DFBResult ret;
     int i;
 
     PrepareDraw(renderer);
@@ -923,7 +934,6 @@
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
-    DFBResult ret;
     int i;
 
     PrepareDraw(renderer);
@@ -946,11 +956,10 @@
     DirectFB_TextureData *texturedata =
         (DirectFB_TextureData *) texture->driverdata;
     Uint8 alpha = 0xFF;
-    DFBResult ret;
 
     if (texturedata->display) {
         int px, py;
-        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+        SDL_Window *window = renderer->window;
         SDL_DFB_WINDOWDATA(window);
         SDL_VideoDisplay *display = texturedata->display;
         DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
@@ -960,7 +969,7 @@
                                                       srcrect->x, srcrect->y,
                                                       srcrect->w,
                                                       srcrect->h));
-        windata->window->GetPosition(windata->window, &px, &py);
+        SDL_DFB_CHECK(windata->window->GetPosition(windata->window, &px, &py));
         px += windata->client.x;
         py += windata->client.y;
         SDL_DFB_CHECKERR(dispdata->
@@ -1048,11 +1057,10 @@
 DirectFB_RenderPresent(SDL_Renderer * renderer)
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+    SDL_Window *window = renderer->window;
     SDL_DFB_WINDOWDATA(window);
 
     DFBRectangle sr;
-    DFBResult ret;
 
     sr.x = 0;
     sr.y = 0;
@@ -1078,8 +1086,9 @@
         DFB_DisplayData *dispdata =
             (DFB_DisplayData *) data->display->driverdata;
         dispdata->vidIDinuse = 0;
-        dispdata->vidlayer->SetCooperativeLevel(dispdata->vidlayer,
-                                                DLSCL_ADMINISTRATIVE);
+        /* FIXME: Shouldn't we reset the cooperative level */
+        SDL_DFB_CHECK(dispdata->vidlayer->SetCooperativeLevel(dispdata->vidlayer,
+                                                DLSCL_ADMINISTRATIVE));
         SDL_DFB_RELEASE(dispdata->vidlayer);
     }
     SDL_FreeDirtyRects(&data->dirty);
--- a/src/video/directfb/SDL_DirectFB_video.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_video.c	Sun Aug 22 13:45:56 2010 -0700
@@ -129,7 +129,7 @@
 #endif
 
     device->free = DirectFB_DeleteDevice;
-
+	fprintf(LOG_CHANNEL, "Device setup %p!!\n", device->ShowWindow);
     return device;
   error:
     if (device)
@@ -163,19 +163,20 @@
     fprintf(LOG_CHANNEL, "\nBlitting flags:\n");
     for (n = 0; blitting_flags[n].flag; n++) {
         if (desc.blitting_flags & blitting_flags[n].flag)
-            printf("    %s\n", blitting_flags[n].name);
+            fprintf(LOG_CHANNEL, "    %s\n", blitting_flags[n].name);
     }
 
     fprintf(LOG_CHANNEL, "\nDrawing flags:\n");
     for (n = 0; drawing_flags[n].flag; n++) {
         if (desc.drawing_flags & drawing_flags[n].flag)
-            printf("    %s\n", drawing_flags[n].name);
+            fprintf(LOG_CHANNEL, "    %s\n", drawing_flags[n].name);
     }
 
+
     fprintf(LOG_CHANNEL, "\nAcceleration flags:\n");
     for (n = 0; acceleration_mask[n].mask; n++) {
         if (desc.acceleration_mask & acceleration_mask[n].mask)
-            printf("    %s\n", acceleration_mask[n].name);
+            fprintf(LOG_CHANNEL, "    %s\n", acceleration_mask[n].name);
     }
 
 
@@ -208,7 +209,8 @@
             DirectFBSetOption("disable-module", "x11input");
     }
 
-    devdata->use_linux_input = 1;       /* default: on */
+	/* FIXME: Reenable as default once multi kbd/mouse interface is sorted out */
+	devdata->use_linux_input = 0;       /* default: on */
     stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT);
     if (stemp)
         devdata->use_linux_input = atoi(stemp);
@@ -248,6 +250,7 @@
 
     devdata->dfb = dfb;
     devdata->firstwin = NULL;
+    devdata->grabbed_window = NULL;
 
     _this->driverdata = devdata;
 
--- a/src/video/directfb/SDL_DirectFB_video.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_video.h	Sun Aug 22 13:45:56 2010 -0700
@@ -31,7 +31,14 @@
 
 #include "SDL_mouse.h"
 
-#define DEBUG 0
+
+/* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in
+ * in case we see this again ... 
+ */
+
+#define USE_MULTI_API	(0)
+
+#define DEBUG 1
 #define LOG_CHANNEL 	stdout
 
 #define DFB_VERSIONNUM(X, Y, Z)						\
@@ -71,49 +78,38 @@
 #define DFBENV_USE_LINUX_INPUT		"SDL_DIRECTFB_LINUX_INPUT"      /* Default: on  */
 #define DFBENV_USE_WM				"SDL_DIRECTFB_WM"       /* Default: off  */
 
-#define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { x->Release(x); x = NULL; } } while (0)
+#define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0)
 #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0)
 #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0)
 
 #if DEBUG
-#define SDL_DFB_DEBUG(x...) do { fprintf(LOG_CHANNEL, "%s:", __FUNCTION__); fprintf(LOG_CHANNEL, x); } while (0)
-#define SDL_DFB_DEBUGC(x...) do { fprintf(LOG_CHANNEL, x); } while (0)
-#else
-#define SDL_DFB_DEBUG(x...) do { } while (0)
-#define SDL_DFB_DEBUGC(x...) do { } while (0)
+/* FIXME: do something with DEBUG */
 #endif
 
 #define SDL_DFB_CONTEXT "SDL_DirectFB"
 
-#define SDL_DFB_ERR(x...) 							\
+static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line, const char *src_code) {
+	if (ret != DFB_OK) {
+		fprintf(LOG_CHANNEL, "%s <%d>:\n\t", src_file, src_line );
+		fprintf(LOG_CHANNEL, "\t%s\n", src_code );
+		fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) );
+		SDL_SetError( src_code, DirectFBErrorString (ret) );
+	}
+	return ret;
+}
+
+#define SDL_DFB_CHECK(x...) sdl_dfb_check( x, __FILE__, __LINE__, #x )
+
+#define SDL_DFB_CHECKERR(x...) if ( sdl_dfb_check( x, __FILE__, __LINE__, #x ) != DFB_OK ) goto error
+
+#define SDL_DFB_DEBUG(x...) 							\
 	do {											\
 		fprintf(LOG_CHANNEL, "%s: %s <%d>:\n\t",			\
 			SDL_DFB_CONTEXT, __FILE__, __LINE__ );	\
-		fprintf(LOG_CHANNEL, x );						\
+        fprintf(LOG_CHANNEL, x ); \
 	} while (0)
 
-#define SDL_DFB_CHECK(x...) \
-     do {                                                                \
-          ret = x;                                                    \
-          if (ret != DFB_OK) {                                        \
-               fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); 	      \
-               fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
-               fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
-               SDL_SetError( #x, DirectFBErrorString (ret) );         \
-          }                                                           \
-     } while (0)
-
-#define SDL_DFB_CHECKERR(x...) \
-     do {                                                                \
-          ret = x;                                                    \
-          if (ret != DFB_OK) {                                        \
-               fprintf(LOG_CHANNEL, "%s <%d>:\n", __FILE__, __LINE__ ); \
-               fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
-               fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
-               SDL_SetError( #x, DirectFBErrorString (ret) );         \
-               goto error; 					      \
-          }                                                           \
-     } while (0)
+#define SDL_DFB_ERR(x...) SDL_DFB_DEBUG( x )
 
 #define SDL_DFB_CALLOC(r, n, s) \
      do {                                                                \
@@ -151,9 +147,8 @@
     int use_linux_input;
     int has_own_wm;
 
-    /* OpenGL */
-    void (*glFinish) (void);
-    void (*glFlush) (void);
+	/* window grab */
+	SDL_Window *grabbed_window;
 
     /* global events */
     IDirectFBEventBuffer *events;
--- a/src/video/directfb/SDL_DirectFB_window.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_window.c	Sun Aug 22 13:45:56 2010 -0700
@@ -24,9 +24,14 @@
 #include "SDL_syswm.h"
 #include "../SDL_sysvideo.h"
 #include "../../events/SDL_keyboard_c.h"
+#include "../../video/SDL_pixels_c.h"
 
 #include "SDL_DirectFB_video.h"
+#if SDL_DIRECTFB_OPENGL
+#include "SDL_DirectFB_opengl.h"
+#endif
 
+static void DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window);
 
 int
 DirectFB_CreateWindow(_THIS, SDL_Window * window)
@@ -36,8 +41,7 @@
     DFB_WindowData *windata = NULL;
     DFBWindowOptions wopts;
     DFBWindowDescription desc;
-    IDirectFBFont *font;
-    int ret, x, y;
+    int x, y;
 
     SDL_DFB_CALLOC(window->driverdata, 1, sizeof(DFB_WindowData));
     windata = (DFB_WindowData *) window->driverdata;
@@ -69,7 +73,7 @@
         y = 0;
     }
 
-    DirectFB_WM_AdjustWindowLayout(window);
+    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
 
     /* Create Window */
     desc.flags =
@@ -87,7 +91,7 @@
                                                    &windata->window));
 
     /* Set Options */
-    windata->window->GetOptions(windata->window, &wopts);
+    SDL_DFB_CHECK(windata->window->GetOptions(windata->window, &wopts));
 
     if (window->flags & SDL_WINDOW_RESIZABLE)
         wopts |= DWOP_SCALE;
@@ -96,9 +100,9 @@
 
     if (window->flags & SDL_WINDOW_FULLSCREEN) {
         wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_STACKING | DWOP_KEEP_SIZE;
-        windata->window->SetStackingClass(windata->window, DWSC_UPPER);
+        SDL_DFB_CHECK(windata->window->SetStackingClass(windata->window, DWSC_UPPER));
     }
-    windata->window->SetOptions(windata->window, wopts);
+    SDL_DFB_CHECK(windata->window->SetOptions(windata->window, wopts));
 
     /* See what we got */
     SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
@@ -112,7 +116,7 @@
                      GetSubSurface(windata->window_surface, &windata->client,
                                    &windata->surface));
 
-    windata->window->SetOpacity(windata->window, 0xFF);
+    SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, 0xFF));
 
     /* Create Eventbuffer */
     SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
@@ -123,24 +127,13 @@
 
     /* Create a font */
     /* FIXME: once during Video_Init */
-    if (windata->is_managed) {
-        DFBFontDescription fdesc;
-
-        fdesc.flags = DFDESC_HEIGHT;
-        fdesc.height = windata->theme.font_size;
-        font = NULL;
-        SDL_DFB_CHECK(devdata->
-                      dfb->CreateFont(devdata->dfb, windata->theme.font,
-                                      &fdesc, &font));
-        windata->window_surface->SetFont(windata->window_surface, font);
-        SDL_DFB_RELEASE(font);
-    }
+    windata->font = NULL;
 
     /* Make it the top most window. */
-    windata->window->RaiseToTop(windata->window);
+    SDL_DFB_CHECK(windata->window->RaiseToTop(windata->window));
 
     /* remember parent */
-    windata->window = window;
+    windata->sdl_window = window;
 
     /* Add to list ... */
 
@@ -149,7 +142,7 @@
     devdata->firstwin = windata;
 
     /* Draw Frame */
-    DirectFB_WM_RedrawLayout(window);
+    DirectFB_WM_RedrawLayout(_this, window);
 
     return 0;
   error:
@@ -172,6 +165,7 @@
 
     if (windata->is_managed) {
         windata->wm_needs_redraw = 1;
+        DirectFB_WM_RedrawLayout(_this, window);
     } else
         SDL_Unsupported();
 }
@@ -182,7 +176,6 @@
     SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
     SDL_Surface *surface = NULL;
-    DFBResult ret;
 
     if (icon) {
         SDL_PixelFormat format;
@@ -216,7 +209,7 @@
             memcpy((char *) dest + i * pitch,
                    (char *) p + i * surface->pitch, 4 * surface->w);
 
-        windata->icon->Unlock(windata->icon);
+        SDL_DFB_CHECK(windata->icon->Unlock(windata->icon));
         SDL_FreeSurface(surface);
     } else {
         SDL_DFB_RELEASE(windata->icon);
@@ -249,16 +242,15 @@
         x = 0;
         y = 0;
     }
-    DirectFB_WM_AdjustWindowLayout(window);
-    windata->window->MoveTo(windata->window, x, y);
+    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
+    SDL_DFB_CHECK(windata->window->MoveTo(windata->window, x, y));
 }
 
 void
 DirectFB_SetWindowSize(_THIS, SDL_Window * window)
 {
-    SDL_DFB_DEVICEDATA(_this);
+    //SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
-    int ret;
 
     if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
         int cw;
@@ -272,23 +264,23 @@
 
         if (cw != window->w || ch != window->h) {
 
-            DirectFB_WM_AdjustWindowLayout(window);
+		    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
             SDL_DFB_CHECKERR(windata->window->Resize(windata->window,
                                                      windata->size.w,
                                                      windata->size.h));
         }
 
+        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
+                     (_this, window, &window->w, &window->h));
+        DirectFB_AdjustWindowSurface(_this, window);
+
         SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
                                                        DWET_ALL));
 
-        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
-                         (_this, window, &window->w, &window->h));
-
-        SDL_OnWindowResized(window);
     }
     return;
   error:
-    windata->window->EnableEvents(windata->window, DWET_ALL);
+    SDL_DFB_CHECK(windata->window->EnableEvents(windata->window, DWET_ALL));
     return;
 }
 
@@ -297,7 +289,7 @@
 {
     SDL_DFB_WINDOWDATA(window);
 
-    windata->window->SetOpacity(windata->window, windata->opacity);
+    SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, windata->opacity));
 
 }
 
@@ -306,8 +298,8 @@
 {
     SDL_DFB_WINDOWDATA(window);
 
-    windata->window->GetOpacity(windata->window, &windata->opacity);
-    windata->window->SetOpacity(windata->window, 0);
+    SDL_DFB_CHECK(windata->window->GetOpacity(windata->window, &windata->opacity));
+    SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, 0));
 }
 
 void
@@ -315,8 +307,8 @@
 {
     SDL_DFB_WINDOWDATA(window);
 
-    windata->window->RaiseToTop(windata->window);
-    windata->window->RequestFocus(windata->window);
+    SDL_DFB_CHECK(windata->window->RaiseToTop(windata->window));
+    SDL_DFB_CHECK(windata->window->RequestFocus(windata->window));
 }
 
 void
@@ -352,14 +344,23 @@
 void
 DirectFB_SetWindowGrab(_THIS, SDL_Window * window)
 {
+    SDL_DFB_DEVICEDATA(_this);
     SDL_DFB_WINDOWDATA(window);
+    DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL);
 
     if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) {
-        windata->window->GrabPointer(windata->window);
-        windata->window->GrabKeyboard(windata->window);
+        if (gwindata != NULL)
+        {
+		    SDL_DFB_CHECK(gwindata->window->UngrabPointer(gwindata->window));
+		    SDL_DFB_CHECK(gwindata->window->UngrabKeyboard(gwindata->window));
+        }
+        SDL_DFB_CHECK(windata->window->GrabPointer(windata->window));
+        SDL_DFB_CHECK(windata->window->GrabKeyboard(windata->window));
+        devdata->grabbed_window = window;
     } else {
-        windata->window->UngrabPointer(windata->window);
-        windata->window->UngrabKeyboard(windata->window);
+        SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window));
+        SDL_DFB_CHECK(windata->window->UngrabKeyboard(windata->window));
+        devdata->grabbed_window = NULL;
     }
 }
 
@@ -370,14 +371,19 @@
     SDL_DFB_WINDOWDATA(window);
     DFB_WindowData *p;
 
-    SDL_DFB_DEBUG("Trace\n");
+    /* Some cleanups */
+    SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window));
+    SDL_DFB_CHECK(windata->window->UngrabKeyboard(windata->window));
 
-    /* Some cleanups */
-    windata->window->UngrabPointer(windata->window);
-    windata->window->UngrabKeyboard(windata->window);
+#if SDL_DIRECTFB_OPENGL
+	DirectFB_GL_DestroyWindowContexts(_this, window);
+#endif
 
-    windata->window_surface->SetFont(windata->window_surface, NULL);
-    SDL_DFB_RELEASE(windata->icon);
+    SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, NULL));
+    SDL_DFB_CHECK(windata->surface->ReleaseSource(windata->surface));
+    SDL_DFB_CHECK(windata->window_surface->ReleaseSource(windata->window_surface));
+  	SDL_DFB_RELEASE(windata->icon);
+    SDL_DFB_RELEASE(windata->font);
     SDL_DFB_RELEASE(windata->eventbuffer);
     SDL_DFB_RELEASE(windata->surface);
     SDL_DFB_RELEASE(windata->window_surface);
@@ -405,15 +411,14 @@
     return SDL_FALSE;
 }
 
-void
-DirectFB_AdjustWindowSurface(SDL_Window * window)
+static void
+DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window)
 {
     SDL_DFB_WINDOWDATA(window);
     int adjust = windata->wm_needs_redraw;
     int cw, ch;
-    int ret;
 
-    DirectFB_WM_AdjustWindowLayout(window);
+    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
 
     SDL_DFB_CHECKERR(windata->
                      window_surface->GetSize(windata->window_surface, &cw,
@@ -423,6 +428,10 @@
     }
 
     if (adjust) {
+#if SDL_DIRECTFB_OPENGL
+		DirectFB_GL_FreeWindowContexts(_this, window);
+#endif
+
 #if DFB_VERSION_ATLEAST(1,2,1)
         SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
                                                         windata->size.w,
@@ -446,8 +455,12 @@
                          GetSubSurface(windata->window_surface,
                                        &windata->client, &windata->surface));
 #endif
-        DirectFB_WM_RedrawLayout(window);
-    }
+        DirectFB_WM_RedrawLayout(_this, window);
+        
+#if SDL_DIRECTFB_OPENGL
+		DirectFB_GL_ReAllocWindowContexts(_this, window);
+#endif
+   }
   error:
     return;
 }
--- a/src/video/directfb/SDL_DirectFB_window.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/directfb/SDL_DirectFB_window.h	Sun Aug 22 13:45:56 2010 -0700
@@ -34,9 +34,8 @@
     IDirectFBSurface *surface;
     IDirectFBSurface *window_surface;   /* only used with has_own_wm */
     IDirectFBWindow *window;
-    DirectFB_GLContext *gl_context;
     IDirectFBEventBuffer *eventbuffer;
-    SDL_Window *window;
+    SDL_Window *sdl_window;
     DFB_WindowData *next;
     Uint8 opacity;
     DFBRectangle client;
@@ -46,6 +45,7 @@
     int is_managed;
     int wm_needs_redraw;
     IDirectFBSurface *icon;
+    IDirectFBFont *font;
     DFB_Theme theme;
 };
 
@@ -69,7 +69,7 @@
 extern SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window,
                                          struct SDL_SysWMinfo *info);
 
-extern void DirectFB_AdjustWindowSurface(SDL_Window * window);
+//extern void DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window);
 
 #endif /* _SDL_directfb_window_h */
 
--- a/src/video/pandora/SDL_pandora.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/pandora/SDL_pandora.h	Sun Aug 22 13:45:56 2010 -0700
@@ -68,8 +68,8 @@
 /* Display and window functions */
 int PND_videoinit(_THIS);
 void PND_videoquit(_THIS);
-void PND_getdisplaymodes(_THIS);
-int PND_setdisplaymode(_THIS, SDL_DisplayMode * mode);
+void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display);
+int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
 int PND_setdisplaypalette(_THIS, SDL_Palette * palette);
 int PND_getdisplaypalette(_THIS, SDL_Palette * palette);
 int PND_setdisplaygammaramp(_THIS, Uint16 * ramp);
--- a/src/video/uikit/SDL_uikitappdelegate.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Sun Aug 22 13:45:56 2010 -0700
@@ -42,11 +42,12 @@
 	
 	/* store arguments */
 	forward_argc = argc;
-	forward_argv = (char **)malloc(argc * sizeof(char *));
+	forward_argv = (char **)malloc((argc+1) * sizeof(char *));
 	for (i=0; i<argc; i++) {
 		forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char));
 		strcpy(forward_argv[i], argv[i]);
 	}
+	forward_argv[i] = NULL;
 
 	/* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
 	UIApplicationMain(argc, argv, NULL, @"SDLUIKitDelegate");
--- a/src/video/uikit/SDL_uikitopengles.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/SDL_uikitopengles.m	Sun Aug 22 13:45:56 2010 -0700
@@ -26,6 +26,8 @@
 #include "SDL_uikitwindow.h"
 #include "jumphack.h"
 #include "SDL_sysvideo.h"
+#include "../../events/SDL_keyboard_c.h"
+#include "../../events/SDL_mouse_c.h"
 #include "SDL_loadso.h"
 #include <dlfcn.h>
 
@@ -125,7 +127,11 @@
         UIKit_GL_DeleteContext(_this, view);
         return NULL;
     }
-		
+
+	/* Make this window the current mouse focus for touch input */
+	SDL_SetMouseFocus(window);
+	SDL_SetKeyboardFocus(window);
+
 	return view;
 }
 
--- a/src/video/uikit/SDL_uikitview.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/SDL_uikitview.h	Sun Aug 22 13:45:56 2010 -0700
@@ -13,8 +13,7 @@
     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
+    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
@@ -22,14 +21,13 @@
 
 #import <UIKit/UIKit.h>
 #include "SDL_stdinc.h"
-#include "SDL_mouse.h"
-#include "SDL_mouse_c.h"
 #include "SDL_events.h"
 
-#if SDL_IPHONE_MULTIPLE_MICE
+#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
+#define FIXED_MULTITOUCH
+
+#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
 #define MAX_SIMULTANEOUS_TOUCHES 5
-#else
-#define MAX_SIMULTANEOUS_TOUCHES 1
 #endif
 
 /* *INDENT-OFF* */
@@ -38,8 +36,13 @@
 #else
 @interface SDL_uikitview : UIView {
 #endif
-		
-	SDL_Mouse mice[MAX_SIMULTANEOUS_TOUCHES];
+
+#ifdef FIXED_MULTITOUCH
+	long touchId;
+#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
+	UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
+#endif
+#endif
 
 #if SDL_IPHONE_KEYBOARD
 	UITextField *textField;
--- a/src/video/uikit/SDL_uikitview.m	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/SDL_uikitview.m	Sun Aug 22 13:45:56 2010 -0700
@@ -22,8 +22,11 @@
 
 #import "SDL_uikitview.h"
 
+#include "../../events/SDL_keyboard_c.h"
+#include "../../events/SDL_mouse_c.h"
+#include "../../events/SDL_touch_c.h"
+
 #if SDL_IPHONE_KEYBOARD
-#import "SDL_keyboard_c.h"
 #import "keyinfotable.h"
 #import "SDL_uikitappdelegate.h"
 #import "SDL_uikitwindow.h"
@@ -33,7 +36,6 @@
 
 - (void)dealloc {
 #if SDL_IPHONE_KEYBOARD
-	SDL_DelKeyboard(0);
 	[textField release];
 #endif
 	[super dealloc];
@@ -47,14 +49,27 @@
 	[self initializeKeyboard];
 #endif	
 
-	int i;
-	for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
-        mice[i].id = i;
-		mice[i].driverdata = NULL;
-		SDL_AddMouse(&mice[i], "Mouse", 0, 0, 1);
-	}
-	self.multipleTouchEnabled = YES;
-			
+#ifdef FIXED_MULTITOUCH
+	SDL_Touch touch;
+	touch.id = 0; //TODO: Should be -1?
+
+	//touch.driverdata = SDL_malloc(sizeof(EventTouchData));
+	//EventTouchData* data = (EventTouchData*)(touch.driverdata);
+	
+	touch.x_min = 0;
+	touch.x_max = frame.size.width;
+	touch.native_xres = touch.x_max - touch.x_min;
+	touch.y_min = 0;
+	touch.y_max = frame.size.height;
+	touch.native_yres = touch.y_max - touch.y_min;
+	touch.pressure_min = 0;
+	touch.pressure_max = 1;
+	touch.native_pressureres = touch.pressure_max - touch.pressure_min;
+
+
+	touchId = SDL_AddTouch(&touch, "IPHONE SCREEN");
+#endif
+
 	return self;
 
 }
@@ -62,71 +77,87 @@
 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
 
 	NSEnumerator *enumerator = [touches objectEnumerator];
-	UITouch *touch =(UITouch*)[enumerator nextObject];
+	UITouch *touch = (UITouch*)[enumerator nextObject];
 	
-	/* associate touches with mice, so long as we have slots */
-	int i;
-	int found = 0;
-	for(i=0; touch && i < MAX_SIMULTANEOUS_TOUCHES; i++) {
+	//NSLog("Click");
 	
-		/* check if this mouse is already tracking a touch */
-		if (mice[i].driverdata != NULL) {
-			continue;
-		}
-		/*	
-			mouse not associated with anything right now,
-			associate the touch with this mouse
-		*/
-		found = 1;
-		
-		/* save old mouse so we can switch back */
-		int oldMouse = SDL_SelectMouse(-1);
-		
-		/* select this slot's mouse */
-		SDL_SelectMouse(i);
+	if (touch) {
 		CGPoint locationInView = [touch locationInView: self];
-		
-		/* set driver data to touch object, we'll use touch object later */
-		mice[i].driverdata = [touch retain];
-		
+			
 		/* send moved event */
-		SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y, 0);
-		
+		SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
+
 		/* send mouse down event */
-		SDL_SendMouseButton(i, SDL_PRESSED, SDL_BUTTON_LEFT);
-		
-		/* re-calibrate relative mouse motion */
-		SDL_GetRelativeMouseState(i, NULL, NULL);
-		
-		/* grab next touch */
-		touch = (UITouch*)[enumerator nextObject]; 
-		
-		/* switch back to our old mouse */
-		SDL_SelectMouse(oldMouse);
-		
-	}	
+		SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT);
+	}
+
+#ifdef FIXED_MULTITOUCH
+	while(touch) {
+	  CGPoint locationInView = [touch locationInView: self];
+
+
+#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
+	  //FIXME: TODO: Using touch as the fingerId is potentially dangerous
+	  //It is also much more efficient than storing the UITouch pointer
+	  //and comparing it to the incoming event.
+	  SDL_SendFingerDown(touchId,(long)touch,
+			     SDL_TRUE,locationInView.x,locationInView.y,
+			     1);
+#else
+	  int i;
+	  for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
+	    if(finger[i] == NULL) {
+	      finger[i] = touch;
+	      SDL_SendFingerDown(touchId,i,
+				 SDL_TRUE,locationInView.x,locationInView.y,
+				 1);
+	      break;
+	    }
+	  }
+#endif
+	  
+
+	  
+
+	  touch = (UITouch*)[enumerator nextObject]; 
+	}
+#endif
 }
 
 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
 	
 	NSEnumerator *enumerator = [touches objectEnumerator];
-	UITouch *touch=nil;
+	UITouch *touch = (UITouch*)[enumerator nextObject];
 	
-	while(touch = (UITouch *)[enumerator nextObject]) {
-		/* search for the mouse slot associated with this touch */
-		int i, found = NO;
-		for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
-			if (mice[i].driverdata == touch) {
-				/* found the mouse associate with the touch */
-				[(UITouch*)(mice[i].driverdata) release];
-				mice[i].driverdata = NULL;
-				/* send mouse up */
-				SDL_SendMouseButton(i, SDL_RELEASED, SDL_BUTTON_LEFT);
-				/* discontinue search for this touch */
-				found = YES;
-			}
-		}
+	if (touch) {
+		/* send mouse up */
+		SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT);
 	}
+
+#ifdef FIXED_MULTITOUCH
+	while(touch) {
+	  CGPoint locationInView = [touch locationInView: self];
+	  
+
+#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
+	  SDL_SendFingerDown(touchId,(long)touch,
+			     SDL_FALSE,locationInView.x,locationInView.y,
+			     1);
+#else
+	  int i;
+	  for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
+	    if(finger[i] == touch) {
+	      SDL_SendFingerDown(touchId,i,
+				 SDL_FALSE,locationInView.x,locationInView.y,
+				 1);
+	      break;
+	    }
+	  }
+#endif
+
+	  touch = (UITouch*)[enumerator nextObject]; 
+	}
+#endif
 }
 
 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -141,22 +172,39 @@
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
 	
 	NSEnumerator *enumerator = [touches objectEnumerator];
-	UITouch *touch=nil;
+	UITouch *touch = (UITouch*)[enumerator nextObject];
 	
-	while(touch = (UITouch *)[enumerator nextObject]) {
-		/* try to find the mouse associated with this touch */
-		int i, found = NO;
-		for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
-			if (mice[i].driverdata == touch) {
-				/* found proper mouse */
-				CGPoint locationInView = [touch locationInView: self];
-				/* send moved event */
-				SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y, 0);
-				/* discontinue search */
-				found = YES;
-			}
-		}
+	if (touch) {
+		CGPoint locationInView = [touch locationInView: self];
+
+		/* send moved event */
+		SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
 	}
+
+#ifdef FIXED_MULTITOUCH
+	while(touch) {
+	  CGPoint locationInView = [touch locationInView: self];
+	  
+
+#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
+	  SDL_SendTouchMotion(touchId,(long)touch,
+			      SDL_FALSE,locationInView.x,locationInView.y,
+			      1);
+#else
+	  int i;
+	  for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
+	    if(finger[i] == touch) {
+	      SDL_SendTouchMotion(touchId,i,
+				  SDL_FALSE,locationInView.x,locationInView.y,
+				  1);
+	      break;
+	    }
+	  }
+#endif
+
+	  touch = (UITouch*)[enumerator nextObject]; 
+	}
+#endif
 }
 
 /*
@@ -190,15 +238,6 @@
 	keyboardVisible = NO;
 	/* add the UITextField (hidden) to our view */
 	[self addSubview: textField];
-	
-	/* create our SDL_Keyboard */
-	SDL_Keyboard keyboard;
-	SDL_zero(keyboard);
-	SDL_AddKeyboard(&keyboard, 0);
-	SDLKey keymap[SDL_NUM_SCANCODES];
-	SDL_GetDefaultKeymap(keymap);
-	SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
-	
 }
 
 /* reveal onscreen virtual keyboard */
@@ -218,8 +257,8 @@
 	
 	if ([string length] == 0) {
 		/* it wants to replace text with nothing, ie a delete */
-		SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_DELETE);
-		SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_DELETE);
+		SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE);
+		SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE);
 	}
 	else {
 		/* go through all the characters in the string we've been sent
@@ -245,14 +284,14 @@
 			
 			if (mod & KMOD_SHIFT) {
 				/* If character uses shift, press shift down */
-				SDL_SendKeyboardKey( 0, SDL_PRESSED, SDL_SCANCODE_LSHIFT);
+				SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT);
 			}
 			/* send a keydown and keyup even for the character */
-			SDL_SendKeyboardKey( 0, SDL_PRESSED, code);
-			SDL_SendKeyboardKey( 0, SDL_RELEASED, code);
+			SDL_SendKeyboardKey(SDL_PRESSED, code);
+			SDL_SendKeyboardKey(SDL_RELEASED, code);
 			if (mod & KMOD_SHIFT) {
 				/* If character uses shift, press shift back up */
-				SDL_SendKeyboardKey( 0, SDL_RELEASED, SDL_SCANCODE_LSHIFT);
+				SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);
 			}			
 		}
 	}
--- a/src/video/uikit/jumphack.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/jumphack.c	Sun Aug 22 13:45:56 2010 -0700
@@ -13,7 +13,7 @@
 
 /* returns the jump environment for setting / getting purposes */
 jmp_buf *
-jump_env()
+jump_env(void)
 {
     return &env;
 }
--- a/src/video/uikit/jumphack.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/uikit/jumphack.h	Sun Aug 22 13:45:56 2010 -0700
@@ -11,6 +11,6 @@
 
 /* see SDL_uikitevents.m for more info */
 
-extern jmp_buf *jump_env();
+extern jmp_buf *jump_env(void);
 
 #endif
--- a/src/video/win32/SDL_ceddrawrender.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_ceddrawrender.c	Sun Aug 22 13:45:56 2010 -0700
@@ -459,6 +459,8 @@
     }
     data->ddraw = videodata->ddraw;
 
+    videodata->render = RENDER_DDRAW;
+
     renderer->DisplayModeChanged = DDRAW_DisplayModeChanged;
     renderer->CreateTexture = DDRAW_CreateTexture;
     renderer->QueryTexturePixels = DDRAW_QueryTexturePixels;
--- a/src/video/win32/SDL_d3drender.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_d3drender.c	Sun Aug 22 13:45:56 2010 -0700
@@ -451,6 +451,8 @@
     }
     data->d3d = videodata->d3d;
 
+    videodata->render = RENDER_D3D;
+
     renderer->DisplayModeChanged = D3D_DisplayModeChanged;
     renderer->CreateTexture = D3D_CreateTexture;
     renderer->QueryTexturePixels = D3D_QueryTexturePixels;
--- a/src/video/win32/SDL_gapirender.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_gapirender.c	Sun Aug 22 13:45:56 2010 -0700
@@ -1,670 +1,1281 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 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.
+/***************************************************************************
+ *   Copyright (C) 2010 by Andrey Afletdinov <afletdinov@gmail.com>        *
+ *                                                                         *
+ *   WinCE RAW/GAPI video driver                                           *
+ *                                                                         *
+ *   Part of the SDL - (Simple DirectMedia Layer)                          *
+ *   http://www.libsdl.org                                                 *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
 
-    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
-    
-    Stefan Klug
-    klug.stefan@gmx.de
-*/
 #include "SDL_config.h"
 
 #if SDL_VIDEO_RENDER_GAPI
 
 #include "SDL_win32video.h"
-//#include "../SDL_sysvideo.h"
+#include "SDL_win32window.h"
 #include "../SDL_yuv_sw_c.h"
-#include "../SDL_renderer_sw.h"
 
-#include "SDL_gapirender_c.h"
-
-#define GAPI_RENDERER_DEBUG 1
-
-/* GAPI renderer implementation */
+// RawFrameBufferInfo
+typedef struct
+{
+   WORD wFormat;
+   WORD wBPP;
+   VOID *pFramePointer;
+   int  cxStride;
+   int  cyStride;
+   int  cxPixels;
+   int  cyPixels;
+} RawFrameBufferInfo;
 
-static SDL_Renderer *GAPI_CreateRenderer(SDL_Window * window, Uint32 flags);
-static int GAPI_RenderDrawPoints(SDL_Renderer * renderer,
-                                 const SDL_Point * points, int count);
-static int GAPI_RenderDrawLines(SDL_Renderer * renderer,
-                                const SDL_Point * points, int count);
-static int GAPI_RenderDrawRects(SDL_Renderer * renderer,
-                                const SDL_Rect ** rects, int count);
-static int GAPI_RenderFillRects(SDL_Renderer * renderer,
-                                const SDL_Rect ** rects, int count);
-static int GAPI_RenderCopy(SDL_Renderer * renderer,
-                           SDL_Texture * texture,
-                           const SDL_Rect * srcrect,
-                           const SDL_Rect * dstrect);
-static void GAPI_RenderPresent(SDL_Renderer * renderer);
-static void GAPI_DestroyRenderer(SDL_Renderer * renderer);
+// GXDeviceInfo
+typedef struct
+{
+    long Version;
+    void* pvFrameBuffer;
+    unsigned long cbStride;
+    unsigned long cxWidth;
+    unsigned long cyHeight;
+    unsigned long cBPP;
+    unsigned long ffFormat;
+    char unknown[0x84 - 7 * 4];
+} GXDeviceInfo;
 
-
-SDL_RenderDriver GAPI_RenderDriver = {
-    GAPI_CreateRenderer,
-    {
-     "gapi",
-     (SDL_RENDERER_SINGLEBUFFER),
-     }
+// wince: GXDisplayProperties
+struct GXDisplayProperties
+{
+    DWORD cxWidth;
+    DWORD cyHeight;
+    long cbxPitch;
+    long cbyPitch;
+    long cBPP;
+    DWORD ffFormat;
 };
 
-static HMODULE g_hGapiLib = 0;
+// gx.dll
+typedef int   (*PFNGXOpenDisplay)(HWND hWnd, DWORD dwFlags);
+typedef int   (*PFNGXCloseDisplay)();
+typedef void* (*PFNGXBeginDraw)();
+typedef int   (*PFNGXEndDraw)();
+typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties)();
+typedef int   (*PFNGXSuspend)();
+typedef int   (*PFNGXResume)();
 
-// for testing with GapiEmu
-#define USE_GAPI_EMU 0
-#define EMULATE_AXIM_X30 0
+typedef struct
+{
+    // gx.dll
+    HMODULE                   hGapiLib;
+    PFNGXOpenDisplay          GXOpenDisplay;
+    PFNGXCloseDisplay         GXCloseDisplay;
+    PFNGXBeginDraw            GXBeginDraw;
+    PFNGXEndDraw              GXEndDraw;
+    PFNGXGetDisplayProperties GXGetDisplayProperties;
+    PFNGXSuspend              GXSuspend;
+    PFNGXResume               GXResume;
+} GapiInfo;
+
+//#ifndef DM_DISPLAYORIENTATION
+//#define DM_DISPLAYORIENTATION 0x00800000L
+//#endif
+
+#define FORMAT_565		1
+#define FORMAT_555		2
+#define FORMAT_OTHER		3
+
+#define GETRAWFRAMEBUFFER	0x00020001
+#define GETGXINFO		0x00020000
+
+#define kfPalette		0x10
+#define kfDirect		0x20
+#define kfDirect555		0x40
+#define kfDirect565		0x80
 
-#if 0
-#define GAPI_LOG(...) printf(__VA_ARGS__)
-#else
-#define GAPI_LOG(...)
-#endif
+#define GX_FULLSCREEN		0x01
+
+enum ScreenOrientation { ORIENTATION_UNKNOWN = -1, ORIENTATION_UP = DMDO_0, ORIENTATION_DOWN = DMDO_180, ORIENTATION_LEFT = DMDO_270, ORIENTATION_RIGHT = DMDO_90 };
+enum ScreenGeometry { GEOMETRY_UNKNOWN, GEOMETRY_PORTRAIT, GEOMETRY_LANDSCAPE, GEOMETRY_SQUARE };
+enum FrameBufferFlags { FB_SKIP_OFFSET = 0x0001, FB_RAW_MODE = 0x0002, FB_SUSPENDED = 0x0004 };
+
+// private framebuffer info
+typedef struct
+{
+    int width;
+    int height;
+    int xpitch;
+    int ypitch;
+    int offset;
+} FrameBufferInfo;
 
+// private display data
+typedef struct
+{
+    unsigned char* pixels;	// video memory
+    int format;			// video format
+    FrameBufferInfo fb;		// framebuffer geometry
+    GapiInfo* gapi;		// GAPI module
+    int userOrientation;
+    int systemOrientation;
+    int hardwareGeometry;
+    int flags;			// fb flags
+    float scale;		// scale pointer position
+    int debug;
 
-#if USE_GAPI_EMU && !REPORT_VIDEO_INFO
-#pragma message("Warning: Using GapiEmu in release build. I assume you'd like to set USE_GAPI_EMU to zero.")
-#endif
+} WINCE_RenderData;
+
+typedef struct
+{
+    SDL_SW_YUVTexture *yuv;
+    Uint32 format;
+    void *pixels;
+    int pitch;
+
+} WINCE_TextureData;
 
 
-static void
-GAPI_SetError(const char *prefix, HRESULT result)
-{
-    const char *error;
+// system func
+SDL_Renderer*	WINCE_CreateRenderer(SDL_Window* window, Uint32 flags);
+void		WINCE_DestroyRenderer(SDL_Renderer* renderer);
+
+int		WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture);
+void		WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture);
+int		WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch);
+int		WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch);
+int		WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch);
+void		WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture);
+
+int		WINCE_Available(void);
+void		WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height);
+
+int		WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect);
+void		WINCE_ShowWindow(_THIS, SDL_Window* window, int visible);
+
+void		WINCE_RenderPresent(SDL_Renderer* renderer);
+int		WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count);
+int		WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count);
+int		WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count);
+int		WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count);
+
+void		WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt);
+void		WINCE_DumpVideoInfo(WINCE_RenderData* data);
+void		WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height);
+void		WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height);
+void		WINCE_SquareTransform(WINCE_RenderData* data, int width, int height);
+int		WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug);
+int		WINCE_GetDMOrientation(void);
+int		WINCE_SetDMOrientation(int orientation);
+void		WINCE_UpdateYUVTextureData(SDL_Texture* texture);
+
+// gapi engine specific
+int		GAPI_Init(WINCE_RenderData* data, HWND hwnd);
+void		GAPI_Quit(WINCE_RenderData* data);
+
+// raw engine specific
+int		RAW_Init(WINCE_RenderData* data);
+void		RAW_Quit(WINCE_RenderData* data);
+
+// tools
+void		FrameBufferRotate(FrameBufferInfo* src, int orientation);
+int		GetFrameBufferOrientation(const FrameBufferInfo* src);
+void		PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation);
+void		FrameBufferInitialize(FrameBufferInfo* fb);
+void		FrameBufferDumpInfo(const FrameBufferInfo* fb, const char*);
+const		char* GetOrientationName(int orientation);
+void		UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width);
+
+// stdlib
+inline int	__abs(int x){ return x < 0 ? -x : x; };
+inline void	__swap(int* a, int* b){ int t = *a; *a = *b; *b = t; };
 
-    switch (result) {
-    default:
-        error = "UNKNOWN";
-        break;
+#define GAPI_RENDER_NAME	"gapi"
+#define RAW_RENDER_NAME		"raw"
+//
+SDL_RenderDriver GAPI_RenderDriver = {
+    WINCE_CreateRenderer,
+    {
+	GAPI_RENDER_NAME,
+	(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
+	(SDL_TEXTUREMODULATE_NONE),
+	(SDL_BLENDMODE_NONE),
+	(SDL_TEXTURESCALEMODE_NONE),
+	7,
+	{
+	    SDL_PIXELFORMAT_RGB555,
+	    SDL_PIXELFORMAT_RGB565,
+	    SDL_PIXELFORMAT_YV12,
+	    SDL_PIXELFORMAT_IYUV,
+	    SDL_PIXELFORMAT_YUY2,
+	    SDL_PIXELFORMAT_UYVY,
+	    SDL_PIXELFORMAT_YVYU
+	},
+	0,
+	0
     }
-    SDL_SetError("%s: %s", prefix, error);
+};
+
+SDL_RenderDriver RAW_RenderDriver = {
+    WINCE_CreateRenderer,
+    {
+	RAW_RENDER_NAME,
+	(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
+	(SDL_TEXTUREMODULATE_NONE),
+	(SDL_BLENDMODE_NONE),
+	(SDL_TEXTURESCALEMODE_NONE),
+	7,
+	{
+	    SDL_PIXELFORMAT_RGB555,
+	    SDL_PIXELFORMAT_RGB565,
+	    SDL_PIXELFORMAT_YV12,
+	    SDL_PIXELFORMAT_IYUV,
+	    SDL_PIXELFORMAT_YUY2,
+	    SDL_PIXELFORMAT_UYVY,
+	    SDL_PIXELFORMAT_YVYU
+	},
+	0,
+	0
+    }
+};
+
+int WINCE_Available(void)
+{
+    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
+
+    // raw check
+    RawFrameBufferInfo rfbi = { 0 };
+    HDC hdc = GetDC(NULL);
+    int render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
+    ReleaseDC(NULL, hdc);
+
+    if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 &&
+        rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0)
+	    render_raw = 1;
+
+    if(preferably && 0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0 != render_raw;
+
+    // gapi check
+    HMODULE render_gapi = LoadLibrary(TEXT("\\Windows\\gx.dll"));
+    if(0 == render_gapi)
+        render_gapi = LoadLibrary(TEXT("gx.dll"));
+    FreeLibrary(render_gapi);
+
+    if(preferably && 0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0 != render_gapi;
+
+    return 0 != render_raw || 0 != render_gapi;
 }
 
-void
-GAPI_AddRenderDriver(_THIS)
+void WINCE_AddRenderDriver(_THIS)
 {
-    int i;
+    HDC hdc;
+    HMODULE render_gapi;
+    int render_raw, ii;
+    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
 
-    /* TODO: should we check for support of GetRawFramebuffer here?
-     */
-#if USE_GAPI_EMU
-    g_hGapiLib = LoadLibrary(L"GAPI_Emu.dll");
-#else
-    g_hGapiLib = LoadLibrary(L"\\Windows\\gx.dll");
-#endif
+   // raw check
+    RawFrameBufferInfo rfbi = { 0 };
+    hdc = GetDC(NULL);
+    render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
+    ReleaseDC(NULL, hdc);
 
-    if (g_hGapiLib) {
-#define LINK(name,import) gx.name = (PFN##name)GetProcAddress( g_hGapiLib, L##import );
+    if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 &&
+    	rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0)
+	    render_raw = 1;
 
-        LINK(GXOpenDisplay, "?GXOpenDisplay@@YAHPAUHWND__@@K@Z")
-            LINK(GXCloseDisplay, "?GXCloseDisplay@@YAHXZ")
-            LINK(GXBeginDraw, "?GXBeginDraw@@YAPAXXZ")
-            LINK(GXEndDraw, "?GXEndDraw@@YAHXZ")
-            LINK(GXOpenInput, "?GXOpenInput@@YAHXZ")
-            LINK(GXCloseInput, "?GXCloseInput@@YAHXZ")
-            LINK(GXGetDisplayProperties,
-                 "?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ")
-            LINK(GXGetDefaultKeys, "?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z")
-            LINK(GXSuspend, "?GXSuspend@@YAHXZ")
-            LINK(GXResume, "?GXResume@@YAHXZ")
-            LINK(GXSetViewport, "?GXSetViewport@@YAHKKKK@Z")
-            LINK(GXIsDisplayDRAMBuffer, "?GXIsDisplayDRAMBuffer@@YAHXZ")
+    // gapi check
+    render_gapi = LoadLibrary(TEXT("\\Windows\\gx.dll"));
+    if(0 == render_gapi)
+        render_gapi = LoadLibrary(TEXT("gx.dll"));
+
+    if(render_gapi)
+	FreeLibrary(render_gapi);
 
-            /* wrong gapi.dll */
-            if (!gx.GXOpenDisplay) {
-            FreeLibrary(g_hGapiLib);
-            g_hGapiLib = 0;
-        }
-#undef LINK
-    }
-
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_AddRenderDriver(&_this->displays[i], &GAPI_RenderDriver);
+    for(ii = 0; ii < _this->num_displays; ++ii)
+    {
+	if(preferably)
+	{
+	    if(0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME) && render_raw)
+    		SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver);
+	    else
+	    if(0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME) && render_gapi)
+    		SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver);
+	}
+	else
+	{
+	    if(render_raw)
+    		SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver);
+	    if(render_gapi)
+    		SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver);
+	}
     }
 }
 
-typedef enum
-{
-    USAGE_GX_FUNCS = 0x0001,    /* enable to use GXOpen/GXClose/GXBeginDraw... */
-    USAGE_DATA_PTR_CONSTANT = 0x0002    /* the framebuffer is at a constant location, don't use values from GXBeginDraw() */
-} GAPI_UsageFlags;
-
-
-
-typedef struct
-{
-    int w;
-    int h;
-    int xPitch;                 /* bytes to move to go to the next pixel */
-    int yPitch;                 /* bytes to move to go to the next line */
-    int offset;                 /* data offset, to add to the data returned from GetFramebuffer, before processing */
-
-    void *data;
-    Uint32 usageFlags;          /* these flags contain options to define screen handling and to reliably workarounds */
-
-    Uint32 format;              /* pixel format as defined in SDL_pixels.h */
-
-} GAPI_RenderData;
-
-
-static Uint32
-GuessPixelFormatFromBpp(int bpp)
+SDL_Renderer* WINCE_CreateRenderer(SDL_Window* window, Uint32 flags)
 {
-    switch (bpp) {
-    case 15:
-        return SDL_PIXELFORMAT_RGB555;
-    case 16:
-        return SDL_PIXELFORMAT_RGB565;
-    default:
-        return SDL_PIXELFORMAT_UNKNOWN;
-        break;
-    }
-}
+    SDL_VideoDisplay* display = window->display;
+    SDL_DisplayMode* displayMode = &display->current_mode;
+    SDL_WindowData* windowdata = (SDL_WindowData *) window->driverdata;
+    SDL_Renderer* renderer;
+    WINCE_RenderData* data;
+    int bpp;
+    Uint32 Rmask, Gmask, Bmask, Amask;
 
-static GAPI_RenderData *
-FillRenderDataRawFramebuffer(SDL_Window * window)
-{
-    RawFrameBufferInfo rbi;
-    GAPI_RenderData *renderdata;
-    HDC hdc;
+    if(!(window->flags & SDL_WINDOW_FULLSCREEN))
+	window->flags |= SDL_WINDOW_FULLSCREEN;
 
-    //TODO should we use the hdc of the window?
-    hdc = GetDC(NULL);
-    int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL,
-                           sizeof(RawFrameBufferInfo),
-                           (char *) &rbi);
-    ReleaseDC(NULL, hdc);
-
-    if (!(result > 0)) {
+    if(!SDL_PixelFormatEnumToMasks(displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask))
+    {
+        SDL_SetError("Unknown display format");
         return NULL;
     }
 
-    /* Asus A696 returns wrong results so we do a sanity check
-       See:
-       http://groups.google.com/group/microsoft.public.smartphone.developer/browse_thread/thread/4fde5bddd477de81
-     */
-    if (rbi.cxPixels <= 0 ||
-        rbi.cyPixels <= 0 ||
-        rbi.cxStride == 0 || rbi.cyStride == 0 || rbi.pFramePointer == 0) {
-        return NULL;
+    switch(window->fullscreen_mode.format)
+    {
+	case SDL_PIXELFORMAT_RGB555:
+	case SDL_PIXELFORMAT_RGB565:
+	    break;
+
+	default:
+    	    SDL_SetError("Support only 16 or 15 bpp");
+	    return NULL;
     }
 
-
-    renderdata = (GAPI_RenderData *) SDL_calloc(1, sizeof(*renderdata));
-    if (!renderdata) {
+    renderer = (SDL_Renderer*) SDL_calloc(1, sizeof(SDL_Renderer));
+    if(!renderer)
+    {
         SDL_OutOfMemory();
         return NULL;
     }
-    //Try to match the window size
-    //TODO add rotation support
-    if (rbi.cxPixels != window->w || rbi.cyPixels != window->h) {
-        SDL_free(renderdata);
-        return NULL;
-    }
-    //Check that the display uses a known display format
-    switch (rbi.wFormat) {
-    case FORMAT_565:
-        renderdata->format = SDL_PIXELFORMAT_RGB565;
-        break;
-    case FORMAT_555:
-        renderdata->format = SDL_PIXELFORMAT_RGB555;
-        break;
-    default:
-        //TODO we should add support for other formats
-        SDL_free(renderdata);
-        return NULL;
-    }
 
-    renderdata->usageFlags = USAGE_DATA_PTR_CONSTANT;
-    renderdata->data = rbi.pFramePointer;
-    renderdata->w = rbi.cxPixels;
-    renderdata->h = rbi.cyPixels;
-    renderdata->xPitch = rbi.cxStride;
-    renderdata->yPitch = rbi.cyStride;
-
-    return renderdata;
-
-}
-
-
-static GAPI_RenderData *
-FillRenderDataGAPI(SDL_Window * window)
-{
-    GAPI_RenderData *renderdata;
-    struct GXDisplayProperties gxdp;
-    int tmp;
-
-#ifdef _ARM_
-    WCHAR oemstr[100];
-#endif
-
-    if (!g_hGapiLib) {
-        return NULL;
-    }
-
-    renderdata = (GAPI_RenderData *) SDL_calloc(1, sizeof(GAPI_RenderData));
-    if (!renderdata) {
+    data = (WINCE_RenderData*) SDL_calloc(1, sizeof(WINCE_RenderData));
+    if(!data)
+    {
+        WINCE_DestroyRenderer(renderer);
         SDL_OutOfMemory();
         return NULL;
     }
 
-    gxdp = gx.GXGetDisplayProperties();
-    renderdata->usageFlags = USAGE_GX_FUNCS;
-    renderdata->w = gxdp.cxWidth;
-    renderdata->h = gxdp.cyHeight;
-    renderdata->xPitch = gxdp.cbxPitch;
-    renderdata->yPitch = gxdp.cbyPitch;
-
-    //Check that the display uses a known display format
-    if (gxdp.ffFormat & kfDirect565) {
-        renderdata->format = SDL_PIXELFORMAT_RGB565;
-    } else if (gxdp.ffFormat & kfDirect555) {
-        renderdata->format = SDL_PIXELFORMAT_RGB555;
-    } else {
-        renderdata->format = SDL_PIXELFORMAT_UNKNOWN;
-    }
-
-    /* apply some device specific corrections */
-#ifdef _ARM_
-    SystemParametersInfo(SPI_GETOEMINFO, sizeof(oemstr), oemstr, 0);
-
-    // buggy iPaq38xx
-    if ((oemstr[12] == 'H') && (oemstr[13] == '3')
-        && (oemstr[14] == '8')
-        && (gxdp.cbxPitch > 0)) {
-        renderdata->data = (void *) 0xac0755a0;
-        renderdata->xPitch = -640;
-        renderdata->yPitch = 2;
-    }
-#if (EMULATE_AXIM_X30 == 0)
-    // buggy Dell Axim X30
-    if (_tcsncmp(oemstr, L"Dell Axim X30", 13) == 0)
-#endif
+    // initialize internal engine
+    if(!RAW_Init(data) && !GAPI_Init(data, windowdata->hwnd))
     {
-        GXDeviceInfo gxInfo = { 0 };
-        HDC hdc = GetDC(NULL);
-        int result;
-
-        gxInfo.Version = 100;
-        result =
-            ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo),
-                      (char *) &gxInfo);
-        if (result > 0) {
-            renderdata->usageFlags = USAGE_DATA_PTR_CONSTANT;   /* no more GAPI usage from now */
-            renderdata->data = gxInfo.pvFrameBuffer;
-            this->hidden->needUpdate = 0;
-            renderdata->xPitch = 2;
-            renderdata->yPitch = 480;
-            renderdata->w = gxInfo.cxWidth;
-            renderdata->h = gxInfo.cyHeight;
-
-            //Check that the display uses a known display format
-            switch (rbi->wFormat) {
-            case FORMAT_565:
-                renderdata->format = SDL_PIXELFORMAT_RGB565;
-                break;
-            case FORMAT_555:
-                renderdata->format = SDL_PIXELFORMAT_RGB555;
-                break;
-            default:
-                //TODO we should add support for other formats
-                SDL_free(renderdata);
-                return NULL;
-            }
-        }
-    }
-#endif
-
-
-    if (renderdata->format == SDL_PIXELFORMAT_UNKNOWN) {
-        SDL_SetError("Gapi Pixelformat is unknown");
-        SDL_free(renderdata);
+        WINCE_DestroyRenderer(renderer);
         return NULL;
     }
 
-    /* Gapi always returns values in standard orientation, so we manually apply
-       the current orientation 
-     */
 
-    DEVMODE settings;
-    SDL_memset(&settings, 0, sizeof(DEVMODE));
-    settings.dmSize = sizeof(DEVMODE);
-
-    settings.dmFields = DM_DISPLAYORIENTATION;
-    ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
-
-    if (settings.dmDisplayOrientation == DMDO_90) {
-
-        tmp = renderdata->w;
-        renderdata->w = renderdata->h;
-        renderdata->h = tmp;
-
-        tmp = renderdata->xPitch;
-        renderdata->xPitch = -renderdata->yPitch;
-        renderdata->yPitch = tmp;
-
-        renderdata->offset = -renderdata->w * renderdata->xPitch;
-
-    } else if (settings.dmDisplayOrientation == DMDO_180) {
-
-        renderdata->xPitch = -renderdata->xPitch;
-        renderdata->yPitch = -renderdata->yPitch;
+    // set debug
+    data->debug	= SDL_getenv("DEBUG_VIDEO_GAPI") || SDL_getenv("GAPI_RENDERER_DEBUG") ? 1 : 0;
+#if defined(DEBUG_VIDEO_GAPI) || defined(GAPI_RENDERER_DEBUG)
+    data->debug	= 1;
+#endif
 
-        renderdata->offset = -renderdata->h * renderdata->yPitch
-            - renderdata->w * renderdata->xPitch;
-
-    } else if (settings.dmDisplayOrientation == DMDO_270) {
-
-        tmp = renderdata->w;
-        renderdata->w = renderdata->h;
-        renderdata->h = tmp;
-
-        tmp = renderdata->xPitch;
-        renderdata->xPitch = renderdata->yPitch;
-        renderdata->yPitch = -tmp;
+    windowdata->videodata->render = data->gapi ? RENDER_GAPI : RENDER_RAW;
+    windowdata->videodata->CoordTransform = WINCE_PointerCoordinateTransform;
 
-        renderdata->offset = -renderdata->h * renderdata->yPitch;
-
-    }
+    window->display->device->MaximizeWindow = NULL;
+    window->display->device->MinimizeWindow = NULL;
 
-    if (renderdata->w != window->w || renderdata->h != window->h) {
-        GAPI_LOG("GAPI open failed, wrong size %i %i %i %i\n", renderdata->w,
-                 renderdata->h, renderdata->xPitch, renderdata->yPitch);
-        SDL_free(renderdata);
-        return NULL;
-    }
-
-    return renderdata;
-
-}
-
+    WINCE_SetupOrientation(data, window->w, window->h);
 
-/* This function does the whole encapsulation of Gapi/RAWFRAMEBUFFER
-   it should handle all the device dependent details and fill the device INDEPENDENT
-   RenderData structure.
- */
-GAPI_RenderData *
-FillRenderData(SDL_Window * window)
-{
-    /* We try to match the requested window to the modes available by GAPI and RAWFRAMEBUFFER.
-       First RAWFRAMEBUFFER is tried, as it is the most reliable one 
-       Look here for detailed discussions:
-       http://pdaphonehome.com/forums/samsung-i700/28087-just-saw.html
-       http://blogs.msdn.com/windowsmobile/archive/2007/08/13/have-you-migrated-to-directdraw-yet.aspx
-     */
-
-    GAPI_RenderData *res;
-
-    res = FillRenderDataRawFramebuffer(window);
-    GAPI_LOG("FillRenderDataRawFramebuffer: %p\n", res);
-    if (res) {
-        return res;
-    }
-    //Now we try gapi
-    res = FillRenderDataGAPI(window);
-    GAPI_LOG("FillRenderDataGAPI: %p\n", res);
-
-    return res;
-}
-
-void *
-GetFramebuffer()
-{
-
-}
-
+    renderer->CreateTexture = WINCE_CreateTexture;
+    renderer->DestroyTexture = WINCE_DestroyTexture;
+    renderer->QueryTexturePixels = WINCE_QueryTexturePixels;
+    renderer->UpdateTexture = WINCE_UpdateTexture;
+    renderer->LockTexture = WINCE_LockTexture;
+    renderer->UnlockTexture = WINCE_UnlockTexture;
 
-SDL_Renderer *
-GAPI_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-    SDL_VideoDisplay *display = window->display;
-    SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayMode *displayMode = &display->current_mode;
-    SDL_Renderer *renderer;
-    GAPI_RenderData *data;
-    int i, n;
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        SDL_SetError("Gapi supports only fullscreen windows");
-        return NULL;
-    }
-
-    if (!SDL_PixelFormatEnumToMasks
-        (displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
-        SDL_SetError("Unknown display format");
-        return NULL;
-    }
+    renderer->RenderCopy = WINCE_RenderCopy;
+    renderer->DestroyRenderer = WINCE_DestroyRenderer;
 
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
+    renderer->RenderPresent = WINCE_RenderPresent;
+    renderer->RenderDrawPoints = WINCE_RenderDrawPoints;
+    renderer->RenderDrawLines = WINCE_RenderDrawLines;
+    renderer->RenderDrawRects = WINCE_RenderDrawRects;
+    renderer->RenderFillRects = WINCE_RenderFillRects;
 
-    data = FillRenderData(window);
-    if (!data) {
-        GAPI_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
+    renderer->info = data->gapi ? GAPI_RenderDriver.info : RAW_RenderDriver.info;
 
-    renderer->RenderDrawPoints = GAPI_RenderDrawPoints;
-    renderer->RenderDrawLines = GAPI_RenderDrawLines;
-    renderer->RenderDrawRects = GAPI_RenderDrawRects;
-    renderer->RenderFillRects = GAPI_RenderFillRects;
-    renderer->RenderCopy = GAPI_RenderCopy;
-    renderer->RenderPresent = GAPI_RenderPresent;
-    renderer->DestroyRenderer = GAPI_DestroyRenderer;
-    renderer->info.name = GAPI_RenderDriver.info.name;
-    renderer->info.flags = 0;
     renderer->window = window;
     renderer->driverdata = data;
 
-    /* Gapi provides only a framebuffer so lets use software implementation */
-    Setup_SoftwareRenderer(renderer);
-
-#ifdef GAPI_RENDERER_DEBUG
-    printf("Created gapi renderer\n");
-    printf("use GX functions: %i\n", data->usageFlags & USAGE_GX_FUNCS);
-    printf("framebuffer is constant: %i\n",
-           data->usageFlags & USAGE_DATA_PTR_CONSTANT);
-    printf("w: %i h: %i\n", data->w, data->h);
-    printf("data ptr: %p\n", data->data);       /* this can be 0 in case of GAPI usage */
-    printf("xPitch: %i\n", data->xPitch);
-    printf("yPitch: %i\n", data->yPitch);
-    printf("offset: %i\n", data->offset);
-    printf("format: %x\n", data->format);
-#endif
-
-    if (data->usageFlags & USAGE_GX_FUNCS) {
-        if (gx.GXOpenDisplay(windowdata->hwnd, GX_FULLSCREEN) == 0) {
-            GAPI_DestroyRenderer(renderer);
-            return NULL;
-        }
-    }
-
     return renderer;
 }
 
-static int
-GAPI_RenderDrawPoints(SDL_Renderer * renderer,
-                      const SDL_Point * points, int count)
+void WINCE_DestroyRenderer(SDL_Renderer* renderer)
+{
+    WINCE_RenderData *renderdata = (WINCE_RenderData*) renderer->driverdata;
+
+    if(renderdata)
+    {
+	if(renderdata->gapi)
+    	    GAPI_Quit(renderdata);
+	else
+	    RAW_Quit(renderdata);
+
+        SDL_free(renderdata);
+    }
+
+    SDL_free(renderer);
+}
+
+int WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture)
+{
+    WINCE_TextureData* texturedata = (WINCE_TextureData*) SDL_calloc(1, sizeof(WINCE_TextureData));
+    if(NULL == texturedata)
+    {
+        SDL_OutOfMemory();
+        return -1;
+    }
+
+    texturedata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
+    texturedata->pixels = SDL_malloc(texture->h * texturedata->pitch);
+    if(NULL == texturedata->pixels)
+    {
+        SDL_OutOfMemory();
+        return -1;
+    }
+
+    if(SDL_ISPIXELFORMAT_FOURCC(texture->format))
+    {
+	texturedata->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
+        if(NULL == texturedata->yuv)
+	{
+    	    SDL_OutOfMemory();
+            return -1;
+        }
+	SDL_Window* window = renderer->window;
+	SDL_VideoDisplay* display = window->display;
+	texturedata->format = display->current_mode.format;
+    }
+    else
+    {
+	texturedata->yuv = NULL;
+	texturedata->format = texture->format;
+    }
+
+    texture->driverdata = texturedata;
+
+    return 0;
+}
+
+void WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture)
+{
+    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
+
+    if(texturedata)
+    {
+	if(texturedata->yuv) SDL_SW_DestroyYUVTexture(texturedata->yuv);
+	if(texturedata->pixels) SDL_free(texturedata->pixels);
+	SDL_free(texturedata);
+	texture->driverdata = NULL;
+    }
+}
+
+int WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch)
+{
+    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
+
+    if(texturedata->yuv)
+        return SDL_SW_QueryYUVTexturePixels(texturedata->yuv, pixels, pitch);
+
+    *pixels = texturedata->pixels;
+    *pitch = texturedata->pitch;
+
+    return 0;
+}
+
+int WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch)
 {
-    // TODO implement
+    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
+
+    if(texturedata->yuv)
+    {
+        if(SDL_SW_UpdateYUVTexture(texturedata->yuv, rect, pixels, pitch) < 0)
+            return -1;
+        WINCE_UpdateYUVTextureData(texture);
+        return 0;
+    }
+
+    if(0 < rect->w && 0 < rect->h)
+    {
+	const unsigned char *src = ((const unsigned char*) pixels);
+	unsigned char *dst = ((unsigned char*) texturedata->pixels) +
+				rect->y * texturedata->pitch +
+				rect->x * SDL_BYTESPERPIXEL(texture->format);
+        int length = rect->w * SDL_BYTESPERPIXEL(texture->format);
+	int height = rect->h;
+
+	while(height--)
+	{
+	    SDL_memcpy(dst, src, length);
+	    dst += texturedata->pitch;
+	    src += pitch;
+	}
+    }
+
+    return 0;
+}
+
+int WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch)
+{
+    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
+
+    if(texturedata->yuv)
+        return SDL_SW_LockYUVTexture(texturedata->yuv, rect, dirty, pixels, pitch);
+
+    *pixels = (void *) ((unsigned char*) texturedata->pixels +
+		    rect->y * texturedata->pitch +
+		    rect->x * SDL_BYTESPERPIXEL(texture->format));
+    *pitch = texturedata->pitch;
+}
+
+void WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture)
+{
+    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
+
+    if(texturedata->yuv)
+    {
+        SDL_SW_UnlockYUVTexture(texturedata->yuv);
+	WINCE_UpdateYUVTextureData(texture);
+    }
+}
+
+int WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect)
+{
+    WINCE_RenderData* dstdata = (WINCE_RenderData*) renderer->driverdata;
+    WINCE_TextureData* srcdata = (WINCE_TextureData*) texture->driverdata;
+
+    if((dstdata->flags & FB_SUSPENDED) ||
+       0 >= srect->w || 0 >= srect->h) return;
+
+    // lock gapi
+    if(dstdata->gapi) dstdata->gapi->GXBeginDraw();
+
+    const unsigned char *src = ((const unsigned char*) srcdata->pixels);
+    unsigned char *dst = dstdata->pixels + (dstdata->flags & FB_SKIP_OFFSET ? 0 : dstdata->fb.offset) +
+				drect->y * dstdata->fb.ypitch +
+				drect->x * dstdata->fb.xpitch;
+    if(srcdata->yuv)
+    {
+	return SDL_SW_CopyYUVToRGB(srcdata->yuv,
+                                   srect, srcdata->format,
+                                   drect->w, drect->h, dst,
+                                   dstdata->fb.ypitch);
+    }
+    else
+    {
+	int height = drect->h;
+	int length = drect->w * SDL_BYTESPERPIXEL(texture->format); // in bytes
+
+	while(height--)
+	{
+	    switch(SDL_BYTESPERPIXEL(texture->format))
+	    {
+		case 2: UpdateLine16to16(&dstdata->fb, (Uint16*) src, (Uint16*) dst, length >> 1); break;
+
+		default: break;
+	    }
+
+	    dst += dstdata->fb.ypitch;
+	    src += srcdata->pitch;
+	}
+    }
+
+    // unlock gapi
+    if(dstdata->gapi) dstdata->gapi->GXEndDraw();
+
+    return 0;
+}
+
+void WINCE_RenderPresent(SDL_Renderer* renderer)
+{
+}
+
+int WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count)
+{
     SDL_Unsupported();
     return -1;
 }
 
-static int
-GAPI_RenderDrawLines(SDL_Renderer * renderer,
-                     const SDL_Point * points, int count)
+int WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count)
 {
-    // TODO implement
     SDL_Unsupported();
     return -1;
 }
 
-static int
-GAPI_RenderDrawRects(SDL_Renderer * renderer,
-                     const SDL_Rect ** rects, int count)
+int WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count)
 {
-    // TODO implement
     SDL_Unsupported();
     return -1;
 }
 
-static int
-GAPI_RenderFillRects(SDL_Renderer * renderer,
-                     const SDL_Rect ** rects, int count)
+int WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count)
 {
-    // TODO implement
     SDL_Unsupported();
     return -1;
 }
 
-/* Video memory is very slow so lets optimize as much as possible */
-static void
-updateLine16to16(char *src, int srcXPitch, int srcYPitch,
-                 char *dst, int dstXPitch, int dstYPitch, int width,
-                 int height)
+
+
+void WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height)
 {
-    char *srcLine, *dstLine;
-    char *srcPix, *dstPix;
+    const float maxW1 = GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) ? GetSystemMetrics(SM_CXSCREEN) : GetSystemMetrics(SM_CYSCREEN);
+    const float maxW2 = data->fb.width > data->fb.height ? data->fb.width : data->fb.height;
+
+    // scale define
+    data->scale = maxW2 / maxW1;
+
+    // init fb values
+    FrameBufferInitialize(&data->fb);
+
+    // orientation values
+    data->userOrientation = ORIENTATION_UP;
+    data->systemOrientation = WINCE_GetDMOrientation();
+    data->hardwareGeometry = data->fb.width == data->fb.height ? GEOMETRY_SQUARE :
+				(data->fb.width < data->fb.height ? GEOMETRY_PORTRAIT : GEOMETRY_LANDSCAPE);
+
+    if(data->debug)
+	WINCE_DumpVideoInfo(data);
+
+    if(data->systemOrientation == ORIENTATION_UNKNOWN)
+	data->systemOrientation == ORIENTATION_UP;
+
+    data->userOrientation = ORIENTATION_UP;
 
-    int x, y;
+    switch(data->hardwareGeometry)
+    {
+	case GEOMETRY_PORTRAIT:  WINCE_PortraitTransform(data, width, height); break;
+	case GEOMETRY_LANDSCAPE: WINCE_LandscapeTransform(data, width, height); break;
+	case GEOMETRY_SQUARE:    WINCE_SquareTransform(data, width, height); break;
+	default: break;
+    }
+
+    // debug
+    if(data->debug)
+    {
+	printf("\n");
+	printf("user video width:          %d\n", width);
+	printf("user video height:         %d\n", height);
+	FrameBufferDumpInfo(&data->fb, "user");
+    }
+}
+
+void WINCE_DumpVideoInfo(WINCE_RenderData* data)
+{
+    // get oem info
+    WCHAR oemInfo[48];
+    SDL_memset(oemInfo, 0, sizeof(oemInfo));
+    SystemParametersInfo(SPI_GETOEMINFO, sizeof(oemInfo) - sizeof(WCHAR), oemInfo, 0);
+
+    printf("hardware oem: ");
+    wprintf(oemInfo);
+    printf("\n");
 
-    //First dumb solution
-    if (srcXPitch == 2 && dstXPitch == 2) {
-        srcLine = src;
-        dstLine = dst;
-        y = height;
-        while (y--) {
-            SDL_memcpy(dstLine, srcLine, width * sizeof(Uint16));
-            srcLine += srcYPitch;
-            dstLine += dstYPitch;
-        }
-    } else {
-        //printf("GAPI uses slow blit path %i, %i\n", dstXPitch, dstYPitch);
-        srcLine = src;
-        dstLine = dst;
-        y = height;
-        while (y--) {
-            srcPix = srcLine;
-            dstPix = dstLine;
-            x = width;
-            while (x--) {
-                *((Uint16 *) dstPix) = *((Uint16 *) srcPix);
-                dstPix += dstXPitch;
-                srcPix += srcXPitch;
-            }
-            srcLine += srcYPitch;
-            dstLine += dstYPitch;
-        }
+    printf("video driver mode:             %s\n", (data->flags & FB_RAW_MODE ? RAW_RENDER_NAME : GAPI_RENDER_NAME));
+    printf("GetSystemMetrics(SM_CXSCREEN): %d\n", GetSystemMetrics(SM_CXSCREEN));
+    printf("GetSystemMetrics(SM_CYSCREEN): %d\n", GetSystemMetrics(SM_CYSCREEN));
+    printf("scale coord:                   %f\n", data->scale);
+
+    FrameBufferDumpInfo(&data->fb, "hardware");
+
+    printf("display format:                %p\n", data->format);
+    printf("display bits per pixel:        %d\n", SDL_BITSPERPIXEL(data->format));
+    printf("display bytes per pixel:       %d\n", SDL_BYTESPERPIXEL(data->format));
+    printf("display memory:                %p\n", data->pixels);
+    printf("system orientation:            %d, %s\n", data->systemOrientation, GetOrientationName(data->systemOrientation));
+    printf("hardware geometry:             %d\n", data->hardwareGeometry);
+}
+
+void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible)
+{
+    SDL_WindowData* windowdata = (SDL_WindowData*) window->driverdata;
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
+    SDL_Renderer* renderer = (SDL_Renderer*) window->renderer;
+
+    if(visible)
+    {
+	if(window->flags & SDL_WINDOW_FULLSCREEN)
+	{
+	    if(videodata->SHFullScreen)
+		videodata->SHFullScreen(windowdata->hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
+	    ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_HIDE);
+	}
+
+	ShowWindow(windowdata->hwnd, SW_SHOW);
+        SetForegroundWindow(windowdata->hwnd);
+
+	if(renderer &&
+	    (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
+	{
+	    WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata;
+	    renderdata->flags &= ~FB_SUSPENDED;
+	    if(renderdata->gapi) renderdata->gapi->GXResume();
+	}
+    }
+    else
+    {
+	if(renderer &&
+	    (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
+	{
+	    WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata;
+	    if(renderdata->gapi) renderdata->gapi->GXSuspend();
+	    renderdata->flags |= FB_SUSPENDED;
+	}
+
+	ShowWindow(windowdata->hwnd, SW_HIDE);
+
+	if(window->flags & SDL_WINDOW_FULLSCREEN)
+	{
+	    if(videodata->SHFullScreen)
+		videodata->SHFullScreen(windowdata->hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
+	    ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_SHOW);
+	}
     }
 }
 
-static int
-GAPI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_Rect * dstrect)
+
+void WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt)
+{
+    WINCE_RenderData* data = (WINCE_RenderData*) window->renderer->driverdata;
+
+    pt->x *= data->scale;
+    pt->y *= data->scale;
+
+    PointerRotate(pt, &data->fb, data->userOrientation);
+}
+
+void WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height)
+{
+    if(data->systemOrientation != ORIENTATION_UP)
+	FrameBufferRotate(&data->fb, data->systemOrientation);
+
+    if(data->fb.width != width || data->fb.height != height)
+    switch(data->systemOrientation)
+    {
+	case ORIENTATION_UP:
+	case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break;
+	case ORIENTATION_RIGHT:
+	case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break;
+	default: break;
+    }
+
+    if(data->userOrientation != ORIENTATION_UP)
+	FrameBufferRotate(&data->fb, data->userOrientation);
+}
+
+void WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height)
 {
-    GAPI_RenderData *data = (GAPI_RenderData *) renderer->driverdata;
-    int bpp;
-    int bytespp;
-    int status;
-    Uint32 Rmask, Gmask, Bmask, Amask;
+    switch(data->systemOrientation)
+    {
+	case ORIENTATION_UP:  FrameBufferRotate(&data->fb, ORIENTATION_LEFT); break;
+	case ORIENTATION_LEFT:FrameBufferRotate(&data->fb, ORIENTATION_DOWN); break;
+	case ORIENTATION_DOWN:FrameBufferRotate(&data->fb, ORIENTATION_RIGHT); break;
+	default: break;
+    }
+
+    if(data->fb.width != width || data->fb.height != height)
+    switch(data->systemOrientation)
+    {
+	case ORIENTATION_UP:
+	case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break;
+	case ORIENTATION_RIGHT:
+	case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break;
+	default: break;
+    }
+
+    if(data->userOrientation != ORIENTATION_UP)
+	FrameBufferRotate(&data->fb, data->userOrientation);
+}
+
+void WINCE_SquareTransform(WINCE_RenderData* data, int width, int height)
+{
+    WINCE_PortraitTransform(data, width, height);
+}
 
-    if (texture->format != data->format) {
-        SDL_SetError("Gapi got wrong texture");
-        return -1;
+int WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug)
+{
+    // check square
+    if(GetSystemMetrics(SM_CXSCREEN) == GetSystemMetrics(SM_CYSCREEN) &&
+	fb->width != fb->height)
+    {
+	if(fb->width < fb->height)
+	    fb->height = fb->width;
+	else
+	if(fb->height < fb->width)
+	    fb->width = fb->height;
+    }
+
+    // check width
+    if(__abs(fb->xpitch) == bpp &&
+	fb->width  != __abs(fb->ypitch) / bpp)
+    {
+	if(fb->height == __abs(fb->ypitch) / bpp)
+    	{
+	    __swap(&fb->width, &fb->height);
+
+	    if(debug)
+		printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height);
+	}
+	else
+	    return -1;
+    }
+    else
+    // check height
+    if(__abs(fb->ypitch) == bpp &&
+	fb->height != __abs(fb->xpitch) / bpp)
+    {
+	if(fb->width  == __abs(fb->xpitch) / bpp)
+    	{
+	    __swap(&fb->width, &fb->height);
+
+	    if(debug)
+		printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height);
+	}
+	else
+	    return -1;
     }
 
-    GAPI_LOG("GAPI_RenderCopy\n");
+    return 0;
+}
+
+void WINCE_UpdateYUVTextureData(SDL_Texture* texture)
+{
+    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
+    SDL_Rect rect;
+
+    rect.x = 0;
+    rect.y = 0;
+    rect.w = texture->w;
+    rect.h = texture->h;
+    SDL_SW_CopyYUVToRGB(texturedata->yuv, &rect, texturedata->format, texture->w, texture->h, texturedata->pixels, texturedata->pitch);
+}
+
+int GAPI_Init(WINCE_RenderData* data, HWND hwnd)
+{
+    if(NULL == data->gapi)
+    {
+	const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
+	if(preferably && 0 != SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0;
+
+        data->gapi = (GapiInfo *) SDL_calloc(1, sizeof(GapiInfo));
+        if(NULL == data->gapi)
+        {
+            SDL_OutOfMemory();
+            return 0;
+        }
+
+	data->gapi->hGapiLib = LoadLibrary(TEXT("\\Windows\\gx.dll"));
+	if(0 == data->gapi->hGapiLib)
+	{
+	    data->gapi->hGapiLib = LoadLibrary(TEXT("gx.dll"));
+	    if(0 == data->gapi->hGapiLib) return 0;
+	}
+
+	// load gapi library
+#define LINK(type,name,import) name=(PFN##type)GetProcAddress(data->gapi->hGapiLib,TEXT(import))
+	LINK(GXOpenDisplay,         data->gapi->GXOpenDisplay,         "?GXOpenDisplay@@YAHPAUHWND__@@K@Z");
+	LINK(GXCloseDisplay,        data->gapi->GXCloseDisplay,        "?GXCloseDisplay@@YAHXZ");
+	LINK(GXBeginDraw,           data->gapi->GXBeginDraw,           "?GXBeginDraw@@YAPAXXZ");
+	LINK(GXEndDraw,             data->gapi->GXEndDraw,             "?GXEndDraw@@YAHXZ");
+	LINK(GXGetDisplayProperties,data->gapi->GXGetDisplayProperties,"?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ");
+	LINK(GXSuspend,             data->gapi->GXSuspend,             "?GXSuspend@@YAHXZ");
+	LINK(GXResume,              data->gapi->GXResume,              "?GXResume@@YAHXZ");
+#undef LINK
+
+	int enable = data->gapi->GXGetDisplayProperties && data->gapi->GXCloseDisplay && data->gapi->GXOpenDisplay &&
+	    data->gapi->GXBeginDraw && data->gapi->GXEndDraw && data->gapi->GXSuspend && data->gapi->GXResume;
+
+	if(!enable)
+	{
+	    SDL_SetError("GAPI_Init: error gx.dll: internal error");
+	    GAPI_Quit(data);
+	    return 0;
+	}
+
+	if(0 == data->gapi->GXOpenDisplay(hwnd, GX_FULLSCREEN))
+	{
+	    SDL_SetError("GAPI_Init: couldn't initialize GAPI");
+	    GAPI_Quit(data);
+	    return 0;
+	}
+
+	struct GXDisplayProperties gxProperties = data->gapi->GXGetDisplayProperties();
 
-    if (data->usageFlags & USAGE_GX_FUNCS) {
-        char *buffer;
-        buffer = gx.GXBeginDraw();
-        if (!(data->usageFlags & USAGE_DATA_PTR_CONSTANT)) {
-            data->data = buffer;
+	// fill FrameBufferInfo
+	data->fb.xpitch = gxProperties.cbxPitch;
+	data->fb.ypitch = gxProperties.cbyPitch;
+	data->fb.width  = gxProperties.cxWidth;
+	data->fb.height = gxProperties.cyHeight;
+	data->fb.offset = 0;
+
+        if((gxProperties.ffFormat & kfDirect565) || 16 == gxProperties.cBPP)
+	    data->format = SDL_PIXELFORMAT_RGB565;
+	else
+	if((gxProperties.ffFormat & kfDirect555) || 15 == gxProperties.cBPP)
+	    data->format = SDL_PIXELFORMAT_RGB555;
+	else
+	    data->format = 0;
+
+	// get pixels
+	GXDeviceInfo gxInfo = { 0 };
+	HDC hdc = GetDC(NULL);
+
+	gxInfo.Version = 100;
+	int result = ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), (char *) &gxInfo);
+	ReleaseDC(NULL, hdc);
+
+	if(result > 0)
+	{
+	    // more debug
+	    if(data->debug)
+	    {
+		printf("GXDeviceInfo.pvFrameBuffer:    %p\n", gxInfo.pvFrameBuffer);
+    		printf("GXDeviceInfo.cxWidth:          %d\n", gxInfo.cxWidth);
+    		printf("GXDeviceInfo.cyHeight:         %d\n", gxInfo.cyHeight);
+    		printf("GXDeviceInfo.cbStride:         %d\n", gxInfo.cbStride);
+    		printf("GXDeviceInfo.cBPP:             %d\n", gxInfo.cBPP);
+    		printf("GXDeviceInfo.ffFormat:        0x%x\n", gxInfo.ffFormat);
+
+    		printf("GXDeviceInfo.unk:\n");
+		int ii; for(ii = 0; ii <  sizeof(gxInfo.unknown); ++ii)
+		printf("0x%02hhX,", gxInfo.unknown[ii]);
+		printf("\n");
+	    }
+
+    	    if(gxInfo.ffFormat && gxInfo.ffFormat != gxProperties.ffFormat)
+	    {
+		if((gxInfo.ffFormat & kfDirect565) || 16 == gxInfo.cBPP)
+		    data->format = SDL_PIXELFORMAT_RGB565;
+		else
+		if((gxInfo.ffFormat & kfDirect555) || 15 == gxInfo.cBPP)
+		    data->format = SDL_PIXELFORMAT_RGB555;
+	    }
+
+    	    data->pixels = gxInfo.pvFrameBuffer;
         }
+	else
+	{
+	    data->flags |= FB_SKIP_OFFSET;
+	    data->pixels = data->gapi->GXBeginDraw();
+	    data->gapi->GXEndDraw();
+
+	    if(data->debug)
+	    {
+		printf("GAPI_Init\n");
+		printf("use GXBeginDraw:               %p\n", data->pixels);
+		printf("use skip offset\n");
+	    }
+	}
+
+	if(0 == data->format ||
+	    0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug))
+	{
+	    SDL_SetError("GAPI_Init: unknown hardware");
+	    GAPI_Quit(data);
+	    return 0;
+	}
     }
 
-    GAPI_LOG("GAPI_RenderCopy blit\n");
-    /* If our framebuffer has an xPitch which matches the pixelsize, we
-       can convert the framebuffer to a SDL_surface and blit there,
-       otherwise, we have to use our own blitting routine
-     */
-    SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask,
-                               &Amask);
-    bytespp = bpp >> 3;
-    if (data->xPitch == bytespp && 0) {
-        SDL_Surface *screen =
-            SDL_CreateRGBSurfaceFrom(data->data, data->w, data->h,
-                                     bpp, data->yPitch, Rmask, Gmask, Bmask,
-                                     Amask);
-        status =
-            SDL_UpperBlit((SDL_Surface *) texture->driverdata, srcrect,
-                          screen, dstrect);
-        SDL_FreeSurface(screen);
-    } else {                    /* screen is rotated, we have to blit on our own */
-        SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
+    return data->gapi && data->pixels ? 1 : 0;
+}
+
+void GAPI_Quit(WINCE_RenderData* data)
+{
+    if(data->gapi)
+    {
+	if(data->gapi->GXCloseDisplay) data->gapi->GXCloseDisplay(); 
+	if(data->gapi->hGapiLib)  FreeLibrary(data->gapi->hGapiLib);
+
+	SDL_free(data->gapi);
+        data->gapi = NULL;
+    }
+}
+
+int RAW_Init(WINCE_RenderData* data)
+{
+    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
+    if(preferably && 0 != SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0;
+
+    RawFrameBufferInfo rfbi = { 0 };
+    HDC hdc = GetDC(NULL);
+    int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
+    ReleaseDC(NULL, hdc);
+
+    //disable
+    if(result == 0 || rfbi.pFramePointer == 0 ||
+    	rfbi.cxPixels == 0 || rfbi.cyPixels == 0 ||
+	rfbi.cxStride == 0 || rfbi.cyStride == 0) return 0;
+
+    data->flags     = FB_RAW_MODE;
+
+    // fill FrameBufferInfo
+    SDL_memset(&data->fb, 0, sizeof(FrameBufferInfo));
+
+    data->fb.xpitch = rfbi.cxStride;
+    data->fb.ypitch = rfbi.cyStride;
+    data->fb.width  = rfbi.cxPixels;
+    data->fb.height = rfbi.cyPixels;
+    data->fb.offset = 0;
 
-        char *src, *dst;
-        src = surface->pixels;
-        src += srcrect->y * surface->pitch + srcrect->x * 2;
+    if((FORMAT_565 & rfbi.wFormat) || 16 == rfbi.wBPP)
+	data->format = SDL_PIXELFORMAT_RGB565;
+    else
+    if((FORMAT_555 & rfbi.wFormat) || 15 == rfbi.wBPP)
+	data->format = SDL_PIXELFORMAT_RGB555;
+    else
+	data->format = 0;
+
+    if(0 == data->format ||
+	0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug))
+    {
+	SDL_SetError("RAW_Init: unknown hardware");
+	RAW_Quit(data);
+	return 0;
+    }
+
+    data->pixels = rfbi.pFramePointer;
+
+    return data->pixels ? 1 : 0;
+}
+
+void RAW_Quit(WINCE_RenderData* data)
+{
+}
 
-        dst = data->data + data->offset;
-        dst += dstrect->y * data->yPitch + dstrect->x * data->xPitch;
+void FrameBufferInitialize(FrameBufferInfo* fb)
+{
+    int orientation = GetFrameBufferOrientation(fb);
+
+    // set correct start offset
+    switch(orientation)
+    {
+	case ORIENTATION_UP:
+	    fb->offset = 0;
+	    break;
 
-        updateLine16to16(src, 2, surface->pitch,
-                         dst, data->xPitch, data->yPitch,
-                         srcrect->w, srcrect->h);
+	case ORIENTATION_LEFT:
+	    fb->offset = __abs(fb->ypitch * (fb->height - 1));
+	    break;
 
+	case ORIENTATION_RIGHT:
+	    fb->offset = __abs(fb->xpitch * (fb->width - 1));
+	    break;
+
+	case ORIENTATION_DOWN:
+	    fb->offset = __abs(fb->xpitch * (fb->width - 1) +
+				fb->ypitch * (fb->height - 1));
+	    break;
+
+	default: break;
     }
 
-    Uint32 ticks = SDL_GetTicks();
-    if (data->usageFlags & USAGE_GX_FUNCS) {
-        gx.GXEndDraw();
+    //if(orientation != ORIENTATION_UP)
+    switch(orientation)
+    {
+	case ORIENTATION_LEFT: FrameBufferRotate(fb, ORIENTATION_RIGHT); break;
+	case ORIENTATION_RIGHT:FrameBufferRotate(fb, ORIENTATION_LEFT); break;
+	case ORIENTATION_DOWN: FrameBufferRotate(fb, ORIENTATION_DOWN); break;
+
+	default: break;
     }
-    GAPI_LOG("GAPI_RenderCopy %i\n", SDL_GetTicks() - ticks);
-    return status;
+}
+
+int GetFrameBufferOrientation(const FrameBufferInfo* src)
+{
+    if(src->xpitch > 0 && src->ypitch > 0)
+	return ORIENTATION_UP;
+    else
+    if(src->xpitch > 0 && src->ypitch < 0)
+	return ORIENTATION_LEFT;
+    else
+    if(src->xpitch < 0 && src->ypitch > 0)
+	return ORIENTATION_RIGHT;
+    else
+    if(src->xpitch < 0 && src->ypitch < 0)
+	return ORIENTATION_DOWN;
+
+    return ORIENTATION_UNKNOWN;
 }
 
-static void
-GAPI_RenderPresent(SDL_Renderer * renderer)
+void FrameBufferRotate(FrameBufferInfo* dst, int orientation)
 {
-    /* Nothing todo as we rendered directly to the screen on RenderCopy */
+    FrameBufferInfo src;
+    // copy dst -> src
+    SDL_memcpy(&src, dst, sizeof(FrameBufferInfo));
+
+    switch(orientation)
+    {
+        case ORIENTATION_LEFT:
+	    dst->width  = src.height;
+	    dst->height = src.width;
+	    dst->xpitch = src.ypitch;
+	    dst->ypitch = -src.xpitch;
+	    dst->offset = src.offset + src.xpitch * (src.width - 1);
+	    break;
+
+        case ORIENTATION_RIGHT:
+	    dst->width  = src.height;
+	    dst->height = src.width;
+	    dst->xpitch = -src.ypitch;
+	    dst->ypitch = src.xpitch;
+	    dst->offset = src.offset + src.ypitch * (src.height - 1);
+	    break;
+
+        case ORIENTATION_DOWN:
+	    FrameBufferRotate(dst, ORIENTATION_LEFT);
+	    FrameBufferRotate(dst, ORIENTATION_LEFT);
+	    break;
+
+        default:
+	    break;
+    }
+}
+
+void PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation)
+{
+    switch(orientation)
+    {
+	case ORIENTATION_UP:
+	    break;
+
+	case ORIENTATION_LEFT:
+	{
+	    int temp = pt->y;
+	    pt->y = fb->height - pt->x;
+	    pt->x = temp;
+	}
+	    break;
+
+	case ORIENTATION_RIGHT:
+	{
+	    int temp = pt->x;
+	    pt->x = fb->width - pt->y;
+	    pt->y = temp;
+	}
+	    break;
+
+	case ORIENTATION_DOWN:
+	    pt->x = fb->width  - pt->x;
+	    pt->y = fb->height - pt->y;
+	    break;
+
+	default: break;
+    }
 }
 
-static void
-GAPI_DestroyRenderer(SDL_Renderer * renderer)
+const char* GetOrientationName(int orientation)
+{
+    switch(orientation)
+    {
+        case ORIENTATION_UP:        return "UP";
+        case ORIENTATION_DOWN:      return "DOWN";
+        case ORIENTATION_LEFT:      return "LEFT";
+        case ORIENTATION_RIGHT:     return "RIGHT";
+        default: break;
+    }
+
+    return "UNKNOWN";
+}
+
+int WINCE_GetDMOrientation(void)
 {
-    GAPI_RenderData *data = (GAPI_RenderData *) renderer->driverdata;
+    DEVMODE sDevMode = {0};
+    sDevMode.dmSize = sizeof(DEVMODE);
+    sDevMode.dmFields = DM_DISPLAYORIENTATION;
+
+    // DMDO_0, DMDO_90, DMDO_180, DMDO_270
+    if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_TEST, NULL))
+	switch(sDevMode.dmDisplayOrientation)
+	{
+	    case DMDO_0:	return DMDO_0;
+	    case DMDO_90:	return DMDO_90;
+	    case DMDO_180:	return DMDO_180;
+	    case DMDO_270:	return DMDO_270;
+	    default: break;
+	}
 
-    if (data->usageFlags & USAGE_GX_FUNCS) {
-        gx.GXCloseDisplay();
+    SDL_SetError("WINCE_GetDMOrientation: ChangeDisplaySettingsEx return BADMODE");
+    return -1;
+}
+
+int WINCE_SetDMOrientation(int orientation)
+{
+    DEVMODE sDevMode = {0};
+    sDevMode.dmSize = sizeof(DEVMODE);
+    sDevMode.dmFields = DM_DISPLAYORIENTATION;
+
+    switch(orientation)
+    {
+	case DMDO_0:	sDevMode.dmDisplayOrientation = DMDO_0;   break;
+	case DMDO_90:	sDevMode.dmDisplayOrientation = DMDO_90;  break;
+	case DMDO_180:	sDevMode.dmDisplayOrientation = DMDO_180; break;
+	case DMDO_270:	sDevMode.dmDisplayOrientation = DMDO_270; break;
+	default: return 0;
     }
 
-    if (data) {
-        SDL_free(data);
-    }
-    SDL_free(renderer);
+    if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_RESET, NULL))
+	return 1;
+
+    SDL_SetError("WINCE_SetDMOrientation: ChangeDisplaySettingsEx return BADMODE");
+    return -1;
+}
+
+void FrameBufferDumpInfo(const FrameBufferInfo* fb, const char* name)
+{
+    printf("%s fb.width:       %d\n", name, fb->width);
+    printf("%s fb.height:      %d\n", name, fb->height);
+    printf("%s fb.xpitch:      %d\n", name, fb->xpitch);
+    printf("%s fb.ypitch:      %d\n", name, fb->ypitch);
+    printf("%s fb.offset:      %d\n", name, fb->offset);
+
+    int orientation = GetFrameBufferOrientation(fb);
+    printf("%s fb.orientation: %d, %s\n", name, orientation, GetOrientationName(orientation));
 }
 
-#endif /* SDL_VIDEO_RENDER_GAPI */
+void UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width)
+{
+    if(2 == fb->xpitch)
+    {
+	switch(width)
+	{
+	    case 1:
+		*dst = *src;
+		break;
+
+	    case 2:
+		*((Uint32*) dst) = *((Uint32*) src);
+		break;
 
-/* vi: set ts=4 sw=4 expandtab: */
+	    default:
+		SDL_memcpy(dst, src, width * 2);
+		break;
+	}
+    }
+    else
+    if(-2 == fb->xpitch)
+    {
+	while(width--)
+	    *dst-- = *src++;
+    }
+    else
+    {
+	while(width--)
+	{
+	    *dst = *src++;
+	    dst += fb->xpitch / 2;
+	}
+    }
+}
+
+#endif // SDL_VIDEO_RENDER_GAPI
--- a/src/video/win32/SDL_gapirender.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_gapirender.h	Sun Aug 22 13:45:56 2010 -0700
@@ -27,7 +27,11 @@
 /* SDL surface based renderer implementation */
 
 #if SDL_VIDEO_RENDER_GAPI
-extern void GAPI_AddRenderDriver(_THIS);
+extern void WINCE_AddRenderDriver(_THIS);
+extern int  WINCE_Available(void);
+extern void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible);
+extern int  WINCE_GetDMOrientation(void);
+extern int  WINCE_SetDMOrientation(int orientation);
 #endif
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_gapirender_c.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_gapirender_c.h	Sun Aug 22 13:45:56 2010 -0700
@@ -22,100 +22,3 @@
     Stefan Klug
     klug.stefan@gmx.de
 */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* hi res definitions */
-typedef struct _RawFrameBufferInfo
-{
-    WORD wFormat;
-    WORD wBPP;
-    VOID *pFramePointer;
-    int cxStride;
-    int cyStride;
-    int cxPixels;
-    int cyPixels;
-} RawFrameBufferInfo;
-
-#define GETRAWFRAMEBUFFER   0x00020001
-
-#define FORMAT_565 1
-#define FORMAT_555 2
-#define FORMAT_OTHER 3
-
-
-/* From gx.h, since it's not really C compliant */
-
-struct GXDisplayProperties
-{
-    DWORD cxWidth;
-    DWORD cyHeight;             // notice lack of 'th' in the word height.
-    long cbxPitch;              // number of bytes to move right one x pixel - can be negative.
-    long cbyPitch;              // number of bytes to move down one y pixel - can be negative.
-    long cBPP;                  // # of bits in each pixel
-    DWORD ffFormat;             // format flags.
-};
-
-struct GXKeyList
-{
-    short vkUp;                 // key for up
-    POINT ptUp;                 // x,y position of key/button.  Not on screen but in screen coordinates.
-    short vkDown;
-    POINT ptDown;
-    short vkLeft;
-    POINT ptLeft;
-    short vkRight;
-    POINT ptRight;
-    short vkA;
-    POINT ptA;
-    short vkB;
-    POINT ptB;
-    short vkC;
-    POINT ptC;
-    short vkStart;
-    POINT ptStart;
-};
-
-typedef int (*PFNGXOpenDisplay) (HWND hWnd, DWORD dwFlags);
-typedef int (*PFNGXCloseDisplay) ();
-typedef void *(*PFNGXBeginDraw) ();
-typedef int (*PFNGXEndDraw) ();
-typedef int (*PFNGXOpenInput) ();
-typedef int (*PFNGXCloseInput) ();
-typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties) ();
-typedef struct GXKeyList (*PFNGXGetDefaultKeys) (int iOptions);
-typedef int (*PFNGXSuspend) ();
-typedef int (*PFNGXResume) ();
-typedef int (*PFNGXSetViewport) (DWORD dwTop, DWORD dwHeight,
-                                 DWORD dwReserved1, DWORD dwReserved2);
-typedef BOOL(*PFNGXIsDisplayDRAMBuffer) ();
-
-struct GapiFunc
-{
-    PFNGXOpenDisplay GXOpenDisplay;
-    PFNGXCloseDisplay GXCloseDisplay;
-    PFNGXBeginDraw GXBeginDraw;
-    PFNGXEndDraw GXEndDraw;
-    PFNGXOpenInput GXOpenInput;
-    PFNGXCloseInput GXCloseInput;
-    PFNGXGetDisplayProperties GXGetDisplayProperties;
-    PFNGXGetDefaultKeys GXGetDefaultKeys;
-    PFNGXSuspend GXSuspend;
-    PFNGXResume GXResume;
-    PFNGXSetViewport GXSetViewport;
-    PFNGXIsDisplayDRAMBuffer GXIsDisplayDRAMBuffer;
-} gx;
-
-#define kfLandscape      0x8    // Screen is rotated 270 degrees
-#define kfPalette        0x10   // Pixel values are indexes into a palette
-#define kfDirect         0x20   // Pixel values contain actual level information
-#define kfDirect555      0x40   // 5 bits each for red, green and blue values in a pixel.
-#define kfDirect565      0x80   // 5 red bits, 6 green bits and 5 blue bits per pixel
-#define kfDirect888      0x100  // 8 bits each for red, green and blue values in a pixel.
-#define kfDirect444      0x200  // 4 red, 4 green, 4 blue
-#define kfDirectInverted 0x400
-
-#define GX_FULLSCREEN    0x01   // for OpenDisplay()
-#define GX_NORMALKEYS    0x02
-#define GX_LANDSCAPEKEYS        0x03
--- a/src/video/win32/SDL_gdirender.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_gdirender.c	Sun Aug 22 13:45:56 2010 -0700
@@ -184,6 +184,8 @@
         return NULL;
     }
 
+    windowdata->videodata->render = RENDER_GDI;
+
     renderer->DisplayModeChanged = GDI_DisplayModeChanged;
     renderer->CreateTexture = GDI_CreateTexture;
     renderer->QueryTexturePixels = GDI_QueryTexturePixels;
@@ -267,6 +269,34 @@
     }
     data->current_hbm = 0;
 
+#ifdef _WIN32_WCE
+    // check size for GDI fullscreen and rotate
+    if((window->flags & SDL_WINDOW_FULLSCREEN) &&
+        GetSystemMetrics(SM_CXSCREEN) != GetSystemMetrics(SM_CYSCREEN) &&
+        ((GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN) && window->w > window->h) ||
+         (GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) && window->w < window->h)))
+    {
+	int orientation = WINCE_GetDMOrientation();
+	switch(orientation)
+	{
+	    case DMDO_0:   orientation = DMDO_90; break;
+	    case DMDO_270: orientation = DMDO_180; break;
+	    case DMDO_90:  orientation = DMDO_0; break;
+	    case DMDO_180: orientation = DMDO_270; break;
+
+	    default:
+		GDI_DestroyRenderer(renderer);
+		return NULL;
+	}
+
+	if(0 > WINCE_SetDMOrientation(orientation))
+	{
+	    GDI_DestroyRenderer(renderer);
+	    return NULL;
+	}
+    }
+#endif
+
     return renderer;
 }
 
@@ -416,6 +446,7 @@
         WIN_SetError("Couldn't create bitmap");
         return -1;
     }
+
     return 0;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/win32/SDL_win32clipboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,169 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include "SDL_win32video.h"
+#include "SDL_win32window.h"
+#include "../../events/SDL_clipboardevents_c.h"
+
+
+#ifdef UNICODE
+#define TEXT_FORMAT  CF_UNICODETEXT
+#else
+#define TEXT_FORMAT  CF_TEXT
+#endif
+
+
+/* Get any application owned window handle for clipboard association */
+static HWND
+GetWindowHandle(_THIS)
+{
+    SDL_VideoDisplay *display;
+    SDL_Window *window;
+
+    display = _this->displays;
+    if (display) {
+        window = display->windows;
+        if (window) {
+            return ((SDL_WindowData *) window->driverdata)->hwnd;
+        }
+    }
+    return NULL;
+}
+
+int
+WIN_SetClipboardText(_THIS, const char *text)
+{
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    int result = 0;
+
+    if (OpenClipboard(GetWindowHandle(_this))) {
+        HANDLE hMem;
+        LPTSTR tstr;
+        SIZE_T i, size;
+
+        /* Convert the text from UTF-8 to Windows Unicode */
+        tstr = WIN_UTF8ToString(text);
+        if (!tstr) {
+            return -1;
+        }
+
+        /* Find out the size of the data */
+        for (size = 0, i = 0; tstr[i]; ++i, ++size) {
+            if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
+                /* We're going to insert a carriage return */
+                ++size;
+            }
+        }
+        size = (size+1)*sizeof(*tstr);
+
+        /* Save the data to the clipboard */
+        hMem = GlobalAlloc(GMEM_MOVEABLE, size);
+        if (hMem) {
+            LPTSTR dst = (LPTSTR)GlobalLock(hMem);
+            /* Copy the text over, adding carriage returns as necessary */
+            for (i = 0; tstr[i]; ++i) {
+                if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
+                    *dst++ = '\r';
+                }
+                *dst++ = tstr[i];
+            }
+            *dst = 0;
+            GlobalUnlock(hMem);
+
+            EmptyClipboard();
+            if (!SetClipboardData(TEXT_FORMAT, hMem)) {
+                WIN_SetError("Couldn't set clipboard data");
+                result = -1;
+            }
+#ifdef _WIN32_WCE
+            data->clipboard_count = 0;
+#else
+            data->clipboard_count = GetClipboardSequenceNumber();
+#endif
+        }
+        SDL_free(tstr);
+
+        CloseClipboard();
+    } else {
+        WIN_SetError("Couldn't open clipboard");
+        result = -1;
+    }
+    return result;
+}
+
+char *
+WIN_GetClipboardText(_THIS)
+{
+    char *text;
+
+    text = NULL;
+    if (IsClipboardFormatAvailable(TEXT_FORMAT) &&
+        OpenClipboard(GetWindowHandle(_this))) {
+        HANDLE hMem;
+        LPTSTR tstr;
+
+        hMem = GetClipboardData(TEXT_FORMAT);
+        if (hMem) {
+            tstr = (LPTSTR)GlobalLock(hMem);
+            text = WIN_StringToUTF8(tstr);
+            GlobalUnlock(hMem);
+        } else {
+            WIN_SetError("Couldn't get clipboard data");
+        }
+        CloseClipboard();
+    }
+    if (!text) {
+        text = SDL_strdup("");
+    }
+    return text;
+}
+
+SDL_bool
+WIN_HasClipboardText(_THIS)
+{
+    if (IsClipboardFormatAvailable(TEXT_FORMAT)) {
+        return SDL_TRUE;
+    } else {
+        return SDL_FALSE;
+    }
+}
+
+void
+WIN_CheckClipboardUpdate(struct SDL_VideoData * data)
+{
+    DWORD count;
+
+#ifdef _WIN32_WCE
+    count = 0;
+#else
+    count = GetClipboardSequenceNumber();
+#endif
+    if (count != data->clipboard_count) {
+        if (data->clipboard_count) {
+            SDL_SendClipboardUpdate();
+        }
+        data->clipboard_count = count;
+    }
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/win32/SDL_win32clipboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,37 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_win32clipboard_h
+#define _SDL_win32clipboard_h
+
+/* Forward declaration */
+struct SDL_VideoData;
+
+extern int WIN_SetClipboardText(_THIS, const char *text);
+extern char *WIN_GetClipboardText(_THIS);
+extern SDL_bool WIN_HasClipboardText(_THIS);
+extern void WIN_CheckClipboardUpdate(struct SDL_VideoData * data);
+
+#endif /* _SDL_win32clipboard_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32events.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32events.c	Sun Aug 22 13:45:56 2010 -0700
@@ -20,9 +20,9 @@
     slouken@libsdl.org
 */
 
-#if (_WIN32_WINNT < 0x0501)
+#if (_WIN32_WINNT < 0x601)
 #undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x601
 #endif
 
 #include "SDL_config.h"
@@ -33,11 +33,14 @@
 #include "SDL_vkeys.h"
 #include "../../events/SDL_events_c.h"
 
-/*#define WMMSG_DEBUG*/
+
+
+#define WMMSG_DEBUG
 #ifdef WMMSG_DEBUG
-#include <stdio.h>
+#include <stdio.h>	
 #include "wmmsg.h"
 #endif
+//#include <stdio.h>
 
 /* Masks for processing the windows KEYDOWN and KEYUP messages */
 #define REPEATED_KEYMASK    (1<<30)
@@ -59,12 +62,6 @@
 #define WM_INPUT 0x00ff
 #endif
 
-extern HCTX *g_hCtx;
-extern HANDLE *mice;
-extern int total_mice;
-extern int tablet;
-int pressure = 0;               /* the pressure reported by the tablet */
-
 static WPARAM
 RemapVKEY(WPARAM wParam, LPARAM lParam)
 {
@@ -90,10 +87,14 @@
        except they don't have the extended bit (0x1000000) set.
      */
     if (!(lParam & 0x1000000)) {
-        for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
-            if (scancode == keypad_scancodes[i]) {
-                wParam = VK_NUMPAD0 + i;
-                break;
+        if (wParam == VK_DELETE) {
+            wParam = VK_DECIMAL;
+        } else {
+            for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
+                if (scancode == keypad_scancodes[i]) {
+                    wParam = VK_NUMPAD0 + i;
+                    break;
+                }
             }
         }
     }
@@ -105,8 +106,6 @@
 WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     SDL_WindowData *data;
-    RAWINPUT *raw;
-    PACKET packet;
     LRESULT returnCode = -1;
 
     /* Send a SDL_SYSWMEVENT if the application wants them */
@@ -126,9 +125,10 @@
     if (!data) {
         return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
     }
+
 #ifdef WMMSG_DEBUG
-    {
-        FILE *log = fopen("wmmsg.txt", "a");
+    {		
+        FILE *log = fopen("wmmsg.txt", "a");		
         fprintf(log, "Received windows message: %p ", hwnd);
         if (msg > MAX_WMMSG) {
             fprintf(log, "%d", msg);
@@ -140,38 +140,11 @@
     }
 
 #endif
+    if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata))
+        return 0;
 
     switch (msg) {
 
-    case WT_PACKET:
-        {
-            /* if we receive such data we need to update the pressure */
-            SDL_VideoData *videodata = data->videodata;
-            if (videodata->wintabDLL
-                && videodata->WTPacket((HCTX) lParam, (UINT) wParam, &packet)) {
-                SDL_ChangeEnd(tablet, (int) packet.pkCursor);
-                pressure = (int) packet.pkNormalPressure;
-            }
-        }
-        break;
-
-    case WT_PROXIMITY:
-        {
-            /* checking where the proximity message showed up */
-            int h_context = LOWORD(lParam);
-            POINT point;
-            GetCursorPos(&point);
-            ScreenToClient(hwnd, &point);
-
-            /* are we in proximity or out of proximity */
-            if (h_context == 0) {
-                SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYOUT);
-            } else {
-                SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYIN);
-            }
-        }
-        break;
-
     case WM_SHOWWINDOW:
         {
             if (wParam) {
@@ -184,13 +157,9 @@
 
     case WM_ACTIVATE:
         {
-            int index;
-            SDL_Keyboard *keyboard;
             BOOL minimized;
 
             minimized = HIWORD(wParam);
-            index = data->videodata->keyboard;
-            keyboard = SDL_GetKeyboard(index);
             if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
                 SDL_SendWindowEvent(data->window,
@@ -201,13 +170,16 @@
                                         SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
                 }
 #endif
-                if (keyboard && keyboard->focus != data->window) {
-                    SDL_SetKeyboardFocus(index, data->window);
+                if (SDL_GetKeyboardFocus() != data->window) {
+                    SDL_SetKeyboardFocus(data->window);
                 }
-                /* FIXME: Update keyboard state */
+                /*
+                 * FIXME: Update keyboard state
+                 */
+                WIN_CheckClipboardUpdate(data->videodata);
             } else {
-                if (keyboard && keyboard->focus == data->window) {
-                    SDL_SetKeyboardFocus(index, 0);
+                if (SDL_GetKeyboardFocus() == data->window) {
+                    SDL_SetKeyboardFocus(NULL);
                 }
                 if (minimized) {
                     SDL_SendWindowEvent(data->window,
@@ -218,125 +190,37 @@
         returnCode = 0;
         break;
 
-/* WinCE has no RawInput, so we use the classic mouse events.
-   In classic Win32 this is done by WM_INPUT
- */
+	case WM_MOUSEMOVE:
 #ifdef _WIN32_WCE
-    case WM_MOUSEMOVE:
-        SDL_SendMouseMotion(0, 0, LOWORD(lParam), HIWORD(lParam), 0);
+	/* transform coords for VGA, WVGA... */
+	{
+	    SDL_VideoData *videodata = data->videodata;
+	    if(videodata->CoordTransform &&
+		(videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
+	    {
+		POINT pt;
+		pt.x = LOWORD(lParam);
+		pt.y = HIWORD(lParam);
+		videodata->CoordTransform(data->window, &pt);
+    		SDL_SendMouseMotion(data->window, 0, pt.x, pt.y);
+		break;
+	    }
+	}
+#endif
+        SDL_SendMouseMotion(data->window, 0, LOWORD(lParam), HIWORD(lParam));
         break;
 
     case WM_LBUTTONDOWN:
-        SDL_SendMouseMotion(0, 0, LOWORD(lParam), HIWORD(lParam), 0);
-        SDL_SendMouseButton(0, SDL_PRESSED, SDL_BUTTON_LEFT);
+        SDL_SendMouseButton(data->window, SDL_PRESSED, SDL_BUTTON_LEFT);
         break;
 
     case WM_LBUTTONUP:
-        SDL_SendMouseMotion(0, 0, LOWORD(lParam), HIWORD(lParam), 0);
-        SDL_SendMouseButton(0, SDL_RELEASED, SDL_BUTTON_LEFT);
+        SDL_SendMouseButton(data->window, SDL_RELEASED, SDL_BUTTON_LEFT);
         break;
-#else /* _WIN32_WCE */
-
-    case WM_INPUT:             /* mouse events */
-        {
-            LPBYTE lpb;
-            const RAWINPUTHEADER *header;
-            int index = -1;
-            int i;
-            int size = 0;
-            const RAWMOUSE *raw_mouse = NULL;
-            POINT point;
-            USHORT flags;
-            int w, h;
-
-            /* we're collecting raw data to be able to identify the mouse (if there are several) */
-            GetRawInputData((HRAWINPUT) lParam, RID_INPUT, NULL, (PUINT)&size,
-                            sizeof(RAWINPUTHEADER));
-            lpb = SDL_stack_alloc(BYTE, size);
-            GetRawInputData((HRAWINPUT) lParam, RID_INPUT, lpb, (PUINT)&size,
-                            sizeof(RAWINPUTHEADER));
-            raw = (RAWINPUT *) lpb;
-            header = &raw->header;
-            flags = raw->data.mouse.usButtonFlags;
-
-            /* we're checking which mouse generated the event */
-            for (i = 0; i < total_mice; ++i) {
-                if (mice[i] == header->hDevice) {
-                    index = i;
-                    break;
-                }
-            }
-            if (index < 0) {
-                /* New mouse?  Should we dynamically update mouse list? */
-                returnCode = 0;
-                break;
-            }
-
-            GetCursorPos(&point);
-            ScreenToClient(hwnd, &point);
-
-            SDL_GetWindowSize(data->window, &w, &h);
-            if (point.x >= 0 && point.y >= 0 && point.x < w && point.y < h) {
-                SDL_SetMouseFocus(index, data->window);
-            } else {
-                SDL_SetMouseFocus(index, 0);
-                /* FIXME: Should we be doing anything else here? */
-                break;
-            }
-
-            /* if the message was sent by a tablet we have to send also pressure */
-            if (index == tablet) {
-                SDL_SendMouseMotion(index, 0, point.x, point.y, pressure);
-            } else {
-                SDL_SendMouseMotion(index, 0, point.x, point.y, 0);
-            }
-            /* we're sending mouse buttons messages to check up if sth changed */
-            if (flags & RI_MOUSE_LEFT_BUTTON_DOWN) {
-                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_LEFT);
-            } else if (flags & RI_MOUSE_LEFT_BUTTON_UP) {
-                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_LEFT);
-            }
-            if (flags & RI_MOUSE_MIDDLE_BUTTON_DOWN) {
-                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_MIDDLE);
-            } else if (flags & RI_MOUSE_MIDDLE_BUTTON_UP) {
-                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_MIDDLE);
-            }
-            if (flags & RI_MOUSE_RIGHT_BUTTON_DOWN) {
-                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_RIGHT);
-            } else if (flags & RI_MOUSE_RIGHT_BUTTON_UP) {
-                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_RIGHT);
-            }
-            if (flags & RI_MOUSE_BUTTON_4_DOWN) {
-                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_X1);
-            } else if (flags & RI_MOUSE_BUTTON_4_UP) {
-                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_X1);
-            }
-            if (flags & RI_MOUSE_BUTTON_5_DOWN) {
-                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_X2);
-            } else if (flags & RI_MOUSE_BUTTON_5_UP) {
-                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_X2);
-            }
-            if (flags & RI_MOUSE_WHEEL) {
-                SDL_SendMouseWheel(index, 0,
-                                   (short) raw->data.mouse.usButtonData);
-            }
-            SDL_stack_free(lpb);
-        }
-        returnCode = 0;
-        break;
-#endif /* _WIN32_WCE */
 
     case WM_MOUSELEAVE:
-        {
-            int i;
-
-            for (i = 0; i < SDL_GetNumMice(); ++i) {
-                SDL_Mouse *mouse = SDL_GetMouse(i);
-
-                if (mouse->focus == data->window) {
-                    SDL_SetMouseFocus(i, 0);
-                }
-            }
+        if (SDL_GetMouseFocus() == data->window) {
+            SDL_SetMouseFocus(NULL);
         }
         returnCode = 0;
         break;
@@ -344,15 +228,6 @@
     case WM_SYSKEYDOWN:
     case WM_KEYDOWN:
         {
-            int index;
-
-            /* Ignore repeated keys */
-            if (lParam & REPEATED_KEYMASK) {
-                returnCode = 0;
-                break;
-            }
-
-            index = data->videodata->keyboard;
             wParam = RemapVKEY(wParam, lParam);
             switch (wParam) {
             case VK_CONTROL:
@@ -389,7 +264,7 @@
                 break;
             }
             if (wParam < 256) {
-                SDL_SendKeyboardKey(index, SDL_PRESSED,
+                SDL_SendKeyboardKey(SDL_PRESSED,
                                     data->videodata->key_layout[wParam]);
             }
         }
@@ -399,9 +274,6 @@
     case WM_SYSKEYUP:
     case WM_KEYUP:
         {
-            int index;
-
-            index = data->videodata->keyboard;
             wParam = RemapVKEY(wParam, lParam);
             switch (wParam) {
             case VK_CONTROL:
@@ -442,11 +314,11 @@
             if (wParam == VK_SNAPSHOT
                 && SDL_GetKeyboardState(NULL)[SDL_SCANCODE_PRINTSCREEN] ==
                 SDL_RELEASED) {
-                SDL_SendKeyboardKey(index, SDL_PRESSED,
+                SDL_SendKeyboardKey(SDL_PRESSED,
                                     data->videodata->key_layout[wParam]);
             }
             if (wParam < 256) {
-                SDL_SendKeyboardKey(index, SDL_RELEASED,
+                SDL_SendKeyboardKey(SDL_RELEASED,
                                     data->videodata->key_layout[wParam]);
             }
         }
@@ -471,14 +343,14 @@
                 text[2] = 0x80 | (char) (wParam & 0x3F);
                 text[3] = '\0';
             }
-            SDL_SendKeyboardText(data->videodata->keyboard, text);
+            SDL_SendKeyboardText(text);
         }
         returnCode = 0;
         break;
 
     case WM_INPUTLANGCHANGE:
         {
-            WIN_UpdateKeymap(data->videodata->keyboard);
+            WIN_UpdateKeymap();
         }
         returnCode = 1;
         break;
@@ -646,7 +518,39 @@
         }
         returnCode = 0;
         break;
-    }
+	case WM_TOUCH:
+		{
+			//printf("Got Touch Event!\n");
+    
+			FILE *log = fopen("wmmsg.txt", "a");
+			fprintf(log, "Received Touch Message: %p ", hwnd);
+			if (msg > MAX_WMMSG) {
+				fprintf(log, "%d", msg);
+			} else {
+				fprintf(log, "%s", wmtab[msg]);
+			}
+			fprintf(log, "WM_TOUCH = %d -- 0x%X, 0x%X\n",msg, wParam, lParam);
+			fclose(log);
+    
+		}
+		break;
+	case WM_GESTURE:
+		{
+			//printf("Got Touch Event!\n");
+    
+			FILE *log = fopen("wmmsg.txt", "a");
+			fprintf(log, "Received Gesture Message: %p ", hwnd);
+			if (msg > MAX_WMMSG) {
+				fprintf(log, "%d", msg);
+			} else {
+				fprintf(log, "%s", wmtab[msg]);
+			}
+			fprintf(log, "WM_GESTURE = %d -- 0x%X, 0x%X\n",msg, wParam, lParam);
+			fclose(log);
+    
+		}
+		break;		
+	}
 
     /* If there's a window proc, assume it's going to handle messages */
     if (data->wndproc) {
@@ -706,7 +610,7 @@
     class.hbrBackground = NULL;
     class.hInstance = SDL_Instance;
     class.style = SDL_Appstyle;
-    class.lpfnWndProc = DefWindowProc;
+    class.lpfnWndProc = WIN_WindowProc;
     class.cbWndExtra = 0;
     class.cbClsExtra = 0;
     if (!RegisterClass(&class)) {
@@ -739,17 +643,4 @@
     }
 }
 
-/* Sets an error message based on GetLastError() */
-void
-WIN_SetError(const char *prefix)
-{
-    TCHAR buffer[1024];
-    char *message;
-    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
-                  buffer, SDL_arraysize(buffer), NULL);
-    message = WIN_StringToUTF8(buffer);
-    SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
-    SDL_free(message);
-}
-
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32events.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32events.h	Sun Aug 22 13:45:56 2010 -0700
@@ -31,7 +31,6 @@
 extern LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        LPARAM lParam);
 extern void WIN_PumpEvents(_THIS);
-extern void WIN_SetError(const char *prefix);
 
 #endif /* _SDL_win32events_h */
 
--- a/src/video/win32/SDL_win32keyboard.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32keyboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -26,6 +26,14 @@
 #include "../../events/SDL_keyboard_c.h"
 #include "../../events/scancodes_win32.h"
 
+#include <imm.h>
+#include <oleauto.h>
+
+static void IME_Init(SDL_VideoData *videodata, HWND hwnd);
+static void IME_Enable(SDL_VideoData *videodata, HWND hwnd);
+static void IME_Disable(SDL_VideoData *videodata, HWND hwnd);
+static void IME_Quit(SDL_VideoData *videodata);
+
 #ifndef MAPVK_VK_TO_VSC
 #define MAPVK_VK_TO_VSC     0
 #endif
@@ -50,7 +58,6 @@
 WIN_InitKeyboard(_THIS)
 {
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_Keyboard keyboard;
     int i;
 
     /* Make sure the alpha scancodes are correct.  T isn't usually remapped */
@@ -82,9 +89,35 @@
 
     data->key_layout = win32_scancode_table;
 
-    SDL_zero(keyboard);
-    data->keyboard = SDL_AddKeyboard(&keyboard, -1);
-    WIN_UpdateKeymap(data->keyboard);
+    data->ime_com_initialized = SDL_FALSE;
+    data->ime_threadmgr = 0;
+    data->ime_initialized = SDL_FALSE;
+    data->ime_enabled = SDL_FALSE;
+    data->ime_available = SDL_FALSE;
+    data->ime_hwnd_main = 0;
+    data->ime_hwnd_current = 0;
+    data->ime_himc = 0;
+    data->ime_composition[0] = 0;
+    data->ime_readingstring[0] = 0;
+    data->ime_cursor = 0;
+    data->ime_hkl = 0;
+    data->ime_himm32 = 0;
+    data->GetReadingString = 0;
+    data->ShowReadingWindow = 0;
+    data->ImmLockIMC = 0;
+    data->ImmUnlockIMC = 0;
+    data->ImmLockIMCC = 0;
+    data->ImmUnlockIMCC = 0;
+    data->ime_uiless = SDL_FALSE;
+    data->ime_threadmgrex = 0;
+    data->ime_uielemsinkcookie = TF_INVALID_COOKIE;
+    data->ime_alpnsinkcookie = TF_INVALID_COOKIE;
+    data->ime_openmodesinkcookie = TF_INVALID_COOKIE;
+    data->ime_convmodesinkcookie = TF_INVALID_COOKIE;
+    data->ime_uielemsink = 0;
+    data->ime_ippasink = 0;
+
+    WIN_UpdateKeymap();
 
     SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
     SDL_SetScancodeName(SDL_SCANCODE_LGUI, "Left Windows");
@@ -92,7 +125,7 @@
 }
 
 void
-WIN_UpdateKeymap(int keyboard)
+WIN_UpdateKeymap()
 {
     int i;
     SDL_scancode scancode;
@@ -104,8 +137,7 @@
 
         /* Make sure this scancode is a valid character scancode */
         scancode = win32_scancode_table[i];
-        if (scancode == SDL_SCANCODE_UNKNOWN ||
-            (keymap[scancode] & SDLK_SCANCODE_MASK)) {
+        if (scancode == SDL_SCANCODE_UNKNOWN || keymap[scancode] >= 127) {
             continue;
         }
 
@@ -117,15 +149,857 @@
             keymap[scancode] = (MapVirtualKey(i, MAPVK_VK_TO_CHAR) & 0x7FFF);
         }
     }
-    SDL_SetKeymap(keyboard, 0, keymap, SDL_NUM_SCANCODES);
+    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
 }
 
 void
 WIN_QuitKeyboard(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    IME_Quit((SDL_VideoData *)_this->driverdata);
+}
+
+void
+WIN_StartTextInput(_THIS)
+{
+    SDL_Window *window = SDL_GetKeyboardFocus();
+    if (window) {
+        HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
+        SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
+        IME_Init(videodata, hwnd);
+        IME_Enable(videodata, hwnd);
+    }
+}
+
+void
+WIN_StopTextInput(_THIS)
+{
+    SDL_Window *window = SDL_GetKeyboardFocus();
+    if (window) {
+        HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
+        SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
+        IME_Init(videodata, hwnd);
+        IME_Disable(videodata, hwnd);
+    }
+}
+
+void
+WIN_SetTextInputRect(_THIS, SDL_Rect *rect)
+{
+
+}
+
+#define LANG_CHT MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)
+#define LANG_CHS MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)
+
+#define MAKEIMEVERSION(major,minor) ((DWORD) (((BYTE)(major) << 24) | ((BYTE)(minor) << 16) ))
+#define IMEID_VER(id) ((id) & 0xffff0000)
+#define IMEID_LANG(id) ((id) & 0x0000ffff)
+
+#define CHT_HKL_DAYI            ((HKL)0xE0060404)
+#define CHT_HKL_NEW_PHONETIC    ((HKL)0xE0080404)
+#define CHT_HKL_NEW_CHANG_JIE   ((HKL)0xE0090404)
+#define CHT_HKL_NEW_QUICK       ((HKL)0xE00A0404)
+#define CHT_HKL_HK_CANTONESE    ((HKL)0xE00B0404)
+#define CHT_IMEFILENAME1        "TINTLGNT.IME"
+#define CHT_IMEFILENAME2        "CINTLGNT.IME"
+#define CHT_IMEFILENAME3        "MSTCIPHA.IME"
+#define IMEID_CHT_VER42         (LANG_CHT | MAKEIMEVERSION(4, 2))
+#define IMEID_CHT_VER43         (LANG_CHT | MAKEIMEVERSION(4, 3))
+#define IMEID_CHT_VER44         (LANG_CHT | MAKEIMEVERSION(4, 4))
+#define IMEID_CHT_VER50         (LANG_CHT | MAKEIMEVERSION(5, 0))
+#define IMEID_CHT_VER51         (LANG_CHT | MAKEIMEVERSION(5, 1))
+#define IMEID_CHT_VER52         (LANG_CHT | MAKEIMEVERSION(5, 2))
+#define IMEID_CHT_VER60         (LANG_CHT | MAKEIMEVERSION(6, 0))
+#define IMEID_CHT_VER_VISTA     (LANG_CHT | MAKEIMEVERSION(7, 0))
+
+#define CHS_HKL                 ((HKL)0xE00E0804)
+#define CHS_IMEFILENAME1        "PINTLGNT.IME"
+#define CHS_IMEFILENAME2        "MSSCIPYA.IME"
+#define IMEID_CHS_VER41         (LANG_CHS | MAKEIMEVERSION(4, 1))
+#define IMEID_CHS_VER42         (LANG_CHS | MAKEIMEVERSION(4, 2))
+#define IMEID_CHS_VER53         (LANG_CHS | MAKEIMEVERSION(5, 3))
+
+#define LANG() LOWORD((videodata->ime_hkl))
+#define PRIMLANG() ((WORD)PRIMARYLANGID(LANG()))
+#define SUBLANG() SUBLANGID(LANG())
+
+static void IME_UpdateInputLocale(SDL_VideoData *videodata);
+static void IME_ClearComposition(SDL_VideoData *videodata);
+static void IME_SetWindow(SDL_VideoData* videodata, HWND hwnd);
+static void IME_SetupAPI(SDL_VideoData *videodata);
+static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex);
+static void IME_SendEditingEvent(SDL_VideoData *videodata);
+#define SDL_IsEqualIID(riid1, riid2) SDL_IsEqualGUID(riid1, riid2)
+#define SDL_IsEqualGUID(rguid1, rguid2) (!SDL_memcmp(rguid1, rguid2, sizeof(GUID)))
+
+static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata);
+static void UILess_ReleaseSinks(SDL_VideoData *videodata);
+static void UILess_EnableUIUpdates(SDL_VideoData *videodata);
+static void UILess_DisableUIUpdates(SDL_VideoData *videodata);
+
+static void
+IME_Init(SDL_VideoData *videodata, HWND hwnd)
+{
+    if (videodata->ime_initialized)
+        return;
+
+    videodata->ime_hwnd_main = hwnd;
+    if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) {
+        videodata->ime_com_initialized = SDL_TRUE;
+        CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, &videodata->ime_threadmgr);
+    }
+    videodata->ime_initialized = SDL_TRUE;
+    videodata->ime_himm32 = LoadLibraryA("imm32.dll");
+    if (!videodata->ime_himm32) {
+        videodata->ime_available = SDL_FALSE;
+        return;
+    }
+    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))GetProcAddress(videodata->ime_himm32, "ImmLockIMC");
+    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))GetProcAddress(videodata->ime_himm32, "ImmUnlockIMC");
+    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))GetProcAddress(videodata->ime_himm32, "ImmLockIMCC");
+    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))GetProcAddress(videodata->ime_himm32, "ImmUnlockIMCC");
+
+    IME_SetWindow(videodata, hwnd);
+    videodata->ime_himc = ImmGetContext(hwnd);
+    ImmReleaseContext(hwnd, videodata->ime_himc);
+    if (!videodata->ime_himc) {
+        videodata->ime_available = SDL_FALSE;
+        IME_Disable(videodata, hwnd);
+        return;
+    }
+    videodata->ime_available = SDL_TRUE;
+    IME_UpdateInputLocale(videodata);
+    IME_SetupAPI(videodata);
+    videodata->ime_uiless = UILess_SetupSinks(videodata);
+    IME_UpdateInputLocale(videodata);
+    IME_Disable(videodata, hwnd);
+}
+
+static void
+IME_Enable(SDL_VideoData *videodata, HWND hwnd)
+{
+    if (!videodata->ime_initialized || !videodata->ime_hwnd_current)
+        return;
+
+    if (!videodata->ime_available) {
+        IME_Disable(videodata, hwnd);
+        return;
+    }
+    if (videodata->ime_hwnd_current == videodata->ime_hwnd_main)
+        ImmAssociateContext(videodata->ime_hwnd_current, videodata->ime_himc);
+
+    videodata->ime_enabled = SDL_TRUE;
+    IME_UpdateInputLocale(videodata);
+    UILess_EnableUIUpdates(videodata);
+}
+
+static void
+IME_Disable(SDL_VideoData *videodata, HWND hwnd)
+{
+    if (!videodata->ime_initialized || !videodata->ime_hwnd_current)
+        return;
+
+    IME_ClearComposition(videodata);
+    if (videodata->ime_hwnd_current == videodata->ime_hwnd_main)
+        ImmAssociateContext(videodata->ime_hwnd_current, NULL);
+
+    videodata->ime_enabled = SDL_FALSE;
+    UILess_DisableUIUpdates(videodata);
+}
+
+static void
+IME_Quit(SDL_VideoData *videodata)
+{
+    if (!videodata->ime_initialized)
+        return;
+
+    UILess_ReleaseSinks(videodata);
+    if (videodata->ime_hwnd_main)
+        ImmAssociateContext(videodata->ime_hwnd_main, videodata->ime_himc);
+
+    videodata->ime_hwnd_main = 0;
+    videodata->ime_himc = 0;
+    if (videodata->ime_himm32) {
+        FreeLibrary(videodata->ime_himm32);
+        videodata->ime_himm32 = 0;
+    }
+    if (videodata->ime_threadmgr) {
+        videodata->ime_threadmgr->lpVtbl->Release(videodata->ime_threadmgr);
+        videodata->ime_threadmgr = 0;
+    }
+    if (videodata->ime_com_initialized) {
+        CoUninitialize();
+        videodata->ime_com_initialized = SDL_FALSE;
+    }
+    videodata->ime_initialized = SDL_FALSE;
+}
+
+static void
+IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd)
+{
+    DWORD id = 0;
+    HIMC himc = 0;
+    WCHAR buffer[16];
+    WCHAR *s = buffer;
+    DWORD len = 0;
+    DWORD err = 0;
+    BOOL vertical = FALSE;
+    UINT maxuilen = 0;
+    static OSVERSIONINFOA osversion = {0};
+    if (videodata->ime_uiless)
+        return;
+
+    videodata->ime_readingstring[0] = 0;
+    if (!osversion.dwOSVersionInfoSize) {
+        osversion.dwOSVersionInfoSize = sizeof(osversion);
+        GetVersionExA(&osversion);
+    }
+    id = IME_GetId(videodata, 0);
+    if (!id)
+        return;
+
+    himc = ImmGetContext(hwnd);
+    if (!himc)
+        return;
+
+    if (videodata->GetReadingString) {
+        len = videodata->GetReadingString(himc, 0, 0, &err, &vertical, &maxuilen);
+        if (len) {
+            if (len > SDL_arraysize(buffer))
+                len = SDL_arraysize(buffer);
+
+            len = videodata->GetReadingString(himc, len, s, &err, &vertical, &maxuilen);
+        }
+        SDL_wcslcpy(videodata->ime_readingstring, s, len);
+    }
+    else {
+        LPINPUTCONTEXT2 lpimc = videodata->ImmLockIMC(himc);
+        LPBYTE p = 0;
+        s = 0;
+        switch (id)
+        {
+        case IMEID_CHT_VER42:
+        case IMEID_CHT_VER43:
+        case IMEID_CHT_VER44:
+            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 24);
+            if (!p)
+                break;
+
+            len = *(DWORD *)(p + 7*4 + 32*4);
+            s = (WCHAR *)(p + 56);
+            break;
+        case IMEID_CHT_VER51:
+        case IMEID_CHT_VER52:
+        case IMEID_CHS_VER53:
+            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 4);
+            if (!p)
+                break;
+
+            p = *(LPBYTE *)((LPBYTE)p + 1*4 + 5*4);
+            if (!p)
+                break;
+
+            len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2);
+            s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4);
+            break;
+        case IMEID_CHS_VER41:
+            {
+                int offset = (IME_GetId(videodata, 1) >= 0x00000002) ? 8 : 7;
+                p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + offset * 4);
+                if (!p)
+                    break;
+
+                len = *(DWORD *)(p + 7*4 + 16*2*4);
+                s = (WCHAR *)(p + 6*4 + 16*2*1);
+            }
+            break;
+        case IMEID_CHS_VER42:
+            if (osversion.dwPlatformId != VER_PLATFORM_WIN32_NT)
+                break;
+
+            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1*4 + 1*4 + 6*4);
+            if (!p)
+                break;
+
+            len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2);
+            s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4);
+            break;
+        }
+        if (s)
+            SDL_wcslcpy(videodata->ime_readingstring, s, len + 1);
+
+        videodata->ImmUnlockIMCC(lpimc->hPrivate);
+        videodata->ImmUnlockIMC(himc);
+    }
+    ImmReleaseContext(hwnd, himc);
+    IME_SendEditingEvent(videodata);
+}
+
+static void
+IME_InputLangChanged(SDL_VideoData *videodata)
+{
+    UINT lang = PRIMLANG();
+    HWND hwndime = 0;
+    IME_UpdateInputLocale(videodata);
+    IME_SetupAPI(videodata);
+    if (lang != PRIMLANG()) {
+        IME_ClearComposition(videodata);
+    }
+    hwndime = ImmGetDefaultIMEWnd(videodata->ime_hwnd_current);
+    if (hwndime) {
+        SendMessageA(hwndime, WM_IME_CONTROL, IMC_OPENSTATUSWINDOW, 0);
+        SendMessageA(hwndime, WM_IME_CONTROL, IMC_CLOSESTATUSWINDOW, 0);
+    }
+}
+
+static DWORD
+IME_GetId(SDL_VideoData *videodata, UINT uIndex)
+{
+    static HKL hklprev = 0;
+    static DWORD dwRet[2] = {0};
+    DWORD dwVerSize = 0;
+    DWORD dwVerHandle = 0;
+    LPVOID lpVerBuffer = 0;
+    LPVOID lpVerData = 0;
+    UINT cbVerData = 0;
+    char szTemp[256];
+    HKL hkl = 0;
+    DWORD dwLang = 0;
+    if (uIndex >= sizeof(dwRet) / sizeof(dwRet[0]))
+        return 0;
+
+    hkl = videodata->ime_hkl;
+    if (hklprev == hkl)
+        return dwRet[uIndex];
+
+    hklprev = hkl;
+    dwLang = ((DWORD)hkl & 0xffff);
+    if (videodata->ime_uiless && LANG() == LANG_CHT) {
+        dwRet[0] = IMEID_CHT_VER_VISTA;
+        dwRet[1] = 0;
+        return dwRet[0];
+    }
+    if (hkl != CHT_HKL_NEW_PHONETIC
+        && hkl != CHT_HKL_NEW_CHANG_JIE
+        && hkl != CHT_HKL_NEW_QUICK
+        && hkl != CHT_HKL_HK_CANTONESE
+        && hkl != CHS_HKL) {
+        dwRet[0] = dwRet[1] = 0;
+        return dwRet[uIndex];
+    }
+    if (ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1) <= 0) {
+        dwRet[0] = dwRet[1] = 0;
+        return dwRet[uIndex];
+    }
+    if (!videodata->GetReadingString) {
+        #define LCID_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)
+        if (CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME1, -1) != 2
+            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME2, -1) != 2
+            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME3, -1) != 2
+            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME1, -1) != 2
+            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME2, -1) != 2) {
+            dwRet[0] = dwRet[1] = 0;
+            return dwRet[uIndex];
+        }
+        #undef LCID_INVARIANT
+        dwVerSize = GetFileVersionInfoSizeA(szTemp, &dwVerHandle);
+        if (dwVerSize) {
+            lpVerBuffer = SDL_malloc(dwVerSize);
+            if (lpVerBuffer) {
+                if (GetFileVersionInfoA(szTemp, dwVerHandle, dwVerSize, lpVerBuffer)) {
+                    if (VerQueryValueA(lpVerBuffer, "\\", &lpVerData, &cbVerData)) {
+                        #define pVerFixedInfo   ((VS_FIXEDFILEINFO FAR*)lpVerData)
+                        DWORD dwVer = pVerFixedInfo->dwFileVersionMS;
+                        dwVer = (dwVer & 0x00ff0000) << 8 | (dwVer & 0x000000ff) << 16;
+                        if (videodata->GetReadingString ||
+                            dwLang == LANG_CHT && (
+                            dwVer == MAKEIMEVERSION(4, 2) ||
+                            dwVer == MAKEIMEVERSION(4, 3) ||
+                            dwVer == MAKEIMEVERSION(4, 4) ||
+                            dwVer == MAKEIMEVERSION(5, 0) ||
+                            dwVer == MAKEIMEVERSION(5, 1) ||
+                            dwVer == MAKEIMEVERSION(5, 2) ||
+                            dwVer == MAKEIMEVERSION(6, 0))
+                            ||
+                            dwLang == LANG_CHS && (
+                            dwVer == MAKEIMEVERSION(4, 1) ||
+                            dwVer == MAKEIMEVERSION(4, 2) ||
+                            dwVer == MAKEIMEVERSION(5, 3))) {
+                            dwRet[0] = dwVer | dwLang;
+                            dwRet[1] = pVerFixedInfo->dwFileVersionLS;
+                            SDL_free(lpVerBuffer);
+                            return dwRet[0];
+                        }
+                        #undef pVerFixedInfo
+                    }
+                }
+            }
+            SDL_free(lpVerBuffer);
+        }
+    }
+    dwRet[0] = dwRet[1] = 0;
+    return dwRet[uIndex];
+}
+
+static void
+IME_SetupAPI(SDL_VideoData *videodata)
+{
+    char ime_file[MAX_PATH + 1];
+    HMODULE hime = 0;
+    HKL hkl = 0;
+    videodata->GetReadingString = 0;
+    videodata->ShowReadingWindow = 0;
+    if (videodata->ime_uiless)
+        return;
+
+    hkl = videodata->ime_hkl;
+    if (ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1) <= 0)
+        return;
+
+    hime = LoadLibraryA(ime_file);
+    if (!hime)
+        return;
+
+    videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT))
+        GetProcAddress(hime, "GetReadingString");
+    videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL))
+        GetProcAddress(hime, "ShowReadingWindow");
+
+    if (videodata->ShowReadingWindow) {
+        HIMC himc = ImmGetContext(videodata->ime_hwnd_current);
+        if (himc) {
+            videodata->ShowReadingWindow(himc, FALSE);
+            ImmReleaseContext(videodata->ime_hwnd_current, himc);
+        }
+    }
+}
 
-    SDL_DelKeyboard(data->keyboard);
+static void
+IME_SetWindow(SDL_VideoData* videodata, HWND hwnd)
+{
+    videodata->ime_hwnd_current = hwnd;
+    if (videodata->ime_threadmgr) {
+        struct ITfDocumentMgr *document_mgr = 0;
+        if (SUCCEEDED(videodata->ime_threadmgr->lpVtbl->AssociateFocus(videodata->ime_threadmgr, hwnd, NULL, &document_mgr))) {
+            if (document_mgr)
+                document_mgr->lpVtbl->Release(document_mgr);
+        }
+    }
+}
+
+static void
+IME_UpdateInputLocale(SDL_VideoData *videodata)
+{
+    static HKL hklprev = 0;
+    videodata->ime_hkl = GetKeyboardLayout(0);
+    if (hklprev == videodata->ime_hkl)
+        return;
+
+    hklprev = videodata->ime_hkl;
+}
+
+static void
+IME_ClearComposition(SDL_VideoData *videodata)
+{
+    HIMC himc = 0;
+    if (!videodata->ime_initialized)
+        return;
+
+    himc = ImmGetContext(videodata->ime_hwnd_current);
+    if (!himc)
+        return;
+
+    ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
+    if (videodata->ime_uiless)
+        ImmSetCompositionString(himc, SCS_SETSTR, TEXT(""), sizeof(TCHAR), TEXT(""), sizeof(TCHAR));
+
+    ImmNotifyIME(himc, NI_CLOSECANDIDATE, 0, 0);
+    ImmReleaseContext(videodata->ime_hwnd_current, himc);
+    SDL_SendEditingText("", 0, 0);
+}
+
+static void
+IME_ClearEditing(SDL_VideoData *videodata)
+{
+
+}
+
+static void
+IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string)
+{
+    LONG length = ImmGetCompositionStringW(himc, string, videodata->ime_composition, sizeof(videodata->ime_composition));
+    if (length < 0)
+        length = 0;
+
+    length /= sizeof(videodata->ime_composition[0]);
+    videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0));
+    if (videodata->ime_composition[videodata->ime_cursor] == 0x3000) {
+        int i;
+        for (i = videodata->ime_cursor + 1; i < length; ++i)
+            videodata->ime_composition[i - 1] = videodata->ime_composition[i];
+
+        --length;
+    }
+    videodata->ime_composition[length] = 0;
+}
+
+static void
+IME_SendInputEvent(SDL_VideoData *videodata)
+{
+    char *s = 0;
+    s = WIN_StringToUTF8(videodata->ime_composition);
+    SDL_SendKeyboardText(s);
+    SDL_free(s);
+
+    videodata->ime_composition[0] = 0;
+    videodata->ime_readingstring[0] = 0;
+    videodata->ime_cursor = 0;
+}
+
+static void
+IME_SendEditingEvent(SDL_VideoData *videodata)
+{
+    char *s = 0;
+    WCHAR buffer[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
+    buffer[0] = 0;
+    if (videodata->ime_readingstring[0]) {
+        size_t len = SDL_min(SDL_wcslen(videodata->ime_composition), (size_t)videodata->ime_cursor);
+        SDL_wcslcpy(buffer, videodata->ime_composition, len + 1);
+        SDL_wcslcat(buffer, videodata->ime_readingstring, sizeof(buffer));
+        SDL_wcslcat(buffer, &videodata->ime_composition[len], sizeof(buffer) - len);
+    }
+    else {
+        SDL_wcslcpy(buffer, videodata->ime_composition, sizeof(videodata->ime_composition));
+    }
+    s = WIN_StringToUTF8(buffer);
+    SDL_SendEditingText(s, videodata->ime_cursor + SDL_wcslen(videodata->ime_readingstring), 0);
+    SDL_free(s);
+}
+
+SDL_bool
+IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
+{
+    SDL_bool trap = SDL_FALSE;
+    HIMC himc = 0;
+    if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled)
+        return SDL_FALSE;
+
+    switch (msg)
+    {
+    case WM_INPUTLANGCHANGE:
+        //IME_InputLangChanged(videodata);
+        break;
+    case WM_IME_SETCONTEXT:
+        *lParam = 0;
+        break;
+    case WM_IME_STARTCOMPOSITION:
+        trap = SDL_TRUE;
+        break;
+    case WM_IME_COMPOSITION:
+        trap = SDL_TRUE;
+        himc = ImmGetContext(hwnd);
+        if (*lParam & GCS_RESULTSTR) {
+            IME_GetCompositionString(videodata, himc, GCS_RESULTSTR);
+            IME_SendInputEvent(videodata);
+        }
+        if (*lParam & GCS_COMPSTR) {
+            if (!videodata->ime_uiless)
+                videodata->ime_readingstring[0] = 0;
+
+            IME_GetCompositionString(videodata, himc, GCS_COMPSTR);
+            IME_SendEditingEvent(videodata);
+        }
+        ImmReleaseContext(hwnd, himc);
+        break;
+    case WM_IME_ENDCOMPOSITION:
+        videodata->ime_composition[0] = 0;
+        videodata->ime_readingstring[0] = 0;
+        videodata->ime_cursor = 0;
+        SDL_SendEditingText("", 0, 0);
+        break;
+    case WM_IME_NOTIFY:
+        switch (wParam)
+        {
+        case IMN_SETCONVERSIONMODE:
+        case IMN_SETOPENSTATUS:
+            IME_UpdateInputLocale(videodata);
+            break;
+        case IMN_OPENCANDIDATE:
+        case IMN_CHANGECANDIDATE:
+            trap = SDL_TRUE;
+            break;
+        case IMN_CLOSECANDIDATE:
+            trap = SDL_TRUE;
+            break;
+        case IMN_PRIVATE:
+            {
+                DWORD dwId = IME_GetId(videodata, 0);
+                IME_GetReadingString(videodata, hwnd);
+                switch (dwId)
+                {
+                case IMEID_CHT_VER42:
+                case IMEID_CHT_VER43:
+                case IMEID_CHT_VER44:
+                case IMEID_CHS_VER41:
+                case IMEID_CHS_VER42:
+                    if (*lParam == 1 || *lParam == 2)
+                        trap = SDL_TRUE;
+
+                    break;
+                case IMEID_CHT_VER50:
+                case IMEID_CHT_VER51:
+                case IMEID_CHT_VER52:
+                case IMEID_CHT_VER60:
+                case IMEID_CHS_VER53:
+                    if (*lParam == 16
+                        || *lParam == 17
+                        || *lParam == 26
+                        || *lParam == 27
+                        || *lParam == 28)
+                        trap = SDL_TRUE;
+                    break;
+                }
+            }
+            break;
+        default:
+            trap = SDL_TRUE;
+            break;
+        }
+        break;
+    }
+    return trap;
+}
+
+STDMETHODIMP_(ULONG) TSFSink_AddRef(TSFSink *sink)
+{
+    return ++sink->refcount;
+}
+
+STDMETHODIMP_(ULONG)TSFSink_Release(TSFSink *sink)
+{
+    --sink->refcount;
+    if (sink->refcount == 0)
+    {
+        SDL_free(sink);
+        return 0;
+    }
+    return sink->refcount;
+}
+
+STDMETHODIMP UIElementSink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv)
+{
+    if (!ppv)
+        return E_INVALIDARG;
+
+    *ppv = 0;
+    if (SDL_IsEqualIID(riid, &IID_IUnknown))
+        *ppv = (IUnknown *)sink;
+    else if (SDL_IsEqualIID(riid, &IID_ITfUIElementSink))
+        *ppv = (ITfUIElementSink *)sink;
+
+    if (*ppv) {
+        TSFSink_AddRef(sink);
+        return S_OK;
+    }
+    return E_NOINTERFACE;
+}
+
+ITfUIElement *UILess_GetUIElement(SDL_VideoData *videodata, DWORD dwUIElementId)
+{
+    ITfUIElementMgr *puiem = 0;
+    ITfUIElement *pelem = 0;
+    ITfThreadMgrEx *threadmgrex = videodata->ime_threadmgrex;
+
+    if (SUCCEEDED(threadmgrex->lpVtbl->QueryInterface(threadmgrex, &IID_ITfUIElementMgr, (LPVOID *)&puiem))) {
+        puiem->lpVtbl->GetUIElement(puiem, dwUIElementId, &pelem);
+        puiem->lpVtbl->Release(puiem);
+    }
+    return pelem;
+}
+
+STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BOOL *pbShow)
+{
+    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
+    ITfReadingInformationUIElement *preading = 0;
+    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
+    if (!element)
+        return E_INVALIDARG;
+
+    *pbShow = FALSE;
+    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
+        BSTR bstr;
+        if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
+            WCHAR *s = (WCHAR *)bstr;
+            SysFreeString(bstr);
+        }
+        preading->lpVtbl->Release(preading);
+    }
+    return S_OK;
+}
+
+STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId)
+{
+    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
+    ITfReadingInformationUIElement *preading = 0;
+    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
+    if (!element)
+        return E_INVALIDARG;
+
+    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
+        BSTR bstr;
+        if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
+            WCHAR *s = (WCHAR *)bstr;
+            SDL_wcslcpy(videodata->ime_readingstring, s, sizeof(videodata->ime_readingstring));
+            IME_SendEditingEvent(videodata);
+            SysFreeString(bstr);
+        }
+        preading->lpVtbl->Release(preading);
+    }
+    return S_OK;
+}
+
+STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId)
+{
+    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
+    ITfReadingInformationUIElement *preading = 0;
+    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
+    if (!element)
+        return E_INVALIDARG;
+
+    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
+        videodata->ime_readingstring[0] = 0;
+        IME_SendEditingEvent(videodata);
+        preading->lpVtbl->Release(preading);
+    }
+    return S_OK;
+}
+
+STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv)
+{
+    if (!ppv)
+        return E_INVALIDARG;
+
+    *ppv = 0;
+    if (SDL_IsEqualIID(riid, &IID_IUnknown))
+        *ppv = (IUnknown *)sink;
+    else if (SDL_IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink))
+        *ppv = (ITfInputProcessorProfileActivationSink *)sink;
+
+    if (*ppv) {
+        TSFSink_AddRef(sink);
+        return S_OK;
+    }
+    return E_NOINTERFACE;
+}
+
+STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
+{
+    if (SDL_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE))
+        IME_InputLangChanged((SDL_VideoData *)sink->data);
+
+    return S_OK;
+}
+
+static void *vtUIElementSink[] = {
+    (void *)(UIElementSink_QueryInterface),
+    (void *)(TSFSink_AddRef),
+    (void *)(TSFSink_Release),
+    (void *)(UIElementSink_BeginUIElement),
+    (void *)(UIElementSink_UpdateUIElement),
+    (void *)(UIElementSink_EndUIElement)
+};
+
+static void *vtIPPASink[] = {
+    (void *)(IPPASink_QueryInterface),
+    (void *)(TSFSink_AddRef),
+    (void *)(TSFSink_Release),
+    (void *)(IPPASink_OnActivated)
+};
+
+static void
+UILess_EnableUIUpdates(SDL_VideoData *videodata)
+{
+    ITfSource *source = 0;
+    if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie != TF_INVALID_COOKIE)
+        return;
+
+    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
+        source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie);
+        source->lpVtbl->Release(source);
+    }
+}
+
+static void
+UILess_DisableUIUpdates(SDL_VideoData *videodata)
+{
+    ITfSource *source = 0;
+    if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie == TF_INVALID_COOKIE)
+        return;
+
+    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
+        source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie);
+        videodata->ime_uielemsinkcookie = TF_INVALID_COOKIE;
+        source->lpVtbl->Release(source);
+    }
+}
+
+static SDL_bool
+UILess_SetupSinks(SDL_VideoData *videodata)
+{
+    TfClientId clientid = 0;
+    SDL_bool result = SDL_FALSE;
+    ITfSource *source = 0;
+    if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, &videodata->ime_threadmgrex)))
+        return SDL_FALSE;
+
+    if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY)))
+        return SDL_FALSE;
+
+    videodata->ime_uielemsink = SDL_malloc(sizeof(TSFSink));
+    videodata->ime_ippasink = SDL_malloc(sizeof(TSFSink));
+
+    videodata->ime_uielemsink->lpVtbl = vtUIElementSink;
+    videodata->ime_uielemsink->refcount = 1;
+    videodata->ime_uielemsink->data = videodata;
+
+    videodata->ime_ippasink->lpVtbl = vtIPPASink;
+    videodata->ime_ippasink->refcount = 1;
+    videodata->ime_ippasink->data = videodata;
+
+    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
+        if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie))) {
+            if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfInputProcessorProfileActivationSink, (IUnknown *)videodata->ime_ippasink, &videodata->ime_alpnsinkcookie))) {
+                result = SDL_TRUE;
+            }
+        }
+        source->lpVtbl->Release(source);
+    }
+    return result;
+}
+
+#define SAFE_RELEASE(p)                             \
+{                                                   \
+    if (p) {                                        \
+        (p)->lpVtbl->Release((p));                  \
+        (p) = 0;                                    \
+    }                                               \
+}
+
+static void
+UILess_ReleaseSinks(SDL_VideoData *videodata)
+{
+    ITfSource *source = 0;
+    if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, &source))) {
+        source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie);
+        source->lpVtbl->UnadviseSink(source, videodata->ime_alpnsinkcookie);
+        SAFE_RELEASE(source);
+        videodata->ime_threadmgrex->lpVtbl->Deactivate(videodata->ime_threadmgrex);
+        SAFE_RELEASE(videodata->ime_threadmgrex);
+        TSFSink_Release(videodata->ime_uielemsink);
+        videodata->ime_uielemsink = 0;
+        TSFSink_Release(videodata->ime_ippasink);
+        videodata->ime_ippasink = 0;
+    }
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32keyboard.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32keyboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -28,9 +28,15 @@
 extern BYTE keypad_scancodes[10];
 
 extern void WIN_InitKeyboard(_THIS);
-extern void WIN_UpdateKeymap(int keyboard);
+extern void WIN_UpdateKeymap(void);
 extern void WIN_QuitKeyboard(_THIS);
 
+extern void WIN_StartTextInput(_THIS);
+extern void WIN_StopTextInput(_THIS);
+extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);
+
+extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata);
+
 #endif /* _SDL_win32keyboard_h */
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32modes.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32modes.c	Sun Aug 22 13:45:56 2010 -0700
@@ -160,7 +160,6 @@
 int
 WIN_InitModes(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
     DWORD i, j, count;
     DISPLAY_DEVICE device;
 
@@ -204,10 +203,18 @@
 {
     SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->desktop_mode.driverdata;
 
+#ifdef _WIN32_WCE
+    // WINCE: DEVMODE.dmPosition not found, or may be mingw32ce bug
+    rect->x = 0;
+    rect->y = 0;
+    rect->w = display->windows->w;
+    rect->h = display->windows->h;
+#else
     rect->x = (int)data->DeviceMode.dmPosition.x;
     rect->y = (int)data->DeviceMode.dmPosition.y;
     rect->w = data->DeviceMode.dmPelsWidth;
     rect->h = data->DeviceMode.dmPelsHeight;
+#endif
     return 0;
 }
 
--- a/src/video/win32/SDL_win32mouse.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32mouse.c	Sun Aug 22 13:45:56 2010 -0700
@@ -31,182 +31,14 @@
 
 #include "SDL_win32video.h"
 
-#include "../../events/SDL_mouse_c.h"
-
-extern HANDLE *mice;
-extern int total_mice;
-extern int tablet;
-
 void
 WIN_InitMouse(_THIS)
 {
-    int index = 0;
-    RAWINPUTDEVICELIST *deviceList = NULL;
-    int devCount = 0;
-    int i;
-    UINT tmp = 0;
-    char *buffer = NULL;
-    char *tab = "wacom";        /* since windows does't give us handles to tablets, we have to detect a tablet by it's name */
-    const char *rdp = "rdp_mou";
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-/* WinCE has no RawInputDeviceList */
-#ifdef _WIN32_WCE
-    SDL_Mouse mouse;
-    SDL_zero(mouse);
-    mouse.id = 0;
-    SDL_AddMouse(&mouse, "Stylus", 0, 0, 1);
-#else
-    /* we're checking for the number of rawinput devices */
-    if (GetRawInputDeviceList(NULL, &devCount, sizeof(RAWINPUTDEVICELIST))) {
-        return;
-    }
-
-    deviceList = SDL_malloc(sizeof(RAWINPUTDEVICELIST) * devCount);
-
-    /* we're getting the raw input device list */
-    GetRawInputDeviceList(deviceList, &devCount, sizeof(RAWINPUTDEVICELIST));
-    mice = SDL_malloc(devCount * sizeof(HANDLE));
-
-    /* we're getting the details of the devices */
-    for (i = 0; i < devCount; ++i) {
-        int is_rdp = 0;
-        UINT j;
-        UINT k;
-        char *default_device_name = "Pointing device xx";
-        const char *reg_key_root = "System\\CurrentControlSet\\Enum\\";
-        char *device_name = SDL_malloc(256 * sizeof(char));
-        char *key_name = NULL;
-        char *tmp_name = NULL;
-        LONG rc = 0;
-        HKEY hkey;
-        DWORD regtype = REG_SZ;
-        DWORD out = 256 * sizeof(char);
-        SDL_Mouse mouse;
-        size_t l;
-        if (deviceList[i].dwType != RIM_TYPEMOUSE) {    /* if a device isn't a mouse type we don't want it */
-            continue;
-        }
-        if (GetRawInputDeviceInfoA
-            (deviceList[i].hDevice, RIDI_DEVICENAME, NULL, &tmp) < 0) {
-            continue;
-        }
-        buffer = SDL_malloc((tmp + 1) * sizeof(char));
-        key_name =
-            SDL_malloc((tmp + SDL_strlen(reg_key_root) + 1) * sizeof(char));
-
-        /* we're getting the device registry path and polishing it to get it's name,
-           surely there must be an easier way, but we haven't found it yet */
-        if (GetRawInputDeviceInfoA
-            (deviceList[i].hDevice, RIDI_DEVICENAME, buffer, &tmp) < 0) {
-            continue;
-        }
-        buffer += 4;
-        tmp -= 4;
-        tmp_name = buffer;
-        for (j = 0; j < tmp; ++j) {
-            if (*tmp_name == '#') {
-                *tmp_name = '\\';
-            }
-
-            else if (*tmp_name == '{') {
-                break;
-            }
-            ++tmp_name;
-        }
-        *tmp_name = '\0';
-        SDL_memcpy(key_name, reg_key_root, SDL_strlen(reg_key_root));
-        SDL_memcpy(key_name + (SDL_strlen(reg_key_root)), buffer, j + 1);
-        l = SDL_strlen(key_name);
-        is_rdp = 0;
-        if (l >= 7) {
-            for (j = 0; j < l - 7; ++j) {
-                for (k = 0; k < 7; ++k) {
-                    if (rdp[k] !=
-                        SDL_tolower((unsigned char) key_name[j + k])) {
-                        break;
-                    }
-                }
-                if (k == 7) {
-                    is_rdp = 1;
-                    break;
-                }
-            }
-        }
-
-        buffer -= 4;
-
-        if (is_rdp == 1) {
-            SDL_free(buffer);
-            SDL_free(key_name);
-            SDL_free(device_name);
-            is_rdp = 0;
-            continue;
-        }
-
-        /* we're opening the registry key to get the mouse name */
-        rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &hkey);
-        if (rc != ERROR_SUCCESS) {
-            SDL_memcpy(device_name, default_device_name,
-                       SDL_strlen(default_device_name));
-        }
-        rc = RegQueryValueExA(hkey, "DeviceDesc", NULL, &regtype, device_name,
-                              &out);
-        RegCloseKey(hkey);
-        if (rc != ERROR_SUCCESS) {
-            SDL_memcpy(device_name, default_device_name,
-                       SDL_strlen(default_device_name));
-        }
-
-        /* we're saving the handle to the device */
-        mice[index] = deviceList[i].hDevice;
-        SDL_zero(mouse);
-        mouse.id = index;
-        l = SDL_strlen(device_name);
-
-        /* we're checking if the device isn't by any chance a tablet */
-        if (data->wintabDLL && tablet == -1) {
-            for (j = 0; j < l - 5; ++j) {
-                for (k = 0; k < 5; ++k) {
-                    if (tab[k] !=
-                        SDL_tolower((unsigned char) device_name[j + k])) {
-                        break;
-                    }
-                }
-                if (k == 5) {
-                    tablet = index;
-                    break;
-                }
-            }
-        }
-
-        /* if it's a tablet, let's read it's maximum and minimum pressure */
-        if (tablet == index) {
-            AXIS pressure;
-            int cursors;
-            data->WTInfoA(WTI_DEVICES, DVC_NPRESSURE, &pressure);
-            data->WTInfoA(WTI_DEVICES, DVC_NCSRTYPES, &cursors);
-            SDL_AddMouse(&mouse, device_name, pressure.axMax, pressure.axMin,
-                         cursors);
-        } else {
-            SDL_AddMouse(&mouse, device_name, 0, 0, 1);
-        }
-        ++index;
-        SDL_free(buffer);
-        SDL_free(key_name);
-    }
-    total_mice = index;
-    SDL_free(deviceList);
-#endif /*_WIN32_WCE*/
 }
 
 void
 WIN_QuitMouse(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    /* let's delete all of the mice */
-    SDL_MouseQuit();
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32video.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32video.c	Sun Aug 22 13:45:56 2010 -0700
@@ -31,15 +31,25 @@
 #include "SDL_win32shape.h"
 #include "SDL_d3drender.h"
 #include "SDL_gdirender.h"
+#include "SDL_gapirender.h"
 
 /* Initialization/Query functions */
 static int WIN_VideoInit(_THIS);
 static void WIN_VideoQuit(_THIS);
 
-int total_mice = 0;             /* total mouse count */
-HANDLE *mice = NULL;            /* the handles to the detected mice */
-HCTX *g_hCtx = NULL;            /* handles to tablet contexts */
-int tablet = -1;                /* we're assuming that there is no tablet */
+/* Sets an error message based on GetLastError() */
+void
+WIN_SetError(const char *prefix)
+{
+    TCHAR buffer[1024];
+    char *message;
+    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
+                  buffer, SDL_arraysize(buffer), NULL);
+    message = WIN_StringToUTF8(buffer);
+    SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
+    SDL_free(message);
+}
+
 
 /* WIN32 driver bootstrap functions */
 
@@ -67,9 +77,11 @@
         FreeLibrary(data->ddrawDLL);
     }
 #endif
-    if (data->wintabDLL) {
-        FreeLibrary(data->wintabDLL);
+#ifdef _WIN32_WCE
+    if(data->hAygShell) {
+       FreeLibrary(data->hAygShell);
     }
+#endif
     SDL_free(device->driverdata);
     SDL_free(device);
 }
@@ -86,8 +98,10 @@
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
     if (device) {
         data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
+    } else {
+        data = NULL;
     }
-    if (!device || !data) {
+    if (!data) {
         SDL_OutOfMemory();
         if (device) {
             SDL_free(device);
@@ -132,31 +146,14 @@
     }
 #endif /* SDL_VIDEO_RENDER_DDRAW */
 
-    data->wintabDLL = LoadLibrary(TEXT("WINTAB32.DLL"));
-    if (data->wintabDLL) {
-#define PROCNAME(X) #X
-        data->WTInfoA =
-            (UINT(*)(UINT, UINT, LPVOID)) GetProcAddress(data->wintabDLL,
-                                                         PROCNAME(WTInfoA));
-        data->WTOpenA =
-            (HCTX(*)(HWND, LPLOGCONTEXTA, BOOL)) GetProcAddress(data->
-                                                                wintabDLL,
-                                                                PROCNAME
-                                                                (WTOpenA));
-        data->WTPacket =
-            (int (*)(HCTX, UINT, LPVOID)) GetProcAddress(data->wintabDLL,
-                                                         PROCNAME(WTPacket));
-        data->WTClose =
-            (BOOL(*)(HCTX)) GetProcAddress(data->wintabDLL,
-                                           PROCNAME(WTClose));
-#undef PROCNAME
-
-        if (!data->WTInfoA || !data->WTOpenA || !data->WTPacket
-            || !data->WTClose) {
-            FreeLibrary(data->wintabDLL);
-            data->wintabDLL = NULL;
-        }
-    }
+#ifdef _WIN32_WCE
+    data->hAygShell = LoadLibrary(TEXT("\\windows\\aygshell.dll"));
+    if(0 == data->hAygShell)
+        data->hAygShell = LoadLibrary(TEXT("aygshell.dll"));
+    data->SHFullScreen = (0 != data->hAygShell ?
+        (PFNSHFullScreen) GetProcAddress(data->hAygShell, TEXT("SHFullScreen")) : 0);
+    data->CoordTransform = NULL;
+#endif
 
     /* Set the function pointers */
     device->VideoInit = WIN_VideoInit;
@@ -200,6 +197,13 @@
     device->GL_SwapWindow = WIN_GL_SwapWindow;
     device->GL_DeleteContext = WIN_GL_DeleteContext;
 #endif
+    device->StartTextInput = WIN_StartTextInput;
+    device->StopTextInput = WIN_StopTextInput;
+    device->SetTextInputRect = WIN_SetTextInputRect;
+
+    device->SetClipboardText = WIN_SetClipboardText;
+    device->GetClipboardText = WIN_GetClipboardText;
+    device->HasClipboardText = WIN_HasClipboardText;
 
     device->free = WIN_DeleteDevice;
 
@@ -207,10 +211,13 @@
 }
 
 VideoBootStrap WIN32_bootstrap = {
+#ifdef _WIN32_WCE
+    "wince", "SDL WinCE video driver", WINCE_Available, WIN_CreateDevice
+#else
     "win32", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice
+#endif
 };
 
-
 int
 WIN_VideoInit(_THIS)
 {
@@ -228,10 +235,9 @@
     GDI_AddRenderDriver(_this);
 #endif
 #if SDL_VIDEO_RENDER_GAPI
-    GAPI_AddRenderDriver(_this);
+    WINCE_AddRenderDriver(_this);
 #endif
 
-    g_hCtx = SDL_malloc(sizeof(HCTX));
     WIN_InitKeyboard(_this);
     WIN_InitMouse(_this);
 
@@ -244,7 +250,6 @@
     WIN_QuitModes(_this);
     WIN_QuitKeyboard(_this);
     WIN_QuitMouse(_this);
-    SDL_free(g_hCtx);
 }
 
 /* vim: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32video.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32video.h	Sun Aug 22 13:45:56 2010 -0700
@@ -28,11 +28,22 @@
 
 #define WIN32_LEAN_AND_MEAN
 #define STRICT
+#ifndef UNICODE
 #define UNICODE
+#endif
 #undef WINVER
-#define WINVER  0x500           /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
+//#define WINVER  0x500           /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
+#define WINVER 0x601  /* Need 0x600 (_WIN32_WINNT_WIN7) for WM_Touch */
+#if (_WIN32_WINNT < 0x601)
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x601
+#endif
+
+
 #include <windows.h>
 
+#include <msctf.h>
+
 #if SDL_VIDEO_RENDER_D3D
 //#include <d3d9.h>
 #define D3D_DEBUG_INFO
@@ -45,11 +56,7 @@
 #include "ddraw.h"
 #endif
 
-#include "wactab/wintab.h"
-#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
-#define PACKETMODE 0
-#include "wactab/pktdef.h"
-
+#include "SDL_win32clipboard.h"
 #include "SDL_win32events.h"
 #include "SDL_win32gamma.h"
 #include "SDL_win32keyboard.h"
@@ -57,6 +64,7 @@
 #include "SDL_win32mouse.h"
 #include "SDL_win32opengl.h"
 #include "SDL_win32window.h"
+#include "SDL_events.h"
 
 #ifdef UNICODE
 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
@@ -65,11 +73,50 @@
 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
 #endif
+extern void WIN_SetError(const char *prefix);
+
+enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW };
+
+typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
+typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
+
+typedef struct  
+{
+    void **lpVtbl;
+    int refcount;
+    void *data;
+} TSFSink;
+
+// Definition from Win98DDK version of IMM.H
+typedef struct tagINPUTCONTEXT2 {
+    HWND                hWnd;                           
+    BOOL                fOpen;                          
+    POINT               ptStatusWndPos;                 
+    POINT               ptSoftKbdPos;                   
+    DWORD               fdwConversion;                  
+    DWORD               fdwSentence;                    
+    union   {                                           
+        LOGFONTA        A;                              
+        LOGFONTW        W;                              
+    } lfFont;                                           
+    COMPOSITIONFORM     cfCompForm;                     
+    CANDIDATEFORM       cfCandForm[4];                  
+    HIMCC               hCompStr;                       
+    HIMCC               hCandInfo;                      
+    HIMCC               hGuideLine;                     
+    HIMCC               hPrivate;                       
+    DWORD               dwNumMsgBuf;                    
+    HIMCC               hMsgBuf;                        
+    DWORD               fdwInit;                        
+    DWORD               dwReserve[3];                   
+} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;  
 
 /* Private display data */
 
 typedef struct SDL_VideoData
 {
+    int render;
+
 #if SDL_VIDEO_RENDER_D3D
     HANDLE d3dDLL;
     IDirect3D9 *d3d;
@@ -78,18 +125,45 @@
     HANDLE ddrawDLL;
     IDirectDraw *ddraw;
 #endif
+#ifdef _WIN32_WCE
+    HMODULE hAygShell;
+    PFNSHFullScreen SHFullScreen;
+    PFCoordTransform CoordTransform;
+#endif
 
-/* *INDENT-OFF* */
-    /* Function pointers for the Wacom API */
-    HANDLE wintabDLL;
-    UINT (*WTInfoA) (UINT, UINT, LPVOID);
-    HCTX (*WTOpenA) (HWND, LPLOGCONTEXTA, BOOL);
-    int (*WTPacket) (HCTX, UINT, LPVOID);
-    BOOL (*WTClose) (HCTX);
-/* *INDENT-ON* */
+    const SDL_scancode *key_layout;
+    DWORD clipboard_count;
+
+    SDL_bool ime_com_initialized;
+    struct ITfThreadMgr *ime_threadmgr;
+    SDL_bool ime_initialized;
+    SDL_bool ime_enabled;
+    SDL_bool ime_available;
+    HWND ime_hwnd_main;
+    HWND ime_hwnd_current;
+    HIMC ime_himc;
+
+    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
+    WCHAR ime_readingstring[16];
+    int ime_cursor;
 
-    int keyboard;
-    const SDL_scancode *key_layout;
+    HKL ime_hkl;
+    HMODULE ime_himm32;
+    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
+    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
+    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
+    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
+    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
+    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
+
+    SDL_bool ime_uiless;
+    struct ITfThreadMgrEx *ime_threadmgrex;
+    DWORD ime_uielemsinkcookie;
+    DWORD ime_alpnsinkcookie;
+    DWORD ime_openmodesinkcookie;
+    DWORD ime_convmodesinkcookie;
+    TSFSink *ime_uielemsink;
+    TSFSink *ime_ippasink;
 } SDL_VideoData;
 
 #endif /* _SDL_win32video_h */
--- a/src/video/win32/SDL_win32window.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32window.c	Sun Aug 22 13:45:56 2010 -0700
@@ -34,47 +34,12 @@
 #include "../../events/SDL_keyboard_c.h"
 
 #include "SDL_win32video.h"
+#include "SDL_win32window.h"
 
 /* This is included after SDL_win32video.h, which includes windows.h */
 #include "SDL_syswm.h"
-
-
-#define SHFS_SHOWTASKBAR            0x0001
-#define SHFS_HIDETASKBAR            0x0002
-#define SHFS_SHOWSIPBUTTON          0x0004
-#define SHFS_HIDESIPBUTTON          0x0008
-#define SHFS_SHOWSTARTICON          0x0010
-#define SHFS_HIDESTARTICON          0x0020
-
-#ifdef _WIN32_WCE
-// dynamically load aygshell dll because we want SDL to work on HPC and be300
-int aygshell_loaded = 0;
-BOOL(WINAPI * SHFullScreen) (HWND hwndRequester, DWORD dwState) = 0;
-
+#include "SDL_gapirender.h"
 
-static BOOL
-CE_SHFullScreen(HWND hwndRequester, DWORD dwState)
-{
-    if (SHFullScreen == 0 && aygshell_loaded == 0) {
-        aygshell_loaded = 0;
-        void *lib = SDL_LoadObject("aygshell.dll");
-        if (lib) {
-            SHFullScreen =
-                (BOOL(WINAPI *) (HWND, DWORD)) SDL_LoadFunction(lib,
-                                                                "SHFullScreen");
-        }
-    }
-
-    if (SHFullScreen) {
-        SHFullScreen(hwndRequester, dwState);
-        //printf("SHFullscreen(%i)\n",dwState);
-    }
-}
-
-#endif
-
-extern HCTX *g_hCtx;            /* the table of tablet event contexts, each windows has to have it's own tablet context */
-static Uint32 highestId = 0;    /* the highest id of the tablet context */
 
 /* Fake window to help with DirectInput events. */
 HWND SDL_HelperWindow = NULL;
@@ -112,10 +77,12 @@
 
     /* Set up the window proc function */
     data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC);
-    if (data->wndproc == DefWindowProc) {
+    if (data->wndproc == WIN_WindowProc) {
         data->wndproc = NULL;
     }
-    SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc);
+    else {
+        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc);
+    }
 
     /* Fill in the SDL window with the window data */
     {
@@ -165,9 +132,8 @@
         }
     }
     if (GetFocus() == hwnd) {
-        int index = data->videodata->keyboard;
         window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_SetKeyboardFocus(index, data->window);
+        SDL_SetKeyboardFocus(data->window);
 
         if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
             RECT rect;
@@ -186,13 +152,8 @@
 int
 WIN_CreateWindow(_THIS, SDL_Window * window)
 {
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_VideoDisplay *display = window->display;
-    RAWINPUTDEVICE Rid;
-    AXIS TabX, TabY;
-    LOGCONTEXTA lc;
     HWND hwnd;
-    HWND top;
     RECT rect;
     SDL_Rect bounds;
     DWORD style = (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
@@ -210,11 +171,6 @@
     }
 
     /* Figure out what the window area will be */
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        top = HWND_TOPMOST;
-    } else {
-        top = HWND_NOTOPMOST;
-    }
     rect.left = 0;
     rect.top = 0;
     rect.right = window->w;
@@ -224,9 +180,17 @@
     h = (rect.bottom - rect.top);
 
     WIN_GetDisplayBounds(_this, display, &bounds);
+    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+        /* The bounds when this window is visible is the fullscreen mode */
+        SDL_DisplayMode fullscreen_mode;
+        if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
+            bounds.w = fullscreen_mode.w;
+            bounds.h = fullscreen_mode.h;
+        }
+    }
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
         || window->x == SDL_WINDOWPOS_CENTERED) {
-        x = bounds.x + (bounds.w - window->w) / 2;
+        x = bounds.x + (bounds.w - w) / 2;
     } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
         if (bounds.x == 0) {
             x = CW_USEDEFAULT;
@@ -238,7 +202,7 @@
     }
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
         || window->y == SDL_WINDOWPOS_CENTERED) {
-        y = bounds.y + (bounds.h - window->h) / 2;
+        y = bounds.y + (bounds.h - h) / 2;
     } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
         if (bounds.x == 0) {
             y = CW_USEDEFAULT;
@@ -256,48 +220,7 @@
         WIN_SetError("Couldn't create window");
         return -1;
     }
-
-    /* we're configuring the tablet data. See Wintab reference for more info */
-    if (videodata->wintabDLL
-        && videodata->WTInfoA(WTI_DEFSYSCTX, 0, &lc) != 0) {
-        lc.lcPktData = PACKETDATA;
-        lc.lcPktMode = PACKETMODE;
-        lc.lcOptions |= CXO_MESSAGES;
-        lc.lcOptions |= CXO_SYSTEM;
-        lc.lcMoveMask = PACKETDATA;
-        lc.lcBtnDnMask = lc.lcBtnUpMask = PACKETDATA;
-        videodata->WTInfoA(WTI_DEVICES, DVC_X, &TabX);
-        videodata->WTInfoA(WTI_DEVICES, DVC_Y, &TabY);
-        lc.lcInOrgX = 0;
-        lc.lcInOrgY = 0;
-        lc.lcInExtX = TabX.axMax;
-        lc.lcInExtY = TabY.axMax;
-        lc.lcOutOrgX = 0;
-        lc.lcOutOrgY = 0;
-        lc.lcOutExtX = GetSystemMetrics(SM_CXSCREEN);
-        lc.lcOutExtY = -GetSystemMetrics(SM_CYSCREEN);
-        if (window->id > highestId) {
-            HCTX *tmp_hctx;
-            highestId = window->id;
-            tmp_hctx =
-                (HCTX *) SDL_realloc(g_hCtx, (highestId + 1) * sizeof(HCTX));
-            if (!tmp_hctx) {
-                SDL_OutOfMemory();
-                DestroyWindow(hwnd);
-                return -1;
-            }
-            g_hCtx = tmp_hctx;
-        }
-        g_hCtx[window->id] = videodata->WTOpenA(hwnd, &lc, TRUE);
-    }
-#ifndef _WIN32_WCE              /* has no RawInput */
-    /* we're telling the window, we want it to report raw input events from mice */
-    Rid.usUsagePage = 0x01;
-    Rid.usUsage = 0x02;
-    Rid.dwFlags = RIDEV_INPUTSINK;
-    Rid.hwndTarget = hwnd;
-    RegisterRawInputDevices(&Rid, 1, sizeof(Rid));
-#endif
+	//RegisterTouchWindow(hwnd, 0);
 
     WIN_PumpEvents(_this);
 
@@ -437,6 +360,7 @@
     HWND top;
     BOOL menu;
     int x, y;
+    int w, h;
 
     /* Figure out what the window area will be */
     if (window->flags & SDL_WINDOW_FULLSCREEN) {
@@ -455,17 +379,27 @@
     menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
 #endif
     AdjustWindowRectEx(&rect, style, menu, 0);
+    w = (rect.right - rect.left);
+    h = (rect.bottom - rect.top);
 
     WIN_GetDisplayBounds(_this, display, &bounds);
+    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+        /* The bounds when this window is visible is the fullscreen mode */
+        SDL_DisplayMode fullscreen_mode;
+        if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
+            bounds.w = fullscreen_mode.w;
+            bounds.h = fullscreen_mode.h;
+        }
+    }
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
         || window->x == SDL_WINDOWPOS_CENTERED) {
-        x = bounds.x + (bounds.w - window->w) / 2;
+        x = bounds.x + (bounds.w - w) / 2;
     } else {
         x = bounds.x + window->x + rect.left;
     }
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
         || window->y == SDL_WINDOWPOS_CENTERED) {
-        y = bounds.y + (bounds.h - window->h) / 2;
+        y = bounds.y + (bounds.h - h) / 2;
     } else {
         y = bounds.y + window->y + rect.top;
     }
@@ -509,32 +443,22 @@
 void
 WIN_ShowWindow(_THIS, SDL_Window * window)
 {
+#ifdef _WIN32_WCE
+    WINCE_ShowWindow(_this, window, 1);
+#else
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
     ShowWindow(hwnd, SW_SHOW);
-
-#ifdef _WIN32_WCE
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        CE_SHFullScreen(hwnd,
-                        SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
-                        SHFS_HIDESIPBUTTON);
-    }
 #endif
 }
 
 void
 WIN_HideWindow(_THIS, SDL_Window * window)
 {
+#ifdef _WIN32_WCE
+    WINCE_ShowWindow(_this, window, 0);
+#else
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
     ShowWindow(hwnd, SW_HIDE);
-
-#ifdef _WIN32_WCE
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        CE_SHFullScreen(hwnd,
-                        SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR |
-                        SHFS_SHOWSIPBUTTON);
-    }
 #endif
 }
 
@@ -550,45 +474,33 @@
         top = HWND_NOTOPMOST;
     }
     SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE));
-
-#ifdef _WIN32_WCE
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        CE_SHFullScreen(hwnd,
-                        SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
-                        SHFS_HIDESIPBUTTON);
-    }
-#endif
 }
 
 void
 WIN_MaximizeWindow(_THIS, SDL_Window * window)
 {
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
-    ShowWindow(hwnd, SW_MAXIMIZE);
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
 
 #ifdef _WIN32_WCE
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        CE_SHFullScreen(hwnd,
-                        SHFS_HIDESTARTICON | SHFS_HIDETASKBAR |
-                        SHFS_HIDESIPBUTTON);
-    }
+    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
+        videodata->SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
 #endif
+
+    ShowWindow(hwnd, SW_MAXIMIZE);
 }
 
 void
 WIN_MinimizeWindow(_THIS, SDL_Window * window)
 {
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
 
     ShowWindow(hwnd, SW_MINIMIZE);
 
 #ifdef _WIN32_WCE
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        CE_SHFullScreen(hwnd,
-                        SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR |
-                        SHFS_SHOWSIPBUTTON);
-    }
+    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
+	videodata->SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
 #endif
 }
 
@@ -620,15 +532,14 @@
 void
 WIN_DestroyWindow(_THIS, SDL_Window * window)
 {
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
 
     if (data) {
+#ifdef _WIN32_WCE
+	WINCE_ShowWindow(_this, window, 0);
+#endif
         ReleaseDC(data->hwnd, data->hdc);
         if (data->created) {
-            if (videodata->wintabDLL) {
-                videodata->WTClose(g_hCtx[window->id]);
-            }
             DestroyWindow(data->hwnd);
         }
         SDL_free(data);
@@ -674,8 +585,7 @@
     /* Register the class. */
     SDL_HelperWindowClass = RegisterClass(&wce);
     if (SDL_HelperWindowClass == 0) {
-        SDL_SetError("Unable to create Helper Window Class: error %d.",
-                     GetLastError());
+        WIN_SetError("Unable to create Helper Window Class");
         return -1;
     }
 
@@ -693,8 +603,7 @@
                                       hInstance, NULL);
     if (SDL_HelperWindow == NULL) {
         UnregisterClass(SDL_HelperWindowClassName, hInstance);
-        SDL_SetError("Unable to create Helper Window: error %d.",
-                     GetLastError());
+        WIN_SetError("Unable to create Helper Window");
         return -1;
     }
 
@@ -713,8 +622,7 @@
     /* Destroy the window. */
     if (SDL_HelperWindow != NULL) {
         if (DestroyWindow(SDL_HelperWindow) == 0) {
-            SDL_SetError("Unable to destroy Helper Window: error %d.",
-                         GetLastError());
+            WIN_SetError("Unable to destroy Helper Window");
             return;
         }
         SDL_HelperWindow = NULL;
@@ -723,8 +631,7 @@
     /* Unregister the class. */
     if (SDL_HelperWindowClass != 0) {
         if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) {
-            SDL_SetError("Unable to destroy Helper Window Class: error %d.",
-                         GetLastError());
+            WIN_SetError("Unable to destroy Helper Window Class");
             return;
         }
         SDL_HelperWindowClass = 0;
--- a/src/video/win32/SDL_win32window.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/SDL_win32window.h	Sun Aug 22 13:45:56 2010 -0700
@@ -24,6 +24,15 @@
 #ifndef _SDL_win32window_h
 #define _SDL_win32window_h
 
+#ifdef _WIN32_WCE
+#define SHFS_SHOWTASKBAR        0x0001
+#define SHFS_HIDETASKBAR        0x0002
+#define SHFS_SHOWSIPBUTTON      0x0004
+#define SHFS_HIDESIPBUTTON      0x0008
+#define SHFS_SHOWSTARTICON      0x0010
+#define SHFS_HIDESTARTICON      0x0020
+#endif
+
 typedef struct
 {
     SDL_Window *window;
--- a/src/video/win32/wactab/pktdef.h	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-/* *INDENT-OFF* */
-/* -------------------------------- pktdef.h -------------------------------- */
-/* Combined 16 & 32-bit version. */
-
-/*------------------------------------------------------------------------------
-The text and information contained in this file may be freely used,
-copied, or distributed without compensation or licensing restrictions.
-
-This file is copyright 1991-1998 by LCS/Telegraphics.
-------------------------------------------------------------------------------*/
-/*------------------------------------------------------------------------------
-
-How to use pktdef.h:
-
-1. Include wintab.h
-2. if using just one packet format:
-	a. Define PACKETDATA and PACKETMODE as or'ed combinations of WTPKT bits
-	   (use the PK_* identifiers).
-	b. Include pktdef.h.
-	c. The generated structure typedef will be called PACKET.  Use PACKETDATA
-	   and PACKETMODE to fill in the LOGCONTEXT structure.
-3. If using multiple packet formats, for each one:
-	a. Define PACKETNAME. Its text value will be a prefix for this packet's
-	   parameters and names.
-	b. Define <PACKETNAME>PACKETDATA and <PACKETNAME>PACKETMODE similar to
-	   2.a. above.
-	c. Include pktdef.h.
-	d. The generated structure typedef will be called
-	   <PACKETNAME>PACKET. Compare with 2.c. above and example #2 below.
-4. If using extension packet data, do the following additional steps
-   for each extension:
-	a. Before including pktdef.h, define <PACKETNAME>PACKET<EXTENSION>
-	   as either PKEXT_ABSOLUTE or PKEXT_RELATIVE.
-	b. The generated structure typedef will contain a field for the
-	   extension data.
-	c. Scan the WTI_EXTENSION categories to find the extension's
-	   packet mask bit.
-	d. OR the packet mask bit with <PACKETNAME>PACKETDATA and use the
-	   result in the lcPktData field of the LOGCONTEXT structure.
-	e. If <PACKETNAME>PACKET<EXTENSION> was PKEXT_RELATIVE, OR the
-	   packet mask bit with <PACKETNAME>PACKETMODE and use the result
-	   in the lcPktMode field of the LOGCONTEXT structure.
-
-
-Example #1.	-- single packet format
-
-#include <wintab.h>
-#define PACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
-#define PACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
-#include <pktdef.h>
-...
-	lc.lcPktData = PACKETDATA;
-	lc.lcPktMode = PACKETMODE;
-
-Example #2. -- multiple formats
-
-#include <wintab.h>
-#define PACKETNAME		MOE
-#define MOEPACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
-#define MOEPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
-#include <pktdef.h>
-#define PACKETNAME		LARRY
-#define LARRYPACKETDATA	PK_Y | PK_Z | PK_BUTTONS	/@ y, z, buttons @/
-#define LARRYPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
-#include <pktdef.h>
-#define PACKETNAME		CURLY
-#define CURLYPACKETDATA	PK_X | PK_Z | PK_BUTTONS	/@ x, z, buttons @/
-#define CURLYPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
-#include <pktdef.h>
-...
-	lcMOE.lcPktData = MOEPACKETDATA;
-	lcMOE.lcPktMode = MOEPACKETMODE;
-...
-	lcLARRY.lcPktData = LARRYPACKETDATA;
-	lcLARRY.lcPktMode = LARRYPACKETMODE;
-...
-	lcCURLY.lcPktData = CURLYPACKETDATA;
-	lcCURLY.lcPktMode = CURLYPACKETMODE;
-
-Example #3. -- extension packet data "XFOO".
-	
-#include <wintab.h>
-#define PACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
-#define PACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
-#define PACKETXFOO	PKEXT_ABSOLUTE				/@ XFOO absolute mode @/
-#include <pktdef.h>
-...
-UINT ScanExts(UINT wTag)
-{
-	UINT i;
-	UINT wScanTag;
-
-	/@ scan for wTag's info category. @/
-	for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) {
-		 if (wTag == wScanTag) {
-			/@ return category offset from WTI_EXTENSIONS. @/
-			return i;
-		}
-	}
-	/@ return error code. @/
-	return 0xFFFF;
-}
-...
-	lc.lcPktData = PACKETDATA;
-	lc.lcPktMode = PACKETMODE;
-#ifdef PACKETXFOO
-	categoryXFOO = ScanExts(WTX_XFOO);
-	WTInfo(WTI_EXTENSIONS + categoryXFOO, EXT_MASK, &maskXFOO);
-	lc.lcPktData |= maskXFOO;
-#if PACKETXFOO == PKEXT_RELATIVE
-	lc.lcPktMode |= maskXFOO;
-#endif
-#endif
-	WTOpen(hWnd, &lc, TRUE);
-
-
-------------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C" {
-#endif	/* __cplusplus */
-
-#ifndef PACKETNAME
-	/* if no packet name prefix */
-	#define __PFX(x)	x
-	#define __IFX(x,y)	x ## y
-#else
-	/* add prefixes and infixes to packet format names */
-	#define __PFX(x)		__PFX2(PACKETNAME,x)
-	#define __PFX2(p,x)		__PFX3(p,x)
-	#define __PFX3(p,x)		p ## x
-	#define __IFX(x,y)		__IFX2(x,PACKETNAME,y)
-	#define __IFX2(x,i,y)	__IFX3(x,i,y)
-	#define __IFX3(x,i,y)	x ## i ## y
-#endif
-
-#define __SFX2(x,s)		__SFX3(x,s)
-#define __SFX3(x,s)		x ## s
-
-#define __TAG  	__IFX(tag,PACKET)
-#define __TYPES	__PFX(PACKET), * __IFX(P,PACKET), NEAR * __IFX(NP,PACKET), \
-					FAR * __IFX(LP,PACKET)
-
-#define __DATA		(__PFX(PACKETDATA))
-#define __MODE		(__PFX(PACKETMODE))
-#define __EXT(x)	__SFX2(__PFX(PACKET),x)
-
-	
-typedef struct __TAG {
-	#if (__DATA & PK_CONTEXT)
-		HCTX			pkContext;
-	#endif
-	#if (__DATA & PK_STATUS)
-		UINT			pkStatus;
-	#endif
-	#if (__DATA & PK_TIME)
-		DWORD			pkTime;
-	#endif
-	#if (__DATA & PK_CHANGED)
-		WTPKT			pkChanged;
-	#endif
-	#if (__DATA & PK_SERIAL_NUMBER)
-		UINT			pkSerialNumber;
-	#endif
-	#if (__DATA & PK_CURSOR)
-		UINT			pkCursor;
-	#endif
-	#if (__DATA & PK_BUTTONS)
-		DWORD			pkButtons;
-	#endif
-	#if (__DATA & PK_X)
-		LONG			pkX;
-	#endif
-	#if (__DATA & PK_Y)
-		LONG			pkY;
-	#endif
-	#if (__DATA & PK_Z)
-		LONG			pkZ;
-	#endif
-	#if (__DATA & PK_NORMAL_PRESSURE)
-		#if (__MODE & PK_NORMAL_PRESSURE)
-			/* relative */
-			int			pkNormalPressure;
-		#else
-			/* absolute */
-			UINT		pkNormalPressure;
-		#endif
-	#endif
-	#if (__DATA & PK_TANGENT_PRESSURE)
-		#if (__MODE & PK_TANGENT_PRESSURE)
-			/* relative */
-			int			pkTangentPressure;
-		#else
-			/* absolute */
-			UINT		pkTangentPressure;
-		#endif
-	#endif
-	#if (__DATA & PK_ORIENTATION)
-		ORIENTATION		pkOrientation;
-	#endif
-	#if (__DATA & PK_ROTATION)
-		ROTATION		pkRotation; /* 1.1 */
-	#endif
-
-#ifndef NOWTEXTENSIONS
-	/* extensions begin here. */
-	#if (__EXT(FKEYS) == PKEXT_RELATIVE) || (__EXT(FKEYS) == PKEXT_ABSOLUTE)
-		UINT			pkFKeys;
-	#endif
-	#if (__EXT(TILT) == PKEXT_RELATIVE) || (__EXT(TILT) == PKEXT_ABSOLUTE)
-		TILT			pkTilt;
-	#endif
-	#if (__EXT(EXPKEYS) == PKEXT_RELATIVE) || (__EXT(EXPKEYS) == PKEXT_ABSOLUTE)
-		WORD			pkExpKeys[4]; /* 1.3 */
-	#endif
-#endif
-
-} __TYPES ;
-
-#undef PACKETNAME
-#undef __TAG
-#undef __TAG2
-#undef __TYPES
-#undef __TYPES2
-#undef __DATA
-#undef __MODE
-#undef __PFX
-#undef __PFX2
-#undef __PFX3
-#undef __IFX
-#undef __IFX2
-#undef __IFX3
-#undef __SFX2
-#undef __SFX3
-
-#ifdef __cplusplus
-}
-#endif	/* __cplusplus */
--- a/src/video/win32/wactab/wintab.h	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,866 +0,0 @@
-/* *INDENT-OFF* */
-/* -------------------------------- wintab.h -------------------------------- */
-/* Combined 16 & 32-bit version. */
-
-/*------------------------------------------------------------------------------
-The text and information contained in this file may be freely used,
-copied, or distributed without compensation or licensing restrictions.
-
-This file is copyright 1991-1998 by LCS/Telegraphics.
-------------------------------------------------------------------------------*/
-
-#ifndef _INC_WINTAB     /* prevent multiple includes */
-#define _INC_WINTAB
-
-#ifdef __cplusplus
-extern "C" {
-#endif	/* __cplusplus */
-
-/* -------------------------------------------------------------------------- */
-/* Messages */
-#ifndef NOWTMESSAGES
-
-	#define WT_DEFBASE		0x7FF0
-	#define WT_MAXOFFSET	0xF
-
-	#define _WT_PACKET(b)		((b)+0)
-	#define _WT_CTXOPEN(b)		((b)+1)
-	#define _WT_CTXCLOSE(b)		((b)+2)
-	#define _WT_CTXUPDATE(b)	((b)+3)
-	#define _WT_CTXOVERLAP(b)	((b)+4)
-	#define _WT_PROXIMITY(b)	((b)+5)
-	#define _WT_INFOCHANGE(b)	((b)+6)
-	#define _WT_CSRCHANGE(b)	((b)+7) /* 1.1 */
-	#define _WT_MAX(b)			((b)+WT_MAXOFFSET)
-	
-	#define WT_PACKET			_WT_PACKET(WT_DEFBASE)
-	#define WT_CTXOPEN			_WT_CTXOPEN(WT_DEFBASE)
-	#define WT_CTXCLOSE			_WT_CTXCLOSE(WT_DEFBASE)
-	#define WT_CTXUPDATE		_WT_CTXUPDATE(WT_DEFBASE)
-	#define WT_CTXOVERLAP		_WT_CTXOVERLAP(WT_DEFBASE)
-	#define WT_PROXIMITY		_WT_PROXIMITY(WT_DEFBASE)
-	#define WT_INFOCHANGE		_WT_INFOCHANGE(WT_DEFBASE)
-	#define WT_CSRCHANGE		_WT_CSRCHANGE(WT_DEFBASE) /* 1.1 */
-	#define WT_MAX				_WT_MAX(WT_DEFBASE)
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-/* Data Types */
-
-/* -------------------------------------------------------------------------- */
-/* COMMON DATA DEFS */
-
-DECLARE_HANDLE(HMGR);		/* manager handle */
-DECLARE_HANDLE(HCTX);		/* context handle */
-DECLARE_HANDLE(HWTHOOK);	/* hook handle */
-
-typedef DWORD WTPKT;		/* packet mask */
-
-
-#ifndef NOWTPKT
-
-	/* WTPKT bits */
-	#define PK_CONTEXT			0x0001	/* reporting context */
-	#define PK_STATUS			0x0002	/* status bits */
-	#define PK_TIME				0x0004	/* time stamp */
-	#define PK_CHANGED			0x0008	/* change bit vector */
-	#define PK_SERIAL_NUMBER   	0x0010	/* packet serial number */
-	#define PK_CURSOR			0x0020	/* reporting cursor */
-	#define PK_BUTTONS			0x0040	/* button information */
-	#define PK_X				0x0080	/* x axis */
-	#define PK_Y				0x0100	/* y axis */
-	#define PK_Z				0x0200	/* z axis */
-	#define PK_NORMAL_PRESSURE	0x0400	/* normal or tip pressure */
-	#define PK_TANGENT_PRESSURE	0x0800	/* tangential or barrel pressure */
-	#define PK_ORIENTATION		0x1000	/* orientation info: tilts */
-	#define PK_ROTATION			0x2000	/* rotation info; 1.1 */
-
-#endif
-
-typedef DWORD FIX32;				/* fixed-point arithmetic type */
-
-#ifndef NOFIX32
-	#define INT(x)	HIWORD(x)
-	#define FRAC(x)	LOWORD(x)
-
-	#define CASTFIX32(x)	((FIX32)((x)*65536L))
-
-	#define ROUND(x)		(INT(x) + (FRAC(x) > (WORD)0x8000))
-
-	#define FIX_MUL(c, a, b)						\
-		(c = (((DWORD)FRAC(a) * FRAC(b)) >> 16) +	\
-			(DWORD)INT(a) * FRAC(b) +				\
-			(DWORD)INT(b) * FRAC(a) +				\
-			((DWORD)INT(a) * INT(b) << 16))
-
-	#ifdef _WINDLL
-		#define FIX_DIV_SC static
-	#else
-		#define FIX_DIV_SC
-	#endif
-
-	#define FIX_DIV(c, a, b)					\
-		{							   			\
-			FIX_DIV_SC DWORD temp, rem, btemp;	\
-									   			\
-			/* fraction done bytewise */		\
-			temp = ((a / b) << 16);				\
-			rem = a % b;			   			\
-			btemp = b;							\
-			if (INT(btemp) < 256) {				\
-				rem <<= 8;				   		\
-			}									\
-			else {								\
-				btemp >>= 8;					\
-			}									\
-			temp += ((rem / btemp) << 8);  		\
-			rem %= btemp;			   			\
-			rem <<= 8;				   			\
-			temp += rem / btemp;		   		\
-			c = temp;				   			\
-		}
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* INFO DATA DEFS */
-
-#ifndef NOWTINFO
-
-#ifndef NOWTAXIS
-
-typedef struct tagAXIS {
-	LONG	axMin;
-	LONG	axMax;
-	UINT	axUnits;
-	FIX32	axResolution;
-} AXIS, *PAXIS, NEAR *NPAXIS, FAR *LPAXIS;
-
-	/* unit specifiers */
-	#define TU_NONE			0
-	#define TU_INCHES		1
-	#define TU_CENTIMETERS	2
-	#define TU_CIRCLE		3
-
-#endif
-
-#ifndef NOWTSYSBUTTONS
-
-/* system button assignment values */
-#define SBN_NONE		0x00
-#define SBN_LCLICK		0x01
-#define SBN_LDBLCLICK	0x02
-#define SBN_LDRAG		0x03
-#define SBN_RCLICK		0x04
-#define SBN_RDBLCLICK	0x05
-#define SBN_RDRAG		0x06
-#define SBN_MCLICK		0x07
-#define SBN_MDBLCLICK	0x08
-#define SBN_MDRAG		0x09
-/* for Pen Windows */
-#define SBN_PTCLICK		0x10
-#define SBN_PTDBLCLICK	0x20
-#define SBN_PTDRAG		0x30
-#define SBN_PNCLICK		0x40
-#define SBN_PNDBLCLICK	0x50
-#define SBN_PNDRAG		0x60
-#define SBN_P1CLICK		0x70
-#define SBN_P1DBLCLICK	0x80
-#define SBN_P1DRAG		0x90
-#define SBN_P2CLICK		0xA0
-#define SBN_P2DBLCLICK	0xB0
-#define SBN_P2DRAG		0xC0
-#define SBN_P3CLICK		0xD0
-#define SBN_P3DBLCLICK	0xE0
-#define SBN_P3DRAG		0xF0
-
-#endif
-
-#ifndef NOWTCAPABILITIES
-
-/* hardware capabilities */
-#define HWC_INTEGRATED		0x0001
-#define HWC_TOUCH			0x0002
-#define HWC_HARDPROX		0x0004
-#define HWC_PHYSID_CURSORS	0x0008 /* 1.1 */
-#endif
-
-#ifndef NOWTIFC
-
-#ifndef NOWTCURSORS 
-
-/* cursor capabilities */
-#define CRC_MULTIMODE	0x0001 /* 1.1 */
-#define CRC_AGGREGATE	0x0002 /* 1.1 */
-#define CRC_INVERT		0x0004 /* 1.1 */
-
-#endif 
-
-/* info categories */
-#define WTI_INTERFACE		1
-	#define IFC_WINTABID		1
-	#define IFC_SPECVERSION		2
-	#define IFC_IMPLVERSION		3
-	#define IFC_NDEVICES		4
-	#define IFC_NCURSORS		5
-	#define IFC_NCONTEXTS		6
-	#define IFC_CTXOPTIONS		7
-	#define IFC_CTXSAVESIZE		8
-	#define IFC_NEXTENSIONS		9
-	#define IFC_NMANAGERS		10
-	#define IFC_MAX				10
-
-
-#endif
-
-#ifndef NOWTSTATUS
-
-#define WTI_STATUS			2
-	#define STA_CONTEXTS		1
-	#define STA_SYSCTXS			2
-	#define STA_PKTRATE			3
-	#define STA_PKTDATA			4
-	#define STA_MANAGERS		5
-	#define STA_SYSTEM			6
-	#define STA_BUTTONUSE		7
-	#define STA_SYSBTNUSE		8
-	#define STA_MAX				8
-
-#endif
-
-#ifndef NOWTDEFCONTEXT
-
-#define WTI_DEFCONTEXT	3
-#define WTI_DEFSYSCTX	4
-#define WTI_DDCTXS		400 /* 1.1 */
-#define WTI_DSCTXS		500 /* 1.1 */
-	#define CTX_NAME		1
-	#define CTX_OPTIONS		2
-	#define CTX_STATUS		3
-	#define CTX_LOCKS		4
-	#define CTX_MSGBASE		5
-	#define CTX_DEVICE		6
-	#define CTX_PKTRATE		7
-	#define CTX_PKTDATA		8
-	#define CTX_PKTMODE		9
-	#define CTX_MOVEMASK	10
-	#define CTX_BTNDNMASK	11
-	#define CTX_BTNUPMASK	12
-	#define CTX_INORGX		13
-	#define CTX_INORGY		14
-	#define CTX_INORGZ		15
-	#define CTX_INEXTX		16
-	#define CTX_INEXTY		17
-	#define CTX_INEXTZ		18
-	#define CTX_OUTORGX		19
-	#define CTX_OUTORGY		20
-	#define CTX_OUTORGZ		21
-	#define CTX_OUTEXTX		22
-	#define CTX_OUTEXTY		23
-	#define CTX_OUTEXTZ		24
-	#define CTX_SENSX		25
-	#define CTX_SENSY		26
-	#define CTX_SENSZ		27
-	#define CTX_SYSMODE		28
-	#define CTX_SYSORGX		29
-	#define CTX_SYSORGY		30
-	#define CTX_SYSEXTX		31
-	#define CTX_SYSEXTY		32
-	#define CTX_SYSSENSX	33
-	#define CTX_SYSSENSY	34
-	#define CTX_MAX			34
-
-#endif
-
-#ifndef NOWTDEVICES
-
-#define WTI_DEVICES		100
-	#define DVC_NAME			1
-	#define DVC_HARDWARE		2
-	#define DVC_NCSRTYPES		3
-	#define DVC_FIRSTCSR		4
-	#define DVC_PKTRATE			5
-	#define DVC_PKTDATA			6
-	#define DVC_PKTMODE			7
-	#define DVC_CSRDATA			8
-	#define DVC_XMARGIN			9
-	#define DVC_YMARGIN			10
-	#define DVC_ZMARGIN			11
-	#define DVC_X				12
-	#define DVC_Y				13
-	#define DVC_Z				14
-	#define DVC_NPRESSURE		15
-	#define DVC_TPRESSURE		16
-	#define DVC_ORIENTATION		17
-	#define DVC_ROTATION		18 /* 1.1 */
-	#define DVC_PNPID			19 /* 1.1 */
-	#define DVC_MAX				19
-
-#endif
-
-#ifndef NOWTCURSORS
-
-#define WTI_CURSORS		200
-	#define CSR_NAME			1
-	#define CSR_ACTIVE			2
-	#define CSR_PKTDATA			3
-	#define CSR_BUTTONS			4
-	#define CSR_BUTTONBITS		5
-	#define CSR_BTNNAMES		6
-	#define CSR_BUTTONMAP		7
-	#define CSR_SYSBTNMAP		8
-	#define CSR_NPBUTTON		9
-	#define CSR_NPBTNMARKS		10
-	#define CSR_NPRESPONSE		11
-	#define CSR_TPBUTTON		12
-	#define CSR_TPBTNMARKS		13
-	#define CSR_TPRESPONSE		14
-	#define CSR_PHYSID			15 /* 1.1 */
-	#define CSR_MODE			16 /* 1.1 */
-	#define CSR_MINPKTDATA		17 /* 1.1 */
-	#define CSR_MINBUTTONS		18 /* 1.1 */
-	#define CSR_CAPABILITIES	19 /* 1.1 */
-	#define CSR_TYPE				20 /* 1.2 */
-	#define CSR_MAX				20
-
-#endif
-
-#ifndef NOWTEXTENSIONS
-
-#define WTI_EXTENSIONS	300
-	#define EXT_NAME		1
-	#define EXT_TAG			2
-	#define EXT_MASK		3
-	#define EXT_SIZE		4
-	#define EXT_AXES		5
-	#define EXT_DEFAULT		6
-	#define EXT_DEFCONTEXT	7
-	#define EXT_DEFSYSCTX	8
-	#define EXT_CURSORS		9 
-	#define EXT_MAX			109 /* Allow 100 cursors */
-
-#endif
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* CONTEXT DATA DEFS */
-
-#define LCNAMELEN	40
-#define LC_NAMELEN	40
-#ifdef WIN32
-typedef struct tagLOGCONTEXTA {
-	char	lcName[LCNAMELEN];
-	UINT	lcOptions;
-	UINT	lcStatus;
-	UINT	lcLocks;
-	UINT	lcMsgBase;
-	UINT	lcDevice;
-	UINT	lcPktRate;
-	WTPKT	lcPktData;
-	WTPKT	lcPktMode;
-	WTPKT	lcMoveMask;
-	DWORD	lcBtnDnMask;
-	DWORD	lcBtnUpMask;
-	LONG	lcInOrgX;
-	LONG	lcInOrgY;
-	LONG	lcInOrgZ;
-	LONG	lcInExtX;
-	LONG	lcInExtY;
-	LONG	lcInExtZ;
-	LONG	lcOutOrgX;
-	LONG	lcOutOrgY;
-	LONG	lcOutOrgZ;
-	LONG	lcOutExtX;
-	LONG	lcOutExtY;
-	LONG	lcOutExtZ;
-	FIX32	lcSensX;
-	FIX32	lcSensY;
-	FIX32	lcSensZ;
-	BOOL	lcSysMode;
-	int		lcSysOrgX;
-	int		lcSysOrgY;
-	int		lcSysExtX;
-	int		lcSysExtY;
-	FIX32	lcSysSensX;
-	FIX32	lcSysSensY;
-} LOGCONTEXTA, *PLOGCONTEXTA, NEAR *NPLOGCONTEXTA, FAR *LPLOGCONTEXTA;
-typedef struct tagLOGCONTEXTW {
-	WCHAR	lcName[LCNAMELEN];
-	UINT	lcOptions;
-	UINT	lcStatus;
-	UINT	lcLocks;
-	UINT	lcMsgBase;
-	UINT	lcDevice;
-	UINT	lcPktRate;
-	WTPKT	lcPktData;
-	WTPKT	lcPktMode;
-	WTPKT	lcMoveMask;
-	DWORD	lcBtnDnMask;
-	DWORD	lcBtnUpMask;
-	LONG	lcInOrgX;
-	LONG	lcInOrgY;
-	LONG	lcInOrgZ;
-	LONG	lcInExtX;
-	LONG	lcInExtY;
-	LONG	lcInExtZ;
-	LONG	lcOutOrgX;
-	LONG	lcOutOrgY;
-	LONG	lcOutOrgZ;
-	LONG	lcOutExtX;
-	LONG	lcOutExtY;
-	LONG	lcOutExtZ;
-	FIX32	lcSensX;
-	FIX32	lcSensY;
-	FIX32	lcSensZ;
-	BOOL	lcSysMode;
-	int		lcSysOrgX;
-	int		lcSysOrgY;
-	int		lcSysExtX;
-	int		lcSysExtY;
-	FIX32	lcSysSensX;
-	FIX32	lcSysSensY;
-} LOGCONTEXTW, *PLOGCONTEXTW, NEAR *NPLOGCONTEXTW, FAR *LPLOGCONTEXTW;
-#ifdef UNICODE
-typedef LOGCONTEXTW LOGCONTEXT;
-typedef PLOGCONTEXTW PLOGCONTEXT;
-typedef NPLOGCONTEXTW NPLOGCONTEXT;
-typedef LPLOGCONTEXTW LPLOGCONTEXT;
-#else
-typedef LOGCONTEXTA LOGCONTEXT;
-typedef PLOGCONTEXTA PLOGCONTEXT;
-typedef NPLOGCONTEXTA NPLOGCONTEXT;
-typedef LPLOGCONTEXTA LPLOGCONTEXT;
-#endif /* UNICODE */
-#else /* WIN32 */
-typedef struct tagLOGCONTEXT {
-	char	lcName[LCNAMELEN];
-	UINT	lcOptions;
-	UINT	lcStatus;
-	UINT	lcLocks;
-	UINT	lcMsgBase;
-	UINT	lcDevice;
-	UINT	lcPktRate;
-	WTPKT	lcPktData;
-	WTPKT	lcPktMode;
-	WTPKT	lcMoveMask;
-	DWORD	lcBtnDnMask;
-	DWORD	lcBtnUpMask;
-	LONG	lcInOrgX;
-	LONG	lcInOrgY;
-	LONG	lcInOrgZ;
-	LONG	lcInExtX;
-	LONG	lcInExtY;
-	LONG	lcInExtZ;
-	LONG	lcOutOrgX;
-	LONG	lcOutOrgY;
-	LONG	lcOutOrgZ;
-	LONG	lcOutExtX;
-	LONG	lcOutExtY;
-	LONG	lcOutExtZ;
-	FIX32	lcSensX;
-	FIX32	lcSensY;
-	FIX32	lcSensZ;
-	BOOL	lcSysMode;
-	int		lcSysOrgX;
-	int		lcSysOrgY;
-	int		lcSysExtX;
-	int		lcSysExtY;
-	FIX32	lcSysSensX;
-	FIX32	lcSysSensY;
-} LOGCONTEXT, *PLOGCONTEXT, NEAR *NPLOGCONTEXT, FAR *LPLOGCONTEXT;
-#endif /* WIN32 */
-
-	/* context option values */
-	#define CXO_SYSTEM		0x0001
-	#define CXO_PEN			0x0002
-	#define CXO_MESSAGES	0x0004
-	#define CXO_MARGIN		0x8000
-	#define CXO_MGNINSIDE	0x4000
-	#define CXO_CSRMESSAGES	0x0008 /* 1.1 */
-
-	/* context status values */
-	#define CXS_DISABLED	0x0001
-	#define CXS_OBSCURED	0x0002
-	#define CXS_ONTOP		0x0004
-
-	/* context lock values */
-	#define CXL_INSIZE		0x0001
-	#define CXL_INASPECT	0x0002
-	#define CXL_SENSITIVITY	0x0004
-	#define CXL_MARGIN		0x0008
-	#define CXL_SYSOUT		0x0010
-
-/* -------------------------------------------------------------------------- */
-/* EVENT DATA DEFS */
-
-/* For packet structure definition, see pktdef.h */
-
-/* packet status values */
-#define TPS_PROXIMITY		0x0001
-#define TPS_QUEUE_ERR		0x0002
-#define TPS_MARGIN			0x0004
-#define TPS_GRAB			0x0008
-#define TPS_INVERT			0x0010 /* 1.1 */
-
-typedef struct tagORIENTATION {
-	int orAzimuth;
-	int orAltitude;
-	int orTwist;
-} ORIENTATION, *PORIENTATION, NEAR *NPORIENTATION, FAR *LPORIENTATION;
-
-typedef struct tagROTATION { /* 1.1 */
-	int	roPitch;
-	int roRoll;
-	int roYaw;
-} ROTATION, *PROTATION, NEAR *NPROTATION, FAR *LPROTATION;
-// grandfather in obsolete member names.
-#define rotPitch	roPitch
-#define rotRoll		roRoll
-#define rotYaw		roYaw
-
-/* relative buttons */
-#define TBN_NONE	0
-#define TBN_UP		1
-#define TBN_DOWN	2
-
-/* -------------------------------------------------------------------------- */
-/* DEVICE CONFIG CONSTANTS */
-
-#ifndef NOWTDEVCFG
-
-#define WTDC_NONE		0
-#define WTDC_CANCEL		1
-#define WTDC_OK			2
-#define WTDC_RESTART	3
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* HOOK CONSTANTS */
-
-#ifndef NOWTHOOKS
-
-#define WTH_PLAYBACK		1
-#define WTH_RECORD			2
-
-#define WTHC_GETLPLPFN	    (-3)
-#define WTHC_LPLPFNNEXT	    (-2)
-#define WTHC_LPFNNEXT	    (-1)
-#define WTHC_ACTION		    0
-#define WTHC_GETNEXT   	    1
-#define WTHC_SKIP 	   		2
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* PREFERENCE FUNCTION CONSTANTS */
-
-#ifndef NOWTPREF
-
-#define WTP_LPDEFAULT	((LPVOID)-1L)
-#define WTP_DWDEFAULT	((DWORD)-1L)
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* EXTENSION TAGS AND CONSTANTS */
-
-#ifndef NOWTEXTENSIONS
-
-/* constants for use with pktdef.h */
-#define PKEXT_ABSOLUTE	1
-#define PKEXT_RELATIVE	2
-
-/* Extension tags. */
-#define WTX_OBT			0	/* Out of bounds tracking */
-#define WTX_FKEYS		1	/* Function keys */
-#define WTX_TILT		2	/* Raw Cartesian tilt; 1.1 */
-#define WTX_CSRMASK		3	/* select input by cursor type; 1.1 */
-#define WTX_XBTNMASK	4	/* Extended button mask; 1.1 */
-#define WTX_EXPKEYS	5	/* ExpressKeys; 1.3 */
-
-typedef struct tagXBTNMASK {
-	BYTE xBtnDnMask[32];
-	BYTE xBtnUpMask[32];
-} XBTNMASK;
-
-typedef struct tagTILT { /* 1.1 */
-	int tiltX;
-	int tiltY;
-} TILT;
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-/* Functions */
-
-	#ifndef API
-		#ifndef WINAPI
-			#define API			FAR PASCAL
-		#else
-			#define API			WINAPI
-		#endif
-	#endif
-
-#ifndef NOWTCALLBACKS
-
-	#ifndef CALLBACK
-	#define CALLBACK	FAR PASCAL
-	#endif
-
-	#ifndef NOWTMANAGERFXNS
-	/* callback function types */
-	typedef BOOL (WINAPI * WTENUMPROC)(HCTX, LPARAM); /* changed CALLBACK->WINAPI, 1.1 */
-	typedef BOOL (WINAPI * WTCONFIGPROC)(HCTX, HWND);
-	typedef LRESULT (WINAPI * WTHOOKPROC)(int, WPARAM, LPARAM);
-	typedef WTHOOKPROC FAR *LPWTHOOKPROC;
-	#endif
-
-#endif
-
-
-#ifndef NOWTFUNCTIONS
-
-	#ifndef NOWTBASICFXNS
-	/* BASIC FUNCTIONS */
-#ifdef WIN32
-	UINT API WTInfoA(UINT, UINT, LPVOID);
-	#define ORD_WTInfoA						20
-	UINT API WTInfoW(UINT, UINT, LPVOID);
-	#define ORD_WTInfoW					  1020
-	#ifdef UNICODE
-	#define WTInfo  WTInfoW
-	#define ORD_WTInfo  ORD_WTInfoW
-	#else
-	#define WTInfo  WTInfoA
-	#define ORD_WTInfo  ORD_WTInfoA
-	#endif /* !UNICODE */
-#else
-	UINT API WTInfo(UINT, UINT, LPVOID);
-	#define ORD_WTInfo						20
-#endif
-#ifdef WIN32
-	HCTX API WTOpenA(HWND, LPLOGCONTEXTA, BOOL);
-	#define ORD_WTOpenA						21
-	HCTX API WTOpenW(HWND, LPLOGCONTEXTW, BOOL);
-	#define ORD_WTOpenW					  1021
-	#ifdef UNICODE
-	#define WTOpen  WTOpenW
-	#define ORD_WTOpen  ORD_WTOpenW
-	#else
-	#define WTOpen  WTOpenA
-	#define ORD_WTOpen  ORD_WTOpenA
-	#endif /* !UNICODE */
-#else
-	HCTX API WTOpen(HWND, LPLOGCONTEXT, BOOL);
-	#define ORD_WTOpen						21
-#endif
-	BOOL API WTClose(HCTX);
-	#define ORD_WTClose						22
-	int API WTPacketsGet(HCTX, int, LPVOID);
-	#define ORD_WTPacketsGet				23
-	BOOL API WTPacket(HCTX, UINT, LPVOID);
-	#define ORD_WTPacket					24
-	#endif
-
-	#ifndef NOWTVISIBILITYFXNS
-	/* VISIBILITY FUNCTIONS */
-	BOOL API WTEnable(HCTX, BOOL);
-	#define ORD_WTEnable					40
-	BOOL API WTOverlap(HCTX, BOOL);
-	#define ORD_WTOverlap					41
-	#endif
-
-	#ifndef NOWTCTXEDITFXNS
-	/* CONTEXT EDITING FUNCTIONS */
-	BOOL API WTConfig(HCTX, HWND);
-	#define ORD_WTConfig					60
-#ifdef WIN32
-	BOOL API WTGetA(HCTX, LPLOGCONTEXTA);
-	#define ORD_WTGetA						61
-	BOOL API WTGetW(HCTX, LPLOGCONTEXTW);
-	#define ORD_WTGetW					  1061
-	#ifdef UNICODE
-	#define WTGet  WTGetW
-	#define ORD_WTGet  ORD_WTGetW
-	#else
-	#define WTGet  WTGetA
-	#define ORD_WTGet  ORD_WTGetA
-	#endif /* !UNICODE */
-#else
-	BOOL API WTGet(HCTX, LPLOGCONTEXT);
-	#define ORD_WTGet						61
-#endif
-#ifdef WIN32
-	BOOL API WTSetA(HCTX, LPLOGCONTEXTA);
-	#define ORD_WTSetA						62
-	BOOL API WTSetW(HCTX, LPLOGCONTEXTW);
-	#define ORD_WTSetW					  1062
-	#ifdef UNICODE
-	#define WTSet  WTSetW
-	#define ORD_WTSet  ORD_WTSetW
-	#else
-	#define WTSet  WTSetA
-	#define ORD_WTSet  ORD_WTSetA
-	#endif /* !UNICODE */
-#else
-	BOOL API WTSet(HCTX, LPLOGCONTEXT);
-	#define ORD_WTSet						62
-#endif
-	BOOL API WTExtGet(HCTX, UINT, LPVOID);
-	#define ORD_WTExtGet					63
-	BOOL API WTExtSet(HCTX, UINT, LPVOID);
-	#define ORD_WTExtSet					64
-	BOOL API WTSave(HCTX, LPVOID);
-	#define ORD_WTSave						65
-	HCTX API WTRestore(HWND, LPVOID, BOOL);
-	#define ORD_WTRestore					66
-	#endif
-
-	#ifndef NOWTQUEUEFXNS
-	/* ADVANCED PACKET AND QUEUE FUNCTIONS */
-	int API WTPacketsPeek(HCTX, int, LPVOID);
-	#define ORD_WTPacketsPeek				80
-	int API WTDataGet(HCTX, UINT, UINT, int, LPVOID, LPINT);
-	#define ORD_WTDataGet					81
-	int API WTDataPeek(HCTX, UINT, UINT, int, LPVOID, LPINT);
-	#define ORD_WTDataPeek					82
-#ifndef WIN32
-/* OBSOLETE IN WIN32! */
-	DWORD API WTQueuePackets(HCTX);
-	#define ORD_WTQueuePackets				83
-#endif
-	int API WTQueueSizeGet(HCTX);
-	#define ORD_WTQueueSizeGet				84
-	BOOL API WTQueueSizeSet(HCTX, int);
-	#define ORD_WTQueueSizeSet				85
-	#endif
-
-	#ifndef NOWTHMGRFXNS
-	/* MANAGER HANDLE FUNCTIONS */
-	HMGR API WTMgrOpen(HWND, UINT);
-	#define ORD_WTMgrOpen					100
-	BOOL API WTMgrClose(HMGR);
-	#define ORD_WTMgrClose					101
-	#endif
-
-	#ifndef NOWTMGRCTXFXNS
-	/* MANAGER CONTEXT FUNCTIONS */
-	BOOL API WTMgrContextEnum(HMGR, WTENUMPROC, LPARAM);
-	#define ORD_WTMgrContextEnum			120
-	HWND API WTMgrContextOwner(HMGR, HCTX);
-	#define ORD_WTMgrContextOwner			121
-	HCTX API WTMgrDefContext(HMGR, BOOL);
-	#define ORD_WTMgrDefContext				122
-	HCTX API WTMgrDefContextEx(HMGR, UINT, BOOL); /* 1.1 */
-	#define ORD_WTMgrDefContextEx			206
-	#endif
-	
-	#ifndef NOWTMGRCONFIGFXNS
-	/* MANAGER CONFIG BOX  FUNCTIONS */
-	UINT API WTMgrDeviceConfig(HMGR, UINT, HWND);
-	#define ORD_WTMgrDeviceConfig			140
-#ifndef WIN32
-/* OBSOLETE IN WIN32! */
-	BOOL API WTMgrConfigReplace(HMGR, BOOL, WTCONFIGPROC);
-	#define ORD_WTMgrConfigReplace			141
-#endif
-	#endif
-
-	#ifndef NOWTMGRHOOKFXNS
-	/* MANAGER PACKET HOOK FUNCTIONS */
-#ifndef WIN32
-/* OBSOLETE IN WIN32! */
-	WTHOOKPROC API WTMgrPacketHook(HMGR, BOOL, int, WTHOOKPROC);
-	#define ORD_WTMgrPacketHook				160
-	LRESULT API WTMgrPacketHookDefProc(int, WPARAM, LPARAM, LPWTHOOKPROC);
-	#define ORD_WTMgrPacketHookDefProc		161
-#endif
-	#endif
-
-	#ifndef NOWTMGRPREFFXNS
-	/* MANAGER PREFERENCE DATA FUNCTIONS */
-	BOOL API WTMgrExt(HMGR, UINT, LPVOID);
-	#define ORD_WTMgrExt					180
-	BOOL API WTMgrCsrEnable(HMGR, UINT, BOOL);
-	#define ORD_WTMgrCsrEnable				181
-	BOOL API WTMgrCsrButtonMap(HMGR, UINT, LPBYTE, LPBYTE);
-	#define ORD_WTMgrCsrButtonMap			182
-	BOOL API WTMgrCsrPressureBtnMarks(HMGR, UINT, DWORD, DWORD);
-	#define ORD_WTMgrCsrPressureBtnMarks	183
-	BOOL API WTMgrCsrPressureResponse(HMGR, UINT, UINT FAR *, UINT FAR *);
-	#define ORD_WTMgrCsrPressureResponse	184
-	BOOL API WTMgrCsrExt(HMGR, UINT, UINT, LPVOID);
-	#define ORD_WTMgrCsrExt					185
-	#endif
-
-/* Win32 replacements for non-portable functions. */
-	#ifndef NOWTQUEUEFXNS
-	/* ADVANCED PACKET AND QUEUE FUNCTIONS */
-	BOOL API WTQueuePacketsEx(HCTX, UINT FAR *, UINT FAR *);
-	#define ORD_WTQueuePacketsEx			200
-	#endif
-
-	#ifndef NOWTMGRCONFIGFXNS
-	/* MANAGER CONFIG BOX  FUNCTIONS */
-#ifdef WIN32
-	BOOL API WTMgrConfigReplaceExA(HMGR, BOOL, LPSTR, LPSTR);
-	#define ORD_WTMgrConfigReplaceExA		202
-	BOOL API WTMgrConfigReplaceExW(HMGR, BOOL, LPWSTR, LPSTR);
-	#define ORD_WTMgrConfigReplaceExW		1202
-	#ifdef UNICODE
-	#define WTMgrConfigReplaceEx  WTMgrConfigReplaceExW
-	#define ORD_WTMgrConfigReplaceEx  ORD_WTMgrConfigReplaceExW
-	#else
-	#define WTMgrConfigReplaceEx  WTMgrConfigReplaceExA
-	#define ORD_WTMgrConfigReplaceEx  ORD_WTMgrConfigReplaceExA
-	#endif /* !UNICODE */
-#else
-	BOOL API WTMgrConfigReplaceEx(HMGR, BOOL, LPSTR, LPSTR);
-	#define ORD_WTMgrConfigReplaceEx		202
-#endif
-	#endif
-
-	#ifndef NOWTMGRHOOKFXNS
-	/* MANAGER PACKET HOOK FUNCTIONS */
-#ifdef WIN32
-	HWTHOOK API WTMgrPacketHookExA(HMGR, int, LPSTR, LPSTR);
-	#define ORD_WTMgrPacketHookExA			203
-	HWTHOOK API WTMgrPacketHookExW(HMGR, int, LPWSTR, LPSTR);
-	#define ORD_WTMgrPacketHookExW			1203
-	#ifdef UNICODE
-	#define WTMgrPacketHookEx  WTMgrPacketHookExW
-	#define ORD_WTMgrPacketHookEx  ORD_WTMgrPacketHookExW
-	#else
-	#define WTMgrPacketHookEx  WTMgrPacketHookExA
-	#define ORD_WTMgrPacketHookEx  ORD_WTMgrPacketHookExA
-	#endif /* !UNICODE */
-#else
-	HWTHOOK API WTMgrPacketHookEx(HMGR, int, LPSTR, LPSTR);
-	#define ORD_WTMgrPacketHookEx			203
-#endif
-	BOOL API WTMgrPacketUnhook(HWTHOOK);
-	#define ORD_WTMgrPacketUnhook			204
-	LRESULT API WTMgrPacketHookNext(HWTHOOK, int, WPARAM, LPARAM);
-	#define ORD_WTMgrPacketHookNext			205
-	#endif
-
-	#ifndef NOWTMGRPREFFXNS
-	/* MANAGER PREFERENCE DATA FUNCTIONS */
-	BOOL API WTMgrCsrPressureBtnMarksEx(HMGR, UINT, UINT FAR *, UINT FAR *);
-	#define ORD_WTMgrCsrPressureBtnMarksEx	201
-	#endif
-
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif	/* __cplusplus */
-
-#endif /* #define _INC_WINTAB */
-
--- a/src/video/win32/wactab/wintabx.h	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/* *INDENT-OFF* */
-/* ------------------------------- wintabx.h -------------------------------- */
-/* Combined 16 & 32-bit version. */
-
-
-/*------------------------------------------------------------------------------
-The text and information contained in this file may be freely used,
-copied, or distributed without compensation or licensing restrictions.
-
-This file is copyright 1991-1998 by LCS/Telegraphics.
-------------------------------------------------------------------------------*/
-
-#ifndef _INC_WINTABX     /* prevent multiple includes */
-#define _INC_WINTABX
-
-#ifdef __cplusplus
-extern "C" {
-#endif	/* __cplusplus */
-
-/* prototype for wintabx.lib. */
-#define _UnlinkWinTab _UnlinkWintab	
-#ifdef WIN32
-	extern WINAPI _UnlinkWintab(void);
-#else
-	extern FAR _UnlinkWintab(void);
-#endif
-
-/****** Wintab message crackers ***********************************************/
-
-#ifndef HANDLE_MSG
-#define HANDLE_MSG(hwnd, message, fn)    \
-    case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
-#endif
-
-/* void Cls_OnWintabPacket(HWND hwnd, HCTX hCtx, UINT sn) */
-#define HANDLE_WT_PACKET(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(lParam), (UINT)(wParam)), 0L)
-#define FORWARD__WT_PACKET(hwnd, bs, hCtx, sn, fn) \
-    (void)(fn)((hwnd), _WT_PACKET(bs), (WPARAM)(UINT)(sn), (LPARAM)(HCTX)(hCtx))
-#define FORWARD_WT_PACKET(hwnd, hCtx, sn, fn) \
-	FORWARD__WT_PACKET(hwnd, WT_DEFBASE, hCtx, sn, fn)
-
-/* void Cls_OnWintabCtxOpen(HWND hwnd, HCTX hCtx, UINT sf) */
-#define HANDLE_WT_CTXOPEN(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
-#define FORWARD__WT_CTXOPEN(hwnd, bs, hCtx, sf, fn) \
-    (void)(fn)((hwnd), _WT_CTXOPEN(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
-#define FORWARD_WT_CTXOPEN(hwnd, hCtx, sf, fn) \
-	FORWARD__WT_CTXOPEN(hwnd, WT_DEFBASE, hCtx, sf, fn)
-
-/* void Cls_OnWintabCtxClose(HWND hwnd, HCTX hCtx, UINT sf) */
-#define HANDLE_WT_CTXCLOSE(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
-#define FORWARD__WT_CTXCLOSE(hwnd, bs, hCtx, sf, fn) \
-    (void)(fn)((hwnd), _WT_CTXCLOSE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
-#define FORWARD_WT_CTXCLOSE(hwnd, hCtx, sf, fn) \
-	FORWARD__WT_CTXCLOSE(hwnd, WT_DEFBASE, hCtx, sf, fn)
-
-/* void Cls_OnWintabCtxUpdate(HWND hwnd, HCTX hCtx, UINT sf) */
-#define HANDLE_WT_CTXUPDATE(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
-#define FORWARD__WT_CTXUPDATE(hwnd, bs, hCtx, sf, fn) \
-    (void)(fn)((hwnd), _WT_CTXUPDATE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
-#define FORWARD_WT_CTXUPDATE(hwnd, hCtx, sf, fn) \
-	FORWARD__WT_CTXUPDATE(hwnd, WT_DEFBASE, hCtx, sf, fn)
-
-/* void Cls_OnWintabCtxOverlap(HWND hwnd, HCTX hCtx, UINT sf) */
-#define HANDLE_WT_CTXOVERLAP(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
-#define FORWARD__WT_CTXOVERLAP(hwnd, bs, hCtx, sf, fn) \
-    (void)(fn)((hwnd), _WT_CTXOVERLAP(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
-#define FORWARD_WT_CTXOVERLAP(hwnd, hCtx, sf, fn) \
-	FORWARD__WT_CTXOVERLAP(hwnd, WT_DEFBASE, hCtx, sf, fn)
-
-/* void Cls_OnWintabProximity(HWND hwnd, HCTX hCtx, BOOL cp, BOOL hp) */
-#define HANDLE_WT_PROXIMITY(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HCTX)(wParam), (BOOL)LOWORD(lParam),  (BOOL)HIWORD(lParam)), 0L)
-#define FORWARD__WT_PROXIMITY(hwnd, bs, hCtx, cp, hp, fn) \
-    (void)(fn)((hwnd), _WT_PROXIMITY(bs), (WPARAM)(HCTX)(hCtx), MAKELPARAM((cp), (hp))
-#define FORWARD_WT_PROXIMITY(hwnd, hCtx, sf, fn) \
-	FORWARD__WT_PROXIMITY(hwnd, WT_DEFBASE, hCtx, cp, hp, fn)
-
-/* void Cls_OnWintabInfoChange(HWND hwnd, HMGR hMgr, UINT c, UINT i) */
-#define HANDLE_WT_INFOCHANGE(hwnd, wParam, lParam, fn) \
-    ((fn)((hwnd), (HMGR)(wParam), (UINT)LOWORD(lParam),  (UINT)HIWORD(lParam)), 0L)
-#define FORWARD__WT_INFOCHANGE(hwnd, bs, hMgr, cp, hp, fn) \
-    (void)(fn)((hwnd), _WT_INFOCHANGE(bs), (WPARAM)(HMGR)(hMgr), MAKELPARAM((c), (i))
-#define FORWARD_WT_INFOCHANGE(hwnd, hMgr, sf, fn) \
-	FORWARD__WT_INFOCHANGE(hwnd, WT_DEFBASE, hMgr, cp, hp, fn)
-
-/****** Alternate porting layer macros ****************************************/
-
-#define GET_WT_PACKET_HCTX(wp, lp)			((HCTX)lp)
-#define GET_WT_PACKET_SERIAL(wp, lp)		(wp)
-#define GET_WT_PACKET_MPS(h, s)				\
-		(s), (LPARAM)(h)
-
-#define GET_WT_CTXOPEN_HCTX(wp, lp)			((HCTX)wp)
-#define GET_WT_CTXOPEN_STATUS(wp, lp)		((UINT)lp)
-#define GET_WT_CTXOPEN_MPS(h, s)			\
-		(WPARAM)(h), (LPARAM)(s)
-
-#define GET_WT_CTXCLOSE_HCTX(wp, lp)		((HCTX)wp)
-#define GET_WT_CTXCLOSE_STATUS(wp, lp)		((UINT)lp)
-#define GET_WT_CTXCLOSE_MPS(h, s)			\
-		(WPARAM)(h), (LPARAM)(s)
-
-#define GET_WT_CTXUPDATE_HCTX(wp, lp)		((HCTX)wp)
-#define GET_WT_CTXUPDATE_STATUS(wp, lp)		((UINT)lp)
-#define GET_WT_CTXUPDATE_MPS(h, s)			\
-		(WPARAM)(h), (LPARAM)(s)
-
-#define GET_WT_CTXOVERLAP_HCTX(wp, lp)		((HCTX)wp)
-#define GET_WT_CTXOVERLAP_STATUS(wp, lp)	((UINT)lp)
-#define GET_WT_CTXOVERLAP_MPS(h, s)			\
-		(WPARAM)(h), (LPARAM)(s)
-
-#define GET_WT_PROXIMITY_HCTX(wp, lp)		((HCTX)wp)
-#define GET_WT_PROXIMITY_CTXPROX(wp, lp)	LOWORD(lp)
-#define GET_WT_PROXIMITY_HARDPROX(wp, lp)	HIWORD(lp)
-#define GET_WT_PROXIMITY_MPS(h, fc, fh)		\
-		(WPARAM)(h), MAKELONG(fc, fh)
-
-#define GET_WT_INFOCHANGE_HMGR(wp, lp)		((HMGR)wp)
-#define GET_WT_INFOCHANGE_CATEGORY(wp, lp)	LOWORD(lp)
-#define GET_WT_INFOCHANGE_INDEX(wp, lp)		HIWORD(lp)
-#define GET_WT_INFOCHANGE_MPS(h, c, i)		\
-		(WPARAM)(h), MAKELONG(c, i)
-
-
-#ifdef __cplusplus
-}
-#endif	/* __cplusplus */
-
-#endif /* #define _INC_WINTABX */
-
--- a/src/video/win32/wmmsg.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/win32/wmmsg.h	Sun Aug 22 13:45:56 2010 -0700
@@ -283,7 +283,7 @@
     "WM_INITMENU",
     "WM_INITMENUPOPUP",
     "UNKNOWN (280)",
-    "UNKNOWN (281)",
+    "WM_GESTURE",
     "UNKNOWN (282)",
     "UNKNOWN (283)",
     "UNKNOWN (284)",
@@ -578,7 +578,7 @@
     "UNKNOWN (573)",
     "UNKNOWN (574)",
     "UNKNOWN (575)",
-    "UNKNOWN (576)",
+    "WM_TOUCH",
     "UNKNOWN (577)",
     "UNKNOWN (578)",
     "UNKNOWN (579)",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/x11/SDL_eventtouch.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,128 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+#include "SDL_x11video.h"
+#include "SDL_eventtouch.h"
+#include "../../events/SDL_touch_c.h"
+
+
+#ifdef SDL_INPUT_LINUXEV
+#include <linux/input.h>
+#include <fcntl.h>
+#endif
+
+void
+X11_InitTouch(_THIS)
+{
+#ifdef SDL_INPUT_LINUXEV
+  printf("Initializing touch...\n");
+
+  FILE *fd;
+  fd = fopen("/proc/bus/input/devices","r");
+  
+  char c;
+  int i = 0;
+  char line[256];
+  char tstr[256];
+  int vendor = -1,product = -1,event = -1;
+  while(!feof(fd)) {
+    if(fgets(line,256,fd) <=0) continue;
+    //printf("%s",line);
+    if(line[0] == '\n') {
+      if(vendor == 1386){
+	printf("Wacom... Assuming it is a touch device\n");
+	sprintf(tstr,"/dev/input/event%i",event);
+	printf("At location: %s\n",tstr);
+
+	SDL_Touch touch;
+	touch.pressure_max = 0;
+	touch.pressure_min = 0;
+	touch.id = event; 
+	
+
+	touch.driverdata = SDL_malloc(sizeof(EventTouchData));
+	EventTouchData* data = (EventTouchData*)(touch.driverdata);
+
+	data->x = -1;
+	data->y = -1;
+	data->pressure = -1;
+	data->finger = 0;
+	data->up = SDL_FALSE;
+	
+
+	printf("Opening device...\n");
+	//printf("New Touch - DataPtr: %i\n",data);
+	data->eventStream = open(tstr, 
+				 O_RDONLY | O_NONBLOCK);
+	ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr);
+	printf ("Reading From : %s\n", tstr);
+
+
+
+	int abs[5];
+	ioctl(data->eventStream,EVIOCGABS(0),abs);	
+	touch.x_min = abs[1];
+	touch.x_max = abs[2];
+	touch.native_xres = touch.x_max - touch.x_min;
+	ioctl(data->eventStream,EVIOCGABS(ABS_Y),abs);	
+	touch.y_min = abs[1];
+	touch.y_max = abs[2];
+	touch.native_yres = touch.y_max - touch.y_min;
+	ioctl(data->eventStream,EVIOCGABS(ABS_PRESSURE),abs);	
+	touch.pressure_min = abs[1];
+	touch.pressure_max = abs[2];
+	touch.native_pressureres = touch.pressure_max - touch.pressure_min;
+
+	SDL_AddTouch(&touch, tstr);
+      }
+      vendor = -1;
+      product = -1;
+      event = -1;      
+    }
+    else if(line[0] == 'I') {
+      i = 1;
+      while(line[i]) {
+	sscanf(&line[i],"Vendor=%x",&vendor);
+	sscanf(&line[i],"Product=%x",&product);
+	i++;
+      }
+    }
+    else if(line[0] == 'H') {
+      i = 1;
+      while(line[i]) {
+	sscanf(&line[i],"event%d",&event);
+	i++;
+      }
+    }
+  }
+  
+  close(fd);
+#endif
+}
+
+void
+X11_QuitTouch(_THIS)
+{
+    SDL_TouchQuit();
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/x11/SDL_eventtouch.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,43 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_eventtouch_h
+#define _SDL_eventtouch_h
+
+
+//What should this be?
+#if SDL_VIDEO_DRIVER_X11_XINPUT
+typedef struct EventTouchData
+{
+    int x,y,pressure,finger; //Temporary Variables until sync
+    int eventStream;
+    SDL_bool up;
+} EventTouchData;
+#endif
+
+extern void X11_InitTouch(_THIS);
+extern void X11_QuitTouch(_THIS);
+
+#endif /* _SDL_eventtouch_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/x11/SDL_x11clipboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,156 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#include <limits.h> /* For INT_MAX */
+
+#include "SDL_events.h"
+#include "SDL_x11video.h"
+
+
+/* If you don't support UTF-8, you might use XA_STRING here */
+#ifdef X_HAVE_UTF8_STRING
+#define TEXT_FORMAT XInternAtom(display, "UTF8_STRING", False)
+#else
+#define TEXT_FORMAT XA_STRING
+#endif
+
+/* Get any application owned window handle for clipboard association */
+static Window
+GetWindow(_THIS)
+{
+    SDL_VideoDisplay *display;
+    SDL_Window *window;
+
+    display = _this->displays;
+    if (display) {
+        window = display->windows;
+        if (window) {
+            return ((SDL_WindowData *) window->driverdata)->xwindow;
+        }
+    }
+    return None;
+}
+
+int
+X11_SetClipboardText(_THIS, const char *text)
+{
+    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
+    Atom format;
+    Window window;
+
+    /* Get the SDL window that will own the selection */
+    window = GetWindow(_this);
+    if (window == None) {
+        SDL_SetError("Couldn't find a window to own the selection");
+        return -1;
+    }
+
+    /* Save the selection on the root window */
+    format = TEXT_FORMAT;
+    XChangeProperty(display, DefaultRootWindow(display),
+        XA_CUT_BUFFER0, format, 8, PropModeReplace,
+        (const unsigned char *)text, SDL_strlen(text));
+
+    if (XGetSelectionOwner(display, XA_PRIMARY) != window) {
+        XSetSelectionOwner(display, XA_PRIMARY, window, CurrentTime);
+    }
+    return 0;
+}
+
+char *
+X11_GetClipboardText(_THIS)
+{
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
+    Display *display = videodata->display;
+    Atom format;
+    Window window;
+    Window owner;
+    Atom selection;
+    Atom seln_type;
+    int seln_format;
+    unsigned long nbytes;
+    unsigned long overflow;
+    unsigned char *src;
+    char *text;
+
+    text = NULL;
+
+    /* Get the window that holds the selection */
+    window = GetWindow(_this);
+    format = TEXT_FORMAT;
+    owner = XGetSelectionOwner(display, XA_PRIMARY);
+    if ((owner == None) || (owner == window)) {
+        owner = DefaultRootWindow(display);
+        selection = XA_CUT_BUFFER0;
+    } else {
+        /* Request that the selection owner copy the data to our window */
+        owner = window;
+        selection = XInternAtom(display, "SDL_SELECTION", False);
+        XConvertSelection(display, XA_PRIMARY, format, selection, owner,
+            CurrentTime);
+
+        /* FIXME: Should we have a timeout here? */
+        videodata->selection_waiting = SDL_TRUE;
+        while (videodata->selection_waiting) {
+            SDL_PumpEvents();
+        }
+    }
+
+    if (XGetWindowProperty(display, owner, selection, 0, INT_MAX/4, False,
+            format, &seln_type, &seln_format, &nbytes, &overflow, &src)
+            == Success) {
+        if (seln_type == format) {
+            text = (char *)SDL_malloc(nbytes+1);
+            if (text) {
+                SDL_memcpy(text, src, nbytes);
+                text[nbytes] = '\0';
+            }
+        }
+        XFree(src);
+    }
+
+    if (!text) {
+        text = SDL_strdup("");
+    }
+    return text;
+}
+
+SDL_bool
+X11_HasClipboardText(_THIS)
+{
+    /* Not an easy way to tell with X11, as far as I know... */
+    char *text;
+    SDL_bool retval;
+
+    text = X11_GetClipboardText(_this);
+    if (*text) {
+        retval = SDL_TRUE;
+    } else {
+        retval = SDL_FALSE;
+    }
+    SDL_free(text);
+
+    return retval;
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/x11/SDL_x11clipboard.h	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,33 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 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
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_x11clipboard_h
+#define _SDL_x11clipboard_h
+
+extern int X11_SetClipboardText(_THIS, const char *text);
+extern char *X11_GetClipboardText(_THIS);
+extern SDL_bool X11_HasClipboardText(_THIS);
+
+#endif /* _SDL_x11clipboard_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/x11/SDL_x11dyn.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11dyn.h	Sun Aug 22 13:45:56 2010 -0700
@@ -52,6 +52,18 @@
 #include <X11/extensions/XInput.h>
 #endif
 
+#if SDL_VIDEO_DRIVER_X11_XRENDER
+#include <X11/extensions/Xrender.h>
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_XDAMAGE
+#include <X11/extensions/Xdamage.h>
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_XFIXES
+#include <X11/extensions/Xfixes.h>
+#endif
+
 /*
  * When using the "dynamic X11" functionality, we duplicate all the Xlib
  *  symbols that would be referenced by SDL inside of SDL itself.
--- a/src/video/x11/SDL_x11events.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11events.c	Sun Aug 22 13:45:56 2010 -0700
@@ -23,24 +23,56 @@
 
 #include <sys/types.h>
 #include <sys/time.h>
+#include <signal.h>
 #include <unistd.h>
+#include <limits.h> /* For INT_MAX */
 
 #include "SDL_x11video.h"
 #include "../../events/SDL_events_c.h"
 #include "../../events/SDL_mouse_c.h"
+#include "../../events/SDL_touch_c.h"
 
+#include "SDL_timer.h"
 #include "SDL_syswm.h"
 
+#include <stdio.h>
+
+#ifdef SDL_INPUT_LINUXEV
+//Touch Input/event* includes
+#include <linux/input.h>
+#include <fcntl.h>
+#endif
+/*#define DEBUG_XEVENTS*/
+
+/* Check to see if this is a repeated key.
+   (idea shamelessly lifted from GII -- thanks guys! :)
+ */
+static SDL_bool X11_KeyRepeat(Display *display, XEvent *event)
+{
+    XEvent peekevent;
+
+    if (XPending(display)) {
+        XPeekEvent(display, &peekevent);
+        if ((peekevent.type == KeyPress) &&
+            (peekevent.xkey.keycode == event->xkey.keycode) &&
+            ((peekevent.xkey.time-event->xkey.time) < 2)) {
+            return SDL_TRUE;
+        }
+    }
+    return SDL_FALSE;
+}
+
 static void
 X11_DispatchEvent(_THIS)
 {
     SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
+    Display *display = videodata->display;
     SDL_WindowData *data;
     XEvent xevent;
     int i;
 
     SDL_zero(xevent);           /* valgrind fix. --ryan. */
-    XNextEvent(videodata->display, &xevent);
+    XNextEvent(display, &xevent);
 
     /* filter events catchs XIM events and sends them to the correct
        handler */
@@ -75,6 +107,7 @@
     if (!data) {
         return;
     }
+
 #if 0
     printf("type = %d display = %d window = %d\n",
            xevent.type, xevent.xany.display, xevent.xany.window);
@@ -85,44 +118,33 @@
     case EnterNotify:{
 #ifdef DEBUG_XEVENTS
             printf("EnterNotify! (%d,%d,%d)\n", 
-	           xevent.xcrossing.x,
- 	           xevent.xcrossing.y,
+                   xevent.xcrossing.x,
+                   xevent.xcrossing.y,
                    xevent.xcrossing.mode);
             if (xevent.xcrossing.mode == NotifyGrab)
                 printf("Mode: NotifyGrab\n");
             if (xevent.xcrossing.mode == NotifyUngrab)
                 printf("Mode: NotifyUngrab\n");
 #endif
-#if 1
-            /* FIXME: Should we reset data for all mice? */
-            for (i = 0; i < SDL_GetNumMice(); ++i) {
-                SDL_Mouse *mouse = SDL_GetMouse(i);
-                SDL_SetMouseFocus(mouse->id, data->window);
-            }
-#endif
+            SDL_SetMouseFocus(data->window);
         }
         break;
-
         /* Losing mouse coverage? */
     case LeaveNotify:{
 #ifdef DEBUG_XEVENTS
             printf("LeaveNotify! (%d,%d,%d)\n", 
-	           xevent.xcrossing.x,
- 	           xevent.xcrossing.y,
+                   xevent.xcrossing.x,
+                   xevent.xcrossing.y,
                    xevent.xcrossing.mode);
             if (xevent.xcrossing.mode == NotifyGrab)
                 printf("Mode: NotifyGrab\n");
             if (xevent.xcrossing.mode == NotifyUngrab)
                 printf("Mode: NotifyUngrab\n");
 #endif
-            if (xevent.xcrossing.detail != NotifyInferior) {
-#if 1
-                /* FIXME: Should we reset data for all mice? */
-	        for (i = 0; i < SDL_GetNumMice(); ++i) {
-		    SDL_Mouse *mouse = SDL_GetMouse(i);
-		    SDL_SetMouseFocus(mouse->id, 0);
-	        }
-#endif
+            if (xevent.xcrossing.mode != NotifyGrab &&
+                xevent.xcrossing.mode != NotifyUngrab &&
+                xevent.xcrossing.detail != NotifyInferior) {
+                SDL_SetMouseFocus(NULL);
             }
         }
         break;
@@ -132,7 +154,7 @@
 #ifdef DEBUG_XEVENTS
             printf("FocusIn!\n");
 #endif
-            SDL_SetKeyboardFocus(videodata->keyboard, data->window);
+            SDL_SetKeyboardFocus(data->window);
 #ifdef X_HAVE_UTF8_STRING
             if (data->ic) {
                 XSetICFocus(data->ic);
@@ -146,7 +168,7 @@
 #ifdef DEBUG_XEVENTS
             printf("FocusOut!\n");
 #endif
-            SDL_SetKeyboardFocus(videodata->keyboard, 0);
+            SDL_SetKeyboardFocus(NULL);
 #ifdef X_HAVE_UTF8_STRING
             if (data->ic) {
                 XUnsetICFocus(data->ic);
@@ -179,22 +201,21 @@
     case KeyPress:{
             KeyCode keycode = xevent.xkey.keycode;
             KeySym keysym = NoSymbol;
+            SDL_scancode scancode;
             char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
             Status status = 0;
 
 #ifdef DEBUG_XEVENTS
             printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
 #endif
-            SDL_SendKeyboardKey(videodata->keyboard, SDL_PRESSED,
-                                videodata->key_layout[keycode]);
-#if 0
+            SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
+#if 1
             if (videodata->key_layout[keycode] == SDLK_UNKNOWN) {
                 int min_keycode, max_keycode;
-                XDisplayKeycodes(videodata->display, &min_keycode,
-                                 &max_keycode);
-                keysym = XKeycodeToKeysym(videodata->display, keycode, 0);
+                XDisplayKeycodes(display, &min_keycode, &max_keycode);
+                keysym = XKeycodeToKeysym(display, keycode, 0);
                 fprintf(stderr,
-                        "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl@libsdl.org> X11 KeyCode %d (%d), X11 KeySym 0x%X (%s).\n",
+                        "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl@libsdl.org> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n",
                         keycode, keycode - min_keycode, keysym,
                         XKeysymToString(keysym));
             }
@@ -210,7 +231,7 @@
             XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL);
 #endif
             if (*text) {
-                SDL_SendKeyboardText(videodata->keyboard, text);
+                SDL_SendKeyboardText(text);
             }
         }
         break;
@@ -222,8 +243,11 @@
 #ifdef DEBUG_XEVENTS
             printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
 #endif
-            SDL_SendKeyboardKey(videodata->keyboard, SDL_RELEASED,
-                                videodata->key_layout[keycode]);
+            if (X11_KeyRepeat(display, &xevent)) {
+                /* We're about to get a repeated key down, ignore the key up */
+                break;
+            }
+            SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]);
         }
         break;
 
@@ -280,79 +304,149 @@
         }
         break;
 
-    default:{
-            for (i = 0; i < SDL_GetNumMice(); ++i) {
-                SDL_Mouse *mouse;
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-                X11_MouseData *data;
+    case MotionNotify:{
+#ifdef DEBUG_MOTION
+            printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
+#endif
+            SDL_SendMouseMotion(data->window, 0, xevent.xmotion.x, xevent.xmotion.y);
+        }
+        break;
+
+    case ButtonPress:{
+            SDL_SendMouseButton(data->window, SDL_PRESSED, xevent.xbutton.button);
+        }
+        break;
+
+    case ButtonRelease:{
+            SDL_SendMouseButton(data->window, SDL_RELEASED, xevent.xbutton.button);
+        }
+        break;
+
+    case PropertyNotify:{
+#ifdef DEBUG_XEVENTS
+            unsigned char *propdata;
+            int status, real_format;
+            Atom real_type;
+            unsigned long items_read, items_left, i;
+
+            char *name = XGetAtomName(display, xevent.xproperty.atom);
+            if (name) {
+                printf("PropertyNotify: %s %s\n", name, (xevent.xproperty.state == PropertyDelete) ? "deleted" : "changed");
+                XFree(name);
+            }
+
+            status = XGetWindowProperty(display, data->xwindow, xevent.xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata);
+            if (status == Success && items_read > 0) {
+                if (real_type == XA_INTEGER) {
+                    int *values = (int *)propdata;
+
+                    printf("{");
+                    for (i = 0; i < items_read; i++) {
+                        printf(" %d", values[i]);
+                    }
+                    printf(" }\n");
+                } else if (real_type == XA_CARDINAL) {
+                    if (real_format == 32) {
+                        Uint32 *values = (Uint32 *)propdata;
+
+                        printf("{");
+                        for (i = 0; i < items_read; i++) {
+                            printf(" %d", values[i]);
+                        }
+                        printf(" }\n");
+                    } else if (real_format == 16) {
+                        Uint16 *values = (Uint16 *)propdata;
+
+                        printf("{");
+                        for (i = 0; i < items_read; i++) {
+                            printf(" %d", values[i]);
+                        }
+                        printf(" }\n");
+                    } else if (real_format == 8) {
+                        Uint8 *values = (Uint8 *)propdata;
+
+                        printf("{");
+                        for (i = 0; i < items_read; i++) {
+                            printf(" %d", values[i]);
+                        }
+                        printf(" }\n");
+                    }
+                } else if (real_type == XA_STRING ||
+                           real_type == videodata->UTF8_STRING) {
+                    printf("{ \"%s\" }\n", propdata);
+                } else if (real_type == XA_ATOM) {
+                    Atom *atoms = (Atom *)propdata;
+
+                    printf("{");
+                    for (i = 0; i < items_read; i++) {
+                        char *name = XGetAtomName(display, atoms[i]);
+                        if (name) {
+                            printf(" %s", name);
+                            XFree(name);
+                        }
+                    }
+                    printf(" }\n");
+                } else {
+                    char *name = XGetAtomName(display, real_type);
+                    printf("Unknown type: %ld (%s)\n", real_type, name ? name : "UNKNOWN");
+                    if (name) {
+                        XFree(name);
+                    }
+                }
+            }
+#endif
+        }
+        break;
+
+    /* Copy the selection from XA_CUT_BUFFER0 to the requested property */
+    case SelectionRequest: {
+            XSelectionRequestEvent *req;
+            XEvent sevent;
+            int seln_format;
+            unsigned long nbytes;
+            unsigned long overflow;
+            unsigned char *seln_data;
+
+            req = &xevent.xselectionrequest;
+#ifdef DEBUG_XEVENTS
+            printf("SelectionRequest (requestor = %ld, target = %ld)\n",
+                req->requestor, req->target);
 #endif
 
-                mouse = SDL_GetMouse(i);
-                if (!mouse->driverdata) {
-                    switch (xevent.type) {
-                    case MotionNotify:
-#ifdef DEBUG_MOTION
-                        printf("X11 motion: %d,%d\n", xevent.xmotion.x,
-                               xevent.xmotion.y);
-#endif
-                        SDL_SendMouseMotion(mouse->id, 0, xevent.xmotion.x,
-                                            xevent.xmotion.y, 0);
-                        break;
+            SDL_zero(sevent);
+            sevent.xany.type = SelectionNotify;
+            sevent.xselection.selection = req->selection;
+            sevent.xselection.target = None;
+            sevent.xselection.property = None;
+            sevent.xselection.requestor = req->requestor;
+            sevent.xselection.time = req->time;
+            if (XGetWindowProperty(display, DefaultRootWindow(display),
+                    XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
+                    &sevent.xselection.target, &seln_format, &nbytes,
+                    &overflow, &seln_data) == Success) {
+                if (sevent.xselection.target == req->target) {
+                    XChangeProperty(display, req->requestor, req->property,
+                        sevent.xselection.target, seln_format, PropModeReplace,
+                        seln_data, nbytes);
+                    sevent.xselection.property = req->property;
+                }
+                XFree(seln_data);
+            }
+            XSendEvent(display, req->requestor, False, 0, &sevent);
+            XSync(display, False);
+        }
+        break;
 
-                    case ButtonPress:
-                        SDL_SendMouseButton(mouse->id, SDL_PRESSED,
-                                            xevent.xbutton.button);
-                        break;
-
-                    case ButtonRelease:
-                        SDL_SendMouseButton(mouse->id, SDL_RELEASED,
-                                            xevent.xbutton.button);
-                        break;
-                    }
-                    continue;
-                }
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-                data = (X11_MouseData *) mouse->driverdata;
-                if (xevent.type == data->motion) {
-                    XDeviceMotionEvent *move =
-                        (XDeviceMotionEvent *) & xevent;
-#ifdef DEBUG_MOTION
-                    printf("X11 motion: %d,%d\n", move->x, move->y);
+    case SelectionNotify: {
+#ifdef DEBUG_XEVENTS
+            printf("SelectionNotify (requestor = %ld, target = %ld)\n",
+                xevent.xselection.requestor, xevent.xselection.target);
 #endif
-                    SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y,
-                                        move->axis_data[2]);
-                    return;
-                }
-                if (xevent.type == data->button_pressed) {
-                    XDeviceButtonPressedEvent *pressed =
-                        (XDeviceButtonPressedEvent *) & xevent;
-                    SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED,
-                                        pressed->button);
-                    return;
-                }
-                if (xevent.type == data->button_released) {
-                    XDeviceButtonReleasedEvent *released =
-                        (XDeviceButtonReleasedEvent *) & xevent;
-                    SDL_SendMouseButton(released->deviceid, SDL_RELEASED,
-                                        released->button);
-                    return;
-                }
-                if (xevent.type == data->proximity_in) {
-                    XProximityNotifyEvent *proximity =
-                        (XProximityNotifyEvent *) & xevent;
-                    SDL_SendProximity(proximity->deviceid, proximity->x,
-                                      proximity->y, SDL_PROXIMITYIN);
-                    return;
-                }
-                if (xevent.type == data->proximity_out) {
-                    XProximityNotifyEvent *proximity =
-                        (XProximityNotifyEvent *) & xevent;
-                    SDL_SendProximity(proximity->deviceid, proximity->x,
-                                      proximity->y, SDL_PROXIMITYOUT);
-                    return;
-                }
-#endif
-            }
+            videodata->selection_waiting = SDL_FALSE;
+        }
+        break;
+
+    default:{
 #ifdef DEBUG_XEVENTS
             printf("Unhandled event %d\n", xevent.type);
 #endif
@@ -362,7 +456,7 @@
 }
 
 /* Ack!  XPending() actually performs a blocking read if no events available */
-int
+static int
 X11_Pending(Display * display)
 {
     /* Flush the display connection and look to see if events are queued */
@@ -408,6 +502,79 @@
     while (X11_Pending(data->display)) {
         X11_DispatchEvent(_this);
     }
+
+#ifdef SDL_INPUT_LINUXEV
+    /* Process Touch events - TODO When X gets touch support, use that instead*/
+    int i = 0,rd;
+    char name[256];
+    struct input_event ev[64];
+    int size = sizeof (struct input_event);
+
+    for(i = 0;i < SDL_GetNumTouch();++i) {
+	SDL_Touch* touch = SDL_GetTouchIndex(i);
+	if(!touch) printf("Touch %i/%i DNE\n",i,SDL_GetNumTouch());
+	EventTouchData* data;
+	data = (EventTouchData*)(touch->driverdata);
+	if(data == NULL) {
+	  printf("No driver data\n");
+	  continue;
+	}
+	if(data->eventStream <= 0) 
+	    printf("Error: Couldn't open stream\n");
+	rd = read(data->eventStream, ev, size * 64);
+	//printf("Got %i/%i bytes\n",rd,size);
+	if(rd >= size) {
+	    for (i = 0; i < rd / sizeof(struct input_event); i++) {
+		switch (ev[i].type) {
+		case EV_ABS:
+		    //printf("Got position x: %i!\n",data->x);
+		    switch (ev[i].code) {
+			case ABS_X:
+			    data->x = ev[i].value;
+			    break;
+			case ABS_Y:
+			    data->y = ev[i].value;
+			    break;
+			case ABS_PRESSURE:
+			    data->pressure = ev[i].value;
+			    if(data->pressure < 0) data->pressure = 0;
+			    break;
+			case ABS_MISC:
+			    if(ev[i].value == 0)
+			        data->up = SDL_TRUE;			    
+			    break;
+			}
+		    break;
+		case EV_MSC:
+		    if(ev[i].code == MSC_SERIAL)
+			data->finger = ev[i].value;
+		    break;
+		case EV_SYN:
+		  //printf("Id: %i\n",touch->id); 
+		  if(data->up) {
+		      SDL_SendFingerDown(touch->id,data->finger,
+			  	       SDL_FALSE,data->x,data->y,
+				       data->pressure);		    
+		  }
+		  else if(data->x >= 0 || data->y >= 0)
+		    SDL_SendTouchMotion(touch->id,data->finger, 
+					SDL_FALSE,data->x,data->y,
+					data->pressure);
+		  
+		    //printf("Synched: %i tx: %i, ty: %i\n",
+		    //	   data->finger,data->x,data->y);
+		  data->x = -1;
+		  data->y = -1;
+		  data->pressure = -1;
+		  data->finger = 0;
+		  data->up = SDL_FALSE;
+		    
+		  break;		
+		}
+	    }
+	}
+    }
+#endif
 }
 
 /* This is so wrong it hurts */
--- a/src/video/x11/SDL_x11keyboard.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11keyboard.c	Sun Aug 22 13:45:56 2010 -0700
@@ -172,7 +172,6 @@
 X11_InitKeyboard(_THIS)
 {
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_Keyboard keyboard;
     int i, j;
     int min_keycode, max_keycode;
     struct {
@@ -212,7 +211,9 @@
             }
         }
         if (j == SDL_arraysize(fingerprint)) {
-            /* printf("Using scancode set %d\n", i); */
+#ifdef DEBUG_KEYBOARD
+            printf("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d\n", i, min_keycode, max_keycode, scancode_set[i].table_size);
+#endif
             SDL_memcpy(&data->key_layout[min_keycode], scancode_set[i].table,
                        sizeof(SDL_scancode) * scancode_set[i].table_size);
             fingerprint_detected = SDL_TRUE;
@@ -251,8 +252,6 @@
         }
     }
 
-    SDL_zero(keyboard);
-    data->keyboard = SDL_AddKeyboard(&keyboard, -1);
     X11_UpdateKeymap(_this);
 
     SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
@@ -280,15 +279,12 @@
 
         keymap[scancode] = X11_KeyCodeToSDLKey(data->display, (KeyCode)i);
     }
-    SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
+    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
 }
 
 void
 X11_QuitKeyboard(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    SDL_DelKeyboard(data->keyboard);
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/x11/SDL_x11modes.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11modes.c	Sun Aug 22 13:45:56 2010 -0700
@@ -23,10 +23,7 @@
 
 #include "SDL_x11video.h"
 
-//#define X11MODES_DEBUG
-#undef SDL_VIDEO_DRIVER_X11_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_VIDMODE
+/*#define X11MODES_DEBUG*/
 
 static int
 get_visualinfo(Display * display, int screen, XVisualInfo * vinfo)
@@ -253,6 +250,7 @@
     return SDL_TRUE;
 }
 
+static
 Bool SDL_NAME(XF86VidModeGetModeInfo) (Display * dpy, int scr,
                                        SDL_NAME(XF86VidModeModeInfo) * info)
 {
@@ -296,6 +294,7 @@
                                       &data->saved_view.y);
 }
 
+/*
 static void
 restore_mode(Display * display, SDL_DisplayData * data)
 {
@@ -313,6 +312,7 @@
                                           data->saved_view.y);
     }
 }
+*/
 #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
 
 void
--- a/src/video/x11/SDL_x11mouse.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11mouse.c	Sun Aug 22 13:45:56 2010 -0700
@@ -24,139 +24,14 @@
 #include "SDL_x11mouse.h"
 #include "../../events/SDL_mouse_c.h"
 
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-static void
-X11_FreeMouse(SDL_Mouse * mouse)
-{
-    X11_MouseData *data = (X11_MouseData *) mouse->driverdata;
-
-    if (data) {
-        XCloseDevice(data->display, data->device);
-        SDL_free(data);
-    }
-}
-#endif
-
 void
 X11_InitMouse(_THIS)
 {
-    SDL_Mouse mouse;
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    X11_MouseData *data;
-    int i, j, n;
-    XDeviceInfo *DevList;
-    XAnyClassPtr deviceClass;
-    int event_code;
-    XEventClass xEvent;
-#endif
-    int num_mice = 0;
-
-    SDL_zero(mouse);
-
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-    /* we're getting the list of input devices */
-    n = 0;
-    if (SDL_X11_HAVE_XINPUT) {
-        DevList = XListInputDevices(display, &n);
-    }
-
-    /* we're aquiring valuators: mice, tablets, etc. */
-    for (i = 0; i < n; ++i) {
-        /* if it's the core pointer or core keyborard we don't want it */
-        if ((DevList[i].use != IsXPointer && DevList[i].use != IsXKeyboard)) {
-            /* we have to check all of the device classes */
-            deviceClass = DevList[i].inputclassinfo;
-            for (j = 0; j < DevList[i].num_classes; ++j) {
-                if (deviceClass->class == ValuatorClass) {      /* bingo ;) */
-                    XValuatorInfo *valInfo;
-
-                    data = (X11_MouseData *) SDL_calloc(1, sizeof(*data));
-                    if (!data) {
-                        continue;
-                    }
-                    data->display = display;
-                    data->device = XOpenDevice(display, DevList[i].id);
-
-                    /* motion events */
-                    DeviceMotionNotify(data->device, event_code, xEvent);
-                    if (xEvent) {
-                        data->xevents[data->num_xevents++] = xEvent;
-                        data->motion = event_code;
-                    }
-
-                    /* button events */
-                    DeviceButtonPress(data->device, event_code, xEvent);
-                    if (xEvent) {
-                        data->xevents[data->num_xevents++] = xEvent;
-                        data->button_pressed = event_code;
-                    }
-                    DeviceButtonRelease(data->device, event_code, xEvent);
-                    if (xEvent) {
-                        data->xevents[data->num_xevents++] = xEvent;
-                        data->button_released = event_code;
-                    }
-
-                    /* proximity events */
-                    ProximityIn(data->device, event_code, xEvent);
-                    if (xEvent) {
-                        data->xevents[data->num_xevents++] = xEvent;
-                        data->proximity_in = event_code;
-                    }
-                    ProximityOut(data->device, event_code, xEvent);
-                    if (xEvent) {
-                        data->xevents[data->num_xevents++] = xEvent;
-                        data->proximity_out = event_code;
-                    }
-
-                    SDL_zero(mouse);
-                    mouse.id = DevList[i].id;
-                    mouse.FreeMouse = X11_FreeMouse;
-                    mouse.driverdata = data;
-
-                    /* lets get the device parameters */
-                    valInfo = (XValuatorInfo *) deviceClass;
-                    /* if the device reports pressure, lets check it parameteres */
-                    if (valInfo->num_axes > 2) {
-                        SDL_AddMouse(&mouse, DevList[i].name,
-                                     valInfo->axes[2].max_value,
-                                     valInfo->axes[2].min_value, 1);
-                    } else {
-                        SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
-                    }
-#ifndef IsXExtensionPointer
-#define IsXExtensionPointer 4
-#endif
-                    if (DevList[i].use == IsXExtensionPointer) {
-                        ++num_mice;
-                    }
-                    break;
-                }
-                /* if it's not class we're interested in, lets go further */
-                deviceClass =
-                    (XAnyClassPtr) ((char *) deviceClass +
-                                    deviceClass->length);
-            }
-        }
-    }
-    XFreeDeviceList(DevList);
-#endif
-
-    if (num_mice == 0) {
-        SDL_zero(mouse);
-        SDL_AddMouse(&mouse, "CorePointer", 0, 0, 1);
-    }
 }
 
 void
 X11_QuitMouse(_THIS)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    /* !!! FIXME: use XCloseDevice()? Or maybe handle under SDL_MouseQuit()? */
-
-    /* let's delete all of the mice */
-    SDL_MouseQuit();
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/x11/SDL_x11opengl.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11opengl.c	Sun Aug 22 13:45:56 2010 -0700
@@ -121,28 +121,29 @@
     /* Load function pointers */
     handle = _this->gl_config.dll_handle;
     _this->gl_data->glXGetProcAddress =
-        (void *(*)(const GLubyte *)) GL_LoadFunction(handle,
-                                                     "glXGetProcAddressARB");
+        (void *(*)(const GLubyte *))
+            GL_LoadFunction(handle, "glXGetProcAddressARB");
     _this->gl_data->glXChooseVisual =
-        (XVisualInfo * (*)(Display *, int, int *)) GL_LoadFunction(handle,
-                                                                   "glXChooseVisual");
+        (XVisualInfo * (*)(Display *, int, int *))
+            X11_GL_GetProcAddress(_this, "glXChooseVisual");
     _this->gl_data->glXCreateContext =
         (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int))
-        GL_LoadFunction(handle, "glXCreateContext");
+            X11_GL_GetProcAddress(_this, "glXCreateContext");
     _this->gl_data->glXDestroyContext =
-        (void (*)(Display *, GLXContext)) GL_LoadFunction(handle,
-                                                          "glXDestroyContext");
+        (void (*)(Display *, GLXContext))
+            X11_GL_GetProcAddress(_this, "glXDestroyContext");
     _this->gl_data->glXMakeCurrent =
-        (int (*)(Display *, GLXDrawable, GLXContext)) GL_LoadFunction(handle,
-                                                                      "glXMakeCurrent");
+        (int (*)(Display *, GLXDrawable, GLXContext))
+            X11_GL_GetProcAddress(_this, "glXMakeCurrent");
     _this->gl_data->glXSwapBuffers =
-        (void (*)(Display *, GLXDrawable)) GL_LoadFunction(handle,
-                                                           "glXSwapBuffers");
+        (void (*)(Display *, GLXDrawable))
+            X11_GL_GetProcAddress(_this, "glXSwapBuffers");
 
     if (!_this->gl_data->glXChooseVisual ||
         !_this->gl_data->glXCreateContext ||
         !_this->gl_data->glXDestroyContext ||
-        !_this->gl_data->glXMakeCurrent || !_this->gl_data->glXSwapBuffers) {
+        !_this->gl_data->glXMakeCurrent ||
+        !_this->gl_data->glXSwapBuffers) {
         SDL_SetError("Could not retrieve OpenGL functions");
         return -1;
     }
@@ -156,13 +157,10 @@
 void *
 X11_GL_GetProcAddress(_THIS, const char *proc)
 {
-    void *handle;
-
-    handle = _this->gl_config.dll_handle;
     if (_this->gl_data->glXGetProcAddress) {
         return _this->gl_data->glXGetProcAddress((const GLubyte *) proc);
     }
-    return GL_LoadFunction(handle, proc);
+    return GL_LoadFunction(_this->gl_config.dll_handle, proc);
 }
 
 void
--- a/src/video/x11/SDL_x11render.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11render.c	Sun Aug 22 13:45:56 2010 -0700
@@ -1,4 +1,5 @@
 /*
+
     SDL - Simple DirectMedia Layer
     Copyright (C) 1997-2010 Sam Lantinga
 
@@ -26,6 +27,7 @@
 #include <limits.h> /* For INT_MIN and INT_MAX */
 
 #include "SDL_x11video.h"
+#include "SDL_x11render.h"
 #include "../SDL_rect_c.h"
 #include "../SDL_pixels_c.h"
 #include "../SDL_yuv_sw_c.h"
@@ -38,6 +40,8 @@
 static int X11_QueryTexturePixels(SDL_Renderer * renderer,
                                   SDL_Texture * texture, void **pixels,
                                   int *pitch);
+static int X11_SetTextureRGBAMod(SDL_Renderer * renderer,
+                                 SDL_Texture * texture);
 static int X11_SetTextureBlendMode(SDL_Renderer * renderer,
                                    SDL_Texture * texture);
 static int X11_SetTextureScaleMode(SDL_Renderer * renderer,
@@ -95,6 +99,25 @@
     int scanline_pad;
     Window xwindow;
     Pixmap pixmaps[3];
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    Pixmap stencil;
+    Pixmap brush;
+    Picture brush_pict;
+    Picture xwindow_pict;
+    Picture pixmap_picts[3];
+    Picture drawable_pict;
+    Picture stencil_pict;
+    int blend_op;
+    XRenderPictFormat *xwindow_pict_fmt;
+    XRenderPictFormat *drawable_pict_fmt;
+    GC stencil_gc;
+    SDL_bool use_xrender;
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+    SDL_bool use_xdamage;
+    Damage stencil_damage;
+    XserverRegion stencil_parts;
+#endif
+#endif
     int current_pixmap;
     Drawable drawable;
     SDL_PixelFormat format;
@@ -108,6 +131,17 @@
     SDL_SW_YUVTexture *yuv;
     Uint32 format;
     Pixmap pixmap;
+    int depth;
+    Visual *visual;
+    GC gc;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    Picture picture;
+    Pixmap modulated_pixmap;
+    Picture modulated_picture;
+    XRenderPictFormat* picture_fmt;
+    int blend_op;
+    const char* filter;
+#endif
     XImage *image;
 #ifndef NO_SHARED_MEMORY
     /* MIT shared memory extension information */
@@ -148,11 +182,121 @@
                         texture->h, data->pixels, data->pitch);
 }
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+static SDL_bool
+CheckXRender(Display *display, int *major, int *minor)
+{
+    const char *env;
+
+    *major = *minor = 0;
+
+    env = SDL_getenv("SDL_VIDEO_X11_XRENDER");
+
+    if (env && !SDL_atoi(env)) {
+        return SDL_FALSE;
+    }
+
+    if (!SDL_X11_HAVE_XRENDER) {
+        return SDL_FALSE;
+    }
+
+    if (!XRenderQueryVersion(display, major, minor)) {
+        return SDL_FALSE;
+    }
+
+    if (*major != 0 || *minor < 10) {
+        return SDL_FALSE;
+    }
+
+    return SDL_TRUE;
+}
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_XFIXES
+static SDL_bool
+CheckXFixes(Display *display, int *major, int *minor)
+{
+    const char *env;
+
+    *major = *minor = 0;
+
+    env = SDL_getenv("SDL_VIDEO_X11_XFIXES");
+
+    if (env && !SDL_atoi(env)) {
+        return SDL_FALSE;
+    }
+
+    if (!SDL_X11_HAVE_XFIXES) {
+        return SDL_FALSE;
+    }
+
+    if (!XFixesQueryVersion(display, major, minor)) {
+        return SDL_FALSE;
+    }
+
+    if (*major < 2) {
+        return SDL_FALSE;
+    }
+
+    return SDL_TRUE;
+}
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+static SDL_bool
+CheckXDamage(Display *display, int *major, int *minor)
+{
+    const char *env;
+
+    *major = *minor = 0;
+
+    env = SDL_getenv("SDL_VIDEO_X11_XDAMAGE");
+
+    if (env && !SDL_atoi(env)) {
+        return SDL_FALSE;
+    }
+
+    if (!SDL_X11_HAVE_XDAMAGE) {
+        return SDL_FALSE;
+    }
+
+    if (!XDamageQueryVersion(display, major, minor)) {
+        return SDL_FALSE;
+    }
+
+    return SDL_TRUE;
+}
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+static Uint32
+XRenderPictFormatToSDLPixelFormatEnum(XRenderPictFormat *pict_format)
+{
+    if (pict_format->type != PictTypeDirect) {
+        SDL_SetError("Indexed pict formats not supported ATM");
+        return 0;
+    }
+    Uint32 Amask, Rmask, Gmask, Bmask;
+    int bpp;
+
+    Rmask = pict_format->direct.redMask << pict_format->direct.red;
+    Gmask = pict_format->direct.greenMask << pict_format->direct.green;
+    Bmask = pict_format->direct.blueMask << pict_format->direct.blue;
+    Amask = pict_format->direct.alphaMask << pict_format->direct.alpha;
+    bpp = pict_format->depth;
+
+    Uint32 format;
+    format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
+    return format;
+}
+#endif
+
 void
 X11_AddRenderDriver(_THIS)
 {
     SDL_RendererInfo *info = &X11_RenderDriver.info;
     SDL_DisplayMode *mode = &SDL_CurrentDisplay->desktop_mode;
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
     int i;
 
     info->texture_formats[info->num_texture_formats++] = mode->format;
@@ -162,6 +306,37 @@
     info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_UYVY;
     info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YVYU;
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    int major, minor;
+    if (CheckXRender(data->display, &major, &minor)) {
+        XRenderPictFormat templ;
+        templ.type = PictTypeDirect;
+        XRenderPictFormat *pict_format;
+        Uint32 format;
+        int i = 0;
+        /* Convert each XRenderPictFormat into appropriate
+         * SDLPixelFormatEnum. */
+        while (info->num_texture_formats < 50) {
+            pict_format =
+                XRenderFindFormat(data->display, PictFormatType, &templ, i++);
+            if (pict_format) {
+                format = XRenderPictFormatToSDLPixelFormatEnum(pict_format);
+                if (format != SDL_PIXELTYPE_UNKNOWN) {
+                    info->texture_formats[info->num_texture_formats++] = format;
+                }
+            }
+            else
+                break;
+        }
+        /* Update the capabilities of the renderer. */
+        info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD |
+                             SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK);
+        info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW |
+                             SDL_TEXTURESCALEMODE_BEST);
+        info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA);
+    }
+#endif
+
     for (i = 0; i < _this->num_displays; ++i) {
         SDL_AddRenderDriver(&_this->displays[i], &X11_RenderDriver);
     }
@@ -176,6 +351,7 @@
     SDL_Renderer *renderer;
     X11_RenderData *data;
     XGCValues gcv;
+    gcv.graphics_exposures = False;
     int i, n;
     int bpp;
     Uint32 Rmask, Gmask, Bmask, Amask;
@@ -198,10 +374,12 @@
     data->depth = displaydata->depth;
     data->scanline_pad = displaydata->scanline_pad;
     data->xwindow = windowdata->xwindow;
-
+    
     renderer->DisplayModeChanged = X11_DisplayModeChanged;
     renderer->CreateTexture = X11_CreateTexture;
     renderer->QueryTexturePixels = X11_QueryTexturePixels;
+    renderer->SetTextureAlphaMod = X11_SetTextureRGBAMod;
+    renderer->SetTextureColorMod = X11_SetTextureRGBAMod;
     renderer->SetTextureBlendMode = X11_SetTextureBlendMode;
     renderer->SetTextureScaleMode = X11_SetTextureScaleMode;
     renderer->UpdateTexture = X11_UpdateTexture;
@@ -224,6 +402,111 @@
 
     renderer->info.flags = SDL_RENDERER_ACCELERATED;
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    int major, minor;
+    data->use_xrender = CheckXRender(data->display, &major, &minor);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+    if (CheckXDamage(data->display, &major, &minor)) {
+        if (CheckXFixes(data->display, &major, &minor)) {
+            data->use_xdamage = SDL_TRUE;
+        }
+    }
+#endif
+    if (data->use_xrender) {
+        /* Find the PictFormat from the visual.
+         * Should be an RGB PictFormat most of the time. */
+        data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display,
+                                                         data->visual);
+        if (!data->xwindow_pict_fmt) {
+            SDL_SetError("XRenderFindVisualFormat() failed");
+            return NULL;
+        }
+        data->xwindow_pict = XRenderCreatePicture(data->display,
+                                                  data->xwindow,
+                                                  data->xwindow_pict_fmt,
+                                                  0, NULL);
+        if (!data->xwindow_pict) {
+            SDL_SetError("XRenderCreatePicture() failed");
+            return NULL;
+        }
+        // FIXME: Clear the window. Is this required?
+        XRenderComposite(data->display,
+                         PictOpClear,
+                         data->xwindow_pict,
+                         None,
+                         data->xwindow_pict,
+                         0, 0,
+                         0, 0,
+                         0, 0,
+                         window->w, window->h);
+        /* Create a clip mask that is used for rendering primitives. */
+        data->stencil = XCreatePixmap(data->display, data->xwindow,
+                                   window->w, window->h, 32);
+        if (!data->stencil) {
+            SDL_SetError("XCreatePixmap() failed.");
+            return NULL;
+        }
+        
+        /* Create the GC for the clip mask. */
+        data->stencil_gc = XCreateGC(data->display, data->stencil,
+                                  GCGraphicsExposures, &gcv);
+        /* Set the GC parameters. */
+        XSetBackground(data->display, data->stencil_gc, 0);
+        XSetForeground(data->display, data->stencil_gc, 0);
+        XFillRectangle(data->display, data->stencil, data->stencil_gc,
+                       0, 0, window->w, window->h);
+        XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF);
+
+        /* Create an XRender Picture for the clip mask. */
+        data->stencil_pict =
+            XRenderCreatePicture(data->display, data->stencil,
+                                 XRenderFindStandardFormat(data->display,
+                                                           PictStandardARGB32),
+                                 0, NULL);
+        if (!data->stencil_pict) {
+            SDL_SetError("XRenderCreatePicture() failed.");
+            return NULL;
+        }
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage) {
+            data->stencil_damage =
+                XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty);
+            if (!data->stencil_damage) {
+                SDL_SetError("XDamageCreate() failed.");
+                return NULL;
+            }
+            XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
+        }
+#endif
+        /* Create a brush pixmap for the color being
+         * drawn at any given time. */
+        data->brush =
+            XCreatePixmap(data->display, data->xwindow, 1, 1, 32);
+        if (!data->brush) {
+            SDL_SetError("XCreatePixmap() failed.");
+            return NULL;
+        }
+
+        /* Set some parameters for the brush. */
+        XRenderPictureAttributes brush_attr;
+        brush_attr.repeat = RepeatNormal;
+        /* Create an XRender Picture for the brush
+         * with the above parameters. */
+        data->brush_pict =
+            XRenderCreatePicture(data->display, data->brush,
+                                 XRenderFindStandardFormat(data->display,
+                                                           PictStandardARGB32),
+                                 CPRepeat, &brush_attr);
+        if (!data->brush_pict) {
+            SDL_SetError("XRenderCreatePicture() failed.");
+            return NULL;
+        }
+        // FIXME: Is the following necessary?
+        /* Set the default blending mode. */
+        renderer->blendMode = SDL_BLENDMODE_BLEND;
+        data->blend_op = PictOpOver;
+    }
+#endif
     if (flags & SDL_RENDERER_SINGLEBUFFER) {
         renderer->info.flags |=
             (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY);
@@ -238,39 +521,112 @@
         renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
         n = 1;
     }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender) {
+        if (n > 0)
+            data->drawable_pict_fmt =
+                XRenderFindStandardFormat(data->display, PictStandardARGB32);
+        else
+            data->drawable_pict_fmt = data->xwindow_pict_fmt;
+    }
+#endif
     for (i = 0; i < n; ++i) {
-        data->pixmaps[i] =
-            XCreatePixmap(data->display, data->xwindow, window->w, window->h,
-                          displaydata->depth);
-        if (data->pixmaps[i] == None) {
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender) {
+            data->pixmaps[i] = XCreatePixmap(data->display,
+                                             data->xwindow,
+                                             window->w,
+                                             window->h,
+                                             32);
+        }
+        else
+#endif
+        {
+            data->pixmaps[i] =
+                XCreatePixmap(data->display, data->xwindow, window->w, window->h,
+                              displaydata->depth);
+        }
+        if (!data->pixmaps[i]) {
             X11_DestroyRenderer(renderer);
             SDL_SetError("XCreatePixmap() failed");
             return NULL;
         }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender) {
+            /* Create XRender pictures for each of the pixmaps
+             * and clear the pixmaps. */
+            data->pixmap_picts[i] = 
+                XRenderCreatePicture(data->display,
+                                     data->pixmaps[i],
+                                     XRenderFindStandardFormat(data->display,
+                                                               PictStandardARGB32),
+                                     0, None);
+            if (!data->pixmap_picts[i]) {
+                SDL_SetError("XRenderCreatePicture() failed");
+                return NULL;
+            }
+
+            XRenderComposite(data->display,
+                             PictOpClear,
+                             data->pixmap_picts[i],
+                             None,
+                             data->pixmap_picts[i],
+                             0, 0,
+                             0, 0,
+                             0, 0,
+                             window->w, window->h);
+        }
+#endif
     }
     if (n > 0) {
         data->drawable = data->pixmaps[0];
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if(data->use_xrender == SDL_TRUE)
+            data->drawable_pict = data->pixmap_picts[0];
+#endif
         data->makedirty = SDL_TRUE;
     } else {
         data->drawable = data->xwindow;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if(data->use_xrender == SDL_TRUE)
+            data->drawable_pict = data->xwindow_pict;
+#endif
         data->makedirty = SDL_FALSE;
     }
     data->current_pixmap = 0;
 
-    /* Get the format of the window */
-    if (!SDL_PixelFormatEnumToMasks
-        (display->current_mode.format, &bpp, &Rmask, &Gmask, &Bmask,
-         &Amask)) {
-        SDL_SetError("Unknown display format");
-        X11_DestroyRenderer(renderer);
-        return NULL;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    /* When using XRender the drawable format
+     * is not the same as the screen format. */
+    if (data->use_xrender) {
+        bpp = data->drawable_pict_fmt->depth;
+        Rmask = ((data->drawable_pict_fmt->direct.redMask)
+                    << (data->drawable_pict_fmt->direct.red));
+        Gmask = ((data->drawable_pict_fmt->direct.greenMask)
+                    << (data->drawable_pict_fmt->direct.green));
+        Bmask = ((data->drawable_pict_fmt->direct.blueMask)
+                    << (data->drawable_pict_fmt->direct.blue));
+        Amask = ((data->drawable_pict_fmt->direct.alphaMask)
+                    << (data->drawable_pict_fmt->direct.alpha));
+    }
+    else
+#endif
+    {
+        /* Get the format of the window */
+        if (!SDL_PixelFormatEnumToMasks
+            (display->current_mode.format, &bpp, &Rmask, &Gmask, &Bmask,
+             &Amask)) {
+            SDL_SetError("Unknown display format");
+            X11_DestroyRenderer(renderer);
+            return NULL;
+        }
     }
     SDL_InitFormat(&data->format, bpp, Rmask, Gmask, Bmask, Amask);
 
     /* Create the drawing context */
     gcv.graphics_exposures = False;
     data->gc =
-        XCreateGC(data->display, data->xwindow, GCGraphicsExposures, &gcv);
+        XCreateGC(data->display, data->drawable, GCGraphicsExposures, &gcv);
     if (!data->gc) {
         X11_DestroyRenderer(renderer);
         SDL_SetError("XCreateGC() failed");
@@ -287,6 +643,67 @@
     SDL_Window *window = renderer->window;
     int i, n;
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender) {
+        XRenderFreePicture(data->display, data->xwindow_pict);
+        
+        data->xwindow_pict_fmt =
+            XRenderFindVisualFormat(data->display, data->visual);
+        if (!data->xwindow_pict_fmt) {
+            SDL_SetError("XRenderFindVisualFormat() failed.");
+            return -1;
+        }
+
+        data->xwindow_pict =
+            XRenderCreatePicture(data->display, data->xwindow,
+                                 data->xwindow_pict_fmt, 0, NULL);
+        if (!data->xwindow_pict) {
+            SDL_SetError("XRenderCreatePicture() failed.");
+            return -1;
+        }
+
+        XRenderComposite(data->display,
+                         PictOpClear,
+                         data->xwindow_pict,
+                         None,
+                         data->xwindow_pict,
+                         0, 0,
+                         0, 0,
+                         0, 0,
+                         window->w, window->h);
+        
+        XFreePixmap(data->display, data->stencil);
+        data->stencil = XCreatePixmap(data->display, data->xwindow,
+                                   window->w, window->h, 32);
+        if (!data->stencil) {
+            SDL_SetError("XCreatePixmap() failed.");
+            return -1;
+        }
+
+        XRenderFreePicture(data->display, data->stencil_pict);
+        data->stencil_pict =
+            XRenderCreatePicture(data->display, data->stencil,
+                                 XRenderFindStandardFormat(data->display,
+                                                           PictStandardARGB32),
+                                 0, NULL);
+        if (!data->stencil_pict) {
+            SDL_SetError("XRenderCreatePicture() failed.");
+            return -1;
+        }
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        XDamageDestroy(data->display, data->stencil_damage);
+        if (data->use_xdamage) {
+            data->stencil_damage =
+                XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty);
+            if (!data->stencil_damage) {
+                SDL_SetError("XDamageCreate() failed.");
+                return -1;
+            }
+            XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
+        }
+#endif
+    }
+#endif
     if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) {
         n = 0;
     } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
@@ -300,25 +717,173 @@
         if (data->pixmaps[i] != None) {
             XFreePixmap(data->display, data->pixmaps[i]);
             data->pixmaps[i] = None;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+            XRenderFreePicture(data->display, data->pixmap_picts[i]);
+            data->pixmap_picts[i] = None;
+#endif
         }
     }
     for (i = 0; i < n; ++i) {
-        data->pixmaps[i] =
-            XCreatePixmap(data->display, data->xwindow, window->w, window->h,
-                          data->depth);
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender) {
+            data->pixmaps[i] =
+                XCreatePixmap(data->display,
+                              data->xwindow,
+                              window->w,
+                              window->h,
+                              32);
+        }
+        else
+#endif
+        {
+            data->pixmaps[i] =
+                XCreatePixmap(data->display, data->xwindow, window->w, window->h,
+                              data->depth);
+        }
         if (data->pixmaps[i] == None) {
             SDL_SetError("XCreatePixmap() failed");
             return -1;
         }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender) {
+            data->pixmap_picts[i] = 
+                XRenderCreatePicture(data->display,
+                                     data->pixmaps[i],
+                                     XRenderFindStandardFormat(data->display,
+                                                               PictStandardARGB32),
+                                     0, None);
+            if (!data->pixmap_picts[i]) {
+                SDL_SetError("XRenderCreatePicture() failed");
+                return -1;
+            }
+            XRenderComposite(data->display,
+                             PictOpClear,
+                             data->pixmap_picts[i],
+                             None,
+                             data->pixmap_picts[i],
+                             0, 0,
+                             0, 0,
+                             0, 0,
+                             window->w, window->h);
+
+       }
+#endif
     }
     if (n > 0) {
         data->drawable = data->pixmaps[0];
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        data->drawable_pict = data->pixmap_picts[0];
+#endif
     }
     data->current_pixmap = 0;
 
     return 0;
 }
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+static void
+SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask)
+{
+    if (sdl_mask == 0) {
+        *comp = 0;
+        *compMask = 0;
+    } else {
+        (*comp) = 0;
+        (*compMask) = 0;
+        while(!(sdl_mask & 1)) {
+            (*comp)++;
+            sdl_mask >>= 1;
+        }
+        while(sdl_mask & 1) {
+            (*compMask) = ((*compMask) << 1) | 1;
+            sdl_mask >>= 1;
+        }
+    }
+}
+
+static XRenderPictFormat*
+PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format)
+{
+    XRenderPictFormat* pict_fmt = NULL;
+    X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
+    
+    if (data->use_xrender) {
+
+        int bpp;
+        Uint32 Amask, Rmask, Gmask, Bmask;
+        if(!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
+            SDL_SetError("Unknown pixel format");
+            return NULL;
+        }
+        XRenderPictFormat templ;
+        unsigned long mask = (PictFormatType | PictFormatDepth | PictFormatRed |
+                              PictFormatRedMask | PictFormatGreen | PictFormatGreenMask |
+                              PictFormatBlue | PictFormatBlueMask | PictFormatAlpha |
+                              PictFormatAlphaMask);
+
+        templ.type = PictTypeDirect;
+        templ.depth = bpp;
+        SDLMaskToXRenderMask(Amask, &(templ.direct.alpha), &(templ.direct.alphaMask));
+        SDLMaskToXRenderMask(Rmask, &(templ.direct.red), &(templ.direct.redMask));
+        SDLMaskToXRenderMask(Gmask, &(templ.direct.green), &(templ.direct.greenMask));
+        SDLMaskToXRenderMask(Bmask, &(templ.direct.blue), &(templ.direct.blueMask));
+        pict_fmt = XRenderFindFormat(data->display, mask, &templ, 0);
+    }
+    
+    return pict_fmt;
+}
+
+static Visual*
+PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format)
+{
+    X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
+
+    if (data->use_xrender) {
+        int bpp;
+        Uint32 Amask, Rmask, Gmask, Bmask;
+        SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask);
+
+        XVisualInfo vinfo_templ;
+        long vinfo_mask;
+        int nitems_return;
+
+        vinfo_mask = (VisualDepthMask | VisualRedMaskMask |
+                      VisualGreenMaskMask | VisualBlueMaskMask);
+        vinfo_templ.depth = bpp;
+        vinfo_templ.red_mask = Rmask;
+        vinfo_templ.green_mask = Gmask;
+        vinfo_templ.blue_mask = Bmask;
+
+        XVisualInfo * ret = XGetVisualInfo(data->display, vinfo_mask,
+                                           &vinfo_templ, &nitems_return);
+        
+        if (nitems_return) {
+            return ret[0].visual;
+        }
+    }
+
+    return NULL;
+}
+
+static XRenderColor
+SDLColorToXRenderColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+{
+    double rd, gd, bd, ad;
+    XRenderColor ret;
+    rd = r / 255.0;
+    gd = g / 255.0;
+    bd = b / 255.0;
+    ad = a / 255.0;
+    
+    ret.red = (unsigned short) (rd * ad * 0xFFFF);
+    ret.green = (unsigned short) (gd * ad * 0xFFFF);
+    ret.blue = (unsigned short) (bd * ad * 0xFFFF);
+    ret.alpha = (unsigned short) (ad * 0xFFFF);
+
+    return ret;
+}
+#endif
+
 static int
 X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
 {
@@ -327,15 +892,18 @@
     SDL_VideoDisplay *display = window->display;
     X11_TextureData *data;
     int pitch_alignmask = ((renderdata->scanline_pad / 8) - 1);
-
+    XGCValues gcv;
+    
     data = (X11_TextureData *) SDL_calloc(1, sizeof(*data));
     if (!data) {
         SDL_OutOfMemory();
         return -1;
     }
+    data->depth = renderdata->depth;
+    data->visual = renderdata->visual;
+    data->gc = renderdata->gc;
 
     texture->driverdata = data;
-
     if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
         data->yuv =
             SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
@@ -344,18 +912,26 @@
         }
         data->format = display->current_mode.format;
     } else {
-        /* The image/pixmap depth must be the same as the window or you
-           get a BadMatch error when trying to putimage or copyarea.
-         */
-        if (texture->format != display->current_mode.format) {
-            SDL_SetError("Texture format doesn't match window format");
-            return -1;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender)
+        {
+            Uint32 Amask, Rmask, Gmask, Bmask;
+            SDL_PixelFormatEnumToMasks(texture->format, &(data->depth),
+                                       &Rmask, &Gmask, &Bmask, &Amask);
+            data->visual = PixelFormatEnumToVisual(renderer, texture->format);
+        }
+        else
+#endif
+        {
+            if (texture->format != display->current_mode.format)
+            {
+                SDL_SetError("Texture format doesn't match window format");
+                return -1;
+            }
         }
         data->format = texture->format;
     }
-    data->pitch = texture->w * SDL_BYTESPERPIXEL(data->format);
-    data->pitch = (data->pitch + pitch_alignmask) & ~pitch_alignmask;
-
+    
     if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) {
 #ifndef NO_SHARED_MEMORY
         XShmSegmentInfo *shminfo = &data->shminfo;
@@ -363,37 +939,42 @@
         shm_error = True;
 
         if (SDL_X11_HAVE_SHM) {
-            shminfo->shmid =
-                shmget(IPC_PRIVATE, texture->h * data->pitch,
-                       IPC_CREAT | 0777);
-            if (shminfo->shmid >= 0) {
-                shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0);
-                shminfo->readOnly = False;
-                if (shminfo->shmaddr != (char *) -1) {
-                    shm_error = False;
-                    X_handler = XSetErrorHandler(shm_errhandler);
-                    XShmAttach(renderdata->display, shminfo);
-                    XSync(renderdata->display, False);
-                    XSetErrorHandler(X_handler);
-                    if (shm_error) {
-                        shmdt(shminfo->shmaddr);
+            data->image =
+                XShmCreateImage(renderdata->display, data->visual,
+                                data->depth, ZPixmap, NULL,
+                                shminfo, texture->w, texture->h);
+            if (data->image) {
+                shminfo->shmid =
+                    shmget(IPC_PRIVATE, texture->h * data->image->bytes_per_line,
+                           IPC_CREAT | 0777);
+                if (shminfo->shmid >= 0) {
+                    shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0);
+                    shminfo->readOnly = False;
+                    if (shminfo->shmaddr != (char *) -1) {
+                        shm_error = False;
+                        X_handler = XSetErrorHandler(shm_errhandler);
+                        XShmAttach(renderdata->display, shminfo);
+                        XSync(renderdata->display, False);
+                        XSetErrorHandler(X_handler);
+                        if (shm_error) {
+                            XShmDetach(renderdata->display, shminfo);
+                            shmdt(shminfo->shmaddr);
+                            XDestroyImage(data->image);
+                            XSync(renderdata->display, False);
+                        }
+                        else {
+                            data->pixels = data->image->data = shminfo->shmaddr;
+                            shmctl(shminfo->shmid, IPC_RMID, NULL);
+                            data->pixmap =
+                                XCreatePixmap(renderdata->display, renderdata->xwindow,
+                                              texture->w, texture->h, data->depth);
+                            if (!data->pixmap) {
+                                SDL_SetError("XCreatePixmap() failed");
+                                return -1;
+                            }
+                        }
                     }
                 }
-                shmctl(shminfo->shmid, IPC_RMID, NULL);
-            }
-        }
-        if (!shm_error) {
-            data->pixels = shminfo->shmaddr;
-
-            data->image =
-                XShmCreateImage(renderdata->display, renderdata->visual,
-                                renderdata->depth, ZPixmap, shminfo->shmaddr,
-                                shminfo, texture->w, texture->h);
-            if (!data->image) {
-                XShmDetach(renderdata->display, shminfo);
-                XSync(renderdata->display, False);
-                shmdt(shminfo->shmaddr);
-                shm_error = True;
             }
         }
         if (shm_error) {
@@ -402,47 +983,106 @@
         if (!data->image)
 #endif /* not NO_SHARED_MEMORY */
         {
-            data->pixels = SDL_malloc(texture->h * data->pitch);
-            if (!data->pixels) {
-                X11_DestroyTexture(renderer, texture);
-                SDL_OutOfMemory();
-                return -1;
-            }
-
             data->image =
-                XCreateImage(renderdata->display, renderdata->visual,
-                             renderdata->depth, ZPixmap, 0, data->pixels,
+                XCreateImage(renderdata->display, data->visual,
+                             data->depth, ZPixmap, 0, NULL,
                              texture->w, texture->h,
                              SDL_BYTESPERPIXEL(data->format) * 8,
-                             data->pitch);
+                             0);
             if (!data->image) {
                 X11_DestroyTexture(renderer, texture);
                 SDL_SetError("XCreateImage() failed");
                 return -1;
             }
+            data->pixels = SDL_malloc(texture->h * data->image->bytes_per_line);
+            if (!data->pixels) {
+                X11_DestroyTexture(renderer, texture);
+                SDL_OutOfMemory();
+                return -1;
+            }
+            data->image->data = data->pixels;
+            data->pixmap =
+                XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w,
+                              texture->h, data->depth);
+            if (data->pixmap == None) {
+                X11_DestroyTexture(renderer, texture);
+                SDL_SetError("XCreatePixmap() failed");
+                return -1;
+            }
         }
-    } else {
+    } 
+    else {
+        data->image =
+            XCreateImage(renderdata->display, data->visual,
+                         data->depth, ZPixmap, 0, NULL,
+                         texture->w, texture->h,
+                         SDL_BYTESPERPIXEL(data->format) * 8,
+                         0);
+        if (!data->image) {
+            X11_DestroyTexture(renderer, texture);
+            SDL_SetError("XCreateImage() failed");
+            return -1;
+        }
         data->pixmap =
             XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w,
-                          texture->h, renderdata->depth);
+                          texture->h, data->depth);
         if (data->pixmap == None) {
             X11_DestroyTexture(renderer, texture);
             SDL_SetError("XCreatePixmap() failed");
             return -1;
         }
+    }
 
-        data->image =
-            XCreateImage(renderdata->display, renderdata->visual,
-                         renderdata->depth, ZPixmap, 0, NULL, texture->w,
-                         texture->h, SDL_BYTESPERPIXEL(data->format) * 8,
-                         data->pitch);
-        if (!data->image) {
+    data->pitch = data->image->bytes_per_line;
+
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if(renderdata->use_xrender) {
+        gcv.graphics_exposures = False;
+        data->gc =
+            XCreateGC(renderdata->display, data->pixmap, GCGraphicsExposures, &gcv);
+        if (!data->gc) {
+            SDL_SetError("XCreateGC() failed");
+            return -1;
+        }
+        data->picture_fmt =
+            PixelFormatEnumToXRenderPictFormat(renderer, texture->format);
+        if (data->picture_fmt == NULL) {
             X11_DestroyTexture(renderer, texture);
-            SDL_SetError("XCreateImage() failed");
+            SDL_SetError("Texture format not supported by driver");
             return -1;
         }
+        data->picture =
+            XRenderCreatePicture(renderdata->display, data->pixmap,
+                                 data->picture_fmt, 0, NULL);
+        if (!data->picture) {
+            X11_DestroyTexture(renderer, texture);
+            SDL_SetError("XRenderCreatePicture() failed");
+            return -1;
+        }
+        data->modulated_pixmap =
+            XCreatePixmap(renderdata->display, renderdata->xwindow,
+                          texture->w, texture->h, data->depth);
+        if (!data->modulated_pixmap) {
+            X11_DestroyTexture(renderer, texture);
+            SDL_SetError("XCreatePixmap() failed");
+            return -1;
+        }
+        data->modulated_picture =
+            XRenderCreatePicture(renderdata->display, data->modulated_pixmap,
+                                 data->picture_fmt, 0, NULL);
+        if (!data->modulated_picture) {
+            X11_DestroyTexture(renderer, texture);
+            SDL_SetError("XRenderCreatePicture() failed");
+            return -1;
+        }
+        // FIXME: Is the following required?
+        /* Set the default blending and scaling modes. */
+        texture->blendMode = SDL_BLENDMODE_NONE;
+        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        data->blend_op = PictOpSrc;
+        data->filter = NULL;
     }
-
+#endif
     return 0;
 }
 
@@ -462,14 +1102,109 @@
 }
 
 static int
+X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture)
+{
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    X11_TextureData *data = (X11_TextureData *) texture->driverdata;
+    X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
+
+    if (renderdata->use_xrender) {
+
+        Uint8 r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF;
+
+        /* Check if alpha modulation is required. */
+        if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) {
+            a = texture->a;
+        }
+
+        /* Check if color modulation is required. */
+        if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
+            r = texture->r;
+            g = texture->g;
+            b = texture->b;
+        }
+
+        /* We can save some labour if no modulation is required. */
+        if (texture->modMode != SDL_TEXTUREMODULATE_NONE) {
+            XRenderColor mod_color =
+                SDLColorToXRenderColor(r, g, b, a);
+            XRenderFillRectangle(renderdata->display, PictOpSrc,
+                                 renderdata->brush_pict, &mod_color,
+                                 0, 0, 1, 1);
+        }
+
+        /* We can save some labour dealing with component alpha
+         * if color modulation is not required. */
+        XRenderPictureAttributes attr;
+        if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
+            attr.component_alpha = True;
+            XRenderChangePicture(renderdata->display, renderdata->brush_pict,
+                                 CPComponentAlpha, &attr);
+        }
+
+        /* Again none of this is necessary is no modulation
+         * is required. */
+        if (texture->modMode != SDL_TEXTUREMODULATE_NONE) {
+            XRenderComposite(renderdata->display, PictOpSrc,
+                             data->picture, renderdata->brush_pict,
+                             data->modulated_picture,
+                             0, 0, 0, 0, 0, 0, texture->w, texture->h);
+        }
+
+        /* We only need to reset the component alpha
+         * attribute if color modulation is required. */
+        if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { 
+            attr.component_alpha = False;
+            XRenderChangePicture(renderdata->display, renderdata->brush_pict,
+                                 CPComponentAlpha, &attr);
+        }
+
+        return 0;
+    } else {
+        SDL_Unsupported();
+        return -1;
+    }
+#else
+    SDL_Unsupported();
+    return -1;
+#endif
+}
+
+static int
 X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
+    X11_TextureData *data = (X11_TextureData *) texture->driverdata;
+    X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
     switch (texture->blendMode) {
     case SDL_BLENDMODE_NONE:
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender) {
+            data->blend_op = PictOpSrc;
+            return 0;
+        }
+    case SDL_BLENDMODE_MOD:
+    case SDL_BLENDMODE_MASK:
+    case SDL_BLENDMODE_BLEND:
+        if (renderdata->use_xrender) {
+            data->blend_op = PictOpOver;
+            return 0;
+        }
+    case SDL_BLENDMODE_ADD:
+        if (renderdata->use_xrender) {
+            data->blend_op = PictOpAdd;
+            return 0;
+        }
+#endif
         return 0;
     default:
         SDL_Unsupported();
         texture->blendMode = SDL_BLENDMODE_NONE;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender) {
+            texture->blendMode = SDL_BLENDMODE_BLEND;
+            data->blend_op = PictOpOver;
+        }
+#endif
         return -1;
     }
 }
@@ -478,19 +1213,48 @@
 X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     X11_TextureData *data = (X11_TextureData *) texture->driverdata;
+    X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
 
     switch (texture->scaleMode) {
     case SDL_TEXTURESCALEMODE_NONE:
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender) {
+            data->filter = NULL;
+        }
+#endif
         return 0;
     case SDL_TEXTURESCALEMODE_FAST:
         /* We can sort of fake it for streaming textures */
         if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) {
             return 0;
         }
-        /* Fall through to unsupported case */
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender) {
+            data->filter = FilterFast;
+            return 0;
+        }
+    case SDL_TEXTURESCALEMODE_SLOW:
+        if (renderdata->use_xrender) {
+            data->filter = FilterGood;
+            return 0;
+        }
+    case SDL_TEXTURESCALEMODE_BEST:
+        if (renderdata->use_xrender) {
+            data->filter = FilterBest;
+            return 0;
+        }
+#endif
+    /* Fall through to unsupported case */
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (renderdata->use_xrender) {
+            texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+            data->filter = NULL;
+        }
+        else
+#endif
+            texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
         return -1;
     }
     return 0;
@@ -531,7 +1295,7 @@
             data->image->height = rect->h;
             data->image->data = (char *) pixels;
             data->image->bytes_per_line = pitch;
-            XPutImage(renderdata->display, data->pixmap, renderdata->gc,
+            XPutImage(renderdata->display, data->pixmap, data->gc,
                       data->image, 0, 0, rect->x, rect->y, rect->w, rect->h);
         }
         return 0;
@@ -574,12 +1338,36 @@
 static int
 X11_SetDrawBlendMode(SDL_Renderer * renderer)
 {
+    X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
     switch (renderer->blendMode) {
     case SDL_BLENDMODE_NONE:
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        //PictOpSrc
+        data->blend_op = PictOpSrc;
+        return 0;
+    case SDL_BLENDMODE_MOD:
+    case SDL_BLENDMODE_MASK:
+    case SDL_BLENDMODE_BLEND: // PictOpOver
+        data->blend_op = PictOpOver;
+        return 0;
+    case SDL_BLENDMODE_ADD: // PictOpAdd
+        data->blend_op = PictOpAdd;
+        return 0;
+    /* FIXME case SDL_BLENDMODE_MOD: */
+#endif
         return 0;
     default:
         SDL_Unsupported();
-        renderer->blendMode = SDL_BLENDMODE_NONE;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if(data->use_xrender) {
+            renderer->blendMode = SDL_BLENDMODE_BLEND;
+            data->blend_op = PictOpOver;
+        }
+        else
+#endif
+        {
+            renderer->blendMode = SDL_BLENDMODE_NONE;
+        }
         return -1;
     }
 }
@@ -600,16 +1388,37 @@
         return SDL_MapRGBA(&data->format, r, g, b, a);
 }
 
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+static XRenderColor
+xrenderdrawcolor(SDL_Renderer *renderer)
+{
+    XRenderColor xrender_color;
+    if(renderer->blendMode == SDL_BLENDMODE_NONE) {
+        xrender_color =
+            SDLColorToXRenderColor(renderer->r, renderer->g, renderer->b, 0xFF);
+    }
+    else {
+        xrender_color =
+            SDLColorToXRenderColor(renderer->r, renderer->g, renderer->b, renderer->a);
+    }
+    return xrender_color;
+}
+#endif
+
 static int
 X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
                      int count)
 {
     X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
     SDL_Window *window = renderer->window;
-    unsigned long foreground;
     XPoint *xpoints, *xpoint;
     int i, xcount;
+    SDL_Rect clip;
 
+    clip.x = 0;
+    clip.y = 0;
+    clip.w = window->w;
+    clip.h = window->h;
     if (data->makedirty) {
         SDL_Rect rect;
 
@@ -624,27 +1433,105 @@
         }
         SDL_AddDirtyRect(&data->dirty, &rect);
     }
+    {
+        xpoint = xpoints = SDL_stack_alloc(XPoint, count);
+        xcount = 0;
+        for (i = 0; i < count; ++i) {
+            int x = points[i].x;
+            int y = points[i].y;
+            if (x < 0 || x >= window->w || y < 0 || y >= window->h) {
+                continue;
+            }
+            xpoint->x = (short)x;
+            xpoint->y = (short)y;
+            ++xpoint;
+            ++xcount;
+        }
 
-    foreground = renderdrawcolor(renderer, 1);
-    XSetForeground(data->display, data->gc, foreground);
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+        {
+            XSetForeground(data->display, data->stencil_gc, 0);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+            {
+                /* Update only those parts which were changed
+                * in the previous drawing operation */
+                XFixesSetGCClipRegion(data->display, data->stencil_gc,
+                                      0, 0, data->stencil_parts);
+            }
+#endif
+            XFillRectangle(data->display, data->stencil, data->stencil_gc,
+                           0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+            {
+                XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None);
+            }
+#endif
+            XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF);
 
-    xpoint = xpoints = SDL_stack_alloc(XPoint, count);
-    xcount = 0;
-    for (i = 0; i < count; ++i) {
-        int x = points[i].x;
-        int y = points[i].y;
-        if (x < 0 || x >= window->w || y < 0 || y >= window->h) {
-            continue;
+            XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount,
+                        CoordModeOrigin);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+            {
+                /* Store the damaged region in stencil_parts */
+                XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
+            }
+#endif
         }
-        xpoint->x = (short)x;
-        xpoint->y = (short)y;
-        ++xpoint;
-        ++xcount;
+#endif
     }
-    if (xcount > 0) {
-        XDrawPoints(data->display, data->drawable, data->gc, xpoints, xcount,
-                    CoordModeOrigin);
+
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+    {
+        XRenderColor foreground;
+        foreground = xrenderdrawcolor(renderer);
+
+        XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict,
+                             &foreground, 0, 0, 1, 1);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+        {
+            /* Update only those parts which drawn
+             * to in the current drawing operation */
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict,
+                                       0, 0, data->stencil_parts);
+        }
+#endif
+        XRenderComposite(data->display, data->blend_op, data->brush_pict,
+                         data->stencil_pict, data->drawable_pict,
+                         0, 0, 0, 0, 0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+        {
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None);
+        }
+#endif
     }
+    else
+#endif
+    {
+        unsigned long foreground = renderdrawcolor(renderer, 1);
+        XSetForeground(data->display, data->gc, foreground);
+
+
+        if (xcount > 0) {
+            XDrawPoints(data->display, data->drawable, data->gc, xpoints, xcount,
+                        CoordModeOrigin);
+        }
+    }
+
     SDL_stack_free(xpoints);
 
     return 0;
@@ -667,65 +1554,146 @@
     clip.y = 0;
     clip.w = window->w;
     clip.h = window->h;
-
-    foreground = renderdrawcolor(renderer, 1);
-    XSetForeground(data->display, data->gc, foreground);
-
-    xpoint = xpoints = SDL_stack_alloc(XPoint, count);
-    xcount = 0;
-    minx = INT_MAX;
-    miny = INT_MAX;
-    maxx = INT_MIN;
-    maxy = INT_MIN;
-    for (i = 0; i < count; ++i) {
-        int x = points[i].x;
-        int y = points[i].y;
+    {
+        Pixmap drawable;
+        GC gc;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+       if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+       { 
+            drawable = data->stencil;
+            gc = data->stencil_gc;
 
-        /* If the point is inside the window, add it to the list */
-        if (x >= 0 && x < window->w && y >= 0 && y < window->h) {
-            if (x < minx) {
-                minx = x;
-            } else if (x > maxx) {
-                maxx = x;
-            }
-            if (y < miny) {
-                miny = y;
-            } else if (y > maxy) {
-                maxy = y;
-            }
-            xpoint->x = (short)x;
-            xpoint->y = (short)y;
-            ++xpoint;
-            ++xcount;
-            continue;
+            XSetForeground(data->display, data->stencil_gc, 0);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+                XFixesSetGCClipRegion(data->display, data->stencil_gc,
+                                      0, 0, data->stencil_parts);
+#endif
+            XFillRectangle(data->display, data->stencil, data->stencil_gc,
+                           0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+                XFixesSetGCClipRegion(data->display, data->stencil_gc,
+                                      0, 0, None);
+#endif
+            XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF);
+        }
+        else
+#endif
+        {
+            drawable = data->drawable;
+            gc = data->gc;
         }
 
-        /* We need to clip the line segments joined by this point */
-        if (xcount > 0) {
-            int x1 = xpoint[-1].x;
-            int y1 = xpoint[-1].y;
-            int x2 = x;
-            int y2 = y;
-            if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) {
-                if (x2 < minx) {
-                    minx = x2;
-                } else if (x2 > maxx) {
-                    maxx = x2;
+        foreground = renderdrawcolor(renderer, 1);
+        XSetForeground(data->display, data->gc, foreground);
+
+        xpoint = xpoints = SDL_stack_alloc(XPoint, count);
+        xcount = 0;
+        minx = INT_MAX;
+        miny = INT_MAX;
+        maxx = INT_MIN;
+        maxy = INT_MIN;
+        for (i = 0; i < count; ++i) {
+            int x = points[i].x;
+            int y = points[i].y;
+
+            /* If the point is inside the window, add it to the list */
+            if (x >= 0 && x < window->w && y >= 0 && y < window->h) {
+                if (x < minx) {
+                    minx = x;
+                } else if (x > maxx) {
+                    maxx = x;
                 }
-                if (y2 < miny) {
-                    miny = y2;
-                } else if (y2 > maxy) {
-                    maxy = y2;
+                if (y < miny) {
+                    miny = y;
+                } else if (y > maxy) {
+                    maxy = y;
                 }
-                xpoint->x = (short)x2;
-                xpoint->y = (short)y2;
+                xpoint->x = (short)x;
+                xpoint->y = (short)y;
                 ++xpoint;
                 ++xcount;
+                continue;
             }
-            XDrawLines(data->display, data->drawable, data->gc,
-                       xpoints, xcount, CoordModeOrigin);
+
+            /* We need to clip the line segments joined by this point */
+            if (xcount > 0) {
+                int x1 = xpoint[-1].x;
+                int y1 = xpoint[-1].y;
+                int x2 = x;
+                int y2 = y;
+                if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) {
+                    if (x2 < minx) {
+                        minx = x2;
+                    } else if (x2 > maxx) {
+                        maxx = x2;
+                    }
+                    if (y2 < miny) {
+                        miny = y2;
+                    } else if (y2 > maxy) {
+                        maxy = y2;
+                    }
+                    xpoint->x = (short)x2;
+                    xpoint->y = (short)y2;
+                    ++xpoint;
+                    ++xcount;
+                }
+                XDrawLines(data->display, drawable, gc,
+                           xpoints, xcount, CoordModeOrigin);
+                if (xpoints[0].x != x2 || xpoints[0].y != y2) {
+                    XDrawPoint(data->display, drawable, gc, x2, y2);
+                }
+                if (data->makedirty) {
+                    SDL_Rect rect;
+
+                    rect.x = minx;
+                    rect.y = miny;
+                    rect.w = (maxx - minx) + 1;
+                    rect.h = (maxy - miny) + 1;
+                    SDL_AddDirtyRect(&data->dirty, &rect);
+                }
+                xpoint = xpoints;
+                xcount = 0;
+                minx = INT_MAX;
+                miny = INT_MAX;
+                maxx = INT_MIN;
+                maxy = INT_MIN;
+            }
+            if (i < (count-1)) {
+                int x1 = x;
+                int y1 = y;
+                int x2 = points[i+1].x;
+                int y2 = points[i+1].y;
+                if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) {
+                    if (x1 < minx) {
+                        minx = x1;
+                    } else if (x1 > maxx) {
+                        maxx = x1;
+                    }
+                    if (y1 < miny) {
+                        miny = y1;
+                    } else if (y1 > maxy) {
+                        maxy = y1;
+                    }
+                    xpoint->x = (short)x1;
+                    xpoint->y = (short)y1;
+                    ++xpoint;
+                    ++xcount;
+                }
+            }
+        }
+        if (xcount > 1) {
+            int x2 = xpoint[-1].x;
+            int y2 = xpoint[-1].y;
+            XDrawLines(data->display, drawable, gc, xpoints, xcount,
+                       CoordModeOrigin);
             if (xpoints[0].x != x2 || xpoints[0].y != y2) {
-                XDrawPoint(data->display, data->drawable, data->gc, x2, y2);
+                XDrawPoint(data->display, drawable, gc, x2, y2);
             }
             if (data->makedirty) {
                 SDL_Rect rect;
@@ -736,54 +1704,37 @@
                 rect.h = (maxy - miny) + 1;
                 SDL_AddDirtyRect(&data->dirty, &rect);
             }
-            xpoint = xpoints;
-            xcount = 0;
-            minx = INT_MAX;
-            miny = INT_MAX;
-            maxx = INT_MIN;
-            maxy = INT_MIN;
-        }
-        if (i < (count-1)) {
-            int x1 = x;
-            int y1 = y;
-            int x2 = points[i+1].x;
-            int y2 = points[i+1].y;
-            if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) {
-                if (x1 < minx) {
-                    minx = x1;
-                } else if (x1 > maxx) {
-                    maxx = x1;
-                }
-                if (y1 < miny) {
-                    miny = y1;
-                } else if (y1 > maxy) {
-                    maxy = y1;
-                }
-                xpoint->x = (short)x1;
-                xpoint->y = (short)y1;
-                ++xpoint;
-                ++xcount;
-            }
         }
     }
-    if (xcount > 1) {
-        int x2 = xpoint[-1].x;
-        int y2 = xpoint[-1].y;
-        XDrawLines(data->display, data->drawable, data->gc, xpoints, xcount,
-                   CoordModeOrigin);
-        if (xpoints[0].x != x2 || xpoints[0].y != y2) {
-            XDrawPoint(data->display, data->drawable, data->gc, x2, y2);
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+    {
+        XRenderColor xrforeground = xrenderdrawcolor(renderer);
+        XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict,
+                             &xrforeground, 0, 0, 1, 1);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+        {
+            XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
+
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict,
+                                       0, 0, data->stencil_parts);
         }
-        if (data->makedirty) {
-            SDL_Rect rect;
-
-            rect.x = minx;
-            rect.y = miny;
-            rect.w = (maxx - minx) + 1;
-            rect.h = (maxy - miny) + 1;
-            SDL_AddDirtyRect(&data->dirty, &rect);
-        }
+#endif
+        XRenderComposite(data->display, data->blend_op, data->brush_pict,
+                         data->stencil_pict, data->drawable_pict,
+                         0, 0, 0, 0, 0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict,
+                                       0, 0, None);
+#endif
     }
+#endif
     SDL_stack_free(xpoints);
 
     return 0;
@@ -795,18 +1746,122 @@
     X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
     SDL_Window *window = renderer->window;
     SDL_Rect clip, rect;
-    unsigned long foreground;
+    int i, xcount;
     XRectangle *xrects, *xrect;
-    int i, xcount;
-
+    xrect = xrects = SDL_stack_alloc(XRectangle, count);
+    xcount = 0;
+    
     clip.x = 0;
     clip.y = 0;
     clip.w = window->w;
     clip.h = window->h;
+    {
 
-    foreground = renderdrawcolor(renderer, 1);
-    XSetForeground(data->display, data->gc, foreground);
+        for (i = 0; i < count; ++i) {
+            if (!SDL_IntersectRect(rects[i], &clip, &rect)) {
+                continue;
+            }
+
+            xrect->x = (short)rect.x;
+            xrect->y = (short)rect.y;
+            xrect->width = (unsigned short)rect.w - 1;
+            xrect->height = (unsigned short)rect.h - 1;
+            ++xrect;
+            ++xcount;
+
+            if (data->makedirty) {
+                SDL_AddDirtyRect(&data->dirty, &rect);
+            }
+        }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+        {
+            XSetForeground(data->display, data->stencil_gc, 0);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+                XFixesSetGCClipRegion(data->display, data->stencil_gc,
+                                      0, 0, data->stencil_parts);
+#endif
+            XFillRectangle(data->display, data->stencil, data->stencil_gc,
+                           0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+                XFixesSetGCClipRegion(data->display, data->stencil_gc,
+                                      0, 0, None);
+#endif
+            XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF);
+
+            XDrawRectangles(data->display, data->stencil, data->stencil_gc, xrects, xcount);
 
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage)
+                XDamageSubtract(data->display, data->stencil_damage,
+                                None, data->stencil_parts);
+#endif
+        }
+#endif
+    }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender &&
+            (renderer->blendMode != SDL_BLENDMODE_NONE) &&
+            !(renderer->a == 0xFF &&
+              renderer->blendMode != SDL_BLENDMODE_ADD &&
+              renderer->blendMode != SDL_BLENDMODE_MOD))
+    {
+        XRenderColor foreground;
+        foreground = xrenderdrawcolor(renderer);
+        XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict,
+                             &foreground, 0, 0, 1, 1);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict,
+                                       0, 0, data->stencil_parts);
+#endif
+        XRenderComposite(data->display, data->blend_op, data->brush_pict,
+                         data->stencil_pict, data->drawable_pict,
+                         0, 0, 0, 0, 0, 0, window->w, window->h);
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+        if (data->use_xdamage)
+            XFixesSetPictureClipRegion(data->display, data->drawable_pict,
+                                       0, 0, None);
+#endif
+    }
+    else
+#endif
+    {
+        unsigned long foreground;
+        
+        foreground = renderdrawcolor(renderer, 1);
+        XSetForeground(data->display, data->gc, foreground);
+    
+        if (xcount > 0) {
+            XDrawRectangles(data->display, data->drawable, data->gc,
+                            xrects, xcount);
+        }
+    }
+    SDL_stack_free(xrects);
+
+    return 0;
+}
+
+static int
+X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
+{
+    X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
+    SDL_Window *window = renderer->window;
+    SDL_Rect clip, rect;
+    
+    clip.x = 0;
+    clip.y = 0;
+    clip.w = window->w;
+    clip.h = window->h;
+    
+    int i, xcount;
+    XRectangle *xrects, *xrect;
     xrect = xrects = SDL_stack_alloc(XRectangle, count);
     xcount = 0;
     for (i = 0; i < count; ++i) {
@@ -825,57 +1880,34 @@
             SDL_AddDirtyRect(&data->dirty, &rect);
         }
     }
-    if (xcount > 0) {
-        XDrawRectangles(data->display, data->drawable, data->gc,
-                        xrects, xcount);
-    }
-    SDL_stack_free(xpoints);
 
-    return 0;
-}
-
-static int
-X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
-{
-    X11_RenderData *data = (X11_RenderData *) renderer->driverdata;
-    SDL_Window *window = renderer->window;
-    SDL_Rect clip, rect;
-    unsigned long foreground;
-    XRectangle *xrects, *xrect;
-    int i, xcount;
-
-    clip.x = 0;
-    clip.y = 0;
-    clip.w = window->w;
-    clip.h = window->h;
-
-    foreground = renderdrawcolor(renderer, 1);
-    XSetForeground(data->display, data->gc, foreground);
-
-    xrect = xrects = SDL_stack_alloc(XRectangle, count);
-    xcount = 0;
-    for (i = 0; i < count; ++i) {
-        if (!SDL_IntersectRect(rects[i], &clip, &rect)) {
-            continue;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender) {
+        XRenderColor foreground;
+        foreground = xrenderdrawcolor(renderer);
+        if (xcount == 1) {
+            XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict,
+                                 &foreground, xrects[0].x, xrects[0].y,
+                                 xrects[0].width, xrects[0].height);
         }
-
-        xrect->x = (short)rect.x;
-        xrect->y = (short)rect.y;
-        xrect->width = (unsigned short)rect.w;
-        xrect->height = (unsigned short)rect.h;
-        ++xrect;
-        ++xcount;
-
-        if (data->makedirty) {
-            SDL_AddDirtyRect(&data->dirty, &rect);
+        else if (xcount > 1) {
+            XRenderFillRectangles(data->display, data->blend_op, data->drawable_pict,
+                                  &foreground, xrects, xcount);
         }
     }
-    if (xcount > 0) {
+    else
+#endif
+    {
+        unsigned long foreground;
+        
+        foreground = renderdrawcolor(renderer, 1);
+        XSetForeground(data->display, data->gc, foreground);
+ 
         XFillRectangles(data->display, data->drawable, data->gc,
                         xrects, xcount);
     }
-    SDL_stack_free(xpoints);
 
+    SDL_stack_free(xrects);
     return 0;
 }
 
@@ -889,103 +1921,223 @@
     if (data->makedirty) {
         SDL_AddDirtyRect(&data->dirty, dstrect);
     }
-    if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (data->use_xrender) {
+        if(texture->access == SDL_TEXTUREACCESS_STREAMING) {
 #ifndef NO_SHARED_MEMORY
-        if (texturedata->shminfo.shmaddr) {
-            XShmPutImage(data->display, data->drawable, data->gc,
-                         texturedata->image, srcrect->x, srcrect->y,
-                         dstrect->x, dstrect->y, srcrect->w, srcrect->h,
-                         False);
-        } else
+            if(texturedata->shminfo.shmaddr) {
+                XShmPutImage(data->display, texturedata->pixmap, texturedata->gc,
+                             texturedata->image, srcrect->x, srcrect->y,
+                             srcrect->x, srcrect->y, srcrect->w, srcrect->h,
+                             False);
+            }
+            else
 #endif
-        if (texturedata->pixels) {
-            XPutImage(data->display, data->drawable, data->gc,
-                      texturedata->image, srcrect->x, srcrect->y, dstrect->x,
-                      dstrect->y, srcrect->w, srcrect->h);
+            if (texturedata->pixels) {
+                XPutImage(data->display, texturedata->pixmap, texturedata->gc,
+                          texturedata->image, srcrect->x, srcrect->y, srcrect->x,
+                          srcrect->y, srcrect->w, srcrect->h);
+            }
+            XSync(data->display, False);
+        }
+        Picture src, mask;
+        XRenderPictureAttributes attr;
+        const SDL_Rect *mrect;
+        /* mrect is the rectangular area of the mask
+         * picture that is aligned with the source. */
+
+        if (texture->modMode == SDL_TEXTUREMODULATE_NONE) {
+            src = texturedata->picture;
+        }
+        else {
+            src = texturedata->modulated_picture;
+        }
+
+        if(texture->blendMode == SDL_BLENDMODE_NONE) 
+        {
+            mask = None;
+            mrect = srcrect;
+        }
+        else if (texture->blendMode == SDL_BLENDMODE_MOD)
+        {
+            /* SDL_BLENDMODE_MOD requires a temporary buffer
+             * i.e. stencil_pict */
+            mask = data->stencil_pict;
+            mrect = dstrect;
+        }
+        else
+        {
+            /* This trick allows on-the-fly multiplication
+             * of the src color channels with it's alpha
+             * channel. */
+            mask = src;
+            mrect = srcrect;
+        }
+
+        if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
+            if (texture->blendMode == SDL_BLENDMODE_MOD) {
+                XRenderComposite(data->display, PictOpSrc, data->drawable_pict,
+                             src, data->stencil_pict,
+                             dstrect->x, dstrect->y, srcrect->x, srcrect->y,
+                             dstrect->x, dstrect->y, dstrect->w, dstrect->h);
+                attr.component_alpha = True;
+                XRenderChangePicture(data->display, data->stencil_pict,
+                                     CPComponentAlpha, &attr);
+            }
+            XRenderComposite(data->display, texturedata->blend_op,
+                            src, mask, data->drawable_pict, srcrect->x, srcrect->y,
+                            mrect->x, mrect->y, dstrect->x, dstrect->y,
+                            dstrect->w, dstrect->h);
         } else {
-            XCopyArea(data->display, texturedata->pixmap, data->drawable,
-                      data->gc, srcrect->x, srcrect->y, dstrect->w,
-                      dstrect->h, dstrect->x, dstrect->y);
-        }
-    } else if (texturedata->yuv
-               || texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        SDL_Surface src, dst;
-        SDL_PixelFormat fmt;
-        SDL_Rect rect;
-        XImage *image = texturedata->scaling_image;
+            /* The transformation is from the dst to src picture. */
+            double xscale = ((double) srcrect->w) / dstrect->w;
+            double yscale = ((double) srcrect->h) / dstrect->h;
+            XTransform xform = {{
+                    {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)},
+                    {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)},
+                    {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}};
+            XRenderSetPictureTransform(data->display, src, &xform);
+            
+            /* Black magic follows. */
+            if (texture->blendMode == SDL_BLENDMODE_MOD) {
+                /* Copy the dst to a temp buffer. */
+                XRenderComposite(data->display, PictOpSrc, data->drawable_pict,
+                             src, data->stencil_pict,
+                             dstrect->x, dstrect->y, srcrect->x, srcrect->y,
+                             dstrect->x, dstrect->y, dstrect->w, dstrect->h);
+                /* Set the compnent alpha flag on the temp buffer. */
+                attr.component_alpha = True;
+                XRenderChangePicture(data->display, data->stencil_pict,
+                                     CPComponentAlpha, &attr);
+            }
 
-        if (!image) {
-            void *pixels;
-            int pitch;
-
-            pitch = dstrect->w * SDL_BYTESPERPIXEL(texturedata->format);
-            pixels = SDL_malloc(dstrect->h * pitch);
-            if (!pixels) {
-                SDL_OutOfMemory();
-                return -1;
+            /* Set the picture filter only if a scaling mode is set. */
+            if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) {
+                XRenderSetPictureFilter(data->display, src,
+                                        texturedata->filter, 0, 0);
             }
 
-            image =
-                XCreateImage(data->display, data->visual, data->depth,
-                             ZPixmap, 0, pixels, dstrect->w, dstrect->h,
-                             SDL_BYTESPERPIXEL(texturedata->format) * 8,
-                             pitch);
+            XRenderComposite(data->display, texturedata->blend_op,
+                             src, mask, data->drawable_pict,
+                             srcrect->x, srcrect->y, mrect->x, mrect->y,
+                             dstrect->x, dstrect->y, dstrect->w, dstrect->h);
+           /* Set the texture transformation back to the identity matrix. */ 
+            XTransform identity = {{
+                    {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)},
+                    {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)},
+                    {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}};
+            XRenderSetPictureTransform(data->display, src, &identity);
+        }
+        
+        /* Reset the component alpha flag only when
+         * the blending mode is SDL_BLENDMODE_MOD. */
+        if (renderer->blendMode == SDL_BLENDMODE_MOD) {
+            attr.component_alpha = False;
+            XRenderChangePicture(data->display, data->stencil_pict,
+                                 CPComponentAlpha, &attr);
+        }
+    }
+    else
+#endif
+    {
+        if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
+#ifndef NO_SHARED_MEMORY
+            if (texturedata->shminfo.shmaddr) {
+                XShmPutImage(data->display, data->drawable, data->gc,
+                             texturedata->image, srcrect->x, srcrect->y,
+                             dstrect->x, dstrect->y, srcrect->w, srcrect->h,
+                             False);
+            } else
+#endif
+            if (texturedata->pixels) {
+                XPutImage(data->display, data->drawable, data->gc,
+                          texturedata->image, srcrect->x, srcrect->y, dstrect->x,
+                          dstrect->y, srcrect->w, srcrect->h);
+            } else {
+                XCopyArea(data->display, texturedata->pixmap, data->drawable,
+                          data->gc, srcrect->x, srcrect->y, dstrect->w,
+                          dstrect->h, dstrect->x, dstrect->y);
+            }
+        } else if (texturedata->yuv
+                   || texture->access == SDL_TEXTUREACCESS_STREAMING) {
+            SDL_Surface src, dst;
+            SDL_PixelFormat fmt;
+            SDL_Rect rect;
+            XImage *image = texturedata->scaling_image;
+
             if (!image) {
-                SDL_SetError("XCreateImage() failed");
+                void *pixels;
+                int pitch;
+
+                pitch = dstrect->w * SDL_BYTESPERPIXEL(texturedata->format);
+                pixels = SDL_malloc(dstrect->h * pitch);
+                if (!pixels) {
+                    SDL_OutOfMemory();
+                    return -1;
+                }
+
+                image =
+                    XCreateImage(data->display, data->visual, data->depth,
+                                 ZPixmap, 0, pixels, dstrect->w, dstrect->h,
+                                 SDL_BYTESPERPIXEL(texturedata->format) * 8,
+                                 pitch);
+                if (!image) {
+                    SDL_SetError("XCreateImage() failed");
+                    return -1;
+                }
+                texturedata->scaling_image = image;
+
+            } else if (image->width != dstrect->w || image->height != dstrect->h
+                       || !image->data) {
+                image->width = dstrect->w;
+                image->height = dstrect->h;
+                image->bytes_per_line =
+                    image->width * SDL_BYTESPERPIXEL(texturedata->format);
+                image->data =
+                    (char *) SDL_realloc(image->data,
+                                         image->height * image->bytes_per_line);
+                if (!image->data) {
+                    SDL_OutOfMemory();
+                    return -1;
+                }
+            }
+
+            /* Set up fake surfaces for SDL_SoftStretch() */
+            SDL_zero(src);
+            src.format = &fmt;
+            src.w = texture->w;
+            src.h = texture->h;
+#ifndef NO_SHARED_MEMORY
+            if (texturedata->shminfo.shmaddr) {
+                src.pixels = texturedata->shminfo.shmaddr;
+            } else
+#endif
+                src.pixels = texturedata->pixels;
+            src.pitch = texturedata->pitch;
+
+            SDL_zero(dst);
+            dst.format = &fmt;
+            dst.w = image->width;
+            dst.h = image->height;
+            dst.pixels = image->data;
+            dst.pitch = image->bytes_per_line;
+
+            fmt.BytesPerPixel = SDL_BYTESPERPIXEL(texturedata->format);
+
+            rect.x = 0;
+            rect.y = 0;
+            rect.w = dstrect->w;
+            rect.h = dstrect->h;
+            if (SDL_SoftStretch(&src, srcrect, &dst, &rect) < 0) {
                 return -1;
             }
-            texturedata->scaling_image = image;
-
-        } else if (image->width != dstrect->w || image->height != dstrect->h
-                   || !image->data) {
-            image->width = dstrect->w;
-            image->height = dstrect->h;
-            image->bytes_per_line =
-                image->width * SDL_BYTESPERPIXEL(texturedata->format);
-            image->data =
-                (char *) SDL_realloc(image->data,
-                                     image->height * image->bytes_per_line);
-            if (!image->data) {
-                SDL_OutOfMemory();
-                return -1;
-            }
+            XPutImage(data->display, data->drawable, data->gc, image, 0, 0,
+                      dstrect->x, dstrect->y, dstrect->w, dstrect->h);
+        } else {
+            XCopyArea(data->display, texturedata->pixmap, data->drawable,
+                      data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
+                      srcrect->x, srcrect->y);
         }
-
-        /* Set up fake surfaces for SDL_SoftStretch() */
-        SDL_zero(src);
-        src.format = &fmt;
-        src.w = texture->w;
-        src.h = texture->h;
-#ifndef NO_SHARED_MEMORY
-        if (texturedata->shminfo.shmaddr) {
-            src.pixels = texturedata->shminfo.shmaddr;
-        } else
-#endif
-            src.pixels = texturedata->pixels;
-        src.pitch = texturedata->pitch;
-
-        SDL_zero(dst);
-        dst.format = &fmt;
-        dst.w = image->width;
-        dst.h = image->height;
-        dst.pixels = image->data;
-        dst.pitch = image->bytes_per_line;
-
-        fmt.BytesPerPixel = SDL_BYTESPERPIXEL(texturedata->format);
-
-        rect.x = 0;
-        rect.y = 0;
-        rect.w = dstrect->w;
-        rect.h = dstrect->h;
-        if (SDL_SoftStretch(&src, srcrect, &dst, &rect) < 0) {
-            return -1;
-        }
-        XPutImage(data->display, data->drawable, data->gc, image, 0, 0,
-                  dstrect->x, dstrect->y, dstrect->w, dstrect->h);
-    } else {
-        XCopyArea(data->display, texturedata->pixmap, data->drawable,
-                  data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
-                  srcrect->x, srcrect->y);
     }
     return 0;
 }
@@ -1064,9 +2216,26 @@
     if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) {
         for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
             const SDL_Rect *rect = &dirty->rect;
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+            if (data->use_xrender)
+            {
+                XRenderComposite(data->display,
+                                 data->blend_op,
+                                 data->drawable_pict,
+                                 None,
+                                 data->xwindow_pict,
+                                 rect->x, rect->y,
+                                 0, 0,
+                                 rect->x, rect->y,
+                                 rect->w, rect->h);
+            }
+            else
+#endif
+            {
             XCopyArea(data->display, data->drawable, data->xwindow,
                       data->gc, rect->x, rect->y, rect->w, rect->h,
                       rect->x, rect->y);
+            }
         }
         SDL_ClearDirtyRects(&data->dirty);
     }
@@ -1076,9 +2245,15 @@
     if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
         data->current_pixmap = (data->current_pixmap + 1) % 2;
         data->drawable = data->pixmaps[data->current_pixmap];
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        data->drawable_pict = data->pixmap_picts[data->current_pixmap];
+#endif
     } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
         data->current_pixmap = (data->current_pixmap + 1) % 3;
         data->drawable = data->pixmaps[data->current_pixmap];
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        data->drawable_pict = data->pixmap_picts[data->current_pixmap];
+#endif
     }
 }
 
@@ -1109,6 +2284,19 @@
         data->pixels = NULL;
     }
 #endif
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+    if (renderdata->use_xrender) {
+        if (data->picture) {
+            XRenderFreePicture(renderdata->display, data->picture);
+        }
+        if (data->modulated_pixmap) {
+            XFreePixmap(renderdata->display, data->modulated_pixmap);
+        }
+        if (data->modulated_picture) {
+            XRenderFreePicture(renderdata->display, data->modulated_picture);
+        }
+    }
+#endif
     if (data->scaling_image) {
         SDL_free(data->scaling_image->data);
         data->scaling_image->data = NULL;
@@ -1132,10 +2320,36 @@
             if (data->pixmaps[i] != None) {
                 XFreePixmap(data->display, data->pixmaps[i]);
             }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+            if (data->use_xrender && data->pixmap_picts[i]) {
+                XRenderFreePicture(data->display, data->pixmap_picts[i]);
+            }
+#endif
         }
         if (data->gc) {
             XFreeGC(data->display, data->gc);
         }
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+        if (data->use_xrender) {
+            if (data->stencil_gc) {
+                XFreeGC(data->display, data->stencil_gc);
+            }
+            if (data->stencil) {
+                XFreePixmap(data->display, data->stencil);
+            }
+            if (data->stencil_pict) {
+                XRenderFreePicture(data->display, data->stencil_pict);
+            }
+            if (data->xwindow_pict) {
+                XRenderFreePicture(data->display, data->xwindow_pict);
+            }
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+            if (data->use_xdamage && data->stencil_damage) {
+                XDamageDestroy(data->display, data->stencil_damage);
+            }
+#endif
+        }
+#endif
         SDL_FreeDirtyRects(&data->dirty);
         SDL_free(data);
     }
--- a/src/video/x11/SDL_x11sym.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11sym.h	Sun Aug 22 13:45:56 2010 -0700
@@ -37,7 +37,9 @@
 SDL_X11_SYM(Bool,XCheckWindowEvent,(Display* a,Window b,long c,XEvent* d),(a,b,c,d),return)
 SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return)
 SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return)
+SDL_X11_SYM(int,XConvertSelection,(Display* a,Atom b,Atom c,Atom d,Window e,Time f),(a,b,c,d,e,f),return)
 SDL_X11_SYM(int,XCopyArea,(Display* a,Drawable b,Drawable c,GC d,int e,int f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
+SDL_X11_SYM(Pixmap,XCreateBitmapFromData,(Display *dpy,Drawable d,_Xconst char *data,unsigned int width,unsigned int height),(dpy,d,data,width,height),return)
 SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
 SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
 SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
@@ -66,15 +68,18 @@
 SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return)
 SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return)
 SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return)
+SDL_X11_SYM(char*,XGetAtomName,(Display *a,Atom b),(a,b),return)
 SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return)
 SDL_X11_SYM(XImage*,XGetImage,(Display* a,Drawable b,int c,int d,unsigned int e,unsigned int f,unsigned long g, int h),(a,b,c,d,e,f,g,h),return)
 SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return)
 SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return)
 SDL_X11_SYM(int,XGetRGBColormaps,(Display* a,Window b,XStandardColormap **c,int *d,Atom e),(a,b,c,d,e),return)
+SDL_X11_SYM(Window,XGetSelectionOwner,(Display* a,Atom b),(a,b),return)
+SDL_X11_SYM(Status,XGetTextProperty,(Display *a,Window b,XTextProperty *c,Atom d),(a,b,c,d),return)
 SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return)
-SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
 SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return)
 SDL_X11_SYM(int,XGetWindowProperty,(Display* a,Window b,Atom c,long d,long e,Bool f,Atom g,Atom* h,int* i,unsigned long* j,unsigned long *k,unsigned char **l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
+SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
 SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return)
 SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return)
 SDL_X11_SYM(int,XGrabServer,(Display* a),(a),return)
@@ -114,14 +119,15 @@
 SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return)
 SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return)
 SDL_X11_SYM(void,XSetRGBColormaps,( Display *a,Window b,XStandardColormap *c,int d,Atom e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XSetSelectionOwner,(Display* a,Atom b,Window c,Time d),(a,b,c,d),return)
 SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return)
-SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return)
 SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),)
-SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
-SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
 SDL_X11_SYM(int,XSetWindowBackground,(Display* a,Window b,unsigned long c),(a,b,c),return)
 SDL_X11_SYM(int,XSetWindowBackgroundPixmap,(Display* a,Window b,Pixmap c),(a,b,c),return)
 SDL_X11_SYM(int,XSetWindowColormap,(Display* a,Window b,Colormap c),(a,b,c),return)
+SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return)
+SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
+SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
 SDL_X11_SYM(int,XStoreColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
 SDL_X11_SYM(Status,XStringListToTextProperty,(char** a,int b,XTextProperty* c),(a,b,c),return)
 SDL_X11_SYM(int,XSync,(Display* a,Bool b),(a,b),return)
@@ -151,7 +157,10 @@
 SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return)
 SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return)
 SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHandler a),(a),return)
-SDL_X11_SYM(Pixmap,XCreateBitmapFromData,(Display *dpy,Drawable d,_Xconst char *data,unsigned int width,unsigned int height),(dpy,d,data,width,height),return)
+SDL_X11_SYM(int,XFillRectangle,(Display *dpy,Drawable d,GC gc,int x,int y,unsigned int width,unsigned int height),(dpy,d,gc,x,y,width,height),return)
+SDL_X11_SYM(int,XSetBackground,(Display *dpy,GC gc,unsigned long background),(dpy,gc,background),return)
+SDL_X11_SYM(Status,XInitImage,(XImage *image),(image),return)
+SDL_X11_SYM(int,XSetClipMask,(Display *dpy,GC gc,Pixmap pixmap),(dpy,gc,pixmap),return)
 
 #if NeedWidePrototypes
 SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return)
@@ -178,6 +187,7 @@
 SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return)
 SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return)
 SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return)
+SDL_X11_SYM(Pixmap,XShmCreatePixmap,(Display *a,Drawable b,char* c,XShmSegmentInfo* d, unsigned int e, unsigned int f, unsigned int g),(a,b,c,d,e,f,g),return)
 SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
 #endif
 
@@ -233,6 +243,42 @@
 SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),return)
 #endif
 
+/* XRender support */
+#if SDL_VIDEO_DRIVER_X11_XRENDER
+SDL_X11_MODULE(XRENDER)
+SDL_X11_SYM(Bool,XRenderQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return)
+SDL_X11_SYM(Bool,XRenderQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return)
+SDL_X11_SYM(XRenderPictFormat*,XRenderFindVisualFormat,(Display *dpy,_Xconst Visual *visual),(dpy,visual),return)
+SDL_X11_SYM(XRenderPictFormat*,XRenderFindStandardFormat,(Display *dpy,int format),(dpy,format),return)
+SDL_X11_SYM(XRenderPictFormat*,XRenderFindFormat,(Display *dpy,unsigned long mask,_Xconst XRenderPictFormat* templ,int count),(dpy,mask,templ,count),return)
+SDL_X11_SYM(Picture,XRenderCreatePicture,(Display *dpy,Drawable drawable,_Xconst XRenderPictFormat* format,unsigned long valuemask,_Xconst XRenderPictureAttributes* attributes),(dpy,drawable,format,valuemask,attributes),return)
+SDL_X11_SYM(void,XRenderFreePicture,(Display *dpy,Picture picture),(dpy,picture),return)
+SDL_X11_SYM(void,XRenderChangePicture,(Display *dpy,Picture picture,unsigned long valuemask,_Xconst XRenderPictureAttributes* attributes),(dpy,picture,valuemask,attributes),return)
+SDL_X11_SYM(void,XRenderComposite,(Display *dpy,int op,Picture src,Picture mask,Picture dst,int src_x,int src_y,int mask_x,int mask_y,int dst_x,int dst_y,unsigned int width,unsigned int height),(dpy,op,src,mask,dst,src_x,src_y,mask_x,mask_y,dst_x,dst_y,width,height),return)
+SDL_X11_SYM(Picture,XRenderCreateSolidFill,(Display *dpy,const XRenderColor *color),(dpy,color),return)
+SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTransform *transform),(dpy,picture,transform),return)
+SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return)
+SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,_Xconst XRectangle *rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return)
+SDL_X11_SYM(void,XRenderSetPictureFilter,(Display *dpy,Picture picture,const char *filter,XFixed *params,int nparams),(dpy,picture,filter,params,nparams),return)
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
+SDL_X11_MODULE(XDAMAGE)
+SDL_X11_SYM(Bool,XDamageQueryExtension,(Display *dpy,int *event_base_return,int *error_base_return),(dpy,event_base_return,error_base_return),return)
+SDL_X11_SYM(Status,XDamageQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return)
+SDL_X11_SYM(Damage,XDamageCreate,(Display *dpy,Drawable d,int level),(dpy,d,level),return)
+SDL_X11_SYM(void,XDamageSubtract,(Display *dpy,Damage damage,XserverRegion repair,XserverRegion parts),(dpy,damage,repair,parts),return)
+SDL_X11_SYM(void,XDamageDestroy,(Display *dpy,Damage damage),(dpy,damage),return)
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_XFIXES
+SDL_X11_MODULE(XFIXES)
+SDL_X11_SYM(Bool,XFixesQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return)
+SDL_X11_SYM(Status,XFixesQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return)
+SDL_X11_SYM(void,XFixesSetGCClipRegion,(Display *dpy,GC gc,int clip_x,int clip_y,XserverRegion region),(dpy,gc,clip_x,clip_y,region),return)
+SDL_X11_SYM(void,XFixesSetPictureClipRegion,(Display *dpy,XID picture,int clip_x,int clip_y,XserverRegion region),(dpy,picture,clip_x,clip_y,region),return)
+#endif
+
 #if SDL_VIDEO_DRIVER_X11_XSHAPE
 SDL_X11_MODULE(XSHAPE)
 SDL_X11_SYM(void,XShapeCombineMask,(Display *dpy,Window dest,int dest_kind,int x_off,int y_off,Pixmap src,int op),(dpy,dest,dest_kind,x_off,y_off,src,op),)
--- a/src/video/x11/SDL_x11video.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11video.c	Sun Aug 22 13:45:56 2010 -0700
@@ -21,8 +21,11 @@
 */
 #include "SDL_config.h"
 
+#include <unistd.h> /* For getpid() and readlink() */
+
 #include "SDL_video.h"
 #include "SDL_mouse.h"
+#include "SDL_eventtouch.h" 
 #include "../SDL_sysvideo.h"
 #include "../SDL_pixels_c.h"
 
@@ -229,6 +232,10 @@
     device->GL_DeleteContext = X11_GLES_DeleteContext;
 #endif
 
+    device->SetClipboardText = X11_SetClipboardText;
+    device->GetClipboardText = X11_GetClipboardText;
+    device->HasClipboardText = X11_HasClipboardText;
+
     device->free = X11_DeleteDevice;
 
     return device;
@@ -239,6 +246,73 @@
     X11_Available, X11_CreateDevice
 };
 
+static int (*handler) (Display *, XErrorEvent *) = NULL;
+static int
+X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e)
+{
+    if (e->error_code == BadWindow) {
+        return (0);
+    } else {
+        return (handler(d, e));
+    }
+}
+
+static void
+X11_CheckWindowManager(_THIS)
+{
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    Display *display = data->display;
+    Atom _NET_SUPPORTING_WM_CHECK;
+    int status, real_format;
+    Atom real_type;
+    unsigned long items_read, items_left;
+    unsigned char *propdata;
+    Window wm_window = 0;
+#ifdef DEBUG_WINDOW_MANAGER
+    char *wm_name;
+#endif
+
+    /* Set up a handler to gracefully catch errors */
+    XSync(display, False);
+    handler = XSetErrorHandler(X11_CheckWindowManagerErrorHandler);
+
+    _NET_SUPPORTING_WM_CHECK = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False);
+    status = XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
+    if (status == Success && items_read) {
+        wm_window = ((Window*)propdata)[0];
+    }
+    if (propdata) {
+        XFree(propdata);
+    }
+
+    if (wm_window) {
+        status = XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
+        if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) {
+            wm_window = None;
+        }
+        if (propdata) {
+            XFree(propdata);
+        }
+    }
+
+    /* Reset the error handler, we're done checking */
+    XSync(display, False);
+    XSetErrorHandler(handler);
+
+    if (!wm_window) {
+#ifdef DEBUG_WINDOW_MANAGER
+        printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n");
+#endif
+        return;
+    }
+    data->net_wm = SDL_TRUE;
+
+#ifdef DEBUG_WINDOW_MANAGER
+    wm_name = X11_GetWindowTitle(_this, wm_window);
+    printf("Window manager: %s\n", wm_name);
+    SDL_free(wm_name);
+#endif
+}
 
 int
 X11_VideoInit(_THIS)
@@ -257,8 +331,20 @@
 #endif
 
     /* Look up some useful Atoms */
-    data->WM_DELETE_WINDOW =
-        XInternAtom(data->display, "WM_DELETE_WINDOW", False);
+#define GET_ATOM(X) data->X = XInternAtom(data->display, #X, False)
+    GET_ATOM(WM_DELETE_WINDOW);
+    GET_ATOM(_NET_WM_STATE);
+    GET_ATOM(_NET_WM_STATE_HIDDEN);
+    GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT);
+    GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ);
+    GET_ATOM(_NET_WM_STATE_FULLSCREEN);
+    GET_ATOM(_NET_WM_NAME);
+    GET_ATOM(_NET_WM_ICON_NAME);
+    GET_ATOM(_NET_WM_ICON);
+    GET_ATOM(UTF8_STRING);
+
+    /* Detect the window manager */
+    X11_CheckWindowManager(_this);
 
     if (X11_InitModes(_this) < 0) {
         return -1;
@@ -273,6 +359,7 @@
     }
     X11_InitMouse(_this);
 
+    X11_InitTouch(_this);
     return 0;
 }
 
@@ -293,10 +380,11 @@
     X11_QuitModes(_this);
     X11_QuitKeyboard(_this);
     X11_QuitMouse(_this);
+    X11_QuitTouch(_this);
 }
 
 SDL_bool
-X11_UseDirectColorVisuals()
+X11_UseDirectColorVisuals(void)
 {
     /* Once we implement DirectColor colormaps and gamma ramp support...
        return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
--- a/src/video/x11/SDL_x11video.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11video.h	Sun Aug 22 13:45:56 2010 -0700
@@ -45,17 +45,28 @@
 #if SDL_VIDEO_DRIVER_X11_SCRNSAVER
 #include <X11/extensions/scrnsaver.h>
 #endif
+#if SDL_VIDEO_DRIVER_X11_XRENDER
+#include <X11/extensions/Xrender.h>
+#endif
+#if SDL_VIDEO_DRIVER_X11_XDAMAGE
+#include <X11/extensions/Xdamage.h>
+#endif
+#if SDL_VIDEO_DRIVER_X11_XFIXES
+#include <X11/extensions/Xfixes.h>
+#endif
 #if SDL_VIDEO_DRIVER_X11_XSHAPE
 #include <X11/extensions/shape.h>
 #endif
 
 #include "SDL_x11dyn.h"
 
+#include "SDL_x11clipboard.h"
 #include "SDL_x11events.h"
 #include "SDL_x11gamma.h"
 #include "SDL_x11keyboard.h"
 #include "SDL_x11modes.h"
 #include "SDL_x11mouse.h"
+#include "SDL_eventtouch.h"
 #include "SDL_x11opengl.h"
 #include "SDL_x11window.h"
 
@@ -70,12 +81,27 @@
     int numwindows;
     SDL_WindowData **windowlist;
     int windowlistlength;
-    int keyboard;
+
+    /* This is true for ICCCM2.0-compliant window managers */
+    SDL_bool net_wm;
+
+    /* Useful atoms */
     Atom WM_DELETE_WINDOW;
+    Atom _NET_WM_STATE;
+    Atom _NET_WM_STATE_HIDDEN;
+    Atom _NET_WM_STATE_MAXIMIZED_VERT;
+    Atom _NET_WM_STATE_MAXIMIZED_HORZ;
+    Atom _NET_WM_STATE_FULLSCREEN;
+    Atom _NET_WM_NAME;
+    Atom _NET_WM_ICON_NAME;
+    Atom _NET_WM_ICON;
+    Atom UTF8_STRING;
+
     SDL_scancode key_layout[256];
+    SDL_bool selection_waiting;
 } SDL_VideoData;
 
-extern SDL_bool X11_UseDirectColorVisuals();
+extern SDL_bool X11_UseDirectColorVisuals(void);
 
 #endif /* _SDL_x11video_h */
 
--- a/src/video/x11/SDL_x11window.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11window.c	Sun Aug 22 13:45:56 2010 -0700
@@ -22,6 +22,7 @@
 #include "SDL_config.h"
 
 #include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
 #include "../../events/SDL_keyboard_c.h"
 #include "../../events/SDL_mouse_c.h"
 
@@ -35,12 +36,57 @@
 #include "SDL_x11opengles.h"
 #endif
 
+#include "SDL_timer.h"
 #include "SDL_syswm.h"
 
 #define _NET_WM_STATE_REMOVE    0l
 #define _NET_WM_STATE_ADD       1l
 #define _NET_WM_STATE_TOGGLE    2l
 
+static SDL_bool
+X11_IsWindowOldFullscreen(_THIS, SDL_Window * window)
+{
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
+
+    /* ICCCM2.0-compliant window managers can handle fullscreen windows */
+    if ((window->flags & SDL_WINDOW_FULLSCREEN) && !videodata->net_wm) {
+        return SDL_TRUE;
+    } else {
+        return SDL_FALSE;
+    }
+}
+
+static SDL_bool
+X11_IsWindowMapped(_THIS, SDL_Window * window)
+{
+    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
+    XWindowAttributes attr;
+
+    XGetWindowAttributes(videodata->display, data->xwindow, &attr);
+    if (attr.map_state != IsUnmapped) {
+        return SDL_TRUE;
+    } else {
+        return SDL_FALSE;
+    }
+}
+
+static int
+X11_GetWMStateProperty(_THIS, SDL_Window * window, Atom atoms[3])
+{
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    int count = 0;
+
+    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+        atoms[count++] = data->_NET_WM_STATE_FULLSCREEN;
+    }
+    if (window->flags & SDL_WINDOW_MAXIMIZED) {
+        atoms[count++] = data->_NET_WM_STATE_MAXIMIZED_VERT;
+        atoms[count++] = data->_NET_WM_STATE_MAXIMIZED_HORZ;
+    }
+    return count;
+}
+
 static void
 X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h)
 {
@@ -49,9 +95,15 @@
         (SDL_DisplayData *) window->display->driverdata;
     XWindowAttributes attr;
 
-    XGetWindowAttributes(data->display, RootWindow(data->display,
-                                                   displaydata->screen),
-                         &attr);
+    XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr);
+    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+        /* The bounds when this window is visible is the fullscreen mode */
+        SDL_DisplayMode fullscreen_mode;
+        if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
+            attr.width = fullscreen_mode.w;
+            attr.height = fullscreen_mode.h;
+        }
+    }
     if (w) {
         *w = attr.width;
     }
@@ -68,7 +120,6 @@
     int numwindows = videodata->numwindows;
     int windowlistlength = videodata->windowlistlength;
     SDL_WindowData **windowlist = videodata->windowlist;
-    int index;
 
     /* Allocate the window data */
     data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
@@ -128,14 +179,10 @@
     }
 
     {
-        Atom _NET_WM_STATE =
-            XInternAtom(data->videodata->display, "_NET_WM_STATE", False);
-        Atom _NET_WM_STATE_MAXIMIZED_VERT =
-            XInternAtom(data->videodata->display,
-                        "_NET_WM_STATE_MAXIMIZED_VERT", False);
-        Atom _NET_WM_STATE_MAXIMIZED_HORZ =
-            XInternAtom(data->videodata->display,
-                        "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+        Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE;
+        Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
+        Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
+        Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN;
         Atom actualType;
         int actualFormat;
         unsigned long i, numItems, bytesAfter;
@@ -148,19 +195,21 @@
                                &propertyValue) == Success) {
             Atom *atoms = (Atom *) propertyValue;
             int maximized = 0;
+            int fullscreen = 0;
 
             for (i = 0; i < numItems; ++i) {
                 if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) {
                     maximized |= 1;
                 } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) {
                     maximized |= 2;
+                } else if ( atoms[i] == _NET_WM_STATE_FULLSCREEN) {
+                    fullscreen = 1;
                 }
-                /* Might also want to check the following properties:
-                   _NET_WM_STATE_ABOVE, _NET_WM_STATE_FULLSCREEN
-                 */
             }
             if (maximized == 3) {
                 window->flags |= SDL_WINDOW_MAXIMIZED;
+            }  else if (fullscreen == 1) {
+                window->flags |= SDL_WINDOW_FULLSCREEN;
             }
             XFree(propertyValue);
         }
@@ -180,11 +229,6 @@
        } else {
        window->flags &= ~SDL_WINDOW_RESIZABLE;
        }
-       if (style & WS_MAXIMIZE) {
-       window->flags |= SDL_WINDOW_MAXIMIZED;
-       } else {
-       window->flags &= ~SDL_WINDOW_MAXIMIZED;
-       }
        if (style & WS_MINIMIZE) {
        window->flags |= SDL_WINDOW_MINIMIZED;
        } else {
@@ -217,6 +261,8 @@
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
     SDL_DisplayData *displaydata =
         (SDL_DisplayData *) window->display->driverdata;
+    Display *display = data->display;
+    int screen = displaydata->screen;
     Visual *visual;
     int depth;
     XSetWindowAttributes xattr;
@@ -225,6 +271,14 @@
     XSizeHints *sizehints;
     XWMHints *wmhints;
     XClassHint *classhints;
+    SDL_bool oldstyle_fullscreen;
+    Atom _NET_WM_WINDOW_TYPE;
+    Atom _NET_WM_WINDOW_TYPE_NORMAL;
+    int wmstate_count;
+    Atom wmstate_atoms[3];
+
+    /* ICCCM2.0-compliant window managers can handle fullscreen windows */
+    oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window);
 
 #if SDL_VIDEO_DRIVER_X11_XINERAMA
 /* FIXME
@@ -238,7 +292,7 @@
     if (window->flags & SDL_WINDOW_OPENGL) {
         XVisualInfo *vinfo;
 
-        vinfo = X11_GL_GetVisual(_this, data->display, displaydata->screen);
+        vinfo = X11_GL_GetVisual(_this, display, screen);
         if (!vinfo) {
             return -1;
         }
@@ -251,7 +305,7 @@
     if (window->flags & SDL_WINDOW_OPENGL) {
         XVisualInfo *vinfo;
 
-        vinfo = X11_GLES_GetVisual(_this, data->display, displaydata->screen);
+        vinfo = X11_GLES_GetVisual(_this, display, screen);
         if (!vinfo) {
             return -1;
         }
@@ -265,7 +319,7 @@
         depth = displaydata->depth;
     }
 
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+    if (oldstyle_fullscreen) {
         xattr.override_redirect = True;
     } else {
         xattr.override_redirect = False;
@@ -276,8 +330,7 @@
     if (visual->class == PseudoColor) {
         printf("asking for PseudoColor\n");
 
-        Status status;
-        XStandardColormap cmap;
+/*      Status status; */
         XColor *colorcells;
         Colormap colormap;
         Sint32 pix;
@@ -290,16 +343,13 @@
         Sint32 r, g, b;
 
         /* Is the colormap we need already registered in SDL? */
-        if (colormap =
-            X11_LookupColormap(data->display,
-                               displaydata->screen, visual->visualid)) {
+        if ((colormap =
+            X11_LookupColormap(display, screen, visual->visualid))) {
             xattr.colormap = colormap;
 /*             printf("found existing colormap\n"); */
         } else {
             /* The colormap is not known to SDL so we will create it */
-            colormap = XCreateColormap(data->display,
-                                       RootWindow(data->display,
-                                                  displaydata->screen),
+            colormap = XCreateColormap(display, RootWindow(display, screen),
                                        visual, AllocAll);
 /*             printf("colormap = %x\n", colormap); */
 
@@ -378,17 +428,15 @@
             }
 
 /*             status = */
-/*                 XStoreColors(data->display, colormap, colorcells, ncolors); */
+/*                 XStoreColors(display, colormap, colorcells, ncolors); */
 
             xattr.colormap = colormap;
-            X11_TrackColormap(data->display, displaydata->screen,
-                              colormap, visual, NULL);
+            X11_TrackColormap(display, screen, colormap, visual, NULL);
 
             SDL_free(colorcells);
         }
     } else if (visual->class == DirectColor) {
         Status status;
-        XStandardColormap cmap;
         XColor *colorcells;
         Colormap colormap;
         int i;
@@ -398,16 +446,13 @@
         int rshift, gshift, bshift;
 
         /* Is the colormap we need already registered in SDL? */
-        if (colormap =
-            X11_LookupColormap(data->display,
-                               displaydata->screen, visual->visualid)) {
+        if ((colormap =
+             X11_LookupColormap(display, screen, visual->visualid))) {
             xattr.colormap = colormap;
 /*             printf("found existing colormap\n"); */
         } else {
             /* The colormap is not known to SDL so we will create it */
-            colormap = XCreateColormap(data->display,
-                                       RootWindow(data->display,
-                                                  displaydata->screen),
+            colormap = XCreateColormap(display, RootWindow(display, screen),
                                        visual, AllocAll);
 /*             printf("colormap = %x\n", colormap); */
 
@@ -419,7 +464,6 @@
             }
 
             /* OK, we got a colormap, now fill it in as best as we can */
-
             colorcells = SDL_malloc(visual->map_entries * sizeof(XColor));
             if (NULL == colorcells) {
                 SDL_SetError("out of memory in X11_CreateWindow");
@@ -481,22 +525,20 @@
             }
 
             status =
-                XStoreColors(data->display, colormap, colorcells, ncolors);
+                XStoreColors(display, colormap, colorcells, ncolors);
 
             xattr.colormap = colormap;
-            X11_TrackColormap(data->display, displaydata->screen,
-                              colormap, visual, colorcells);
+            X11_TrackColormap(display, screen, colormap, visual, colorcells);
 
             SDL_free(colorcells);
         }
     } else {
         xattr.colormap =
-            XCreateColormap(data->display,
-                            RootWindow(data->display, displaydata->screen),
+            XCreateColormap(display, RootWindow(display, screen),
                             visual, AllocNone);
     }
 
-    if ((window->flags & SDL_WINDOW_FULLSCREEN)
+    if (oldstyle_fullscreen
         || window->x == SDL_WINDOWPOS_CENTERED) {
         X11_GetDisplaySize(_this, window, &x, NULL);
         x = (x - window->w) / 2;
@@ -505,7 +547,7 @@
     } else {
         x = window->x;
     }
-    if ((window->flags & SDL_WINDOW_FULLSCREEN)
+    if (oldstyle_fullscreen
         || window->y == SDL_WINDOWPOS_CENTERED) {
         X11_GetDisplaySize(_this, window, NULL, &y);
         y = (y - window->h) / 2;
@@ -515,8 +557,7 @@
         y = window->y;
     }
 
-    w = XCreateWindow(data->display,
-                      RootWindow(data->display, displaydata->screen), x, y,
+    w = XCreateWindow(display, RootWindow(display, screen), x, y,
                       window->w, window->h, 0, depth, InputOutput, visual,
                       (CWOverrideRedirect | CWBackPixel | CWBorderPixel |
                        CWColormap), &xattr);
@@ -541,23 +582,23 @@
     sizehints = XAllocSizeHints();
     if (sizehints) {
         if (!(window->flags & SDL_WINDOW_RESIZABLE)
-            || (window->flags & SDL_WINDOW_FULLSCREEN)) {
+            || oldstyle_fullscreen) {
             sizehints->min_width = sizehints->max_width = window->w;
             sizehints->min_height = sizehints->max_height = window->h;
             sizehints->flags = PMaxSize | PMinSize;
         }
-        if (!(window->flags & SDL_WINDOW_FULLSCREEN)
+        if (!oldstyle_fullscreen
             && window->x != SDL_WINDOWPOS_UNDEFINED
             && window->y != SDL_WINDOWPOS_UNDEFINED) {
             sizehints->x = x;
             sizehints->y = y;
             sizehints->flags |= USPosition;
         }
-        XSetWMNormalHints(data->display, w, sizehints);
+        XSetWMNormalHints(display, w, sizehints);
         XFree(sizehints);
     }
 
-    if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) {
+    if ((window->flags & SDL_WINDOW_BORDERLESS) || oldstyle_fullscreen) {
         SDL_bool set;
         Atom WM_HINTS;
 
@@ -565,7 +606,7 @@
         set = SDL_FALSE;
 
         /* First try to set MWM hints */
-        WM_HINTS = XInternAtom(data->display, "_MOTIF_WM_HINTS", True);
+        WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", True);
         if (WM_HINTS != None) {
             /* Hints used by Motif compliant window managers */
             struct
@@ -578,40 +619,36 @@
             } MWMHints = {
             (1L << 1), 0, 0, 0, 0};
 
-            XChangeProperty(data->display, w, WM_HINTS, WM_HINTS, 32,
+            XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32,
                             PropModeReplace, (unsigned char *) &MWMHints,
-                            sizeof(MWMHints) / sizeof(long));
+                            sizeof(MWMHints) / 4);
             set = SDL_TRUE;
         }
         /* Now try to set KWM hints */
-        WM_HINTS = XInternAtom(data->display, "KWM_WIN_DECORATION", True);
+        WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION", True);
         if (WM_HINTS != None) {
             long KWMHints = 0;
 
-            XChangeProperty(data->display, w,
-                            WM_HINTS, WM_HINTS, 32,
+            XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32,
                             PropModeReplace,
                             (unsigned char *) &KWMHints,
-                            sizeof(KWMHints) / sizeof(long));
+                            sizeof(KWMHints) / 4);
             set = SDL_TRUE;
         }
         /* Now try to set GNOME hints */
-        WM_HINTS = XInternAtom(data->display, "_WIN_HINTS", True);
+        WM_HINTS = XInternAtom(display, "_WIN_HINTS", True);
         if (WM_HINTS != None) {
             long GNOMEHints = 0;
 
-            XChangeProperty(data->display, w,
-                            WM_HINTS, WM_HINTS, 32,
+            XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32,
                             PropModeReplace,
                             (unsigned char *) &GNOMEHints,
-                            sizeof(GNOMEHints) / sizeof(long));
+                            sizeof(GNOMEHints) / 4);
             set = SDL_TRUE;
         }
         /* Finally set the transient hints if necessary */
         if (!set) {
-            XSetTransientForHint(data->display, w,
-                                 RootWindow(data->display,
-                                            displaydata->screen));
+            XSetTransientForHint(display, w, RootWindow(display, screen));
         }
     } else {
         SDL_bool set;
@@ -621,54 +658,35 @@
         set = SDL_FALSE;
 
         /* First try to unset MWM hints */
-        WM_HINTS = XInternAtom(data->display, "_MOTIF_WM_HINTS", True);
+        WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", True);
         if (WM_HINTS != None) {
-            XDeleteProperty(data->display, w, WM_HINTS);
+            XDeleteProperty(display, w, WM_HINTS);
             set = SDL_TRUE;
         }
         /* Now try to unset KWM hints */
-        WM_HINTS = XInternAtom(data->display, "KWM_WIN_DECORATION", True);
+        WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION", True);
         if (WM_HINTS != None) {
-            XDeleteProperty(data->display, w, WM_HINTS);
+            XDeleteProperty(display, w, WM_HINTS);
             set = SDL_TRUE;
         }
         /* Now try to unset GNOME hints */
-        WM_HINTS = XInternAtom(data->display, "_WIN_HINTS", True);
+        WM_HINTS = XInternAtom(display, "_WIN_HINTS", True);
         if (WM_HINTS != None) {
-            XDeleteProperty(data->display, w, WM_HINTS);
+            XDeleteProperty(display, w, WM_HINTS);
             set = SDL_TRUE;
         }
         /* Finally unset the transient hints if necessary */
         if (!set) {
-            /* NOTE: Does this work? */
-            XSetTransientForHint(data->display, w, None);
+            XDeleteProperty(display, w, XA_WM_TRANSIENT_FOR);
         }
     }
 
-    /* Tell KDE to keep fullscreen windows on top */
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        XEvent ev;
-        long mask;
-
-        SDL_zero(ev);
-        ev.xclient.type = ClientMessage;
-        ev.xclient.window = RootWindow(data->display, displaydata->screen);
-        ev.xclient.message_type =
-            XInternAtom(data->display, "KWM_KEEP_ON_TOP", False);
-        ev.xclient.format = 32;
-        ev.xclient.data.l[0] = w;
-        ev.xclient.data.l[1] = CurrentTime;
-        XSendEvent(data->display,
-                   RootWindow(data->display, displaydata->screen), False,
-                   SubstructureRedirectMask, &ev);
-    }
-
     /* Set the input hints so we get keyboard input */
     wmhints = XAllocWMHints();
     if (wmhints) {
         wmhints->input = True;
         wmhints->flags = InputHint;
-        XSetWMHints(data->display, w, wmhints);
+        XSetWMHints(display, w, wmhints);
         XFree(wmhints);
     }
 
@@ -677,15 +695,32 @@
     if (classhints != NULL) {
         classhints->res_name = data->classname;
         classhints->res_class = data->classname;
-        XSetClassHint(data->display, w, classhints);
+        XSetClassHint(display, w, classhints);
         XFree(classhints);
     }
 
+    /* Set the window manager state */
+    wmstate_count = X11_GetWMStateProperty(_this, window, wmstate_atoms);
+    if (wmstate_count > 0) {
+        XChangeProperty(display, w, data->_NET_WM_STATE, XA_ATOM, 32,
+                        PropModeReplace,
+                        (unsigned char *)wmstate_atoms, wmstate_count);
+    } else {
+        XDeleteProperty(display, w, data->_NET_WM_STATE);
+    }
+
+    /* Let the window manager know we're a "normal" window */
+    _NET_WM_WINDOW_TYPE = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
+    _NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False);
+    XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
+                    PropModeReplace,
+                    (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1);
+
     /* Allow the window to be deleted by the window manager */
-    XSetWMProtocols(data->display, w, &data->WM_DELETE_WINDOW, 1);
+    XSetWMProtocols(display, w, &data->WM_DELETE_WINDOW, 1);
 
     if (SetupWindowData(_this, window, w, SDL_TRUE) < 0) {
-        XDestroyWindow(data->display, w);
+        XDestroyWindow(display, w);
         return -1;
     }
 #ifdef X_HAVE_UTF8_STRING
@@ -693,7 +728,7 @@
         Uint32 fevent = 0;
         pXGetICValues(((SDL_WindowData *) window->driverdata)->ic,
                       XNFilterEvents, &fevent, NULL);
-        XSelectInput(data->display, w,
+        XSelectInput(display, w,
                      (FocusChangeMask | EnterWindowMask | LeaveWindowMask |
                       ExposureMask | ButtonPressMask | ButtonReleaseMask |
                       PointerMotionMask | KeyPressMask | KeyReleaseMask |
@@ -702,7 +737,7 @@
     }
 #else
     {
-        XSelectInput(data->display, w,
+        XSelectInput(display, w,
                      (FocusChangeMask | EnterWindowMask | LeaveWindowMask |
                       ExposureMask | ButtonPressMask | ButtonReleaseMask |
                       PointerMotionMask | KeyPressMask | KeyReleaseMask |
@@ -711,32 +746,6 @@
     }
 #endif
 
-#if SDL_VIDEO_DRIVER_X11_XINPUT
-    /* we're informing the display what extension events we want to receive from it */
-    {
-        int i, j, n = 0;
-        XEventClass xevents[256];
-
-        for (i = 0; i < SDL_GetNumMice(); ++i) {
-            SDL_Mouse *mouse;
-            X11_MouseData *data;
-
-            mouse = SDL_GetMouse(i);
-            data = (X11_MouseData *) mouse->driverdata;
-            if (!data) {
-                continue;
-            }
-
-            for (j = 0; j < data->num_xevents; ++j) {
-                xevents[n++] = data->xevents[j];
-            }
-        }
-        if (n > 0) {
-            XSelectExtensionEvent(data->display, w, xevents, n);
-        }
-    }
-#endif
-
     return 0;
 }
 
@@ -745,7 +754,7 @@
 {
     Window w = (Window) data;
 
-    /* FIXME: Query the title from the existing window */
+    window->title = X11_GetWindowTitle(_this, w);
 
     if (SetupWindowData(_this, window, w, SDL_FALSE) < 0) {
         return -1;
@@ -753,6 +762,36 @@
     return 0;
 }
 
+char *
+X11_GetWindowTitle(_THIS, Window xwindow)
+{
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    Display *display = data->display;
+    int status, real_format;
+    Atom real_type;
+    unsigned long items_read, items_left;
+    unsigned char *propdata;
+    char *title = NULL;
+
+    status = XGetWindowProperty(display, xwindow, data->_NET_WM_NAME,
+                0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format,
+                &items_read, &items_left, &propdata);
+    if (status == Success) {
+        title = SDL_strdup(SDL_static_cast(char*, propdata));
+        XFree(propdata);
+    } else {
+        status = XGetWindowProperty(display, xwindow, XA_WM_NAME,
+                    0L, 8192L, False, XA_STRING, &real_type, &real_format,
+                    &items_read, &items_left, &propdata);
+        if (status == Success) {
+            title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1);
+        } else {
+            title = SDL_strdup("");
+        }
+    }
+    return title;
+}
+
 void
 X11_SetWindowTitle(_THIS, SDL_Window * window)
 {
@@ -764,14 +803,8 @@
     const char *icon = NULL;
 
 #ifdef X_HAVE_UTF8_STRING
-    Atom _NET_WM_NAME = 0;
-    Atom _NET_WM_ICON_NAME = 0;
-
-    /* Look up some useful Atoms */
-    if (SDL_X11_HAVE_UTF8) {
-        _NET_WM_NAME = XInternAtom(display, "_NET_WM_NAME", False);
-        _NET_WM_ICON_NAME = XInternAtom(display, "_NET_WM_ICON_NAME", False);
-    }
+    Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME;
+    Atom _NET_WM_ICON_NAME = data->videodata->_NET_WM_ICON_NAME;
 #endif
 
     if (title != NULL) {
@@ -832,13 +865,13 @@
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     Display *display = data->videodata->display;
-    Atom _NET_WM_ICON = XInternAtom(display, "_NET_WM_ICON", False);
+    Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON;
 
     if (icon) {
         SDL_PixelFormat format;
         SDL_Surface *surface;
         int propsize;
-        Uint32 *propdata;
+        long *propdata;
 
         /* Convert the icon to ARGB for modern window managers */
         SDL_InitFormat(&format, 32, 0x00FF0000, 0x0000FF00, 0x000000FF,
@@ -850,12 +883,21 @@
 
         /* Set the _NET_WM_ICON property */
         propsize = 2 + (icon->w * icon->h);
-        propdata = SDL_malloc(propsize * sizeof(Uint32));
+        propdata = SDL_malloc(propsize * sizeof(long));
         if (propdata) {
+            int x, y;
+            Uint32 *src;
+            long *dst;
+
             propdata[0] = icon->w;
             propdata[1] = icon->h;
-            SDL_memcpy(&propdata[2], surface->pixels,
-                       surface->h * surface->pitch);
+            dst = &propdata[2];
+            for (y = 0; y < icon->h; ++y) {
+                src = (Uint32*)((Uint8*)surface->pixels + y * surface->pitch);
+                for (x = 0; x < icon->w; ++x) {
+                    *dst++ = *src++;
+                }
+            }
             XChangeProperty(display, data->xwindow, _NET_WM_ICON, XA_CARDINAL,
                             32, PropModeReplace, (unsigned char *) propdata,
                             propsize);
@@ -870,19 +912,21 @@
 X11_SetWindowPosition(_THIS, SDL_Window * window)
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) window->display->driverdata;
     Display *display = data->videodata->display;
+    SDL_bool oldstyle_fullscreen;
     int x, y;
 
-    if ((window->flags & SDL_WINDOW_FULLSCREEN)
+    /* ICCCM2.0-compliant window managers can handle fullscreen windows */
+    oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window);
+
+    if (oldstyle_fullscreen
         || window->x == SDL_WINDOWPOS_CENTERED) {
         X11_GetDisplaySize(_this, window, &x, NULL);
         x = (x - window->w) / 2;
     } else {
         x = window->x;
     }
-    if ((window->flags & SDL_WINDOW_FULLSCREEN)
+    if (oldstyle_fullscreen
         || window->y == SDL_WINDOWPOS_CENTERED) {
         X11_GetDisplaySize(_this, window, NULL, &y);
         y = (y - window->h) / 2;
@@ -937,26 +981,45 @@
     SDL_DisplayData *displaydata =
         (SDL_DisplayData *) window->display->driverdata;
     Display *display = data->videodata->display;
-    Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", False);
-    Atom _NET_WM_STATE_MAXIMIZED_VERT =
-        XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
-    Atom _NET_WM_STATE_MAXIMIZED_HORZ =
-        XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
-    XEvent e;
+    Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE;
+    Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
+    Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
+    Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN;
+
+    if (X11_IsWindowMapped(_this, window)) {
+        XEvent e;
+
+        SDL_zero(e);
+        e.xany.type = ClientMessage;
+        e.xclient.message_type = _NET_WM_STATE;
+        e.xclient.format = 32;
+        e.xclient.window = data->xwindow;
+        e.xclient.data.l[0] =
+            maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
+        e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT;
+        e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ;
+        e.xclient.data.l[3] = 0l;
 
-    e.xany.type = ClientMessage;
-    e.xany.window = data->xwindow;
-    e.xclient.message_type = _NET_WM_STATE;
-    e.xclient.format = 32;
-    e.xclient.data.l[0] =
-        maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
-    e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT;
-    e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ;
-    e.xclient.data.l[3] = 0l;
-    e.xclient.data.l[4] = 0l;
+        XSendEvent(display, RootWindow(display, displaydata->screen), 0,
+                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
+    } else {
+        int count = 0;
+        Atom atoms[3];
 
-    XSendEvent(display, RootWindow(display, displaydata->screen), 0,
-               SubstructureNotifyMask | SubstructureRedirectMask, &e);
+        if (window->flags & SDL_WINDOW_FULLSCREEN) {
+            atoms[count++] = _NET_WM_STATE_FULLSCREEN;
+        }
+        if (maximized) {
+            atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
+            atoms[count++] = _NET_WM_STATE_MAXIMIZED_HORZ;
+        }
+        if (count > 0) {
+            XChangeProperty(display, data->xwindow, _NET_WM_STATE, XA_ATOM, 32,
+                            PropModeReplace, (unsigned char *)atoms, count);
+        } else {
+            XDeleteProperty(display, data->xwindow, _NET_WM_STATE);
+        }
+    }
 }
 
 void
@@ -968,7 +1031,12 @@
 void
 X11_MinimizeWindow(_THIS, SDL_Window * window)
 {
-    X11_HideWindow(_this, window);
+    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+    SDL_DisplayData *displaydata =
+        (SDL_DisplayData *) window->display->driverdata;
+    Display *display = data->videodata->display;
+ 
+    XIconifyWindow(display, data->xwindow, displaydata->screen);
 }
 
 void
@@ -983,8 +1051,12 @@
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     Display *display = data->videodata->display;
+    SDL_bool oldstyle_fullscreen;
 
-    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
+    /* ICCCM2.0-compliant window managers can handle fullscreen windows */
+    oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window);
+
+    if (((window->flags & SDL_WINDOW_INPUT_GRABBED) || oldstyle_fullscreen)
         && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
         /* Try to grab the mouse */
         for (;;) {
@@ -1047,8 +1119,14 @@
 SDL_bool
 X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
 {
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        /* FIXME! */
+    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+    Display *display = data->videodata->display;
+
+    if (info->version.major == SDL_MAJOR_VERSION &&
+        info->version.minor == SDL_MINOR_VERSION) {
+        info->subsystem = SDL_SYSWM_X11;
+        info->info.x11.display = display;
+        info->info.x11.window = data->xwindow;
         return SDL_TRUE;
     } else {
         SDL_SetError("Application not compiled with SDL %d.%d\n",
--- a/src/video/x11/SDL_x11window.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/src/video/x11/SDL_x11window.h	Sun Aug 22 13:45:56 2010 -0700
@@ -35,6 +35,7 @@
 
 extern int X11_CreateWindow(_THIS, SDL_Window * window);
 extern int X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
+extern char *X11_GetWindowTitle(_THIS, Window xwindow);
 extern void X11_SetWindowTitle(_THIS, SDL_Window * window);
 extern void X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
 extern void X11_SetWindowPosition(_THIS, SDL_Window * window);
--- a/test/Makefile.in	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/Makefile.in	Sun Aug 22 13:45:56 2010 -0700
@@ -7,7 +7,7 @@
 CFLAGS  = @CFLAGS@
 LIBS	= @LIBS@
 
-TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testalpha$(EXE) testatomic$(EXE) testaudioinfo$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcursor$(EXE) testdraw2$(EXE) testdyngles$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testfill$(EXE) testgamma$(EXE) testgl2$(EXE) testgles$(EXE) testgl$(EXE) testhaptic$(EXE) testhread$(EXE) testiconv$(EXE) testime$(EXE) testintersections$(EXE) testjoystick$(EXE) testkeys$(EXE) testloadso$(EXE) testlock$(EXE) testmmousetablet$(EXE) testmultiaudio$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testpower$(EXE) testresample$(EXE) testsem$(EXE) testshape$(EXE) testsprite2$(EXE) testsprite$(EXE) testspriteminimal$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm2$(EXE) testwm$(EXE) threadwin$(EXE) torturethread$(EXE)
+TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testalpha$(EXE) testatomic$(EXE) testaudioinfo$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcursor$(EXE) testdraw2$(EXE) testdyngles$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testfill$(EXE) testgamma$(EXE) testgl2$(EXE) testgles$(EXE) testgl$(EXE) testhaptic$(EXE) testhread$(EXE) testiconv$(EXE) testime$(EXE) testintersections$(EXE) testjoystick$(EXE) testkeys$(EXE) testloadso$(EXE) testlock$(EXE) testmultiaudio$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testpower$(EXE) testresample$(EXE) testsem$(EXE) testshape$(EXE) testsprite2$(EXE) testsprite$(EXE) testspriteminimal$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm2$(EXE) testwm$(EXE) threadwin$(EXE) torturethread$(EXE) testgesture$(EXE)
 
 all: Makefile $(TARGETS)
 
@@ -152,10 +152,10 @@
 testhaptic$(EXE): $(srcdir)/testhaptic.c
 	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
 
-testmmousetablet$(EXE): $(srcdir)/testmmousetablet.c
+testatomic$(EXE): $(srcdir)/testatomic.c
 	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
 
-testatomic$(EXE): $(srcdir)/testatomic.c
+testgesture$(EXE): $(srcdir)/testgesture.c
 	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
  
 testime$(EXE): $(srcdir)/testime.c
--- a/test/automated/testsdl.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/automated/testsdl.c	Sun Aug 22 13:45:56 2010 -0700
@@ -133,7 +133,7 @@
 int main( int argc, char *argv[] )
 {
    int failed;
-   int rev;
+   const char *rev;
    SDL_version ver;
 
    /* Get options. */
@@ -145,7 +145,7 @@
    /* Print some text if verbose. */
    SDL_GetVersion( &ver );
    rev = SDL_GetRevision();
-   SDL_ATprintVerbose( 1, "Running tests with SDL %d.%d.%d revision %d\n",
+   SDL_ATprintVerbose( 1, "Running tests with SDL %d.%d.%d revision %s\n",
          ver.major, ver.minor, ver.patch, rev );
 
    /* Automatic tests. */
--- a/test/checkkeys.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/checkkeys.c	Sun Aug 22 13:45:56 2010 -0700
@@ -53,7 +53,7 @@
 }
 
 static void
-PrintKey(SDL_keysym * sym, int pressed)
+PrintKey(SDL_keysym * sym, SDL_bool pressed, SDL_bool repeat)
 {
     /* Print the keycode, name and state */
     if (sym->sym) {
@@ -87,6 +87,9 @@
         }
     }
     print_modifiers();
+    if (repeat) {
+        printf(" (repeat)");
+    }
     printf("\n");
 }
 
@@ -134,10 +137,8 @@
         SDL_WaitEvent(&event);
         switch (event.type) {
         case SDL_KEYDOWN:
-            PrintKey(&event.key.keysym, 1);
-            break;
         case SDL_KEYUP:
-            PrintKey(&event.key.keysym, 0);
+            PrintKey(&event.key.keysym, event.key.state, event.key.repeat);
             break;
         case SDL_TEXTINPUT:
             PrintText(event.text.text);
--- a/test/common.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/common.c	Sun Aug 22 13:45:56 2010 -0700
@@ -6,7 +6,7 @@
 #include "common.h"
 
 #define VIDEO_USAGE \
-"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display %d] [--fullscreen | --windows N] [--title title] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--double] [--triple]"
+"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display N] [--fullscreen | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--double] [--triple]"
 
 #define AUDIO_USAGE \
 "[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]"
@@ -192,6 +192,14 @@
         state->window_title = argv[index];
         return 2;
     }
+    if (SDL_strcasecmp(argv[index], "--icon") == 0) {
+        ++index;
+        if (!argv[index]) {
+            return -1;
+        }
+        state->window_icon = argv[index];
+        return 2;
+    }
     if (SDL_strcasecmp(argv[index], "--center") == 0) {
         state->window_x = SDL_WINDOWPOS_CENTERED;
         state->window_y = SDL_WINDOWPOS_CENTERED;
@@ -478,6 +486,9 @@
     case SDL_PIXELFORMAT_RGB555:
         fprintf(stderr, "RGB555");
         break;
+    case SDL_PIXELFORMAT_BGR555:
+        fprintf(stderr, "BGR555");
+        break;
     case SDL_PIXELFORMAT_ARGB4444:
         fprintf(stderr, "ARGB4444");
         break;
@@ -611,6 +622,30 @@
     }
 }
 
+static SDL_Surface *
+LoadIcon(const char *file)
+{
+    SDL_Surface *icon;
+
+    /* Load the icon surface */
+    icon = SDL_LoadBMP(file);
+    if (icon == NULL) {
+        fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
+        return (NULL);
+    }
+
+    if (icon->format->palette == NULL) {
+        fprintf(stderr, "Icon must have a palette!\n");
+        SDL_FreeSurface(icon);
+        return (NULL);
+    }
+
+    /* Set the colorkey */
+    SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
+
+    return (icon);
+}
+
 SDL_bool
 CommonInit(CommonState * state)
 {
@@ -791,6 +826,15 @@
                         SDL_GetError());
                 return SDL_FALSE;
             }
+
+            if (state->window_icon) {
+                SDL_Surface *icon = LoadIcon(state->window_icon);
+                if (icon) {
+                    SDL_SetWindowIcon(state->windows[i], icon);
+                    SDL_FreeSurface(icon);
+                }
+            }
+
             SDL_ShowWindow(state->windows[i]);
 
             if (!state->skip_renderer
@@ -929,45 +973,44 @@
         break;
     case SDL_KEYDOWN:
         fprintf(stderr,
-                "Keyboard %d: key pressed  in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
-                event->key.which, event->key.windowID,
+                "Keyboard: key pressed  in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
+                event->key.windowID,
                 event->key.keysym.scancode,
                 SDL_GetScancodeName(event->key.keysym.scancode),
                 event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym));
         break;
     case SDL_KEYUP:
         fprintf(stderr,
-                "Keyboard %d: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
-                event->key.which, event->key.windowID,
+                "Keyboard: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
+                event->key.windowID,
                 event->key.keysym.scancode,
                 SDL_GetScancodeName(event->key.keysym.scancode),
                 event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym));
         break;
     case SDL_TEXTINPUT:
-        fprintf(stderr, "Keyboard %d: text input \"%s\" in window %d",
-                event->text.which, event->text.text, event->text.windowID);
+        fprintf(stderr, "Keyboard: text input \"%s\" in window %d",
+                event->text.text, event->text.windowID);
         break;
     case SDL_MOUSEMOTION:
-        fprintf(stderr, "Mouse %d: moved to %d,%d (%d,%d) in window %d",
-                event->motion.which, event->motion.x, event->motion.y,
+        fprintf(stderr, "Mouse: moved to %d,%d (%d,%d) in window %d",
+                event->motion.x, event->motion.y,
                 event->motion.xrel, event->motion.yrel,
                 event->motion.windowID);
         break;
     case SDL_MOUSEBUTTONDOWN:
-        fprintf(stderr, "Mouse %d: button %d pressed at %d,%d in window %d",
-                event->button.which, event->button.button, event->button.x,
-                event->button.y, event->button.windowID);
+        fprintf(stderr, "Mouse: button %d pressed at %d,%d in window %d",
+                event->button.button, event->button.x, event->button.y,
+                event->button.windowID);
         break;
     case SDL_MOUSEBUTTONUP:
-        fprintf(stderr, "Mouse %d: button %d released at %d,%d in window %d",
-                event->button.which, event->button.button, event->button.x,
-                event->button.y, event->button.windowID);
+        fprintf(stderr, "Mouse: button %d released at %d,%d in window %d",
+                event->button.button, event->button.x, event->button.y,
+                event->button.windowID);
         break;
     case SDL_MOUSEWHEEL:
         fprintf(stderr,
-                "Mouse %d: wheel scrolled %d in x and %d in y in window %d",
-                event->wheel.which, event->wheel.x, event->wheel.y,
-                event->wheel.windowID);
+                "Mouse: wheel scrolled %d in x and %d in y in window %d",
+                event->wheel.x, event->wheel.y, event->wheel.windowID);
         break;
     case SDL_JOYBALLMOTION:
         fprintf(stderr, "Joystick %d: ball %d moved by %d,%d",
@@ -1018,6 +1061,9 @@
         fprintf(stderr, "Joystick %d: button %d released",
                 event->jbutton.which, event->jbutton.button);
         break;
+    case SDL_CLIPBOARDUPDATE:
+        fprintf(stderr, "Clipboard updated");
+        break;
     case SDL_QUIT:
         fprintf(stderr, "Quit requested");
         break;
@@ -1051,11 +1097,43 @@
     case SDL_KEYDOWN:
         switch (event->key.keysym.sym) {
             /* Add hotkeys here */
+        case SDLK_c:
+            if (event->key.keysym.mod & KMOD_CTRL) {
+                /* Ctrl-C copy awesome text! */
+                SDL_SetClipboardText("SDL rocks!\nYou know it!");
+                printf("Copied text to clipboard\n");
+            }
+            break;
+        case SDLK_v:
+            if (event->key.keysym.mod & KMOD_CTRL) {
+                /* Ctrl-V paste awesome text! */
+                char *text = SDL_GetClipboardText();
+                if (*text) {
+                    printf("Clipboard: %s\n", text);
+                } else {
+                    printf("Clipboard is empty\n");
+                }
+                SDL_free(text);
+            }
+            break;
         case SDLK_g:
             if (event->key.keysym.mod & KMOD_CTRL) {
                 /* Ctrl-G toggle grab */
             }
             break;
+        case SDLK_m:
+            if (event->key.keysym.mod & KMOD_CTRL) {
+                /* Ctrl-M maximize */
+                /* FIXME: Which window has focus for this keyboard? */
+                for (i = 0; i < state->num_windows; ++i) {
+                    if (SDL_GetWindowFlags(state->windows[i]) & SDL_WINDOW_MAXIMIZED) {
+                        SDL_RestoreWindow(state->windows[i]);
+                    } else {
+                        SDL_MaximizeWindow(state->windows[i]);
+                    }
+                }
+            }
+            break;
         case SDLK_z:
             if (event->key.keysym.mod & KMOD_CTRL) {
                 /* Ctrl-Z minimize */
--- a/test/common.h	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/common.h	Sun Aug 22 13:45:56 2010 -0700
@@ -24,6 +24,7 @@
     const char *videodriver;
     int display;
     const char *window_title;
+    const char *window_icon;
     Uint32 window_flags;
     int window_x;
     int window_y;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testgesture.c	Sun Aug 22 13:45:56 2010 -0700
@@ -0,0 +1,297 @@
+/*  Usage:
+ *  Spacebar to begin recording a gesture on all touches.
+ *  s to save all touches into "./gestureSave"
+ *  l to load all touches from "./gestureSave"
+ */
+
+#include <stdio.h>
+#include <SDL.h>
+#include <math.h>
+#include <SDL_touch.h>
+#include <SDL_gesture.h>
+
+
+/* Make sure we have good macros for printing 32 and 64 bit values */
+#ifndef PRIs32
+#define PRIs32 "d"
+#endif
+#ifndef PRIu32
+#define PRIu32 "u"
+#endif
+#ifndef PRIs64
+#ifdef __WIN32__
+#define PRIs64 "I64"
+#else
+#define PRIs64 "lld"
+#endif
+#endif
+#ifndef PRIu64
+#ifdef __WIN32__
+#define PRIu64 "I64u"
+#else
+#define PRIu64 "llu"
+#endif
+#endif
+
+#define WIDTH 640
+#define HEIGHT 480
+#define BPP 4
+#define DEPTH 32
+
+//MUST BE A POWER OF 2!
+#define EVENT_BUF_SIZE 256
+
+
+#define VERBOSE SDL_FALSE
+
+SDL_Event events[EVENT_BUF_SIZE];
+int eventWrite;
+
+int colors[7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF};
+
+typedef struct {
+  float x,y;
+} Point;
+
+typedef struct {
+  float ang,r;
+  Point p;
+} Knob;
+
+Knob knob;
+
+void handler (int sig)
+{
+  printf ("\exiting...(%d)\n", sig);
+  exit (0);
+}
+
+void perror_exit (char *error)
+{
+  perror (error);
+  handler (9);
+}
+
+void setpix(SDL_Surface *screen, int x, int y, unsigned int col)
+{
+  Uint32 *pixmem32;
+  Uint32 colour;
+  
+  if((unsigned)x > screen->w) return;
+  if((unsigned)y > screen->h) return;
+
+  pixmem32 = (Uint32*) screen->pixels  + y*screen->pitch/BPP + x;
+  
+  Uint8 r,g,b;
+  float a;
+  
+  memcpy(&colour,pixmem32,screen->format->BytesPerPixel);
+
+  SDL_GetRGB(colour,screen->format,&r,&g,&b);
+  //r = 0;g = 0; b = 0;
+  a = (col>>24)&0xFF;
+  if(a == 0) a = 0xFF; //Hack, to make things easier.
+  a /= 0xFF;
+  r = r*(1-a) + ((col>>16)&0xFF)*(a);
+  g = g*(1-a) + ((col>> 8)&0xFF)*(a);
+  b = b*(1-a) + ((col>> 0)&0xFF)*(a);
+  colour = SDL_MapRGB( screen->format,r, g, b);
+  
+
+  *pixmem32 = colour;
+}
+
+void drawLine(SDL_Surface *screen,int x0,int y0,int x1,int y1,unsigned int col) {
+  float t;
+  for(t=0;t<1;t+=1.f/SDL_max(abs(x0-x1),abs(y0-y1)))
+    setpix(screen,x1+t*(x0-x1),y1+t*(y0-y1),col);
+}
+
+void drawCircle(SDL_Surface* screen,int x,int y,int r,unsigned int c)
+{
+  int tx,ty;
+  float xr;
+  for(ty = -abs(r);ty <= abs(r);ty++) {
+    xr = sqrt(r*r - ty*ty);
+    if(r > 0) { //r > 0 ==> filled circle
+      for(tx=-xr+.5;tx<=xr-.5;tx++) {
+	setpix(screen,x+tx,y+ty,c);
+      }
+    }
+    else {
+      setpix(screen,x-xr+.5,y+ty,c);
+      setpix(screen,x+xr-.5,y+ty,c);
+    }
+  }
+}
+
+void drawKnob(SDL_Surface* screen,Knob k) {
+  drawCircle(screen,k.p.x*screen->w,k.p.y*screen->h,k.r*screen->w,0xFFFFFF);  
+  drawCircle(screen,(k.p.x+k.r/2*cos(k.ang))*screen->w,
+  	            (k.p.y+k.r/2*sin(k.ang))*screen->h,k.r/4*screen->w,0);
+}
+
+void DrawScreen(SDL_Surface* screen)
+{
+  int x, y;
+  if(SDL_MUSTLOCK(screen))
+    {                                              
+      if(SDL_LockSurface(screen) < 0) return;
+    }
+  for(y = 0;y < screen->h;y++)
+    for(x = 0;x < screen->w;x++)
+	setpix(screen,x,y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255);
+
+  int i;
+  //draw Touch History
+  for(i = SDL_max(0,eventWrite - EVENT_BUF_SIZE);i < eventWrite;i++) {
+    SDL_Event event = events[i&(EVENT_BUF_SIZE-1)];
+    int age = eventWrite - i - 1;
+    if(event.type == SDL_FINGERMOTION || 
+       event.type == SDL_FINGERDOWN ||
+       event.type == SDL_FINGERUP) {
+      SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
+      if(inTouch == NULL) continue;
+
+      float x = ((float)event.tfinger.x)/inTouch->xres;
+      float y = ((float)event.tfinger.y)/inTouch->yres;      
+      
+      //draw the touch:      
+      unsigned int c = colors[event.tfinger.touchId%7]; 
+      unsigned int col = 
+	((unsigned int)(c*(.1+.85))) |
+	((unsigned int)((0xFF*(1-((float)age)/EVENT_BUF_SIZE))) & 0xFF)<<24;
+
+      if(event.type == SDL_FINGERMOTION)
+	drawCircle(screen,x*screen->w,y*screen->h,5,col);
+      else if(event.type == SDL_FINGERDOWN)
+	drawCircle(screen,x*screen->w,y*screen->h,-10,col);     
+    }
+  }
+  
+  if(knob.p.x > 0)
+    drawKnob(screen,knob);
+  
+  if(SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);
+  SDL_Flip(screen);
+}
+
+SDL_Surface* initScreen(int width,int height)
+{
+  return SDL_SetVideoMode(width, height, DEPTH,
+			  SDL_HWSURFACE | SDL_RESIZABLE);
+}
+
+int main(int argc, char* argv[])
+{  
+  SDL_Surface *screen;
+  SDL_Event event;
+
+  //gesture variables
+  knob.r = .1;
+  knob.ang = 0;
+
+  
+  SDL_bool quitting = SDL_FALSE;
+  SDL_RWops *src;
+
+  if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
+  
+  if (!(screen = initScreen(WIDTH,HEIGHT)))
+    {
+      SDL_Quit();
+      return 1;
+    }
+
+  while(!quitting) {
+    while(SDL_PollEvent(&event)) 
+      {
+	//Record _all_ events
+	events[eventWrite & (EVENT_BUF_SIZE-1)] = event;
+	eventWrite++;
+	
+	switch (event.type) 
+	  {
+	  case SDL_QUIT:
+	    quitting = SDL_TRUE;
+	    break;
+	  case SDL_KEYDOWN:
+	    switch (event.key.keysym.sym)
+	      {
+	      case SDLK_SPACE:
+		SDL_RecordGesture(-1);
+		break;
+	      case SDLK_s:
+		src = SDL_RWFromFile("gestureSave","w");
+		printf("Wrote %i templates\n",SDL_SaveAllDollarTemplates(src));
+		SDL_RWclose(src);
+		break;
+	      case SDLK_l:
+		src = SDL_RWFromFile("gestureSave","r");
+		printf("Loaded: %i\n",SDL_LoadDollarTemplates(-1,src));
+		SDL_RWclose(src);
+		break;
+	      case SDLK_ESCAPE:
+		quitting = SDL_TRUE;
+		break;
+	    }
+	    break;
+	  case SDL_VIDEORESIZE:
+	    if (!(screen = initScreen(event.resize.w,
+				      event.resize.h)))
+	      {
+		SDL_Quit();
+		return 1;
+	      }
+	    break;
+	  case SDL_FINGERMOTION:    
+	    ;
+#if VERBOSE
+	    printf("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId,
+	    	   event.tfinger.x,event.tfinger.y);
+#endif
+	    SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
+	    SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
+	    break;	    
+	  case SDL_FINGERDOWN:
+#if VERBOSE
+	    printf("Finger: %"PRIs64" down - x: %i, y: %i\n",
+		   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
+#endif
+	    break;
+	  case SDL_FINGERUP:
+#if VERBOSE
+	    printf("Finger: %"PRIs64" up - x: %i, y: %i\n",
+	    	   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
+#endif
+	    break;
+	  case SDL_MULTIGESTURE:
+#if VERBOSE	    
+	    printf("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f\n",
+		   event.mgesture.x,
+		   event.mgesture.y,
+		   event.mgesture.dTheta,
+		   event.mgesture.dDist);
+	    printf("MG: numDownTouch = %i\n",event.mgesture.numFingers);
+#endif
+	    knob.p.x = event.mgesture.x;
+	    knob.p.y = event.mgesture.y;
+	    knob.ang += event.mgesture.dTheta;
+	    knob.r += event.mgesture.dDist;
+	    break;
+	  case SDL_DOLLARGESTURE:
+	    printf("Gesture %"PRIs64" performed, error: %f\n",
+		   event.dgesture.gestureId,
+		   event.dgesture.error);
+	    break;
+	  case SDL_DOLLARRECORD:
+	    printf("Recorded gesture: %"PRIs64"\n",event.dgesture.gestureId);
+	    break;
+	  }
+      }
+    DrawScreen(screen);
+  }  
+  SDL_Quit();  
+  return 0;
+}
+
--- a/test/testime.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/testime.c	Sun Aug 22 13:45:56 2010 -0700
@@ -25,7 +25,49 @@
 SDL_Rect textRect, markedRect;
 Uint32 lineColor, backColor;
 SDL_Color textColor = { 0, 0, 0 };
-char text[MAX_TEXT_LENGTH], *markedText;
+char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
+int cursor = 0;
+
+size_t utf8_length(unsigned char c)
+{
+    c = (unsigned char)(0xff & c);
+    if (c < 0x80)
+        return 1;
+    else if ((c >> 5) ==0x6)
+        return 2;
+    else if ((c >> 4) == 0xe)
+        return 3;
+    else if ((c >> 3) == 0x1e)
+        return 4;
+    else
+        return 0;
+}
+
+char *utf8_next(char *p)
+{
+    size_t len = utf8_length(*p);
+    size_t i = 0;
+    if (!len)
+        return 0;
+
+    for (; i < len; ++i)
+    {
+        ++p;
+        if (!*p)
+            return 0;
+    }
+    return p;
+}
+
+char *utf8_advance(char *p, size_t distance)
+{
+    size_t i = 0;
+    for (; i < distance && p; ++i)
+    {
+        p = utf8_next(p);
+    }
+    return p;
+}
 
 void usage()
 {
@@ -124,7 +166,7 @@
 
     text[0] = 0;
     markedRect = textRect;
-    markedText = NULL;
+    markedText[0] = 0;
 
     SDL_StartTextInput();
 }
@@ -136,11 +178,13 @@
                         int x, int y,
                         SDL_Color color)
 {
-    SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color);
-    SDL_Rect dest = { x, y, textSur->w, textSur->h };
+    if (text && *text) {
+        SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color);
+        SDL_Rect dest = { x, y, textSur->w, textSur->h };
 
-    SDL_BlitSurface(textSur, NULL, sur, &dest);
-    SDL_FreeSurface(textSur);
+        SDL_BlitSurface(textSur, NULL, sur, &dest);
+        SDL_FreeSurface(textSur);
+    }
 }
 #endif
 
@@ -152,7 +196,7 @@
     SDL_FillRect(screen, &textRect, backColor);
 
 #ifdef HAVE_SDL_TTF
-    if (strlen(text))
+    if (*text)
     {
         RenderText(screen, font, text, textRect.x, textRect.y, textColor);
         TTF_SizeUTF8(font, text, &w, &h);
@@ -178,9 +222,22 @@
     cursorRect.h = h;
 
     SDL_FillRect(screen, &markedRect, backColor);
-    if (markedText)
+    if (markedText[0])
     {
 #ifdef HAVE_SDL_TTF
+        if (cursor)
+        {
+            char *p = utf8_advance(markedText, cursor);
+            char c = 0;
+            if (!p)
+                p = &markedText[strlen(markedText)];
+
+            c = *p;
+            *p = 0;
+            TTF_SizeUTF8(font, markedText, &w, 0);
+            cursorRect.x += w;
+            *p = c;
+        }
         RenderText(screen, font, markedText, markedRect.x, markedRect.y, textColor);
         TTF_SizeUTF8(font, markedText, &w, &h);
 #endif
@@ -190,8 +247,6 @@
         underlineRect.h = 2;
         underlineRect.w = w;
 
-        cursorRect.x += w + 1;
-
         SDL_FillRect(screen, &underlineRect, lineColor);
     }
 
@@ -279,8 +334,8 @@
             }
 
             fprintf(stderr,
-                    "Keyboard %d: scancode 0x%08X = %s, keycode 0x%08X = %s\n",
-                    event.key.which, event.key.keysym.scancode,
+                    "Keyboard: scancode 0x%08X = %s, keycode 0x%08X = %s\n",
+                    event.key.keysym.scancode,
                     SDL_GetScancodeName(event.key.keysym.scancode),
                     event.key.keysym.sym, SDL_GetKeyName(event.key.keysym.sym));
             break;
@@ -290,17 +345,16 @@
                 markedRect.w < 0)
                 break;
 
-            fprintf(stderr, "Keyboard %d: text input \"%s\"\n",
-                    event.text.which, event.text.text);
+            fprintf(stderr, "Keyboard: text input \"%s\"\n", event.text.text);
 
             if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text))
-                strcpy(text + SDL_strlen(text), event.text.text);
+                SDL_strlcat(text, event.text.text, sizeof(text));
 
             fprintf(stderr, "text inputed: %s\n", text);
 
             // After text inputed, we can clear up markedText because it
             // is committed
-            markedText = NULL;
+            markedText[0] = 0;
             Redraw();
             break;
 
@@ -308,7 +362,8 @@
             fprintf(stderr, "text editing \"%s\", selected range (%d, %d)\n",
                     event.edit.text, event.edit.start, event.edit.length);
 
-            markedText = event.edit.text;
+            strcpy(markedText, event.edit.text);
+            cursor = event.edit.start;
             Redraw();
             break;
 
--- a/test/testintersections.c	Sun Aug 22 12:43:27 2010 -0700
+++ b/test/testintersections.c	Sun Aug 22 13:45:56 2010 -0700
@@ -288,20 +288,16 @@
             CommonEvent(state, &event, &done);
             switch (event.type) {
             case SDL_MOUSEBUTTONDOWN:
-                if (event.button.which == 0) {
-                    mouse_begin_x = event.button.x;
-                    mouse_begin_y = event.button.y;
-                }
+                mouse_begin_x = event.button.x;
+                mouse_begin_y = event.button.y;
                 break;
             case SDL_MOUSEBUTTONUP:
-                if (event.button.which == 0) {
-                    if (event.button.button == 3)
-                        add_line(mouse_begin_x, mouse_begin_y, event.button.x,
-                                 event.button.y);
-                    if (event.button.button == 1)
-                        add_rect(mouse_begin_x, mouse_begin_y, event.button.x,
-                                 event.button.y);
-                }
+                if (event.button.button == 3)
+                    add_line(mouse_begin_x, mouse_begin_y, event.button.x,
+                             event.button.y);
+                if (event.button.button == 1)
+                    add_rect(mouse_begin_x, mouse_begin_y, event.button.x,
+                             event.button.y);
                 break;
             case SDL_KEYDOWN:
                 switch (event.key.keysym.sym) {
--- a/test/testmmousetablet.c	Sun Aug 22 12:43:27 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#include <stdio.h>
-#include "SDL.h"
-
-SDL_Surface *screen;
-int quit = 0;
-
-int
-main(int argc, char *argv[])
-{
-    SDL_Event event;
-    int mice;
-    int i;
-    printf("Initing...\n");
-    if (SDL_Init(0) != 0) {
-        return 1;
-    }
-    if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
-        return 1;
-    } else {
-        screen = SDL_SetVideoMode(640, 480, 32, SDL_DOUBLEBUF);
-    }
-    mice = SDL_GetNumMice();
-    printf("%d pointing devices found\n", mice);
-    for (i = 0; i < mice; ++i) {
-        printf("device index: %d name:%s\n", i, SDL_GetMouseName(i));
-    }
-    while (quit != 1) {
-        if (SDL_PollEvent(&event) == 0) {
-        } else {
-            switch (event.type) {
-            case SDL_MOUSEMOTION:
-                printf
-                    ("Device id: %d x: %d y: %d relx: %d rely: %d pressure: %d\n \
-					pressure_max: %d pressure_min: %d current cursor:%d\n",
-                     event.motion.which, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel,
-                     event.motion.pressure, event.motion.pressure_max, event.motion.pressure_min,
-                     event.motion.cursor);
-                break;
-            case SDL_PROXIMITYIN:
-                printf("proximity in id: %d x: %d y: %d\n",
-                       (int) event.proximity.which, event.proximity.x,
-                       event.proximity.y);
-                break;
-            case SDL_PROXIMITYOUT:
-                printf("proximity out id: %d x: %d y: %d\n",
-                       (int) event.proximity.which, event.proximity.x,
-                       event.proximity.y);
-                break;
-            case SDL_MOUSEBUTTONDOWN:
-                printf("mouse button down id: %d button:%d\n",
-                       event.button.which, event.button.button);
-                break;
-            case SDL_MOUSEBUTTONUP:
-                printf("mouse button up id: %d button: %d\n",
-                       event.button.which, event.button.button);
-                break;
-            case SDL_QUIT:
-                printf("Quitting\n");
-                SDL_QuitSubSystem(SDL_INIT_VIDEO);
-                SDL_Quit();
-                quit = 1;
-                break;
-            }
-        }
-    }
-    return 0;
-}