Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
authorSam Lantinga <slouken@libsdl.org>
Thu, 03 Feb 2011 15:49:37 -0800
changeset 51664d39eeaad00b
parent 5165 2b1989f59674
child 5167 88c656ffea44
Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
The software renderer has been re-routed to use the framebuffer interface, which makes it possible to have software rendering available even on simple ports.
VisualC/SDL/SDL_VS2008.vcproj
VisualC/SDL/SDL_VS2010.vcxproj
Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
Xcode/SDL/SDL.xcodeproj/project.pbxproj
include/SDL_render.h
include/SDL_video.h
src/events/SDL_windowevents.c
src/render/SDL_render.c
src/render/direct3d/SDL_d3drender.c
src/render/opengl/SDL_renderer_gl.c
src/render/opengles/SDL_renderer_gles.c
src/render/software/SDL_blendline.c
src/render/software/SDL_drawline.c
src/render/software/SDL_renderer_sw.c
src/render/software/SDL_renderer_sw_c.h
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/dummy/SDL_nullframebuffer.c
src/video/dummy/SDL_nullframebuffer_c.h
src/video/dummy/SDL_nullvideo.c
     1.1 --- a/VisualC/SDL/SDL_VS2008.vcproj	Thu Feb 03 11:16:57 2011 -0800
     1.2 +++ b/VisualC/SDL/SDL_VS2008.vcproj	Thu Feb 03 15:49:37 2011 -0800
     1.3 @@ -643,14 +643,6 @@
     1.4  			>
     1.5  		</File>
     1.6  		<File
     1.7 -			RelativePath="..\..\src\video\SDL_alphamult.c"
     1.8 -			>
     1.9 -		</File>
    1.10 -		<File
    1.11 -			RelativePath="..\..\src\video\SDL_alphamult.h"
    1.12 -			>
    1.13 -		</File>
    1.14 -		<File
    1.15  			RelativePath="..\..\src\SDL_assert.c"
    1.16  			>
    1.17  		</File>
    1.18 @@ -687,19 +679,27 @@
    1.19  			>
    1.20  		</File>
    1.21  		<File
    1.22 -			RelativePath="..\..\src\video\SDL_blendfillrect.c"
    1.23 +			RelativePath="..\..\src\render\software\SDL_blendfillrect.c"
    1.24  			>
    1.25  		</File>
    1.26  		<File
    1.27 -			RelativePath="..\..\src\video\SDL_blendline.c"
    1.28 +			RelativePath="..\..\src\render\software\SDL_blendfillrect.h"
    1.29  			>
    1.30  		</File>
    1.31  		<File
    1.32 -			RelativePath="..\..\src\video\SDL_blendpoint.c"
    1.33 +			RelativePath="..\..\src\render\software\SDL_blendline.c"
    1.34  			>
    1.35  		</File>
    1.36  		<File
    1.37 -			RelativePath="..\..\src\video\SDL_blendrect.c"
    1.38 +			RelativePath="..\..\src\render\software\SDL_blendline.h"
    1.39 +			>
    1.40 +		</File>
    1.41 +		<File
    1.42 +			RelativePath="..\..\src\render\software\SDL_blendpoint.c"
    1.43 +			>
    1.44 +		</File>
    1.45 +		<File
    1.46 +			RelativePath="..\..\src\render\software\SDL_blendpoint.h"
    1.47  			>
    1.48  		</File>
    1.49  		<File
    1.50 @@ -795,19 +795,27 @@
    1.51  			>
    1.52  		</File>
    1.53  		<File
    1.54 +			RelativePath="..\..\src\render\software\SDL_draw.h"
    1.55 +			>
    1.56 +		</File>
    1.57 +		<File
    1.58  			RelativePath="..\..\src\video\SDL_draw.h"
    1.59  			>
    1.60  		</File>
    1.61  		<File
    1.62 -			RelativePath="..\..\src\video\SDL_drawline.c"
    1.63 +			RelativePath="..\..\src\render\software\SDL_drawline.c"
    1.64  			>
    1.65  		</File>
    1.66  		<File
    1.67 -			RelativePath="..\..\src\video\SDL_drawpoint.c"
    1.68 +			RelativePath="..\..\src\render\software\SDL_drawline.h"
    1.69  			>
    1.70  		</File>
    1.71  		<File
    1.72 -			RelativePath="..\..\src\video\SDL_drawrect.c"
    1.73 +			RelativePath="..\..\src\render\software\SDL_drawpoint.c"
    1.74 +			>
    1.75 +		</File>
    1.76 +		<File
    1.77 +			RelativePath="..\..\src\render\software\SDL_drawpoint.h"
    1.78  			>
    1.79  		</File>
    1.80  		<File
    1.81 @@ -963,6 +971,14 @@
    1.82  			>
    1.83  		</File>
    1.84  		<File
    1.85 +			RelativePath="..\..\src\video\dummy\SDL_nullframebuffer.c"
    1.86 +			>
    1.87 +		</File>
    1.88 +		<File
    1.89 +			RelativePath="..\..\src\video\dummy\SDL_nullframebuffer_c.h"
    1.90 +			>
    1.91 +		</File>
    1.92 +		<File
    1.93  			RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
    1.94  			>
    1.95  		</File>
    1.96 @@ -1011,6 +1027,10 @@
    1.97  			>
    1.98  		</File>
    1.99  		<File
   1.100 +			RelativePath="..\..\src\render\software\SDL_renderer_sw_c.h"
   1.101 +			>
   1.102 +		</File>
   1.103 +		<File
   1.104  			RelativePath="..\..\src\video\SDL_RLEaccel.c"
   1.105  			>
   1.106  		</File>
     2.1 --- a/VisualC/SDL/SDL_VS2010.vcxproj	Thu Feb 03 11:16:57 2011 -0800
     2.2 +++ b/VisualC/SDL/SDL_VS2010.vcxproj	Thu Feb 03 15:49:37 2011 -0800
     2.3 @@ -285,10 +285,17 @@
     2.4      <ClInclude Include="..\..\src\render\mmx.h" />
     2.5      <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
     2.6      <ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
     2.7 -    <ClInclude Include="..\..\src\video\SDL_alphamult.h" />
     2.8      <ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
     2.9      <ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
    2.10      <ClInclude Include="..\..\src\audio\SDL_audiomem.h" />
    2.11 +    <ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
    2.12 +    <ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
    2.13 +    <ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
    2.14 +    <ClInclude Include="..\..\src\render\software\SDL_draw.h" />
    2.15 +    <ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
    2.16 +    <ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
    2.17 +    <ClInclude Include="..\..\src\render\software\SDL_renderer_sw_c.h" />
    2.18 +    <ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
    2.19      <ClInclude Include="..\..\src\video\SDL_blit.h" />
    2.20      <ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
    2.21      <ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
    2.22 @@ -296,7 +303,6 @@
    2.23      <ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
    2.24      <ClInclude Include="..\..\src\audio\windib\SDL_dibaudio.h" />
    2.25      <ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
    2.26 -    <ClInclude Include="..\..\src\video\SDL_draw.h" />
    2.27      <ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
    2.28      <ClInclude Include="..\..\src\audio\windx5\SDL_dx5audio.h" />
    2.29      <ClInclude Include="..\..\src\SDL_error_c.h" />
    2.30 @@ -367,9 +373,13 @@
    2.31      <ClCompile Include="..\..\src\render\SDL_render.c" />
    2.32      <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
    2.33      <ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
    2.34 +    <ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
    2.35 +    <ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
    2.36 +    <ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
    2.37 +    <ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
    2.38 +    <ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
    2.39      <ClCompile Include="..\..\src\render\software\SDL_renderer_sw.c" />
    2.40      <ClCompile Include="..\..\src\SDL.c" />
    2.41 -    <ClCompile Include="..\..\src\video\SDL_alphamult.c" />
    2.42      <ClCompile Include="..\..\src\SDL_assert.c" />
    2.43      <ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
    2.44      <ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
    2.45 @@ -377,10 +387,7 @@
    2.46      <ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
    2.47      <ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
    2.48      <ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
    2.49 -    <ClCompile Include="..\..\src\video\SDL_blendfillrect.c" />
    2.50 -    <ClCompile Include="..\..\src\video\SDL_blendline.c" />
    2.51 -    <ClCompile Include="..\..\src\video\SDL_blendpoint.c" />
    2.52 -    <ClCompile Include="..\..\src\video\SDL_blendrect.c" />
    2.53 +    <ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
    2.54      <ClCompile Include="..\..\src\video\SDL_blit.c" />
    2.55      <ClCompile Include="..\..\src\video\SDL_blit_0.c" />
    2.56      <ClCompile Include="..\..\src\video\SDL_blit_1.c" />
    2.57 @@ -396,9 +403,6 @@
    2.58      <ClCompile Include="..\..\src\video\SDL_shape.c" />
    2.59      <ClCompile Include="..\..\src\audio\windib\SDL_dibaudio.c" />
    2.60      <ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
    2.61 -    <ClCompile Include="..\..\src\video\SDL_drawline.c" />
    2.62 -    <ClCompile Include="..\..\src\video\SDL_drawpoint.c" />
    2.63 -    <ClCompile Include="..\..\src\video\SDL_drawrect.c" />
    2.64      <ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
    2.65      <ClCompile Include="..\..\src\audio\windx5\SDL_dx5audio.c" />
    2.66      <ClCompile Include="..\..\src\joystick\windows\SDL_dxjoystick.c" />
     3.1 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Thu Feb 03 11:16:57 2011 -0800
     3.2 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Thu Feb 03 15:49:37 2011 -0800
     3.3 @@ -69,10 +69,6 @@
     3.4  		041B2CF312FA0F680087D585 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */; };
     3.5  		0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; };
     3.6  		0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
     3.7 -		043DD76F10FD8A0000DED673 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */; };
     3.8 -		043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */; };
     3.9 -		043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */; };
    3.10 -		043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */; };
    3.11  		04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; };
    3.12  		04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
    3.13  		04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; };
    3.14 @@ -81,13 +77,7 @@
    3.15  		044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB311E6069F0076F181 /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
    3.16  		044E5FB611E6069F0076F181 /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB411E6069F0076F181 /* SDL_input.h */; settings = {ATTRIBUTES = (Public, ); }; };
    3.17  		044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; };
    3.18 -		0463873F0F0B5B7D0041FD65 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387370F0B5B7D0041FD65 /* SDL_blendline.c */; };
    3.19 -		046387400F0B5B7D0041FD65 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */; };
    3.20 -		046387410F0B5B7D0041FD65 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387390F0B5B7D0041FD65 /* SDL_blendrect.c */; };
    3.21  		046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */; };
    3.22 -		046387430F0B5B7D0041FD65 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873B0F0B5B7D0041FD65 /* SDL_draw.h */; };
    3.23 -		046387440F0B5B7D0041FD65 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */; };
    3.24 -		046387450F0B5B7D0041FD65 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */; };
    3.25  		046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; };
    3.26  		047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; };
    3.27  		047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; };
    3.28 @@ -108,6 +98,20 @@
    3.29  		04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; settings = {ATTRIBUTES = (Public, ); }; };
    3.30  		04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
    3.31  		04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
    3.32 +		04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; };
    3.33 +		04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */; };
    3.34 +		04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; };
    3.35 +		04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806D12FB751400FC43C0 /* SDL_blendline.h */; };
    3.36 +		04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; };
    3.37 +		04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */; };
    3.38 +		04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807012FB751400FC43C0 /* SDL_draw.h */; };
    3.39 +		04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; };
    3.40 +		04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807212FB751400FC43C0 /* SDL_drawline.h */; };
    3.41 +		04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; };
    3.42 +		04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */; };
    3.43 +		04F7808112FB751400FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */; };
    3.44 +		04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */; };
    3.45 +		04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; };
    3.46  		04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
    3.47  		04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
    3.48  		04FFAB9612E23BDC00BA343D /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
    3.49 @@ -325,10 +329,6 @@
    3.50  		041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_sw.c; sourceTree = "<group>"; };
    3.51  		0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = "<group>"; };
    3.52  		0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = "<group>"; };
    3.53 -		043DD76B10FD8A0000DED673 /* SDL_alphamult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_alphamult.c; sourceTree = "<group>"; };
    3.54 -		043DD76C10FD8A0000DED673 /* SDL_alphamult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_alphamult.h; sourceTree = "<group>"; };
    3.55 -		043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
    3.56 -		043DD76E10FD8A0000DED673 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = "<group>"; };
    3.57  		04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = "<group>"; };
    3.58  		04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = "<group>"; };
    3.59  		04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = "<group>"; };
    3.60 @@ -337,13 +337,7 @@
    3.61  		044E5FB311E6069F0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
    3.62  		044E5FB411E6069F0076F181 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; };
    3.63  		044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
    3.64 -		046387370F0B5B7D0041FD65 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
    3.65 -		046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
    3.66 -		046387390F0B5B7D0041FD65 /* SDL_blendrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendrect.c; sourceTree = "<group>"; };
    3.67  		0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = "<group>"; };
    3.68 -		0463873B0F0B5B7D0041FD65 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
    3.69 -		0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
    3.70 -		0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
    3.71  		0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
    3.72  		047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = "<group>"; };
    3.73  		047677B90EA76A31008ABAF1 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_haptic.c; path = ../../src/haptic/SDL_haptic.c; sourceTree = SOURCE_ROOT; };
    3.74 @@ -364,6 +358,20 @@
    3.75  		04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = ../../include/SDL_config_iphoneos.h; sourceTree = SOURCE_ROOT; };
    3.76  		04F2AF531104ABC300D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
    3.77  		04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
    3.78 +		04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
    3.79 +		04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = "<group>"; };
    3.80 +		04F7806C12FB751400FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
    3.81 +		04F7806D12FB751400FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = "<group>"; };
    3.82 +		04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
    3.83 +		04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = "<group>"; };
    3.84 +		04F7807012FB751400FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
    3.85 +		04F7807112FB751400FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
    3.86 +		04F7807212FB751400FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = "<group>"; };
    3.87 +		04F7807312FB751400FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
    3.88 +		04F7807412FB751400FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = "<group>"; };
    3.89 +		04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw_c.h; sourceTree = "<group>"; };
    3.90 +		04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = "<group>"; };
    3.91 +		04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = "<group>"; };
    3.92  		04FFAB8912E23B8D00BA343D /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
    3.93  		04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
    3.94  		04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; };
    3.95 @@ -684,6 +692,18 @@
    3.96  		041B2CEC12FA0F680087D585 /* software */ = {
    3.97  			isa = PBXGroup;
    3.98  			children = (
    3.99 +				04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */,
   3.100 +				04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */,
   3.101 +				04F7806C12FB751400FC43C0 /* SDL_blendline.c */,
   3.102 +				04F7806D12FB751400FC43C0 /* SDL_blendline.h */,
   3.103 +				04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */,
   3.104 +				04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */,
   3.105 +				04F7807012FB751400FC43C0 /* SDL_draw.h */,
   3.106 +				04F7807112FB751400FC43C0 /* SDL_drawline.c */,
   3.107 +				04F7807212FB751400FC43C0 /* SDL_drawline.h */,
   3.108 +				04F7807312FB751400FC43C0 /* SDL_drawpoint.c */,
   3.109 +				04F7807412FB751400FC43C0 /* SDL_drawpoint.h */,
   3.110 +				04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */,
   3.111  				041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */,
   3.112  			);
   3.113  			path = software;
   3.114 @@ -1083,12 +1103,6 @@
   3.115  				FDA685F40DF244C800F98A1A /* dummy */,
   3.116  				0495E6850E97408800152DFE /* SDL_glfuncs.h */,
   3.117  				0495E6840E97408800152DFE /* SDL_glesfuncs.h */,
   3.118 -				043DD76B10FD8A0000DED673 /* SDL_alphamult.c */,
   3.119 -				043DD76C10FD8A0000DED673 /* SDL_alphamult.h */,
   3.120 -				043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */,
   3.121 -				046387370F0B5B7D0041FD65 /* SDL_blendline.c */,
   3.122 -				046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */,
   3.123 -				046387390F0B5B7D0041FD65 /* SDL_blendrect.c */,
   3.124  				FDA683000DF2374E00F98A1A /* SDL_blit.c */,
   3.125  				FDA683010DF2374E00F98A1A /* SDL_blit.h */,
   3.126  				FDA683020DF2374E00F98A1A /* SDL_blit_0.c */,
   3.127 @@ -1103,10 +1117,6 @@
   3.128  				0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */,
   3.129  				FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */,
   3.130  				044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
   3.131 -				0463873B0F0B5B7D0041FD65 /* SDL_draw.h */,
   3.132 -				0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */,
   3.133 -				0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */,
   3.134 -				043DD76E10FD8A0000DED673 /* SDL_drawrect.c */,
   3.135  				0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */,
   3.136  				FDA6830D0DF2374E00F98A1A /* SDL_gamma.c */,
   3.137  				FDA6830E0DF2374E00F98A1A /* SDL_leaks.h */,
   3.138 @@ -1129,6 +1139,8 @@
   3.139  			children = (
   3.140  				FDA685F50DF244C800F98A1A /* SDL_nullevents.c */,
   3.141  				FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */,
   3.142 +				04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */,
   3.143 +				04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */,
   3.144  				FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */,
   3.145  				FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */,
   3.146  			);
   3.147 @@ -1202,13 +1214,11 @@
   3.148  				047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */,
   3.149  				04461DEE0EA76BA3006C462D /* SDL_haptic.h in Headers */,
   3.150  				046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */,
   3.151 -				046387430F0B5B7D0041FD65 /* SDL_draw.h in Headers */,
   3.152  				04B2ECEC1025CE4800F9BC5F /* SDL_atomic.h in Headers */,
   3.153  				04B2ECED1025CE4800F9BC5F /* SDL_power.h in Headers */,
   3.154  				04B2ECEE1025CE4800F9BC5F /* SDL_revision.h in Headers */,
   3.155  				04B2ED081025CF9E00F9BC5F /* SDL_config.h in Headers */,
   3.156  				04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */,
   3.157 -				043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */,
   3.158  				04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */,
   3.159  				006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
   3.160  				044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */,
   3.161 @@ -1224,6 +1234,14 @@
   3.162  				041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */,
   3.163  				04409BA612FA989600FB9AA8 /* mmx.h in Headers */,
   3.164  				04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
   3.165 +				04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */,
   3.166 +				04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */,
   3.167 +				04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */,
   3.168 +				04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */,
   3.169 +				04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */,
   3.170 +				04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */,
   3.171 +				04F7808112FB751400FC43C0 /* SDL_renderer_sw_c.h in Headers */,
   3.172 +				04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
   3.173  			);
   3.174  			runOnlyForDeploymentPostprocessing = 0;
   3.175  		};
   3.176 @@ -1449,15 +1467,7 @@
   3.177  				047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */,
   3.178  				047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */,
   3.179  				047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */,
   3.180 -				0463873F0F0B5B7D0041FD65 /* SDL_blendline.c in Sources */,
   3.181 -				046387400F0B5B7D0041FD65 /* SDL_blendpoint.c in Sources */,
   3.182 -				046387410F0B5B7D0041FD65 /* SDL_blendrect.c in Sources */,
   3.183 -				046387440F0B5B7D0041FD65 /* SDL_drawline.c in Sources */,
   3.184 -				046387450F0B5B7D0041FD65 /* SDL_drawpoint.c in Sources */,
   3.185  				046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */,
   3.186 -				043DD76F10FD8A0000DED673 /* SDL_alphamult.c in Sources */,
   3.187 -				043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */,
   3.188 -				043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */,
   3.189  				04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */,
   3.190  				56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */,
   3.191  				56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */,
   3.192 @@ -1473,6 +1483,12 @@
   3.193  				041B2CF312FA0F680087D585 /* SDL_renderer_sw.c in Sources */,
   3.194  				04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */,
   3.195  				04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */,
   3.196 +				04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */,
   3.197 +				04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */,
   3.198 +				04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */,
   3.199 +				04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */,
   3.200 +				04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */,
   3.201 +				04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */,
   3.202  			);
   3.203  			runOnlyForDeploymentPostprocessing = 0;
   3.204  		};
     4.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Thu Feb 03 11:16:57 2011 -0800
     4.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Thu Feb 03 15:49:37 2011 -0800
     4.3 @@ -252,12 +252,6 @@
     4.4  		04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; };
     4.5  		04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; };
     4.6  		04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; };
     4.7 -		04BD016F12E6671800899322 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4812E6671800899322 /* SDL_alphamult.c */; };
     4.8 -		04BD017012E6671800899322 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4912E6671800899322 /* SDL_alphamult.h */; };
     4.9 -		04BD017112E6671800899322 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */; };
    4.10 -		04BD017212E6671800899322 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4B12E6671800899322 /* SDL_blendline.c */; };
    4.11 -		04BD017312E6671800899322 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */; };
    4.12 -		04BD017412E6671800899322 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4D12E6671800899322 /* SDL_blendrect.c */; };
    4.13  		04BD017512E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; };
    4.14  		04BD017612E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; };
    4.15  		04BD017712E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; };
    4.16 @@ -272,10 +266,6 @@
    4.17  		04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; };
    4.18  		04BD018112E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
    4.19  		04BD018212E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
    4.20 -		04BD018312E6671800899322 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5C12E6671800899322 /* SDL_draw.h */; };
    4.21 -		04BD018412E6671800899322 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5D12E6671800899322 /* SDL_drawline.c */; };
    4.22 -		04BD018512E6671800899322 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */; };
    4.23 -		04BD018612E6671800899322 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5F12E6671800899322 /* SDL_drawrect.c */; };
    4.24  		04BD018712E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
    4.25  		04BD018812E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; };
    4.26  		04BD018912E6671800899322 /* SDL_glesfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */; };
    4.27 @@ -461,12 +451,6 @@
    4.28  		04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; };
    4.29  		04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; };
    4.30  		04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; };
    4.31 -		04BD038912E6671800899322 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4812E6671800899322 /* SDL_alphamult.c */; };
    4.32 -		04BD038A12E6671800899322 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4912E6671800899322 /* SDL_alphamult.h */; };
    4.33 -		04BD038B12E6671800899322 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */; };
    4.34 -		04BD038C12E6671800899322 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4B12E6671800899322 /* SDL_blendline.c */; };
    4.35 -		04BD038D12E6671800899322 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */; };
    4.36 -		04BD038E12E6671800899322 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4D12E6671800899322 /* SDL_blendrect.c */; };
    4.37  		04BD038F12E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; };
    4.38  		04BD039012E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; };
    4.39  		04BD039112E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; };
    4.40 @@ -481,10 +465,6 @@
    4.41  		04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; };
    4.42  		04BD039B12E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
    4.43  		04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
    4.44 -		04BD039D12E6671800899322 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5C12E6671800899322 /* SDL_draw.h */; };
    4.45 -		04BD039E12E6671800899322 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5D12E6671800899322 /* SDL_drawline.c */; };
    4.46 -		04BD039F12E6671800899322 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */; };
    4.47 -		04BD03A012E6671800899322 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5F12E6671800899322 /* SDL_drawrect.c */; };
    4.48  		04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
    4.49  		04BD03A212E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; };
    4.50  		04BD03A312E6671800899322 /* SDL_glesfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */; };
    4.51 @@ -564,6 +544,34 @@
    4.52  		04DEA57311E6006A00386CAC /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA56F11E6006A00386CAC /* SDL_input.h */; };
    4.53  		04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
    4.54  		04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; };
    4.55 +		04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
    4.56 +		04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
    4.57 +		04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
    4.58 +		04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
    4.59 +		04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
    4.60 +		04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
    4.61 +		04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; };
    4.62 +		04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; };
    4.63 +		04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; };
    4.64 +		04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; };
    4.65 +		04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; };
    4.66 +		04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; };
    4.67 +		04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; };
    4.68 +		04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; };
    4.69 +		04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; };
    4.70 +		04F7805412FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */; };
    4.71 +		04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
    4.72 +		04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
    4.73 +		04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; };
    4.74 +		04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; };
    4.75 +		04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; };
    4.76 +		04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; };
    4.77 +		04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; };
    4.78 +		04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; };
    4.79 +		04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; };
    4.80 +		04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; };
    4.81 +		04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; };
    4.82 +		04F7806012FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */; };
    4.83  		453773821207C518002F0F45 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 453773811207C518002F0F45 /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
    4.84  		8CB0A77811F6A87F00CBA2DE /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
    4.85  		8CB0A77911F6A87F00CBA2DE /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
    4.86 @@ -818,12 +826,6 @@
    4.87  		04BDFEE912E6671800899322 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = "<group>"; };
    4.88  		04BDFEEC12E6671800899322 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = "<group>"; };
    4.89  		04BDFEED12E6671800899322 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
    4.90 -		04BDFF4812E6671800899322 /* SDL_alphamult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_alphamult.c; sourceTree = "<group>"; };
    4.91 -		04BDFF4912E6671800899322 /* SDL_alphamult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_alphamult.h; sourceTree = "<group>"; };
    4.92 -		04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
    4.93 -		04BDFF4B12E6671800899322 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
    4.94 -		04BDFF4C12E6671800899322 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
    4.95 -		04BDFF4D12E6671800899322 /* SDL_blendrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendrect.c; sourceTree = "<group>"; };
    4.96  		04BDFF4E12E6671800899322 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = "<group>"; };
    4.97  		04BDFF4F12E6671800899322 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = "<group>"; };
    4.98  		04BDFF5012E6671800899322 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = "<group>"; };
    4.99 @@ -838,10 +840,6 @@
   4.100  		04BDFF5912E6671800899322 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = "<group>"; };
   4.101  		04BDFF5A12E6671800899322 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
   4.102  		04BDFF5B12E6671800899322 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
   4.103 -		04BDFF5C12E6671800899322 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
   4.104 -		04BDFF5D12E6671800899322 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
   4.105 -		04BDFF5E12E6671800899322 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
   4.106 -		04BDFF5F12E6671800899322 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = "<group>"; };
   4.107  		04BDFF6012E6671800899322 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
   4.108  		04BDFF6112E6671800899322 /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = "<group>"; };
   4.109  		04BDFF6212E6671800899322 /* SDL_glesfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glesfuncs.h; sourceTree = "<group>"; };
   4.110 @@ -918,6 +916,20 @@
   4.111  		04BDFFFA12E6671800899322 /* XF86VMode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = XF86VMode.c; sourceTree = "<group>"; };
   4.112  		04DEA56F11E6006A00386CAC /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; };
   4.113  		04F2AF681104AC4500D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
   4.114 +		04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = "<group>"; };
   4.115 +		04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = "<group>"; };
   4.116 +		04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
   4.117 +		04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = "<group>"; };
   4.118 +		04F7803F12FB74A200FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
   4.119 +		04F7804012FB74A200FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = "<group>"; };
   4.120 +		04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
   4.121 +		04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = "<group>"; };
   4.122 +		04F7804312FB74A200FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
   4.123 +		04F7804412FB74A200FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
   4.124 +		04F7804512FB74A200FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = "<group>"; };
   4.125 +		04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
   4.126 +		04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = "<group>"; };
   4.127 +		04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw_c.h; sourceTree = "<group>"; };
   4.128  		0C5AF5E501191D2B7F000001 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = begin_code.h; path = ../../include/begin_code.h; sourceTree = SOURCE_ROOT; };
   4.129  		0C5AF5E601191D2B7F000001 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = close_code.h; path = ../../include/close_code.h; sourceTree = SOURCE_ROOT; };
   4.130  		0C5AF5E801191D2B7F000001 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = ../../include/SDL_audio.h; sourceTree = SOURCE_ROOT; };
   4.131 @@ -1210,6 +1222,18 @@
   4.132  		041B2CA012FA0D680087D585 /* software */ = {
   4.133  			isa = PBXGroup;
   4.134  			children = (
   4.135 +				04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */,
   4.136 +				04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */,
   4.137 +				04F7803F12FB74A200FC43C0 /* SDL_blendline.c */,
   4.138 +				04F7804012FB74A200FC43C0 /* SDL_blendline.h */,
   4.139 +				04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */,
   4.140 +				04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */,
   4.141 +				04F7804312FB74A200FC43C0 /* SDL_draw.h */,
   4.142 +				04F7804412FB74A200FC43C0 /* SDL_drawline.c */,
   4.143 +				04F7804512FB74A200FC43C0 /* SDL_drawline.h */,
   4.144 +				04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */,
   4.145 +				04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */,
   4.146 +				04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */,
   4.147  				041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */,
   4.148  			);
   4.149  			path = software;
   4.150 @@ -1487,12 +1511,6 @@
   4.151  				04BDFEE712E6671800899322 /* dummy */,
   4.152  				04BDFFB712E6671800899322 /* x11 */,
   4.153  				04BDFFD712E6671800899322 /* Xext */,
   4.154 -				04BDFF4812E6671800899322 /* SDL_alphamult.c */,
   4.155 -				04BDFF4912E6671800899322 /* SDL_alphamult.h */,
   4.156 -				04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */,
   4.157 -				04BDFF4B12E6671800899322 /* SDL_blendline.c */,
   4.158 -				04BDFF4C12E6671800899322 /* SDL_blendpoint.c */,
   4.159 -				04BDFF4D12E6671800899322 /* SDL_blendrect.c */,
   4.160  				04BDFF4E12E6671800899322 /* SDL_blit.c */,
   4.161  				04BDFF4F12E6671800899322 /* SDL_blit.h */,
   4.162  				04BDFF5012E6671800899322 /* SDL_blit_0.c */,
   4.163 @@ -1507,10 +1525,6 @@
   4.164  				04BDFF5912E6671800899322 /* SDL_blit_slow.h */,
   4.165  				04BDFF5A12E6671800899322 /* SDL_bmp.c */,
   4.166  				04BDFF5B12E6671800899322 /* SDL_clipboard.c */,
   4.167 -				04BDFF5C12E6671800899322 /* SDL_draw.h */,
   4.168 -				04BDFF5D12E6671800899322 /* SDL_drawline.c */,
   4.169 -				04BDFF5E12E6671800899322 /* SDL_drawpoint.c */,
   4.170 -				04BDFF5F12E6671800899322 /* SDL_drawrect.c */,
   4.171  				04BDFF6012E6671800899322 /* SDL_fillrect.c */,
   4.172  				04BDFF6112E6671800899322 /* SDL_gamma.c */,
   4.173  				04BDFF6212E6671800899322 /* SDL_glesfuncs.h */,
   4.174 @@ -1562,6 +1576,8 @@
   4.175  			children = (
   4.176  				04BDFEE812E6671800899322 /* SDL_nullevents.c */,
   4.177  				04BDFEE912E6671800899322 /* SDL_nullevents_c.h */,
   4.178 +				04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */,
   4.179 +				04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */,
   4.180  				04BDFEEC12E6671800899322 /* SDL_nullvideo.c */,
   4.181  				04BDFEED12E6671800899322 /* SDL_nullvideo.h */,
   4.182  			);
   4.183 @@ -1893,12 +1909,10 @@
   4.184  				04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */,
   4.185  				04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */,
   4.186  				04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */,
   4.187 -				04BD017012E6671800899322 /* SDL_alphamult.h in Headers */,
   4.188  				04BD017612E6671800899322 /* SDL_blit.h in Headers */,
   4.189  				04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */,
   4.190  				04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */,
   4.191  				04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */,
   4.192 -				04BD018312E6671800899322 /* SDL_draw.h in Headers */,
   4.193  				04BD018912E6671800899322 /* SDL_glesfuncs.h in Headers */,
   4.194  				04BD018A12E6671800899322 /* SDL_glfuncs.h in Headers */,
   4.195  				04BD018B12E6671800899322 /* SDL_leaks.h in Headers */,
   4.196 @@ -1942,6 +1956,14 @@
   4.197  				041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */,
   4.198  				04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */,
   4.199  				04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
   4.200 +				04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
   4.201 +				04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
   4.202 +				04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */,
   4.203 +				04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */,
   4.204 +				04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */,
   4.205 +				04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */,
   4.206 +				04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */,
   4.207 +				04F7805412FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */,
   4.208  			);
   4.209  			runOnlyForDeploymentPostprocessing = 0;
   4.210  		};
   4.211 @@ -2016,12 +2038,10 @@
   4.212  				04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */,
   4.213  				04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */,
   4.214  				04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */,
   4.215 -				04BD038A12E6671800899322 /* SDL_alphamult.h in Headers */,
   4.216  				04BD039012E6671800899322 /* SDL_blit.h in Headers */,
   4.217  				04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */,
   4.218  				04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */,
   4.219  				04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */,
   4.220 -				04BD039D12E6671800899322 /* SDL_draw.h in Headers */,
   4.221  				04BD03A312E6671800899322 /* SDL_glesfuncs.h in Headers */,
   4.222  				04BD03A412E6671800899322 /* SDL_glfuncs.h in Headers */,
   4.223  				04BD03A512E6671800899322 /* SDL_leaks.h in Headers */,
   4.224 @@ -2065,6 +2085,14 @@
   4.225  				041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */,
   4.226  				04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */,
   4.227  				04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
   4.228 +				04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
   4.229 +				04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
   4.230 +				04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */,
   4.231 +				04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */,
   4.232 +				04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */,
   4.233 +				04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */,
   4.234 +				04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */,
   4.235 +				04F7806012FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */,
   4.236  			);
   4.237  			runOnlyForDeploymentPostprocessing = 0;
   4.238  		};
   4.239 @@ -2385,11 +2413,6 @@
   4.240  				04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */,
   4.241  				04BD011712E6671800899322 /* SDL_nullevents.c in Sources */,
   4.242  				04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */,
   4.243 -				04BD016F12E6671800899322 /* SDL_alphamult.c in Sources */,
   4.244 -				04BD017112E6671800899322 /* SDL_blendfillrect.c in Sources */,
   4.245 -				04BD017212E6671800899322 /* SDL_blendline.c in Sources */,
   4.246 -				04BD017312E6671800899322 /* SDL_blendpoint.c in Sources */,
   4.247 -				04BD017412E6671800899322 /* SDL_blendrect.c in Sources */,
   4.248  				04BD017512E6671800899322 /* SDL_blit.c in Sources */,
   4.249  				04BD017712E6671800899322 /* SDL_blit_0.c in Sources */,
   4.250  				04BD017812E6671800899322 /* SDL_blit_1.c in Sources */,
   4.251 @@ -2400,9 +2423,6 @@
   4.252  				04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */,
   4.253  				04BD018112E6671800899322 /* SDL_bmp.c in Sources */,
   4.254  				04BD018212E6671800899322 /* SDL_clipboard.c in Sources */,
   4.255 -				04BD018412E6671800899322 /* SDL_drawline.c in Sources */,
   4.256 -				04BD018512E6671800899322 /* SDL_drawpoint.c in Sources */,
   4.257 -				04BD018612E6671800899322 /* SDL_drawrect.c in Sources */,
   4.258  				04BD018712E6671800899322 /* SDL_fillrect.c in Sources */,
   4.259  				04BD018812E6671800899322 /* SDL_gamma.c in Sources */,
   4.260  				04BD018C12E6671800899322 /* SDL_pixels.c in Sources */,
   4.261 @@ -2443,6 +2463,12 @@
   4.262  				041B2CA712FA0D680087D585 /* SDL_renderer_sw.c in Sources */,
   4.263  				04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
   4.264  				04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
   4.265 +				04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
   4.266 +				04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
   4.267 +				04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */,
   4.268 +				04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */,
   4.269 +				04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */,
   4.270 +				04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */,
   4.271  			);
   4.272  			runOnlyForDeploymentPostprocessing = 0;
   4.273  		};
   4.274 @@ -2512,11 +2538,6 @@
   4.275  				04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */,
   4.276  				04BD033112E6671800899322 /* SDL_nullevents.c in Sources */,
   4.277  				04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */,
   4.278 -				04BD038912E6671800899322 /* SDL_alphamult.c in Sources */,
   4.279 -				04BD038B12E6671800899322 /* SDL_blendfillrect.c in Sources */,
   4.280 -				04BD038C12E6671800899322 /* SDL_blendline.c in Sources */,
   4.281 -				04BD038D12E6671800899322 /* SDL_blendpoint.c in Sources */,
   4.282 -				04BD038E12E6671800899322 /* SDL_blendrect.c in Sources */,
   4.283  				04BD038F12E6671800899322 /* SDL_blit.c in Sources */,
   4.284  				04BD039112E6671800899322 /* SDL_blit_0.c in Sources */,
   4.285  				04BD039212E6671800899322 /* SDL_blit_1.c in Sources */,
   4.286 @@ -2527,9 +2548,6 @@
   4.287  				04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */,
   4.288  				04BD039B12E6671800899322 /* SDL_bmp.c in Sources */,
   4.289  				04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */,
   4.290 -				04BD039E12E6671800899322 /* SDL_drawline.c in Sources */,
   4.291 -				04BD039F12E6671800899322 /* SDL_drawpoint.c in Sources */,
   4.292 -				04BD03A012E6671800899322 /* SDL_drawrect.c in Sources */,
   4.293  				04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */,
   4.294  				04BD03A212E6671800899322 /* SDL_gamma.c in Sources */,
   4.295  				04BD03A612E6671800899322 /* SDL_pixels.c in Sources */,
   4.296 @@ -2570,6 +2588,12 @@
   4.297  				041B2CAD12FA0D680087D585 /* SDL_renderer_sw.c in Sources */,
   4.298  				04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
   4.299  				04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
   4.300 +				04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
   4.301 +				04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
   4.302 +				04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */,
   4.303 +				04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */,
   4.304 +				04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */,
   4.305 +				04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */,
   4.306  			);
   4.307  			runOnlyForDeploymentPostprocessing = 0;
   4.308  		};
     5.1 --- a/include/SDL_render.h	Thu Feb 03 11:16:57 2011 -0800
     5.2 +++ b/include/SDL_render.h	Thu Feb 03 15:49:37 2011 -0800
     5.3 @@ -154,6 +154,7 @@
     5.4   *  
     5.5   *  \return A valid rendering context or NULL if there was an error.
     5.6   *  
     5.7 + *  \sa SDL_CreateSoftwareRenderer()
     5.8   *  \sa SDL_GetRendererInfo()
     5.9   *  \sa SDL_DestroyRenderer()
    5.10   */
    5.11 @@ -161,6 +162,18 @@
    5.12                                                 int index, Uint32 flags);
    5.13  
    5.14  /**
    5.15 + *  \brief Create a 2D software rendering context for a surface.
    5.16 + *  
    5.17 + *  \param surface The surface where rendering is done.
    5.18 + *  
    5.19 + *  \return A valid rendering context or NULL if there was an error.
    5.20 + *  
    5.21 + *  \sa SDL_CreateRenderer()
    5.22 + *  \sa SDL_DestroyRenderer()
    5.23 + */
    5.24 +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
    5.25 +
    5.26 +/**
    5.27   *  \brief Get information about a rendering context.
    5.28   */
    5.29  extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
     6.1 --- a/include/SDL_video.h	Thu Feb 03 11:16:57 2011 -0800
     6.2 +++ b/include/SDL_video.h	Thu Feb 03 15:49:37 2011 -0800
     6.3 @@ -608,6 +608,40 @@
     6.4                                                      int fullscreen);
     6.5  
     6.6  /**
     6.7 + *  \brief Get an SDL surface associated with the window.
     6.8 + *
     6.9 + *  \return A surface in the optimal format for the window, or NULL on error.
    6.10 + *
    6.11 + *  \note You may not combine this with 3D or the rendering API on this window.
    6.12 + *
    6.13 + *  \sa SDL_UpdateWindowSurface()
    6.14 + *  \sa SDL_UpdateWindowSurfaceRects()
    6.15 + */
    6.16 +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
    6.17 +
    6.18 +/**
    6.19 + *  \brief Copy the window surface to the screen.
    6.20 + *
    6.21 + *  \return 0 on success, or -1 on error.
    6.22 + *
    6.23 + *  \sa SDL_GetWindowSurface()
    6.24 + *  \sa SDL_UpdateWindowSurfaceRects()
    6.25 + */
    6.26 +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
    6.27 +
    6.28 +/**
    6.29 + *  \brief Copy a number of rectangles on the window surface to the screen.
    6.30 + *
    6.31 + *  \return 0 on success, or -1 on error.
    6.32 + *
    6.33 + *  \sa SDL_GetWindowSurface()
    6.34 + *  \sa SDL_UpdateWindowSurfaceRect()
    6.35 + */
    6.36 +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
    6.37 +                                                         int numrects,
    6.38 +                                                         SDL_Rect * rects);
    6.39 +
    6.40 +/**
    6.41   *  \brief Set a window's input grab mode.
    6.42   *  
    6.43   *  \param mode This is 1 to grab input, and 0 to release input.
     7.1 --- a/src/events/SDL_windowevents.c	Thu Feb 03 11:16:57 2011 -0800
     7.2 +++ b/src/events/SDL_windowevents.c	Thu Feb 03 15:49:37 2011 -0800
     7.3 @@ -106,6 +106,7 @@
     7.4          }
     7.5          window->w = data1;
     7.6          window->h = data2;
     7.7 +        SDL_OnWindowResized(window);
     7.8          break;
     7.9      case SDL_WINDOWEVENT_MINIMIZED:
    7.10          if (window->flags & SDL_WINDOW_MINIMIZED) {
     8.1 --- a/src/render/SDL_render.c	Thu Feb 03 11:16:57 2011 -0800
     8.2 +++ b/src/render/SDL_render.c	Thu Feb 03 15:49:37 2011 -0800
     8.3 @@ -26,6 +26,7 @@
     8.4  #include "SDL_render.h"
     8.5  #include "SDL_sysrender.h"
     8.6  #include "../video/SDL_pixels_c.h"
     8.7 +#include "software/SDL_renderer_sw_c.h"
     8.8  
     8.9  
    8.10  #define CHECK_RENDERER_MAGIC(renderer, retval) \
    8.11 @@ -137,12 +138,19 @@
    8.12  
    8.13      if (renderer) {
    8.14          renderer->magic = &renderer_magic;
    8.15 +        renderer->window = window;
    8.16  
    8.17          SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
    8.18      }
    8.19      return renderer;
    8.20  }
    8.21  
    8.22 +SDL_Renderer *
    8.23 +SDL_CreateSoftwareRenderer(SDL_Surface * surface)
    8.24 +{
    8.25 +    return SW_CreateRendererForSurface(surface);
    8.26 +}
    8.27 +
    8.28  int
    8.29  SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info)
    8.30  {
     9.1 --- a/src/render/direct3d/SDL_d3drender.c	Thu Feb 03 11:16:57 2011 -0800
     9.2 +++ b/src/render/direct3d/SDL_d3drender.c	Thu Feb 03 15:49:37 2011 -0800
     9.3 @@ -327,7 +327,6 @@
     9.4      renderer->DestroyTexture = D3D_DestroyTexture;
     9.5      renderer->DestroyRenderer = D3D_DestroyRenderer;
     9.6      renderer->info = D3D_RenderDriver.info;
     9.7 -    renderer->window = window;
     9.8      renderer->driverdata = data;
     9.9  
    9.10      renderer->info.flags = SDL_RENDERER_ACCELERATED;
    10.1 --- a/src/render/opengl/SDL_renderer_gl.c	Thu Feb 03 11:16:57 2011 -0800
    10.2 +++ b/src/render/opengl/SDL_renderer_gl.c	Thu Feb 03 15:49:37 2011 -0800
    10.3 @@ -209,7 +209,6 @@
    10.4      renderer->DestroyTexture = GL_DestroyTexture;
    10.5      renderer->DestroyRenderer = GL_DestroyRenderer;
    10.6      renderer->info = GL_RenderDriver.info;
    10.7 -    renderer->window = window;
    10.8      renderer->driverdata = data;
    10.9  
   10.10      renderer->info.flags = SDL_RENDERER_ACCELERATED;
    11.1 --- a/src/render/opengles/SDL_renderer_gles.c	Thu Feb 03 11:16:57 2011 -0800
    11.2 +++ b/src/render/opengles/SDL_renderer_gles.c	Thu Feb 03 15:49:37 2011 -0800
    11.3 @@ -202,7 +202,6 @@
    11.4      renderer->DestroyTexture = GLES_DestroyTexture;
    11.5      renderer->DestroyRenderer = GLES_DestroyRenderer;
    11.6      renderer->info = GL_ES_RenderDriver.info;
    11.7 -    renderer->window = window;
    11.8      renderer->driverdata = data;
    11.9  
   11.10      renderer->info.flags = SDL_RENDERER_ACCELERATED;
    12.1 --- a/src/render/software/SDL_blendline.c	Thu Feb 03 11:16:57 2011 -0800
    12.2 +++ b/src/render/software/SDL_blendline.c	Thu Feb 03 15:49:37 2011 -0800
    12.3 @@ -23,6 +23,7 @@
    12.4  
    12.5  #include "SDL_draw.h"
    12.6  #include "SDL_blendline.h"
    12.7 +#include "SDL_blendpoint.h"
    12.8  
    12.9  
   12.10  static void
    13.1 --- a/src/render/software/SDL_drawline.c	Thu Feb 03 11:16:57 2011 -0800
    13.2 +++ b/src/render/software/SDL_drawline.c	Thu Feb 03 15:49:37 2011 -0800
    13.3 @@ -23,6 +23,7 @@
    13.4  
    13.5  #include "SDL_draw.h"
    13.6  #include "SDL_drawline.h"
    13.7 +#include "SDL_drawpoint.h"
    13.8  
    13.9  
   13.10  static void
    14.1 --- a/src/render/software/SDL_renderer_sw.c	Thu Feb 03 11:16:57 2011 -0800
    14.2 +++ b/src/render/software/SDL_renderer_sw.c	Thu Feb 03 15:49:37 2011 -0800
    14.3 @@ -69,7 +69,7 @@
    14.4      SW_CreateRenderer,
    14.5      {
    14.6       "software",
    14.7 -     (SDL_RENDERER_PRESENTVSYNC),
    14.8 +     0,
    14.9       8,
   14.10       {
   14.11        SDL_PIXELFORMAT_RGB555,
   14.12 @@ -87,61 +87,19 @@
   14.13  
   14.14  typedef struct
   14.15  {
   14.16 -    Uint32 format;
   14.17      SDL_bool updateSize;
   14.18 -    SDL_Texture *texture;
   14.19 -    SDL_Surface surface;
   14.20 -    SDL_Renderer *renderer;
   14.21 +    SDL_Surface *surface;
   14.22  } SW_RenderData;
   14.23  
   14.24 -static SDL_Texture *
   14.25 -CreateTexture(SDL_Renderer * renderer, Uint32 format, int w, int h)
   14.26 -{
   14.27 -    SDL_Texture *texture;
   14.28 -
   14.29 -    texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
   14.30 -    if (!texture) {
   14.31 -        SDL_OutOfMemory();
   14.32 -        return NULL;
   14.33 -    }
   14.34 -
   14.35 -    texture->format = format;
   14.36 -    texture->access = SDL_TEXTUREACCESS_STREAMING;
   14.37 -    texture->w = w;
   14.38 -    texture->h = h;
   14.39 -    texture->renderer = renderer;
   14.40 -
   14.41 -    if (renderer->CreateTexture(renderer, texture) < 0) {
   14.42 -        SDL_free(texture);
   14.43 -        return NULL;
   14.44 -    }
   14.45 -    return texture;
   14.46 -}
   14.47 -
   14.48 -static void
   14.49 -DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
   14.50 -{
   14.51 -    renderer->DestroyTexture(renderer, texture);
   14.52 -    SDL_free(texture);
   14.53 -}
   14.54  
   14.55  SDL_Renderer *
   14.56 -SW_CreateRenderer(SDL_Window * window, Uint32 flags)
   14.57 +SW_CreateRendererForSurface(SDL_Surface * surface)
   14.58  {
   14.59      SDL_Renderer *renderer;
   14.60      SW_RenderData *data;
   14.61 -    int i;
   14.62 -    int w, h;
   14.63 -    Uint32 format;
   14.64 -    int bpp;
   14.65 -    Uint32 Rmask, Gmask, Bmask, Amask;
   14.66 -    Uint32 renderer_flags;
   14.67 -    const char *desired_driver;
   14.68  
   14.69 -    format = SDL_GetWindowPixelFormat(window);
   14.70 -    if (!SDL_PixelFormatEnumToMasks
   14.71 -        (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
   14.72 -        SDL_SetError("Unknown display format");
   14.73 +    if (!surface) {
   14.74 +        SDL_SetError("Can't create renderer for NULL surface");
   14.75          return NULL;
   14.76      }
   14.77  
   14.78 @@ -157,6 +115,8 @@
   14.79          SDL_OutOfMemory();
   14.80          return NULL;
   14.81      }
   14.82 +    data->surface = surface;
   14.83 +
   14.84      renderer->WindowEvent = SW_WindowEvent;
   14.85      renderer->CreateTexture = SW_CreateTexture;
   14.86      renderer->SetTextureColorMod = SW_SetTextureColorMod;
   14.87 @@ -174,80 +134,34 @@
   14.88      renderer->RenderPresent = SW_RenderPresent;
   14.89      renderer->DestroyRenderer = SW_DestroyRenderer;
   14.90      renderer->info = SW_RenderDriver.info;
   14.91 -    renderer->info.flags = 0;
   14.92 -    renderer->window = window;
   14.93      renderer->driverdata = data;
   14.94  
   14.95 -    data->format = format;
   14.96 -
   14.97 -    /* Find a render driver that we can use to display data */
   14.98 -    renderer_flags = 0;
   14.99 -    if (flags & SDL_RENDERER_PRESENTVSYNC) {
  14.100 -        renderer_flags |= SDL_RENDERER_PRESENTVSYNC;
  14.101 -    }
  14.102 -    desired_driver = SDL_getenv("SDL_VIDEO_RENDERER_SWDRIVER");
  14.103 -    for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) {
  14.104 -        SDL_RendererInfo info;
  14.105 -        SDL_GetRenderDriverInfo(i, &info);
  14.106 -        if (SDL_strcmp(info.name, SW_RenderDriver.info.name) == 0) {
  14.107 -            continue;
  14.108 -        }
  14.109 -        if (desired_driver
  14.110 -            && SDL_strcasecmp(desired_driver, info.name) != 0) {
  14.111 -            continue;
  14.112 -        }
  14.113 -        data->renderer = SDL_CreateRenderer(window, i, renderer_flags);
  14.114 -        if (data->renderer) {
  14.115 -            break;
  14.116 -        }
  14.117 -    }
  14.118 -    if (i == SDL_GetNumRenderDrivers()) {
  14.119 -        SW_DestroyRenderer(renderer);
  14.120 -        SDL_SetError("Couldn't find display render driver");
  14.121 -        return NULL;
  14.122 -    }
  14.123 -    if (data->renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
  14.124 -        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
  14.125 -    }
  14.126 -
  14.127 -    /* Create the textures we'll use for display */
  14.128 -    SDL_GetWindowSize(window, &w, &h);
  14.129 -    data->texture = CreateTexture(data->renderer, data->format, w, h);
  14.130 -    if (!data->texture) {
  14.131 -        SW_DestroyRenderer(renderer);
  14.132 -        return NULL;
  14.133 -    }
  14.134 -
  14.135 -    /* Create a surface we'll use for rendering */
  14.136 -    data->surface.flags = SDL_PREALLOC;
  14.137 -    data->surface.format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
  14.138 -    if (!data->surface.format) {
  14.139 -        SW_DestroyRenderer(renderer);
  14.140 -        return NULL;
  14.141 -    }
  14.142 -
  14.143      return renderer;
  14.144  }
  14.145  
  14.146 -static SDL_Texture *
  14.147 +SDL_Renderer *
  14.148 +SW_CreateRenderer(SDL_Window * window, Uint32 flags)
  14.149 +{
  14.150 +    SDL_Surface *surface;
  14.151 +
  14.152 +    surface = SDL_GetWindowSurface(window);
  14.153 +    if (!surface) {
  14.154 +        return NULL;
  14.155 +    }
  14.156 +    return SW_CreateRendererForSurface(surface);
  14.157 +}
  14.158 +
  14.159 +static SDL_Surface *
  14.160  SW_ActivateRenderer(SDL_Renderer * renderer)
  14.161  {
  14.162      SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.163      SDL_Window *window = renderer->window;
  14.164  
  14.165      if (data->updateSize) {
  14.166 -        /* Recreate the textures for the new window size */
  14.167 -        int w, h;
  14.168 -        if (data->texture) {
  14.169 -            DestroyTexture(data->renderer, data->texture);
  14.170 -        }
  14.171 -        SDL_GetWindowSize(window, &w, &h);
  14.172 -        data->texture = CreateTexture(data->renderer, data->format, w, h);
  14.173 -        if (data->texture) {
  14.174 -            data->updateSize = SDL_FALSE;
  14.175 -        }
  14.176 +        data->surface = SDL_GetWindowSurface(window);
  14.177 +        data->updateSize = SDL_FALSE;
  14.178      }
  14.179 -    return data->texture;
  14.180 +    return data->surface;
  14.181  }
  14.182  
  14.183  static void
  14.184 @@ -356,264 +270,130 @@
  14.185  SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
  14.186                      int count)
  14.187  {
  14.188 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.189 -    SDL_Texture *texture = SW_ActivateRenderer(renderer);
  14.190 -    SDL_Rect rect;
  14.191 -    int i;
  14.192 -    int x, y;
  14.193 -    int status = 0;
  14.194 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
  14.195  
  14.196 -    if (!texture) {
  14.197 +    if (!surface) {
  14.198          return -1;
  14.199      }
  14.200  
  14.201 -    /* Get the smallest rectangle that contains everything */
  14.202 -    rect.x = 0;
  14.203 -    rect.y = 0;
  14.204 -    rect.w = texture->w;
  14.205 -    rect.h = texture->h;
  14.206 -    if (!SDL_EnclosePoints(points, count, &rect, &rect)) {
  14.207 -        /* Nothing to draw */
  14.208 -        return 0;
  14.209 -    }
  14.210 -
  14.211 -    if (data->renderer->LockTexture(data->renderer, texture, &rect,
  14.212 -                                    &data->surface.pixels,
  14.213 -                                    &data->surface.pitch) < 0) {
  14.214 -        return -1;
  14.215 -    }
  14.216 -
  14.217 -    data->surface.clip_rect.w = data->surface.w = rect.w;
  14.218 -    data->surface.clip_rect.h = data->surface.h = rect.h;
  14.219 -
  14.220      /* Draw the points! */
  14.221      if (renderer->blendMode == SDL_BLENDMODE_NONE) {
  14.222 -        Uint32 color = SDL_MapRGBA(data->surface.format,
  14.223 +        Uint32 color = SDL_MapRGBA(surface->format,
  14.224                                     renderer->r, renderer->g, renderer->b,
  14.225                                     renderer->a);
  14.226  
  14.227 -        for (i = 0; i < count; ++i) {
  14.228 -            x = points[i].x - rect.x;
  14.229 -            y = points[i].y - rect.y;
  14.230 -
  14.231 -            status = SDL_DrawPoint(&data->surface, x, y, color);
  14.232 -        }
  14.233 +        return SDL_DrawPoints(surface, points, count, color);
  14.234      } else {
  14.235 -        for (i = 0; i < count; ++i) {
  14.236 -            x = points[i].x - rect.x;
  14.237 -            y = points[i].y - rect.y;
  14.238 -
  14.239 -            status = SDL_BlendPoint(&data->surface, x, y,
  14.240 -                                    renderer->blendMode,
  14.241 -                                    renderer->r, renderer->g, renderer->b,
  14.242 -                                    renderer->a);
  14.243 -        }
  14.244 +        return SDL_BlendPoints(surface, points, count,
  14.245 +                               renderer->blendMode,
  14.246 +                               renderer->r, renderer->g, renderer->b,
  14.247 +                               renderer->a);
  14.248      }
  14.249 -
  14.250 -    data->renderer->UnlockTexture(data->renderer, texture);
  14.251 -
  14.252 -    return status;
  14.253  }
  14.254  
  14.255  static int
  14.256  SW_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
  14.257                     int count)
  14.258  {
  14.259 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.260 -    SDL_Texture *texture = SW_ActivateRenderer(renderer);
  14.261 -    SDL_Rect clip, rect;
  14.262 -    int i;
  14.263 -    int x1, y1, x2, y2;
  14.264 -    int status = 0;
  14.265 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
  14.266  
  14.267 -    if (!texture) {
  14.268 +    if (!surface) {
  14.269          return -1;
  14.270      }
  14.271  
  14.272 -    /* Get the smallest rectangle that contains everything */
  14.273 -    clip.x = 0;
  14.274 -    clip.y = 0;
  14.275 -    clip.w = texture->w;
  14.276 -    clip.h = texture->h;
  14.277 -    SDL_EnclosePoints(points, count, NULL, &rect);
  14.278 -    if (!SDL_IntersectRect(&rect, &clip, &rect)) {
  14.279 -        /* Nothing to draw */
  14.280 -        return 0;
  14.281 -    }
  14.282 -
  14.283 -    if (data->renderer->LockTexture(data->renderer, texture, &rect,
  14.284 -                                    &data->surface.pixels,
  14.285 -                                    &data->surface.pitch) < 0) {
  14.286 -        return -1;
  14.287 -    }
  14.288 -
  14.289 -    data->surface.clip_rect.w = data->surface.w = rect.w;
  14.290 -    data->surface.clip_rect.h = data->surface.h = rect.h;
  14.291 -
  14.292 -    /* Draw the points! */
  14.293 +    /* Draw the lines! */
  14.294      if (renderer->blendMode == SDL_BLENDMODE_NONE) {
  14.295 -        Uint32 color = SDL_MapRGBA(data->surface.format,
  14.296 +        Uint32 color = SDL_MapRGBA(surface->format,
  14.297                                     renderer->r, renderer->g, renderer->b,
  14.298                                     renderer->a);
  14.299  
  14.300 -        for (i = 1; i < count; ++i) {
  14.301 -            x1 = points[i-1].x - rect.x;
  14.302 -            y1 = points[i-1].y - rect.y;
  14.303 -            x2 = points[i].x - rect.x;
  14.304 -            y2 = points[i].y - rect.y;
  14.305 -
  14.306 -            status = SDL_DrawLine(&data->surface, x1, y1, x2, y2, color);
  14.307 -        }
  14.308 +        return SDL_DrawLines(surface, points, count, color);
  14.309      } else {
  14.310 -        for (i = 1; i < count; ++i) {
  14.311 -            x1 = points[i-1].x - rect.x;
  14.312 -            y1 = points[i-1].y - rect.y;
  14.313 -            x2 = points[i].x - rect.x;
  14.314 -            y2 = points[i].y - rect.y;
  14.315 -
  14.316 -            status = SDL_BlendLine(&data->surface, x1, y1, x2, y2,
  14.317 -                                   renderer->blendMode,
  14.318 -                                   renderer->r, renderer->g, renderer->b,
  14.319 -                                   renderer->a);
  14.320 -        }
  14.321 +        return SDL_BlendLines(surface, points, count,
  14.322 +                              renderer->blendMode,
  14.323 +                              renderer->r, renderer->g, renderer->b,
  14.324 +                              renderer->a);
  14.325      }
  14.326 -
  14.327 -    data->renderer->UnlockTexture(data->renderer, texture);
  14.328 -
  14.329 -    return status;
  14.330  }
  14.331  
  14.332  static int
  14.333  SW_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
  14.334                     int count)
  14.335  {
  14.336 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.337 -    SDL_Texture *texture = SW_ActivateRenderer(renderer);
  14.338 -    SDL_Rect clip, rect;
  14.339 -    Uint32 color = 0;
  14.340 -    int i;
  14.341 -    int status = 0;
  14.342 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
  14.343  
  14.344 -    if (!texture) {
  14.345 +    if (!surface) {
  14.346          return -1;
  14.347      }
  14.348  
  14.349 -    clip.x = 0;
  14.350 -    clip.y = 0;
  14.351 -    clip.w = texture->w;
  14.352 -    clip.h = texture->h;
  14.353 -
  14.354      if (renderer->blendMode == SDL_BLENDMODE_NONE) {
  14.355 -        color = SDL_MapRGBA(data->surface.format,
  14.356 -                            renderer->r, renderer->g, renderer->b,
  14.357 -                            renderer->a);
  14.358 +        Uint32 color = SDL_MapRGBA(surface->format,
  14.359 +                                   renderer->r, renderer->g, renderer->b,
  14.360 +                                   renderer->a);
  14.361 +        return SDL_FillRects(surface, rects, count, color);
  14.362 +    } else {
  14.363 +        return SDL_BlendFillRects(surface, rects, count,
  14.364 +                                     renderer->blendMode,
  14.365 +                                     renderer->r, renderer->g, renderer->b,
  14.366 +                                     renderer->a);
  14.367      }
  14.368 -
  14.369 -    for (i = 0; i < count; ++i) {
  14.370 -        if (!SDL_IntersectRect(rects[i], &clip, &rect)) {
  14.371 -            /* Nothing to draw */
  14.372 -            continue;
  14.373 -        }
  14.374 -
  14.375 -        if (data->renderer->LockTexture(data->renderer, texture, &rect,
  14.376 -                                        &data->surface.pixels,
  14.377 -                                        &data->surface.pitch) < 0) {
  14.378 -            return -1;
  14.379 -        }
  14.380 -
  14.381 -        data->surface.clip_rect.w = data->surface.w = rect.w;
  14.382 -        data->surface.clip_rect.h = data->surface.h = rect.h;
  14.383 -
  14.384 -        if (renderer->blendMode == SDL_BLENDMODE_NONE) {
  14.385 -            status = SDL_FillRect(&data->surface, NULL, color);
  14.386 -        } else {
  14.387 -            status = SDL_BlendFillRect(&data->surface, NULL,
  14.388 -                                       renderer->blendMode,
  14.389 -                                       renderer->r, renderer->g, renderer->b,
  14.390 -                                       renderer->a);
  14.391 -        }
  14.392 -
  14.393 -        data->renderer->UnlockTexture(data->renderer, texture);
  14.394 -    }
  14.395 -    return status;
  14.396  }
  14.397  
  14.398  static int
  14.399  SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
  14.400                const SDL_Rect * srcrect, const SDL_Rect * dstrect)
  14.401  {
  14.402 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.403 -    SDL_Surface *surface;
  14.404 -    SDL_Rect real_srcrect;
  14.405 -    SDL_Rect real_dstrect;
  14.406 -    int status;
  14.407 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
  14.408 +    SDL_Surface *src = (SDL_Surface *) texture->driverdata;
  14.409 +    SDL_Rect final_rect = *dstrect;
  14.410  
  14.411 -    if (!SW_ActivateRenderer(renderer)) {
  14.412 +    if (!surface) {
  14.413          return -1;
  14.414      }
  14.415 -
  14.416 -    if (data->renderer->LockTexture(data->renderer, data->texture, dstrect,
  14.417 -                                    &data->surface.pixels,
  14.418 -                                    &data->surface.pitch) < 0) {
  14.419 -        return -1;
  14.420 -    }
  14.421 -
  14.422 -    surface = (SDL_Surface *) texture->driverdata;
  14.423 -    real_srcrect = *srcrect;
  14.424 -
  14.425 -    data->surface.w = dstrect->w;
  14.426 -    data->surface.h = dstrect->h;
  14.427 -    data->surface.clip_rect.w = dstrect->w;
  14.428 -    data->surface.clip_rect.h = dstrect->h;
  14.429 -    real_dstrect = data->surface.clip_rect;
  14.430 -
  14.431 -    status = SDL_LowerBlit(surface, &real_srcrect, &data->surface, &real_dstrect);
  14.432 -    data->renderer->UnlockTexture(data->renderer, data->texture);
  14.433 -    return status;
  14.434 +    return SDL_BlitSurface(src, srcrect, surface, &final_rect);
  14.435  }
  14.436  
  14.437  static int
  14.438  SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
  14.439                      Uint32 format, void * pixels, int pitch)
  14.440  {
  14.441 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.442 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
  14.443 +    Uint32 src_format;
  14.444 +    void *src_pixels;
  14.445  
  14.446 -    if (!SW_ActivateRenderer(renderer)) {
  14.447 +    if (!surface) {
  14.448          return -1;
  14.449      }
  14.450  
  14.451 -    if (data->renderer->LockTexture(data->renderer, data->texture, rect,
  14.452 -                                    &data->surface.pixels,
  14.453 -                                    &data->surface.pitch) < 0) {
  14.454 +    if (rect->x < 0 || rect->x+rect->w > surface->w ||
  14.455 +        rect->y < 0 || rect->y+rect->h > surface->h) {
  14.456 +        SDL_SetError("Tried to read outside of surface bounds");
  14.457          return -1;
  14.458      }
  14.459  
  14.460 -    SDL_ConvertPixels(rect->w, rect->h,
  14.461 -                      data->format, data->surface.pixels, data->surface.pitch,
  14.462 -                      format, pixels, pitch);
  14.463 +    src_format = SDL_MasksToPixelFormatEnum(
  14.464 +                    surface->format->BitsPerPixel,
  14.465 +                    surface->format->Rmask, surface->format->Gmask,
  14.466 +                    surface->format->Bmask, surface->format->Amask);
  14.467  
  14.468 -    data->renderer->UnlockTexture(data->renderer, data->texture);
  14.469 -    return 0;
  14.470 +    src_pixels = (void*)((Uint8 *) surface->pixels +
  14.471 +                    rect->y * surface->pitch +
  14.472 +                    rect->x * surface->format->BytesPerPixel);
  14.473 +
  14.474 +    return SDL_ConvertPixels(rect->w, rect->h,
  14.475 +                             src_format, src_pixels, surface->pitch,
  14.476 +                             format, pixels, pitch);
  14.477  }
  14.478  
  14.479  static void
  14.480  SW_RenderPresent(SDL_Renderer * renderer)
  14.481  {
  14.482      SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.483 -    SDL_Texture *texture = SW_ActivateRenderer(renderer);
  14.484 -    SDL_Rect rect;
  14.485 +    SDL_Window *window = renderer->window;
  14.486  
  14.487 -    if (!texture) {
  14.488 -        return;
  14.489 +    if (window) {
  14.490 +        SDL_UpdateWindowSurface(window);
  14.491      }
  14.492 -
  14.493 -    /* Send the data to the display */
  14.494 -    rect.x = 0;
  14.495 -    rect.y = 0;
  14.496 -    rect.w = texture->w;
  14.497 -    rect.h = texture->h;
  14.498 -    data->renderer->RenderCopy(data->renderer, texture, &rect, &rect);
  14.499 -    data->renderer->RenderPresent(data->renderer);
  14.500  }
  14.501  
  14.502  static void
  14.503 @@ -628,18 +408,8 @@
  14.504  SW_DestroyRenderer(SDL_Renderer * renderer)
  14.505  {
  14.506      SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
  14.507 -    SDL_Window *window = renderer->window;
  14.508  
  14.509      if (data) {
  14.510 -        if (data->texture) {
  14.511 -            DestroyTexture(data->renderer, data->texture);
  14.512 -        }
  14.513 -        if (data->surface.format) {
  14.514 -            SDL_FreeFormat(data->surface.format);
  14.515 -        }
  14.516 -        if (data->renderer) {
  14.517 -            data->renderer->DestroyRenderer(data->renderer);
  14.518 -        }
  14.519          SDL_free(data);
  14.520      }
  14.521      SDL_free(renderer);
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/src/render/software/SDL_renderer_sw_c.h	Thu Feb 03 15:49:37 2011 -0800
    15.3 @@ -0,0 +1,25 @@
    15.4 +/*
    15.5 +    SDL - Simple DirectMedia Layer
    15.6 +    Copyright (C) 1997-2010 Sam Lantinga
    15.7 +
    15.8 +    This library is free software; you can redistribute it and/or
    15.9 +    modify it under the terms of the GNU Lesser General Public
   15.10 +    License as published by the Free Software Foundation; either
   15.11 +    version 2.1 of the License, or (at your option) any later version.
   15.12 +
   15.13 +    This library is distributed in the hope that it will be useful,
   15.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.16 +    Lesser General Public License for more details.
   15.17 +
   15.18 +    You should have received a copy of the GNU Lesser General Public
   15.19 +    License along with this library; if not, write to the Free Software
   15.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   15.21 +
   15.22 +    Sam Lantinga
   15.23 +    slouken@libsdl.org
   15.24 +*/
   15.25 +
   15.26 +extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface);
   15.27 +
   15.28 +/* vi: set ts=4 sw=4 expandtab: */
    16.1 --- a/src/video/SDL_sysvideo.h	Thu Feb 03 11:16:57 2011 -0800
    16.2 +++ b/src/video/SDL_sysvideo.h	Thu Feb 03 15:49:37 2011 -0800
    16.3 @@ -80,6 +80,8 @@
    16.4  
    16.5      SDL_DisplayMode fullscreen_mode;
    16.6      
    16.7 +    SDL_Surface *surface;
    16.8 +
    16.9      SDL_WindowShaper *shaper;
   16.10  
   16.11      SDL_WindowUserData *data;
   16.12 @@ -190,7 +192,10 @@
   16.13      void (*RestoreWindow) (_THIS, SDL_Window * window);
   16.14      void (*SetWindowGrab) (_THIS, SDL_Window * window);
   16.15      void (*DestroyWindow) (_THIS, SDL_Window * window);
   16.16 -    
   16.17 +    int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
   16.18 +    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, int numrects, SDL_Rect * rects);
   16.19 +    void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
   16.20 +
   16.21      /* * * */
   16.22      /*
   16.23       * Shaped-window functions
   16.24 @@ -344,6 +349,7 @@
   16.25  
   16.26  extern void SDL_OnWindowShown(SDL_Window * window);
   16.27  extern void SDL_OnWindowHidden(SDL_Window * window);
   16.28 +extern void SDL_OnWindowResized(SDL_Window * window);
   16.29  extern void SDL_OnWindowMinimized(SDL_Window * window);
   16.30  extern void SDL_OnWindowRestored(SDL_Window * window);
   16.31  extern void SDL_OnWindowFocusGained(SDL_Window * window);
    17.1 --- a/src/video/SDL_video.c	Thu Feb 03 11:16:57 2011 -0800
    17.2 +++ b/src/video/SDL_video.c	Thu Feb 03 15:49:37 2011 -0800
    17.3 @@ -95,6 +95,130 @@
    17.4  /* Various local functions */
    17.5  static void SDL_UpdateWindowGrab(SDL_Window * window);
    17.6  
    17.7 +/* Support for framebuffer emulation using an accelerated renderer */
    17.8 +
    17.9 +#define SDL_WINDOWTEXTUREDATA   "_SDL_WindowTextureData"
   17.10 +
   17.11 +typedef struct {
   17.12 +    SDL_Renderer *renderer;
   17.13 +    SDL_Texture *texture;
   17.14 +    void *pixels;
   17.15 +    int pitch;
   17.16 +} SDL_WindowTextureData;
   17.17 +
   17.18 +static int
   17.19 +SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
   17.20 +{
   17.21 +    SDL_WindowTextureData *data;
   17.22 +    SDL_Renderer *renderer;
   17.23 +    SDL_RendererInfo info;
   17.24 +    Uint32 i;
   17.25 +
   17.26 +    data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
   17.27 +    if (!data) {
   17.28 +        data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data));
   17.29 +        if (!data) {
   17.30 +            SDL_OutOfMemory();
   17.31 +            return -1;
   17.32 +        }
   17.33 +        SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data);
   17.34 +    }
   17.35 +
   17.36 +    renderer = data->renderer;
   17.37 +    if (!renderer) {
   17.38 +        renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
   17.39 +        if (!renderer) {
   17.40 +            return -1;
   17.41 +        }
   17.42 +        data->renderer = renderer;
   17.43 +    }
   17.44 +
   17.45 +    /* Free any old texture and pixel data */
   17.46 +    if (data->texture) {
   17.47 +        SDL_DestroyTexture(data->texture);
   17.48 +        data->texture = NULL;
   17.49 +    }
   17.50 +    if (data->pixels) {
   17.51 +        SDL_free(data->pixels);
   17.52 +        data->pixels = NULL;
   17.53 +    }
   17.54 +
   17.55 +    if (SDL_GetRendererInfo(renderer, &info) < 0) {
   17.56 +        return -1;
   17.57 +    }
   17.58 +
   17.59 +    /* Find the first format without an alpha channel */
   17.60 +    *format = info.texture_formats[0];
   17.61 +    for (i = 0; i < info.num_texture_formats; ++i) {
   17.62 +        if (!SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) {
   17.63 +            *format = info.texture_formats[i];
   17.64 +            break;
   17.65 +        }
   17.66 +    }
   17.67 +
   17.68 +    data->texture = SDL_CreateTexture(renderer, *format,
   17.69 +                                      SDL_TEXTUREACCESS_STREAMING,
   17.70 +                                      window->w, window->h);
   17.71 +    if (!data->texture) {
   17.72 +        return -1;
   17.73 +    }
   17.74 +
   17.75 +    /* Create framebuffer data */
   17.76 +    data->pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3);
   17.77 +    data->pixels = SDL_malloc(window->h * data->pitch);
   17.78 +    if (!data->pixels) {
   17.79 +        SDL_OutOfMemory();
   17.80 +        return -1;
   17.81 +    }
   17.82 +
   17.83 +    *pixels = data->pixels;
   17.84 +    *pitch = data->pitch;
   17.85 +    return 0;
   17.86 +}
   17.87 +
   17.88 +static int
   17.89 +SDL_UpdateWindowTexture(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects)
   17.90 +{
   17.91 +    SDL_WindowTextureData *data;
   17.92 +
   17.93 +    data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
   17.94 +    if (!data || !data->texture) {
   17.95 +        SDL_SetError("No window texture data");
   17.96 +        return -1;
   17.97 +    }
   17.98 +
   17.99 +    if (SDL_UpdateTexture(data->texture, NULL, data->pixels, data->pitch) < 0) {
  17.100 +        return -1;
  17.101 +    }
  17.102 +    if (SDL_RenderCopy(data->renderer, data->texture, NULL, NULL) < 0) {
  17.103 +        return -1;
  17.104 +    }
  17.105 +    SDL_RenderPresent(data->renderer);
  17.106 +    return 0;
  17.107 +}
  17.108 +
  17.109 +static void
  17.110 +SDL_DestroyWindowTexture(_THIS, SDL_Window * window)
  17.111 +{
  17.112 +    SDL_WindowTextureData *data;
  17.113 +
  17.114 +    data = SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, NULL);
  17.115 +    if (!data) {
  17.116 +        return;
  17.117 +    }
  17.118 +    if (data->texture) {
  17.119 +        SDL_DestroyTexture(data->texture);
  17.120 +    }
  17.121 +    if (data->renderer) {
  17.122 +        SDL_DestroyRenderer(data->renderer);
  17.123 +    }
  17.124 +    if (data->pixels) {
  17.125 +        SDL_free(data->pixels);
  17.126 +    }
  17.127 +    SDL_free(data);
  17.128 +}
  17.129 +
  17.130 +
  17.131  static int
  17.132  cmpmodes(const void *A, const void *B)
  17.133  {
  17.134 @@ -228,6 +352,7 @@
  17.135          SDL_VideoQuit();
  17.136          return -1;
  17.137      }
  17.138 +
  17.139      /* Make sure some displays were added */
  17.140      if (_this->num_displays == 0) {
  17.141          SDL_SetError("The video driver did not add any displays");
  17.142 @@ -235,6 +360,13 @@
  17.143          return (-1);
  17.144      }
  17.145  
  17.146 +    /* Add the renderer framebuffer emulation if needed */
  17.147 +    if (!_this->CreateWindowFramebuffer) {
  17.148 +        _this->CreateWindowFramebuffer = SDL_CreateWindowTexture;
  17.149 +        _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture;
  17.150 +        _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture;
  17.151 +    }
  17.152 +
  17.153      /* We're ready to go! */
  17.154      return 0;
  17.155  }
  17.156 @@ -1216,6 +1348,69 @@
  17.157      return 0;
  17.158  }
  17.159  
  17.160 +static SDL_Surface *
  17.161 +SDL_CreateWindowFramebuffer(SDL_Window * window)
  17.162 +{
  17.163 +    Uint32 format;
  17.164 +    void *pixels;
  17.165 +    int pitch;
  17.166 +    int bpp;
  17.167 +    Uint32 Rmask, Gmask, Bmask, Amask;
  17.168 +
  17.169 +    if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) {
  17.170 +        return NULL;
  17.171 +    }
  17.172 +
  17.173 +    if (_this->CreateWindowFramebuffer(_this, window, &format, &pixels, &pitch) < 0) {
  17.174 +        return NULL;
  17.175 +    }
  17.176 +
  17.177 +    if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
  17.178 +        return NULL;
  17.179 +    }
  17.180 +
  17.181 +    return SDL_CreateRGBSurfaceFrom(pixels, window->w, window->h, bpp, pitch, Rmask, Gmask, Bmask, Amask);
  17.182 +}
  17.183 +
  17.184 +SDL_Surface *
  17.185 +SDL_GetWindowSurface(SDL_Window * window)
  17.186 +{
  17.187 +    CHECK_WINDOW_MAGIC(window, NULL);
  17.188 +
  17.189 +    if (!window->surface) {
  17.190 +        window->surface = SDL_CreateWindowFramebuffer(window);
  17.191 +    }
  17.192 +    return window->surface;
  17.193 +}
  17.194 +
  17.195 +int
  17.196 +SDL_UpdateWindowSurface(SDL_Window * window)
  17.197 +{
  17.198 +    SDL_Rect full_rect;
  17.199 +
  17.200 +    CHECK_WINDOW_MAGIC(window, -1);
  17.201 +
  17.202 +    full_rect.x = 0;
  17.203 +    full_rect.y = 0;
  17.204 +    full_rect.w = window->w;
  17.205 +    full_rect.h = window->h;
  17.206 +    return SDL_UpdateWindowSurfaceRects(window, 1, &full_rect);
  17.207 +}
  17.208 +
  17.209 +int
  17.210 +SDL_UpdateWindowSurfaceRects(SDL_Window * window,
  17.211 +                             int numrects, SDL_Rect * rects)
  17.212 +{
  17.213 +    CHECK_WINDOW_MAGIC(window, -1);
  17.214 +
  17.215 +    if (!window->surface) {
  17.216 +        SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface");
  17.217 +        return -1;
  17.218 +    }
  17.219 +
  17.220 +    return _this->UpdateWindowFramebuffer(_this, window, numrects, rects);
  17.221 +}
  17.222 +
  17.223  void
  17.224  SDL_SetWindowGrab(SDL_Window * window, int mode)
  17.225  {
  17.226 @@ -1262,6 +1457,15 @@
  17.227  }
  17.228  
  17.229  void
  17.230 +SDL_OnWindowResized(SDL_Window * window)
  17.231 +{
  17.232 +    if (window->surface) {
  17.233 +        SDL_FreeSurface(window->surface);
  17.234 +        window->surface = NULL;
  17.235 +    }
  17.236 +}
  17.237 +
  17.238 +void
  17.239  SDL_OnWindowMinimized(SDL_Window * window)
  17.240  {
  17.241      SDL_UpdateFullscreenMode(window, SDL_FALSE);
  17.242 @@ -1336,6 +1540,9 @@
  17.243      /* Restore video mode, etc. */
  17.244      SDL_UpdateFullscreenMode(window, SDL_FALSE);
  17.245  
  17.246 +    if (_this->DestroyWindowFramebuffer) {
  17.247 +        _this->DestroyWindowFramebuffer(_this, window);
  17.248 +    }
  17.249      if (_this->DestroyWindow) {
  17.250          _this->DestroyWindow(_this, window);
  17.251      }
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/src/video/dummy/SDL_nullframebuffer.c	Thu Feb 03 15:49:37 2011 -0800
    18.3 @@ -0,0 +1,90 @@
    18.4 +/*
    18.5 +    SDL - Simple DirectMedia Layer
    18.6 +    Copyright (C) 1997-2010 Sam Lantinga
    18.7 +
    18.8 +    This library is free software; you can redistribute it and/or
    18.9 +    modify it under the terms of the GNU Lesser General Public
   18.10 +    License as published by the Free Software Foundation; either
   18.11 +    version 2.1 of the License, or (at your option) any later version.
   18.12 +
   18.13 +    This library is distributed in the hope that it will be useful,
   18.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18.16 +    Lesser General Public License for more details.
   18.17 +
   18.18 +    You should have received a copy of the GNU Lesser General Public
   18.19 +    License along with this library; if not, write to the Free Software
   18.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   18.21 +
   18.22 +    Sam Lantinga
   18.23 +    slouken@libsdl.org
   18.24 +*/
   18.25 +#include "SDL_config.h"
   18.26 +
   18.27 +#include "../SDL_sysvideo.h"
   18.28 +
   18.29 +
   18.30 +#define DUMMY_SURFACE   "_SDL_DummySurface"
   18.31 +
   18.32 +int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
   18.33 +{
   18.34 +    SDL_Surface *surface;
   18.35 +    const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
   18.36 +    int w, h;
   18.37 +    int bpp;
   18.38 +    Uint32 Rmask, Gmask, Bmask, Amask;
   18.39 +
   18.40 +    /* Free the old framebuffer surface */
   18.41 +    surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE);
   18.42 +    if (surface) {
   18.43 +        SDL_FreeSurface(surface);
   18.44 +    }
   18.45 +
   18.46 +    /* Create a new one */
   18.47 +    SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask);
   18.48 +    SDL_GetWindowSize(window, &w, &h);
   18.49 +    surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask);
   18.50 +    if (!surface) {
   18.51 +        return -1;
   18.52 +    }
   18.53 +
   18.54 +    /* Save the info and return! */
   18.55 +    SDL_SetWindowData(window, DUMMY_SURFACE, surface);
   18.56 +    *format = surface_format;
   18.57 +    *pixels = surface->pixels;
   18.58 +    *pitch = surface->pitch;
   18.59 +    return 0;
   18.60 +}
   18.61 +
   18.62 +int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects)
   18.63 +{
   18.64 +    static int frame_number;
   18.65 +    SDL_Surface *surface;
   18.66 +
   18.67 +    surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE);
   18.68 +    if (!surface) {
   18.69 +        SDL_SetError("Couldn't find dummy surface for window");
   18.70 +        return -1;
   18.71 +    }
   18.72 +
   18.73 +    /* Send the data to the display */
   18.74 +    if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) {
   18.75 +        char file[128];
   18.76 +        SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
   18.77 +                     SDL_GetWindowID(window), ++frame_number);
   18.78 +        SDL_SaveBMP(surface, file);
   18.79 +    }
   18.80 +    return 0;
   18.81 +}
   18.82 +
   18.83 +void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
   18.84 +{
   18.85 +    SDL_Surface *surface;
   18.86 +
   18.87 +    surface = (SDL_Surface *) SDL_SetWindowData(window, DUMMY_SURFACE, NULL);
   18.88 +    if (surface) {
   18.89 +        SDL_FreeSurface(surface);
   18.90 +    }
   18.91 +}
   18.92 +
   18.93 +/* vi: set ts=4 sw=4 expandtab: */
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/src/video/dummy/SDL_nullframebuffer_c.h	Thu Feb 03 15:49:37 2011 -0800
    19.3 @@ -0,0 +1,28 @@
    19.4 +/*
    19.5 +    SDL - Simple DirectMedia Layer
    19.6 +    Copyright (C) 1997-2010 Sam Lantinga
    19.7 +
    19.8 +    This library is free software; you can redistribute it and/or
    19.9 +    modify it under the terms of the GNU Lesser General Public
   19.10 +    License as published by the Free Software Foundation; either
   19.11 +    version 2.1 of the License, or (at your option) any later version.
   19.12 +
   19.13 +    This library is distributed in the hope that it will be useful,
   19.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   19.16 +    Lesser General Public License for more details.
   19.17 +
   19.18 +    You should have received a copy of the GNU Lesser General Public
   19.19 +    License along with this library; if not, write to the Free Software
   19.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   19.21 +
   19.22 +    Sam Lantinga
   19.23 +    slouken@libsdl.org
   19.24 +*/
   19.25 +#include "SDL_config.h"
   19.26 +
   19.27 +extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
   19.28 +extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects);
   19.29 +extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
   19.30 +
   19.31 +/* vi: set ts=4 sw=4 expandtab: */
    20.1 --- a/src/video/dummy/SDL_nullvideo.c	Thu Feb 03 11:16:57 2011 -0800
    20.2 +++ b/src/video/dummy/SDL_nullvideo.c	Thu Feb 03 15:49:37 2011 -0800
    20.3 @@ -44,6 +44,7 @@
    20.4  
    20.5  #include "SDL_nullvideo.h"
    20.6  #include "SDL_nullevents_c.h"
    20.7 +#include "SDL_nullframebuffer_c.h"
    20.8  
    20.9  #define DUMMYVID_DRIVER_NAME "dummy"
   20.10  
   20.11 @@ -91,6 +92,9 @@
   20.12      device->VideoQuit = DUMMY_VideoQuit;
   20.13      device->SetDisplayMode = DUMMY_SetDisplayMode;
   20.14      device->PumpEvents = DUMMY_PumpEvents;
   20.15 +    device->CreateWindowFramebuffer = SDL_DUMMY_CreateWindowFramebuffer;
   20.16 +    device->UpdateWindowFramebuffer = SDL_DUMMY_UpdateWindowFramebuffer;
   20.17 +    device->DestroyWindowFramebuffer = SDL_DUMMY_DestroyWindowFramebuffer;
   20.18  
   20.19      device->free = DUMMY_DeleteDevice;
   20.20