changeset 4618:844b5ef4b149

Merged Sunny's XRender changes from SDL-gsoc2010_xrender
author Sam Lantinga <slouken@libsdl.org>
date Wed, 28 Jul 2010 00:54:23 -0700 (2010-07-28)
parents e1664f94f026 (diff) cfbb1ff4b8ec (current diff)
children b9a205e6369f
files configure.in include/SDL_video.h src/SDL_error.c src/video/x11/SDL_x11modes.c src/video/x11/SDL_x11render.c src/video/x11/SDL_x11sym.h src/video/x11/SDL_x11video.h src/video/x11/SDL_x11window.c
diffstat 206 files changed, 14543 insertions(+), 10268 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Jul 28 13:08:14 2010 +0530
+++ b/.hgignore	Wed Jul 28 00:54:23 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
--- a/Makefile.in	Wed Jul 28 13:08:14 2010 +0530
+++ b/Makefile.in	Wed Jul 28 00:54:23 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_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_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_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
 
 LT_AGE      = @LT_AGE@
 LT_CURRENT  = @LT_CURRENT@
--- a/Makefile.pandora	Wed Jul 28 13:08:14 2010 +0530
+++ b/Makefile.pandora	Wed Jul 28 00:54:23 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/VisualC/SDL.sln	Wed Jul 28 13:08:14 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C++ Express 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.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/SDL.vcproj	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 2010 -0700
@@ -0,0 +1,1058 @@
+<?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_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
+			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	Wed Jul 28 13:08:14 2010 +0530
+++ b/VisualC/SDL/SDL_VS2008.vcproj	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/VisualC/SDL_VS2008.sln	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 2010 -0700
@@ -0,0 +1,245 @@
+<?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>
--- a/VisualC/SDLmain/SDLmain_VS2008.vcproj	Wed Jul 28 13:08:14 2010 +0530
+++ b/VisualC/SDLmain/SDLmain_VS2008.vcproj	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj	Wed Jul 28 00:54:23 2010 -0700
@@ -105,6 +105,13 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
+		04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = FD1B48920E313154007AB34E /* SDLiPhoneOS.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 006E982211955059001DE610 /* testsdl.app */;
+			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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/Demos/src/fireworks.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/Demos/src/mixer.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/Demos/src/touch.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Wed Jul 28 00:54:23 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 */; };
@@ -308,11 +313,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>"; };
@@ -826,19 +836,23 @@
 		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 */,
 				04461DED0EA76BA3006C462D /* SDL_haptic.h */,
+				044E5FB411E6069F0076F181 /* SDL_input.h */,
 				FD99B8DE0DD52EB400FB1D6B /* SDL_joystick.h */,
 				FD99B8DF0DD52EB400FB1D6B /* SDL_keyboard.h */,
 				FD99B8E00DD52EB400FB1D6B /* SDL_keysym.h */,
@@ -865,8 +879,6 @@
 				FD99B8F20DD52EB400FB1D6B /* SDL_types.h */,
 				FD99B8F30DD52EB400FB1D6B /* SDL_version.h */,
 				FD99B8F40DD52EB400FB1D6B /* SDL_video.h */,
-				FD99B8F50DD52EB400FB1D6B /* SDL.h */,
-				FD99B8F60DD52EB400FB1D6B /* SDL_endian.h */,
 			);
 			name = "Public Headers";
 			sourceTree = "<group>";
@@ -950,6 +962,8 @@
 				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 +1037,7 @@
 		FDA682420DF2374D00F98A1A /* video */ = {
 			isa = PBXGroup;
 			children = (
+				044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
 				FD689F090E26E5D900F90B21 /* uikit */,
 				FDA685F40DF244C800F98A1A /* dummy */,
 				0495E6850E97408800152DFE /* SDL_glfuncs.h */,
@@ -1173,6 +1188,9 @@
 				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 */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1411,6 +1429,8 @@
 				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 */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
--- a/Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Wed Jul 28 00:54:23 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,9 +464,17 @@
 		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 */; };
 		BECDF62E0761BA81005FE872 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538330006D78D67F000001 /* SDL_audio.c */; };
 		BECDF62F0761BA81005FE872 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538331006D78D67F000001 /* SDL_audiocvt.c */; };
@@ -795,10 +821,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>"; };
@@ -1033,6 +1072,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 */,
@@ -1312,6 +1353,14 @@
 		01538367006D79147F000001 /* events */ = {
 			isa = PBXGroup;
 			children = (
+				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 */,
@@ -1380,6 +1429,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 */,
@@ -1420,12 +1470,13 @@
 		0153844A006D81B07F000001 /* Public Headers */ = {
 			isa = PBXGroup;
 			children = (
-				04F2AF681104AC4500D6DDF7 /* SDL_assert.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 */,
@@ -1435,6 +1486,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 */,
@@ -1743,6 +1795,16 @@
 				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 */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1843,6 +1905,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;
 		};
@@ -2035,7 +2107,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;
@@ -2202,6 +2274,9 @@
 				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 */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2318,6 +2393,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	Wed Jul 28 00:54:23 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>
--- a/configure.in	Wed Jul 28 13:08:14 2010 +0530
+++ b/configure.in	Wed Jul 28 00:54:23 2010 -0700
@@ -1057,7 +1057,7 @@
                     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
 
             if test x$ac_cv_func_shmat != xyes; then
@@ -1267,7 +1267,7 @@
             if test x$enable_render_x11 = xyes; then
                 AC_DEFINE(SDL_VIDEO_RENDER_X11)
             fi
-       fi
+        fi
     fi
 }
 
@@ -1978,7 +1978,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
     ],[
@@ -2449,6 +2449,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)
@@ -2472,16 +2478,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL.h	Wed Jul 28 00:54:23 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"
--- a/include/SDL_atomic.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_atomic.h	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_compat.h	Wed Jul 28 00:54:23 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_iphoneos.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_config_iphoneos.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_config_pandora.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_endian.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_events.h	Wed Jul 28 00:54:23 2010 -0700
@@ -75,9 +75,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,6 +90,9 @@
     SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
     SDL_JOYBUTTONUP,            /**< Joystick button released */
 
+    /* Clipboard events */
+    SDL_CLIPBOARDUPDATE = 0x700, /**< The clipboard changed */
+
     /* Obsolete events */
     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
     SDL_EVENT_COMPAT2,
@@ -124,10 +131,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 +146,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 +160,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 +170,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 +187,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 +202,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
@@ -371,7 +345,6 @@
     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 */
 
     /** Temporarily here for backwards compatibility */
     /*@{*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_input.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_keyboard.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_mouse.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_mutex.h	Wed Jul 28 00:54:23 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_pixels.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_pixels.h	Wed Jul 28 00:54:23 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_stdinc.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_stdinc.h	Wed Jul 28 00:54:23 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
  */
--- a/include/SDL_syswm.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_syswm.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_thread.h	Wed Jul 28 00:54:23 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
--- a/include/SDL_video.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/include/SDL_video.h	Wed Jul 28 00:54:23 2010 -0700
@@ -88,7 +88,6 @@
  *  \sa SDL_SetWindowTitle()
  *  \sa SDL_ShowWindow()
  */
-struct SDL_Window;
 typedef struct SDL_Window SDL_Window;
 
 /**
--- a/src/SDL.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/SDL.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/SDL_assert.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/SDL_compat.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/SDL_error.c	Wed Jul 28 00:54:23 2010 -0700
@@ -26,6 +26,8 @@
 #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? */
@@ -38,8 +40,6 @@
 
 #define SDL_ERRBUFIZE	1024
 
-//#define DEBUG_ERROR
-
 /* Private functions */
 
 static const char *
@@ -118,7 +118,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/SDL_error_c.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/audio/SDL_audio.c	Wed Jul 28 00:54:23 2010 -0700
@@ -73,15 +73,15 @@
 
 /* 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,
@@ -257,7 +257,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 +269,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 +280,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 +306,10 @@
 
     return 0;
 }
+#endif
 
 /* Deinitialize the stream simply by freeing the buffer */
-void
+static void
 SDL_StreamDeinit(SDL_AudioStreamer * stream)
 {
     if (stream->buffer != NULL) {
--- a/src/audio/SDL_audiodev.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/audio/SDL_audiodev.c	Wed Jul 28 00:54:23 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"
--- a/src/audio/windx5/directx.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/audio/windx5/directx.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/cpuinfo/SDL_cpuinfo.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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_keyboard.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/SDL_keyboard.c	Wed Jul 28 00:54:23 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,7 +778,6 @@
         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));
         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
         posted = (SDL_PushEvent(&event) > 0);
@@ -844,22 +786,17 @@
 }
 
 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));
@@ -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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/SDL_keyboard_c.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/SDL_mouse.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/SDL_mouse_c.h	Wed Jul 28 00:54:23 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: */
--- a/src/events/scancodes_win32.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/scancodes_win32.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/events/scancodes_xfree86.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/file/cocoa/SDL_rwopsbundlesupport.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/haptic/SDL_haptic.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/haptic/linux/SDL_syshaptic.c	Wed Jul 28 00:54:23 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/joystick/SDL_joystick_c.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/joystick/SDL_joystick_c.h	Wed Jul 28 00:54:23 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);
--- a/src/joystick/bsd/SDL_sysjoystick.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Wed Jul 28 00:54:23 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/main/dummy/SDL_dummy_main.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/main/dummy/SDL_dummy_main.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/main/win32/SDL_win32_main.c	Wed Jul 28 00:54:23 2010 -0700
@@ -71,6 +71,7 @@
                 ++argc;
             }
             /* Skip over word */
+            lastp = bufp;
             while (*bufp && (*bufp != '"' || *lastp == '\\')) {
                 lastp = bufp;
                 ++bufp;
--- a/src/thread/SDL_thread.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/thread/SDL_thread.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/thread/win32/SDL_syssem.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/timer/SDL_systimer.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/timer/unix/SDL_systimer.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_blit_slow.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_renderer_gles.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_renderer_sw.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_stretch.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_surface.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_sysvideo.h	Wed Jul 28 00:54:23 2010 -0700
@@ -303,6 +303,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;
@@ -312,6 +317,7 @@
     Uint8 window_magic;
     Uint8 texture_magic;
     Uint32 next_object_id;
+    char * clipboard_text;
 
     /* * * */
     /* Data used by the GL drivers */
@@ -381,9 +387,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
@@ -418,7 +421,7 @@
 #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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/SDL_video.c	Wed Jul 28 00:54:23 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
@@ -304,7 +301,7 @@
 }
 
 SDL_VideoDevice *
-SDL_GetVideoDevice()
+SDL_GetVideoDevice(void)
 {
     return _this;
 }
@@ -718,16 +715,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 +2830,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 +3268,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/cocoa/SDL_cocoaclipboard.h	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoaevents.m	Wed Jul 28 00:54:23 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_cocoakeyboard.m	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoakeyboard.m	Wed Jul 28 00:54:23 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,
@@ -204,7 +197,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 +219,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 +237,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 +251,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 +261,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 +278,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 +289,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 +306,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 +319,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 +333,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 +351,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 +362,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 +373,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 +382,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 +399,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 +424,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 +437,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 +445,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 +466,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 +538,7 @@
                 keymap[scancode] = s[0];
             }
         }
-        SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
         return;
     }
 
@@ -603,7 +592,7 @@
                 keymap[scancode] = c;
             }
         }
-        SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
         return;
     }
 #endif
@@ -613,10 +602,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 +631,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 +670,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 +691,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 +726,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoamodes.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoamouse.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoaopengl.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoavideo.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoavideo.m	Wed Jul 28 00:54:23 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
@@ -108,6 +108,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.m	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/cocoa/SDL_cocoawindow.m	Wed Jul 28 00:54:23 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
@@ -126,28 +126,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
@@ -162,10 +158,8 @@
 
 - (void)mouseDown:(NSEvent *)theEvent
 {
-    int index;
     int button;
 
-    index = _data->videodata->mouse;
     switch ([theEvent buttonNumber]) {
     case 0:
         button = SDL_BUTTON_LEFT;
@@ -180,7 +174,7 @@
         button = [theEvent buttonNumber];
         break;
     }
-    SDL_SendMouseButton(index, SDL_PRESSED, button);
+    SDL_SendMouseButton(_data->window, SDL_PRESSED, button);
 }
 
 - (void)rightMouseDown:(NSEvent *)theEvent
@@ -195,10 +189,8 @@
 
 - (void)mouseUp:(NSEvent *)theEvent
 {
-    int index;
     int button;
 
-    index = _data->videodata->mouse;
     switch ([theEvent buttonNumber]) {
     case 0:
         button = SDL_BUTTON_LEFT;
@@ -213,7 +205,7 @@
         button = [theEvent buttonNumber];
         break;
     }
-    SDL_SendMouseButton(index, SDL_RELEASED, button);
+    SDL_SendMouseButton(_data->window, SDL_RELEASED, button);
 }
 
 - (void)rightMouseUp:(NSEvent *)theEvent
@@ -229,24 +221,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);
     }
 }
 
@@ -267,10 +252,20 @@
 
 - (void)scrollWheel:(NSEvent *)theEvent
 {
-    int index;
+    float x = [theEvent deltaX];
+    float y = [theEvent deltaY];
 
-    index = _data->videodata->mouse;
-    SDL_SendMouseWheel(index, (int)([theEvent deltaX]+0.9f), (int)([theEvent deltaY]+0.9f));
+    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);
 }
 
 @end
@@ -361,9 +356,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 */
@@ -385,8 +379,6 @@
     NSRect rect;
     SDL_Rect bounds;
     unsigned int style;
-    NSString *title;
-    int status;
 
     Cocoa_GetDisplayBounds(_this, display, &bounds);
     if ((window->flags & SDL_WINDOW_FULLSCREEN)
@@ -452,7 +444,6 @@
     NSAutoreleasePool *pool;
     NSWindow *nswindow = (NSWindow *) data;
     NSString *title;
-    int status;
 
     pool = [[NSAutoreleasePool alloc] init];
 
@@ -625,7 +616,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_WM.c	Wed Jul 28 00:54:23 2010 -0700
@@ -210,7 +210,7 @@
     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_SendWindowEvent(window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
 }
 
 void
@@ -226,7 +226,7 @@
                             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_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
 }
 
 enum
@@ -304,7 +304,7 @@
             case WM_POS_NONE:
                 return 0;
             case WM_POS_CLOSE:
-                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0,
+                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0,
                                     0);
                 return 1;
             case WM_POS_MAX:
--- a/src/video/directfb/SDL_DirectFB_events.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_events.c	Wed Jul 28 00:54:23 2010 -0700
@@ -32,6 +32,19 @@
 #include "../../events/scancodes_linux.h"
 #include "SDL_DirectFB_events.h"
 
+#if USE_MULTI_API
+#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p)
+#define SDL_SendMouseButton_ex(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(id, relative, x, y, p) SDL_SendMouseMotion(relative, x, y)
+#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(state, button)
+#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode)
+#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text)
+#endif
+
+
 /* The translation tables from a DirectFB keycode to a SDL keysym */
 static SDLKey oskeymap[256];
 static int sys_ids;
@@ -54,7 +67,6 @@
      *        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;
@@ -72,27 +84,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 +123,7 @@
         mouse->y = mouse->last_y = y;
         //SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0);
     }
+#endif
 }
 
 static int
@@ -150,9 +172,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(devdata->mouse_id[0], 0, evt->x,
                                         evt->y, 0);
-                    SDL_SendMouseButton(devdata->mouse_id[0],
+                    SDL_SendMouseButton_ex(devdata->mouse_id[0],
                                         SDL_PRESSED,
                                         DirectFB_TranslateButton
                                         (evt->button));
@@ -164,9 +186,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(devdata->mouse_id[0], 0, evt->x,
                                         evt->y, 0);
-                    SDL_SendMouseButton(devdata->mouse_id[0],
+                    SDL_SendMouseButton_ex(devdata->mouse_id[0],
                                         SDL_RELEASED,
                                         DirectFB_TranslateButton
                                         (evt->button));
@@ -177,10 +199,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(devdata->mouse_id[0], 0,
                                             evt->x, evt->y, 0);
                 } else {
                     /* relative movements are not exact! 
@@ -200,12 +222,12 @@
         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 +235,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 +256,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 +293,7 @@
 }
 
 static void
-ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt)
+ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt)
 {
     SDL_DFB_DEVICEDATA(_this);
     SDL_keysym keysym;
@@ -280,16 +302,17 @@
 
     if (!devdata->use_linux_input) {
         if (ievt->type == DIET_AXISMOTION) {
-            if ((grabbed_window >= 0) && (ievt->flags & DIEF_AXISREL)) {
+            if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) {
                 if (ievt->axis == DIAI_X)
-                    SDL_SendMouseMotion(ievt->device_id, 1,
+                    SDL_SendMouseMotion_ex(ievt->device_id, 1,
                                         ievt->axisrel, 0, 0);
                 else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
+                    SDL_SendMouseMotion_ex(ievt->device_id, 1, 0,
                                         ievt->axisrel, 0);
             }
         }
     } else {
+#if USE_MULTI_API
         static int last_x, last_y;
 
         switch (ievt->type) {
@@ -308,34 +331,34 @@
                         int x, y;
 
                         windata->window->GetPosition(windata->window, &x, &y);
-                        SDL_SendMouseMotion(ievt->device_id, 0,
+                        SDL_SendMouseMotion_ex(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(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(ievt->device_id, 1,
                                         ievt->axisrel, 0, 0);
                 else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion(ievt->device_id, 1, 0,
+                    SDL_SendMouseMotion_ex(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;
@@ -363,6 +386,7 @@
         default:
             break;              /* please gcc */
         }
+#endif
     }
 }
 
@@ -378,7 +402,7 @@
 
     for (p = devdata->firstwin; p != NULL; p = p->next) {
         DFBWindowEvent evt;
-        SDL_Window *w = SDL_GetWindowFromID(p->window);
+        SDL_Window *w = p->sdl_window;
 
         if (w->flags & SDL_WINDOW_INPUT_GRABBED) {
             grabbed_window = w;
@@ -603,19 +627,27 @@
                 DFBInputDeviceDescription desc, void *callbackdata)
 {
     DFB_DeviceData *devdata = callbackdata;
+#if USE_MULTI_API
     SDL_Keyboard keyboard;
+#endif
     SDLKey keymap[SDL_NUM_SCANCODES];
 
     if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) {
+#if USE_MULTI_API
         SDL_zero(keyboard);
         SDL_AddKeyboard(&keyboard, 0);
+#endif
         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);
+#if USE_MULTI_API
         SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
+#else
+        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
+#endif
         devdata->num_keyboard++;
 
         return DFENUM_CANCEL;
@@ -623,6 +655,7 @@
     return DFENUM_OK;
 }
 
+#if USE_MULTI_API
 static DFBEnumerationResult
 EnumKeyboards(DFBInputDeviceID device_id,
               DFBInputDeviceDescription desc, void *callbackdata)
@@ -652,6 +685,7 @@
     }
     return DFENUM_OK;
 }
+#endif
 
 void
 DirectFB_InitKeyboard(_THIS)
@@ -662,6 +696,7 @@
     DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap));
 
     devdata->num_keyboard = 0;
+#if USE_MULTI_API
     if (devdata->use_linux_input) {
         sys_ids = 0;
         SDL_DFB_CHECK(devdata->dfb->
@@ -672,11 +707,14 @@
                                                          EnumKeyboards,
                                                          devdata));
         }
-    } else {
+    } else
+#else
+    {
         SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
                                                      input_device_cb,
                                                      devdata));
     }
+#endif
 }
 
 void
@@ -759,3 +797,4 @@
     }
 }
 #endif
+
--- a/src/video/directfb/SDL_DirectFB_modes.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_modes.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_mouse.c	Wed Jul 28 00:54:23 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_render.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_render.c	Wed Jul 28 00:54:23 2010 -0700
@@ -423,7 +423,7 @@
 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) {
@@ -445,7 +445,7 @@
 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;
@@ -501,7 +501,7 @@
 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;
@@ -950,7 +950,7 @@
 
     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;
@@ -1048,7 +1048,7 @@
 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;
--- a/src/video/directfb/SDL_DirectFB_video.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_video.c	Wed Jul 28 00:54:23 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,10 +209,14 @@
             DirectFBSetOption("disable-module", "x11input");
     }
 
-    devdata->use_linux_input = 1;       /* default: on */
+#if USE_MULTI_API
+	devdata->use_linux_input = 1;       /* default: on */
     stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT);
     if (stemp)
         devdata->use_linux_input = atoi(stemp);
+#else
+	devdata->use_linux_input = 0;       /* no way to support this ... */
+#endif
 
     if (!devdata->use_linux_input)
         DirectFBSetOption("disable-module", "linux_input");
--- a/src/video/directfb/SDL_DirectFB_video.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_video.h	Wed Jul 28 00:54:23 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)						\
--- a/src/video/directfb/SDL_DirectFB_window.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_window.c	Wed Jul 28 00:54:23 2010 -0700
@@ -140,7 +140,7 @@
     windata->window->RaiseToTop(windata->window);
 
     /* remember parent */
-    windata->window = window;
+    windata->sdl_window = window;
 
     /* Add to list ... */
 
--- a/src/video/directfb/SDL_DirectFB_window.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/directfb/SDL_DirectFB_window.h	Wed Jul 28 00:54:23 2010 -0700
@@ -36,7 +36,7 @@
     IDirectFBWindow *window;
     DirectFB_GLContext *gl_context;
     IDirectFBEventBuffer *eventbuffer;
-    SDL_Window *window;
+    SDL_Window *sdl_window;
     DFB_WindowData *next;
     Uint8 opacity;
     DFBRectangle client;
--- a/src/video/pandora/SDL_pandora.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/pandora/SDL_pandora.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/SDL_uikitopengles.m	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/SDL_uikitview.h	Wed Jul 28 00:54:23 2010 -0700
@@ -22,8 +22,6 @@
 
 #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
@@ -38,8 +36,10 @@
 #else
 @interface SDL_uikitview : UIView {
 #endif
-		
+
+#if FIXME_MULTITOUCH
 	SDL_Mouse mice[MAX_SIMULTANEOUS_TOUCHES];
+#endif
 
 #if SDL_IPHONE_KEYBOARD
 	UITextField *textField;
--- a/src/video/uikit/SDL_uikitview.m	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/SDL_uikitview.m	Wed Jul 28 00:54:23 2010 -0700
@@ -22,8 +22,10 @@
 
 #import "SDL_uikitview.h"
 
+#include "../../events/SDL_keyboard_c.h"
+#include "../../events/SDL_mouse_c.h"
+
 #if SDL_IPHONE_KEYBOARD
-#import "SDL_keyboard_c.h"
 #import "keyinfotable.h"
 #import "SDL_uikitappdelegate.h"
 #import "SDL_uikitwindow.h"
@@ -33,7 +35,6 @@
 
 - (void)dealloc {
 #if SDL_IPHONE_KEYBOARD
-	SDL_DelKeyboard(0);
 	[textField release];
 #endif
 	[super dealloc];
@@ -47,6 +48,7 @@
 	[self initializeKeyboard];
 #endif	
 
+#if FIXME_MULTITOUCH
 	int i;
 	for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
         mice[i].id = i;
@@ -54,6 +56,7 @@
 		SDL_AddMouse(&mice[i], "Mouse", 0, 0, 1);
 	}
 	self.multipleTouchEnabled = YES;
+#endif
 			
 	return self;
 
@@ -62,8 +65,9 @@
 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
 
 	NSEnumerator *enumerator = [touches objectEnumerator];
-	UITouch *touch =(UITouch*)[enumerator nextObject];
+	UITouch *touch = (UITouch*)[enumerator nextObject];
 	
+#if FIXME_MULTITOUCH
 	/* associate touches with mice, so long as we have slots */
 	int i;
 	int found = 0;
@@ -98,21 +102,32 @@
 		/* 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);
 		
-	}	
+		/* grab next touch */
+		touch = (UITouch*)[enumerator nextObject]; 
+	}
+#else
+	if (touch) {
+		CGPoint locationInView = [touch locationInView: self];
+			
+		/* send moved event */
+		SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
+
+		/* send mouse down event */
+		SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT);
+	}
+#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]) {
+#if FIXME_MULTITOUCH
+	while(touch) {
 		/* search for the mouse slot associated with this touch */
 		int i, found = NO;
 		for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
@@ -126,7 +141,16 @@
 				found = YES;
 			}
 		}
+		
+		/* grab next touch */
+		touch = (UITouch*)[enumerator nextObject]; 
 	}
+#else
+	if (touch) {
+		/* send mouse up */
+		SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT);
+	}
+#endif
 }
 
 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -141,9 +165,10 @@
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
 	
 	NSEnumerator *enumerator = [touches objectEnumerator];
-	UITouch *touch=nil;
+	UITouch *touch = (UITouch*)[enumerator nextObject];
 	
-	while(touch = (UITouch *)[enumerator nextObject]) {
+#if FIXME_MULTITOUCH
+	while(touch) {
 		/* try to find the mouse associated with this touch */
 		int i, found = NO;
 		for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
@@ -156,7 +181,18 @@
 				found = YES;
 			}
 		}
+		
+		/* grab next touch */
+		touch = (UITouch*)[enumerator nextObject]; 
 	}
+#else
+	if (touch) {
+		CGPoint locationInView = [touch locationInView: self];
+
+		/* send moved event */
+		SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
+	}
+#endif
 }
 
 /*
@@ -190,15 +226,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 +245,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 +272,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/jumphack.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/uikit/jumphack.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_ceddrawrender.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_d3drender.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_gapirender.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_gapirender.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_gapirender_c.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_gdirender.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32events.c	Wed Jul 28 00:54:23 2010 -0700
@@ -58,12 +58,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)
 {
@@ -89,10 +83,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;
+                }
             }
         }
     }
@@ -104,8 +102,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 */
@@ -142,35 +138,6 @@
 
     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) {
@@ -183,13 +150,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,
@@ -200,13 +163,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,
@@ -217,125 +183,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, &size,
-                            sizeof(RAWINPUTHEADER));
-            lpb = SDL_stack_alloc(BYTE, size);
-            GetRawInputData((HRAWINPUT) lParam, RID_INPUT, lpb, &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;
@@ -343,15 +221,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:
@@ -388,7 +257,7 @@
                 break;
             }
             if (wParam < 256) {
-                SDL_SendKeyboardKey(index, SDL_PRESSED,
+                SDL_SendKeyboardKey(SDL_PRESSED,
                                     data->videodata->key_layout[wParam]);
             }
         }
@@ -398,9 +267,6 @@
     case WM_SYSKEYUP:
     case WM_KEYUP:
         {
-            int index;
-
-            index = data->videodata->keyboard;
             wParam = RemapVKEY(wParam, lParam);
             switch (wParam) {
             case VK_CONTROL:
@@ -441,11 +307,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]);
             }
         }
@@ -470,14 +336,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;
@@ -736,17 +602,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32events.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32keyboard.c	Wed Jul 28 00:54:23 2010 -0700
@@ -50,7 +50,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 +81,7 @@
 
     data->key_layout = win32_scancode_table;
 
-    SDL_zero(keyboard);
-    data->keyboard = SDL_AddKeyboard(&keyboard, -1);
-    WIN_UpdateKeymap(data->keyboard);
+    WIN_UpdateKeymap();
 
     SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
     SDL_SetScancodeName(SDL_SCANCODE_LGUI, "Left Windows");
@@ -92,7 +89,7 @@
 }
 
 void
-WIN_UpdateKeymap(int keyboard)
+WIN_UpdateKeymap()
 {
     int i;
     SDL_scancode scancode;
@@ -104,8 +101,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 +113,12 @@
             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;
-
-    SDL_DelKeyboard(data->keyboard);
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/win32/SDL_win32keyboard.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32keyboard.h	Wed Jul 28 00:54:23 2010 -0700
@@ -28,7 +28,7 @@
 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);
 
 #endif /* _SDL_win32keyboard_h */
--- a/src/video/win32/SDL_win32modes.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32modes.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32mouse.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32video.c	Wed Jul 28 00:54:23 2010 -0700
@@ -30,15 +30,25 @@
 #include "SDL_win32video.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 */
 
@@ -66,9 +76,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);
 }
@@ -85,8 +97,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);
@@ -131,31 +145,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;
@@ -195,16 +192,23 @@
     device->GL_DeleteContext = WIN_GL_DeleteContext;
 #endif
 
+    device->SetClipboardText = WIN_SetClipboardText;
+    device->GetClipboardText = WIN_GetClipboardText;
+    device->HasClipboardText = WIN_HasClipboardText;
+
     device->free = WIN_DeleteDevice;
 
     return device;
 }
 
 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)
 {
@@ -222,10 +226,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);
 
@@ -238,7 +241,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32video.h	Wed Jul 28 00:54:23 2010 -0700
@@ -28,7 +28,9 @@
 
 #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() */
 #include <windows.h>
@@ -45,11 +47,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"
@@ -65,11 +63,19 @@
 #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*);
 
 /* Private display data */
 
 typedef struct SDL_VideoData
 {
+    int render;
+
 #if SDL_VIDEO_RENDER_D3D
     HANDLE d3dDLL;
     IDirect3D9 *d3d;
@@ -78,17 +84,14 @@
     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* */
+    DWORD clipboard_count;
 
-    int keyboard;
     const SDL_scancode *key_layout;
 } SDL_VideoData;
 
--- a/src/video/win32/SDL_win32window.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32window.c	Wed Jul 28 00:54:23 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;
@@ -165,9 +130,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 +150,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 +169,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 +178,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 +200,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;
@@ -257,48 +219,6 @@
         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
-
     WIN_PumpEvents(_this);
 
     if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) {
@@ -437,6 +357,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 +376,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 +440,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 +471,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 +529,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 +582,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 +600,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 +619,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 +628,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/win32/SDL_win32window.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 13:08:14 2010 +0530
+++ /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	Wed Jul 28 13:08:14 2010 +0530
+++ /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 */
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/x11/SDL_x11clipboard.c	Wed Jul 28 00:54:23 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	Wed Jul 28 00:54:23 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_x11events.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11events.c	Wed Jul 28 00:54:23 2010 -0700
@@ -23,24 +23,48 @@
 
 #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 "SDL_timer.h"
 #include "SDL_syswm.h"
 
+/*#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 +99,7 @@
     if (!data) {
         return;
     }
+
 #if 0
     printf("type = %d display = %d window = %d\n",
            xevent.type, xevent.xany.display, xevent.xany.window);
@@ -85,21 +110,15 @@
     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;
 
@@ -107,22 +126,18 @@
     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 +147,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 +161,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 +194,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 +224,7 @@
             XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL);
 #endif
             if (*text) {
-                SDL_SendKeyboardText(videodata->keyboard, text);
+                SDL_SendKeyboardText(text);
             }
         }
         break;
@@ -222,8 +236,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 +297,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 +449,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 */
--- a/src/video/x11/SDL_x11keyboard.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11keyboard.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11modes.c	Wed Jul 28 00:54:23 2010 -0700
@@ -23,22 +23,18 @@
 
 #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)
 {
     const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID");
     int depth;
-    XVisualInfo *vi;
-    int nvis;
 
     /* Look for an exact visual, if requested */
     if (visual_id) {
-        XVisualInfo template;
+        XVisualInfo *vi, template;
+        int nvis;
 
         SDL_zero(template);
         template.visualid = SDL_strtol(visual_id, NULL, 0);
@@ -49,6 +45,7 @@
             return 0;
         }
     }
+
     depth = DefaultDepth(display, screen);
     if ((X11_UseDirectColorVisuals() &&
          XMatchVisualInfo(display, screen, depth, DirectColor, 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11mouse.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11opengl.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11render.c	Wed Jul 28 00:54:23 2010 -0700
@@ -27,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"
--- a/src/video/x11/SDL_x11sym.h	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11sym.h	Wed Jul 28 00:54:23 2010 -0700
@@ -37,6 +37,7 @@
 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(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)
@@ -66,15 +67,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 +118,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)
--- a/src/video/x11/SDL_x11video.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11video.c	Wed Jul 28 00:54:23 2010 -0700
@@ -21,6 +21,8 @@
 */
 #include "SDL_config.h"
 
+#include <unistd.h> /* For getpid() and readlink() */
+
 #include "SDL_video.h"
 #include "SDL_mouse.h"
 #include "../SDL_sysvideo.h"
@@ -225,6 +227,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;
@@ -235,6 +241,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)
@@ -253,8 +326,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;
@@ -292,7 +377,7 @@
 }
 
 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11video.h	Wed Jul 28 00:54:23 2010 -0700
@@ -56,6 +56,7 @@
 #endif
 #include "SDL_x11dyn.h"
 
+#include "SDL_x11clipboard.h"
 #include "SDL_x11events.h"
 #include "SDL_x11gamma.h"
 #include "SDL_x11keyboard.h"
@@ -75,12 +76,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11window.c	Wed Jul 28 00:54:23 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"
 
@@ -34,12 +35,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)
 {
@@ -67,7 +113,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));
@@ -127,14 +172,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;
@@ -147,19 +188,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);
         }
@@ -179,11 +222,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 {
@@ -216,6 +254,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;
@@ -224,6 +264,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
@@ -237,7 +285,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;
         }
@@ -250,7 +298,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;
         }
@@ -264,7 +312,7 @@
         depth = displaydata->depth;
     }
 
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
+    if (oldstyle_fullscreen) {
         xattr.override_redirect = True;
     } else {
         xattr.override_redirect = False;
@@ -275,8 +323,7 @@
     if (visual->class == PseudoColor) {
         printf("asking for PseudoColor\n");
 
-        Status status;
-        XStandardColormap cmap;
+/*      Status status; */
         XColor *colorcells;
         Colormap colormap;
         Sint32 pix;
@@ -289,16 +336,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); */
 
@@ -377,17 +421,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;
@@ -397,16 +439,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); */
 
@@ -418,7 +457,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");
@@ -480,22 +518,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;
@@ -504,7 +540,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;
@@ -514,8 +550,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);
@@ -523,10 +558,6 @@
         SDL_SetError("Couldn't create window");
         return -1;
     }
-/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
-    //XSetWindowBackground(data->display, w, 0xFF000000);
-    //XSetWindowBackgroundPixmap(data->display, w, ParentRelative);
-#endif*/
 #if SDL_VIDEO_DRIVER_PANDORA
     /* Create the GLES window surface */
     _this->gles_data->egl_surface =
@@ -544,23 +575,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;
 
@@ -568,7 +599,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
@@ -581,40 +612,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;
@@ -624,54 +651,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);
     }
 
@@ -680,15 +688,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
@@ -696,7 +721,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 |
@@ -705,7 +730,7 @@
     }
 #else
     {
-        XSelectInput(data->display, w,
+        XSelectInput(display, w,
                      (FocusChangeMask | EnterWindowMask | LeaveWindowMask |
                       ExposureMask | ButtonPressMask | ButtonReleaseMask |
                       PointerMotionMask | KeyPressMask | KeyReleaseMask |
@@ -714,32 +739,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;
 }
 
@@ -748,7 +747,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;
@@ -756,6 +755,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)
 {
@@ -767,14 +796,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) {
@@ -835,13 +858,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,
@@ -853,12 +876,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);
@@ -873,19 +905,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;
@@ -938,26 +972,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
@@ -969,7 +1022,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
@@ -984,8 +1042,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 (;;) {
@@ -1048,8 +1110,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/src/video/x11/SDL_x11window.h	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/Makefile.in	Wed Jul 28 00:54:23 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) 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) testsprite2$(EXE) testsprite$(EXE) testspriteminimal$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm2$(EXE) testwm$(EXE) threadwin$(EXE) torturethread$(EXE)
 
 all: Makefile $(TARGETS)
 
@@ -149,9 +149,6 @@
 testhaptic$(EXE): $(srcdir)/testhaptic.c
 	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
 
-testmmousetablet$(EXE): $(srcdir)/testmmousetablet.c
-	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
-
 testatomic$(EXE): $(srcdir)/testatomic.c
 	$(CC) -o $@ $? $(CFLAGS) $(LIBS)
  
--- a/test/automated/testsdl.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/automated/testsdl.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/checkkeys.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/common.c	Wed Jul 28 00:54:23 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;
@@ -611,6 +619,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 +823,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 +970,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 +1058,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 +1094,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	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/common.h	Wed Jul 28 00:54:23 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;
--- a/test/testime.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/testime.c	Wed Jul 28 00:54:23 2010 -0700
@@ -279,8 +279,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,8 +290,7 @@
                 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);
--- a/test/testintersections.c	Wed Jul 28 13:08:14 2010 +0530
+++ b/test/testintersections.c	Wed Jul 28 00:54:23 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	Wed Jul 28 13:08:14 2010 +0530
+++ /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;
-}