# HG changeset patch # User Sam Lantinga # Date 1296776977 28800 # Node ID 4d39eeaad00bfe26232827bb1bbf491fea0e329e # Parent 2b1989f59674c96392b9454a52a3942016dd9aa1 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. diff -r 2b1989f59674 -r 4d39eeaad00b VisualC/SDL/SDL_VS2008.vcproj --- a/VisualC/SDL/SDL_VS2008.vcproj Thu Feb 03 11:16:57 2011 -0800 +++ b/VisualC/SDL/SDL_VS2008.vcproj Thu Feb 03 15:49:37 2011 -0800 @@ -643,14 +643,6 @@ > - - - - @@ -687,19 +679,27 @@ > + + + + + + + + + + + + @@ -1011,6 +1027,10 @@ > + + diff -r 2b1989f59674 -r 4d39eeaad00b VisualC/SDL/SDL_VS2010.vcxproj --- a/VisualC/SDL/SDL_VS2010.vcxproj Thu Feb 03 11:16:57 2011 -0800 +++ b/VisualC/SDL/SDL_VS2010.vcxproj Thu Feb 03 15:49:37 2011 -0800 @@ -285,10 +285,17 @@ - + + + + + + + + @@ -296,7 +303,6 @@ - @@ -367,9 +373,13 @@ + + + + + - @@ -377,10 +387,7 @@ - - - - + @@ -396,9 +403,6 @@ - - - diff -r 2b1989f59674 -r 4d39eeaad00b Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Thu Feb 03 11:16:57 2011 -0800 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Thu Feb 03 15:49:37 2011 -0800 @@ -69,10 +69,6 @@ 041B2CF312FA0F680087D585 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */; }; 0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; }; 0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; }; - 043DD76F10FD8A0000DED673 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */; }; - 043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */; }; - 043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */; }; - 043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */; }; 04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; }; 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; }; 04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; }; @@ -81,13 +77,7 @@ 044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB311E6069F0076F181 /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; 044E5FB611E6069F0076F181 /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB411E6069F0076F181 /* SDL_input.h */; settings = {ATTRIBUTES = (Public, ); }; }; 044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; }; - 0463873F0F0B5B7D0041FD65 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387370F0B5B7D0041FD65 /* SDL_blendline.c */; }; - 046387400F0B5B7D0041FD65 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */; }; - 046387410F0B5B7D0041FD65 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 046387390F0B5B7D0041FD65 /* SDL_blendrect.c */; }; 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */; }; - 046387430F0B5B7D0041FD65 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873B0F0B5B7D0041FD65 /* SDL_draw.h */; }; - 046387440F0B5B7D0041FD65 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */; }; - 046387450F0B5B7D0041FD65 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */; }; 046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; }; 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; }; 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; }; @@ -108,6 +98,20 @@ 04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; settings = {ATTRIBUTES = (Public, ); }; }; 04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; }; + 04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; }; + 04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */; }; + 04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; }; + 04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806D12FB751400FC43C0 /* SDL_blendline.h */; }; + 04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; }; + 04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */; }; + 04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807012FB751400FC43C0 /* SDL_draw.h */; }; + 04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; }; + 04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807212FB751400FC43C0 /* SDL_drawline.h */; }; + 04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; }; + 04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */; }; + 04F7808112FB751400FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */; }; + 04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; }; 04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; }; 04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; }; 04FFAB9612E23BDC00BA343D /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -325,10 +329,6 @@ 041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_sw.c; sourceTree = ""; }; 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; }; 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; }; - 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_alphamult.c; sourceTree = ""; }; - 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_alphamult.h; sourceTree = ""; }; - 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; - 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = ""; }; 04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; }; 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; }; 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; }; @@ -337,13 +337,7 @@ 044E5FB311E6069F0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; }; 044E5FB411E6069F0076F181 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; }; 044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = ""; }; - 046387370F0B5B7D0041FD65 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; - 046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; - 046387390F0B5B7D0041FD65 /* SDL_blendrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendrect.c; sourceTree = ""; }; 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = ""; }; - 0463873B0F0B5B7D0041FD65 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; - 0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; - 0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = ""; }; 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = ""; }; 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; }; @@ -364,6 +358,20 @@ 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = ../../include/SDL_config_iphoneos.h; sourceTree = SOURCE_ROOT; }; 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; }; 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; }; + 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; + 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = ""; }; + 04F7806C12FB751400FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; + 04F7806D12FB751400FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = ""; }; + 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; + 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = ""; }; + 04F7807012FB751400FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; + 04F7807112FB751400FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; + 04F7807212FB751400FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = ""; }; + 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; + 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = ""; }; + 04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw_c.h; sourceTree = ""; }; + 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = ""; }; + 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = ""; }; 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = ""; }; 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; }; 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; }; @@ -684,6 +692,18 @@ 041B2CEC12FA0F680087D585 /* software */ = { isa = PBXGroup; children = ( + 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */, + 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */, + 04F7806C12FB751400FC43C0 /* SDL_blendline.c */, + 04F7806D12FB751400FC43C0 /* SDL_blendline.h */, + 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */, + 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */, + 04F7807012FB751400FC43C0 /* SDL_draw.h */, + 04F7807112FB751400FC43C0 /* SDL_drawline.c */, + 04F7807212FB751400FC43C0 /* SDL_drawline.h */, + 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */, + 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */, + 04F7807512FB751400FC43C0 /* SDL_renderer_sw_c.h */, 041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */, ); path = software; @@ -1083,12 +1103,6 @@ FDA685F40DF244C800F98A1A /* dummy */, 0495E6850E97408800152DFE /* SDL_glfuncs.h */, 0495E6840E97408800152DFE /* SDL_glesfuncs.h */, - 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */, - 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */, - 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */, - 046387370F0B5B7D0041FD65 /* SDL_blendline.c */, - 046387380F0B5B7D0041FD65 /* SDL_blendpoint.c */, - 046387390F0B5B7D0041FD65 /* SDL_blendrect.c */, FDA683000DF2374E00F98A1A /* SDL_blit.c */, FDA683010DF2374E00F98A1A /* SDL_blit.h */, FDA683020DF2374E00F98A1A /* SDL_blit_0.c */, @@ -1103,10 +1117,6 @@ 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */, FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */, 044E5FB711E606EB0076F181 /* SDL_clipboard.c */, - 0463873B0F0B5B7D0041FD65 /* SDL_draw.h */, - 0463873C0F0B5B7D0041FD65 /* SDL_drawline.c */, - 0463873D0F0B5B7D0041FD65 /* SDL_drawpoint.c */, - 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */, 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */, FDA6830D0DF2374E00F98A1A /* SDL_gamma.c */, FDA6830E0DF2374E00F98A1A /* SDL_leaks.h */, @@ -1129,6 +1139,8 @@ children = ( FDA685F50DF244C800F98A1A /* SDL_nullevents.c */, FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */, + 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */, + 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */, FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */, FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */, ); @@ -1202,13 +1214,11 @@ 047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */, 04461DEE0EA76BA3006C462D /* SDL_haptic.h in Headers */, 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */, - 046387430F0B5B7D0041FD65 /* SDL_draw.h in Headers */, 04B2ECEC1025CE4800F9BC5F /* SDL_atomic.h in Headers */, 04B2ECED1025CE4800F9BC5F /* SDL_power.h in Headers */, 04B2ECEE1025CE4800F9BC5F /* SDL_revision.h in Headers */, 04B2ED081025CF9E00F9BC5F /* SDL_config.h in Headers */, 04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */, - 043DD77010FD8A0000DED673 /* SDL_alphamult.h in Headers */, 04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */, 006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */, 044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */, @@ -1224,6 +1234,14 @@ 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */, 04409BA612FA989600FB9AA8 /* mmx.h in Headers */, 04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */, + 04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */, + 04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */, + 04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */, + 04F7808112FB751400FC43C0 /* SDL_renderer_sw_c.h in Headers */, + 04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1449,15 +1467,7 @@ 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */, 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */, 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */, - 0463873F0F0B5B7D0041FD65 /* SDL_blendline.c in Sources */, - 046387400F0B5B7D0041FD65 /* SDL_blendpoint.c in Sources */, - 046387410F0B5B7D0041FD65 /* SDL_blendrect.c in Sources */, - 046387440F0B5B7D0041FD65 /* SDL_drawline.c in Sources */, - 046387450F0B5B7D0041FD65 /* SDL_drawpoint.c in Sources */, 046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */, - 043DD76F10FD8A0000DED673 /* SDL_alphamult.c in Sources */, - 043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */, - 043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */, 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */, 56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */, 56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */, @@ -1473,6 +1483,12 @@ 041B2CF312FA0F680087D585 /* SDL_renderer_sw.c in Sources */, 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */, 04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */, + 04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */, + 04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */, + 04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff -r 2b1989f59674 -r 4d39eeaad00b Xcode/SDL/SDL.xcodeproj/project.pbxproj --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj Thu Feb 03 11:16:57 2011 -0800 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj Thu Feb 03 15:49:37 2011 -0800 @@ -252,12 +252,6 @@ 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; 04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; }; 04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; }; - 04BD016F12E6671800899322 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4812E6671800899322 /* SDL_alphamult.c */; }; - 04BD017012E6671800899322 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4912E6671800899322 /* SDL_alphamult.h */; }; - 04BD017112E6671800899322 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */; }; - 04BD017212E6671800899322 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4B12E6671800899322 /* SDL_blendline.c */; }; - 04BD017312E6671800899322 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */; }; - 04BD017412E6671800899322 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4D12E6671800899322 /* SDL_blendrect.c */; }; 04BD017512E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; }; 04BD017612E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; }; 04BD017712E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; }; @@ -272,10 +266,6 @@ 04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; }; 04BD018112E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; }; 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; }; - 04BD018312E6671800899322 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5C12E6671800899322 /* SDL_draw.h */; }; - 04BD018412E6671800899322 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5D12E6671800899322 /* SDL_drawline.c */; }; - 04BD018512E6671800899322 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */; }; - 04BD018612E6671800899322 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5F12E6671800899322 /* SDL_drawrect.c */; }; 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; }; 04BD018812E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; }; 04BD018912E6671800899322 /* SDL_glesfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */; }; @@ -461,12 +451,6 @@ 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; 04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; }; 04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; }; - 04BD038912E6671800899322 /* SDL_alphamult.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4812E6671800899322 /* SDL_alphamult.c */; }; - 04BD038A12E6671800899322 /* SDL_alphamult.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4912E6671800899322 /* SDL_alphamult.h */; }; - 04BD038B12E6671800899322 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */; }; - 04BD038C12E6671800899322 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4B12E6671800899322 /* SDL_blendline.c */; }; - 04BD038D12E6671800899322 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */; }; - 04BD038E12E6671800899322 /* SDL_blendrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4D12E6671800899322 /* SDL_blendrect.c */; }; 04BD038F12E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; }; 04BD039012E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; }; 04BD039112E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; }; @@ -481,10 +465,6 @@ 04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; }; 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; }; 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; }; - 04BD039D12E6671800899322 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5C12E6671800899322 /* SDL_draw.h */; }; - 04BD039E12E6671800899322 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5D12E6671800899322 /* SDL_drawline.c */; }; - 04BD039F12E6671800899322 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */; }; - 04BD03A012E6671800899322 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5F12E6671800899322 /* SDL_drawrect.c */; }; 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; }; 04BD03A212E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; }; 04BD03A312E6671800899322 /* SDL_glesfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */; }; @@ -564,6 +544,34 @@ 04DEA57311E6006A00386CAC /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA56F11E6006A00386CAC /* SDL_input.h */; }; 04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; }; + 04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; }; + 04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; }; + 04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; }; + 04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; }; + 04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; }; + 04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; }; + 04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; }; + 04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; }; + 04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; }; + 04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; }; + 04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; + 04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; + 04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + 04F7805412FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */; }; + 04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; }; + 04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; }; + 04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; }; + 04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; }; + 04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; }; + 04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; }; + 04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; }; + 04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; }; + 04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; + 04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; + 04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + 04F7806012FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */; }; 453773821207C518002F0F45 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 453773811207C518002F0F45 /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8CB0A77811F6A87F00CBA2DE /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8CB0A77911F6A87F00CBA2DE /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -818,12 +826,6 @@ 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = ""; }; 04BDFEED12E6671800899322 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = ""; }; - 04BDFF4812E6671800899322 /* SDL_alphamult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_alphamult.c; sourceTree = ""; }; - 04BDFF4912E6671800899322 /* SDL_alphamult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_alphamult.h; sourceTree = ""; }; - 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; - 04BDFF4B12E6671800899322 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; - 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; - 04BDFF4D12E6671800899322 /* SDL_blendrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendrect.c; sourceTree = ""; }; 04BDFF4E12E6671800899322 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = ""; }; 04BDFF4F12E6671800899322 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = ""; }; 04BDFF5012E6671800899322 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = ""; }; @@ -838,10 +840,6 @@ 04BDFF5912E6671800899322 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = ""; }; 04BDFF5A12E6671800899322 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = ""; }; 04BDFF5B12E6671800899322 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = ""; }; - 04BDFF5C12E6671800899322 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; - 04BDFF5D12E6671800899322 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; - 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; - 04BDFF5F12E6671800899322 /* SDL_drawrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawrect.c; sourceTree = ""; }; 04BDFF6012E6671800899322 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = ""; }; 04BDFF6112E6671800899322 /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = ""; }; 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glesfuncs.h; sourceTree = ""; }; @@ -918,6 +916,20 @@ 04BDFFFA12E6671800899322 /* XF86VMode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = XF86VMode.c; sourceTree = ""; }; 04DEA56F11E6006A00386CAC /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_input.h; path = ../../include/SDL_input.h; sourceTree = SOURCE_ROOT; }; 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; }; + 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = ""; }; + 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = ""; }; + 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; + 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = ""; }; + 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; + 04F7804012FB74A200FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = ""; }; + 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; + 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = ""; }; + 04F7804312FB74A200FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; + 04F7804412FB74A200FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; + 04F7804512FB74A200FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = ""; }; + 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; + 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = ""; }; + 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw_c.h; sourceTree = ""; }; 0C5AF5E501191D2B7F000001 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = begin_code.h; path = ../../include/begin_code.h; sourceTree = SOURCE_ROOT; }; 0C5AF5E601191D2B7F000001 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = close_code.h; path = ../../include/close_code.h; sourceTree = SOURCE_ROOT; }; 0C5AF5E801191D2B7F000001 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = ../../include/SDL_audio.h; sourceTree = SOURCE_ROOT; }; @@ -1210,6 +1222,18 @@ 041B2CA012FA0D680087D585 /* software */ = { isa = PBXGroup; children = ( + 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */, + 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */, + 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */, + 04F7804012FB74A200FC43C0 /* SDL_blendline.h */, + 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */, + 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */, + 04F7804312FB74A200FC43C0 /* SDL_draw.h */, + 04F7804412FB74A200FC43C0 /* SDL_drawline.c */, + 04F7804512FB74A200FC43C0 /* SDL_drawline.h */, + 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */, + 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */, + 04F7804812FB74A200FC43C0 /* SDL_renderer_sw_c.h */, 041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */, ); path = software; @@ -1487,12 +1511,6 @@ 04BDFEE712E6671800899322 /* dummy */, 04BDFFB712E6671800899322 /* x11 */, 04BDFFD712E6671800899322 /* Xext */, - 04BDFF4812E6671800899322 /* SDL_alphamult.c */, - 04BDFF4912E6671800899322 /* SDL_alphamult.h */, - 04BDFF4A12E6671800899322 /* SDL_blendfillrect.c */, - 04BDFF4B12E6671800899322 /* SDL_blendline.c */, - 04BDFF4C12E6671800899322 /* SDL_blendpoint.c */, - 04BDFF4D12E6671800899322 /* SDL_blendrect.c */, 04BDFF4E12E6671800899322 /* SDL_blit.c */, 04BDFF4F12E6671800899322 /* SDL_blit.h */, 04BDFF5012E6671800899322 /* SDL_blit_0.c */, @@ -1507,10 +1525,6 @@ 04BDFF5912E6671800899322 /* SDL_blit_slow.h */, 04BDFF5A12E6671800899322 /* SDL_bmp.c */, 04BDFF5B12E6671800899322 /* SDL_clipboard.c */, - 04BDFF5C12E6671800899322 /* SDL_draw.h */, - 04BDFF5D12E6671800899322 /* SDL_drawline.c */, - 04BDFF5E12E6671800899322 /* SDL_drawpoint.c */, - 04BDFF5F12E6671800899322 /* SDL_drawrect.c */, 04BDFF6012E6671800899322 /* SDL_fillrect.c */, 04BDFF6112E6671800899322 /* SDL_gamma.c */, 04BDFF6212E6671800899322 /* SDL_glesfuncs.h */, @@ -1562,6 +1576,8 @@ children = ( 04BDFEE812E6671800899322 /* SDL_nullevents.c */, 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */, + 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */, + 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */, 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */, 04BDFEED12E6671800899322 /* SDL_nullvideo.h */, ); @@ -1893,12 +1909,10 @@ 04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */, 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */, 04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */, - 04BD017012E6671800899322 /* SDL_alphamult.h in Headers */, 04BD017612E6671800899322 /* SDL_blit.h in Headers */, 04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */, 04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */, 04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */, - 04BD018312E6671800899322 /* SDL_draw.h in Headers */, 04BD018912E6671800899322 /* SDL_glesfuncs.h in Headers */, 04BD018A12E6671800899322 /* SDL_glfuncs.h in Headers */, 04BD018B12E6671800899322 /* SDL_leaks.h in Headers */, @@ -1942,6 +1956,14 @@ 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */, 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */, 04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */, + 04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */, + 04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */, + 04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */, + 04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */, + 04F7805412FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2016,12 +2038,10 @@ 04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */, 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */, 04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */, - 04BD038A12E6671800899322 /* SDL_alphamult.h in Headers */, 04BD039012E6671800899322 /* SDL_blit.h in Headers */, 04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */, 04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */, 04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */, - 04BD039D12E6671800899322 /* SDL_draw.h in Headers */, 04BD03A312E6671800899322 /* SDL_glesfuncs.h in Headers */, 04BD03A412E6671800899322 /* SDL_glfuncs.h in Headers */, 04BD03A512E6671800899322 /* SDL_leaks.h in Headers */, @@ -2065,6 +2085,14 @@ 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */, 04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */, 04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */, + 04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */, + 04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */, + 04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */, + 04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */, + 04F7806012FB74A200FC43C0 /* SDL_renderer_sw_c.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2385,11 +2413,6 @@ 04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */, 04BD011712E6671800899322 /* SDL_nullevents.c in Sources */, 04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */, - 04BD016F12E6671800899322 /* SDL_alphamult.c in Sources */, - 04BD017112E6671800899322 /* SDL_blendfillrect.c in Sources */, - 04BD017212E6671800899322 /* SDL_blendline.c in Sources */, - 04BD017312E6671800899322 /* SDL_blendpoint.c in Sources */, - 04BD017412E6671800899322 /* SDL_blendrect.c in Sources */, 04BD017512E6671800899322 /* SDL_blit.c in Sources */, 04BD017712E6671800899322 /* SDL_blit_0.c in Sources */, 04BD017812E6671800899322 /* SDL_blit_1.c in Sources */, @@ -2400,9 +2423,6 @@ 04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */, 04BD018112E6671800899322 /* SDL_bmp.c in Sources */, 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */, - 04BD018412E6671800899322 /* SDL_drawline.c in Sources */, - 04BD018512E6671800899322 /* SDL_drawpoint.c in Sources */, - 04BD018612E6671800899322 /* SDL_drawrect.c in Sources */, 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */, 04BD018812E6671800899322 /* SDL_gamma.c in Sources */, 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */, @@ -2443,6 +2463,12 @@ 041B2CA712FA0D680087D585 /* SDL_renderer_sw.c in Sources */, 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */, 04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */, + 04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */, + 04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */, + 04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2512,11 +2538,6 @@ 04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */, 04BD033112E6671800899322 /* SDL_nullevents.c in Sources */, 04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */, - 04BD038912E6671800899322 /* SDL_alphamult.c in Sources */, - 04BD038B12E6671800899322 /* SDL_blendfillrect.c in Sources */, - 04BD038C12E6671800899322 /* SDL_blendline.c in Sources */, - 04BD038D12E6671800899322 /* SDL_blendpoint.c in Sources */, - 04BD038E12E6671800899322 /* SDL_blendrect.c in Sources */, 04BD038F12E6671800899322 /* SDL_blit.c in Sources */, 04BD039112E6671800899322 /* SDL_blit_0.c in Sources */, 04BD039212E6671800899322 /* SDL_blit_1.c in Sources */, @@ -2527,9 +2548,6 @@ 04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */, 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */, 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */, - 04BD039E12E6671800899322 /* SDL_drawline.c in Sources */, - 04BD039F12E6671800899322 /* SDL_drawpoint.c in Sources */, - 04BD03A012E6671800899322 /* SDL_drawrect.c in Sources */, 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */, 04BD03A212E6671800899322 /* SDL_gamma.c in Sources */, 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */, @@ -2570,6 +2588,12 @@ 041B2CAD12FA0D680087D585 /* SDL_renderer_sw.c in Sources */, 04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */, 04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */, + 04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */, + 04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */, + 04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff -r 2b1989f59674 -r 4d39eeaad00b include/SDL_render.h --- a/include/SDL_render.h Thu Feb 03 11:16:57 2011 -0800 +++ b/include/SDL_render.h Thu Feb 03 15:49:37 2011 -0800 @@ -154,6 +154,7 @@ * * \return A valid rendering context or NULL if there was an error. * + * \sa SDL_CreateSoftwareRenderer() * \sa SDL_GetRendererInfo() * \sa SDL_DestroyRenderer() */ @@ -161,6 +162,18 @@ int index, Uint32 flags); /** + * \brief Create a 2D software rendering context for a surface. + * + * \param surface The surface where rendering is done. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateRenderer() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** * \brief Get information about a rendering context. */ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, diff -r 2b1989f59674 -r 4d39eeaad00b include/SDL_video.h --- a/include/SDL_video.h Thu Feb 03 11:16:57 2011 -0800 +++ b/include/SDL_video.h Thu Feb 03 15:49:37 2011 -0800 @@ -608,6 +608,40 @@ int fullscreen); /** + * \brief Get an SDL surface associated with the window. + * + * \return A surface in the optimal format for the window, or NULL on error. + * + * \note You may not combine this with 3D or the rendering API on this window. + * + * \sa SDL_UpdateWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); + +/** + * \brief Copy the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); + +/** + * \brief Copy a number of rectangles on the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRect() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + int numrects, + SDL_Rect * rects); + +/** * \brief Set a window's input grab mode. * * \param mode This is 1 to grab input, and 0 to release input. diff -r 2b1989f59674 -r 4d39eeaad00b src/events/SDL_windowevents.c --- a/src/events/SDL_windowevents.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/events/SDL_windowevents.c Thu Feb 03 15:49:37 2011 -0800 @@ -106,6 +106,7 @@ } window->w = data1; window->h = data2; + SDL_OnWindowResized(window); break; case SDL_WINDOWEVENT_MINIMIZED: if (window->flags & SDL_WINDOW_MINIMIZED) { diff -r 2b1989f59674 -r 4d39eeaad00b src/render/SDL_render.c --- a/src/render/SDL_render.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/SDL_render.c Thu Feb 03 15:49:37 2011 -0800 @@ -26,6 +26,7 @@ #include "SDL_render.h" #include "SDL_sysrender.h" #include "../video/SDL_pixels_c.h" +#include "software/SDL_renderer_sw_c.h" #define CHECK_RENDERER_MAGIC(renderer, retval) \ @@ -137,12 +138,19 @@ if (renderer) { renderer->magic = &renderer_magic; + renderer->window = window; SDL_AddEventWatch(SDL_RendererEventWatch, renderer); } return renderer; } +SDL_Renderer * +SDL_CreateSoftwareRenderer(SDL_Surface * surface) +{ + return SW_CreateRendererForSurface(surface); +} + int SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) { diff -r 2b1989f59674 -r 4d39eeaad00b src/render/direct3d/SDL_d3drender.c --- a/src/render/direct3d/SDL_d3drender.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/direct3d/SDL_d3drender.c Thu Feb 03 15:49:37 2011 -0800 @@ -327,7 +327,6 @@ renderer->DestroyTexture = D3D_DestroyTexture; renderer->DestroyRenderer = D3D_DestroyRenderer; renderer->info = D3D_RenderDriver.info; - renderer->window = window; renderer->driverdata = data; renderer->info.flags = SDL_RENDERER_ACCELERATED; diff -r 2b1989f59674 -r 4d39eeaad00b src/render/opengl/SDL_renderer_gl.c --- a/src/render/opengl/SDL_renderer_gl.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/opengl/SDL_renderer_gl.c Thu Feb 03 15:49:37 2011 -0800 @@ -209,7 +209,6 @@ renderer->DestroyTexture = GL_DestroyTexture; renderer->DestroyRenderer = GL_DestroyRenderer; renderer->info = GL_RenderDriver.info; - renderer->window = window; renderer->driverdata = data; renderer->info.flags = SDL_RENDERER_ACCELERATED; diff -r 2b1989f59674 -r 4d39eeaad00b src/render/opengles/SDL_renderer_gles.c --- a/src/render/opengles/SDL_renderer_gles.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/opengles/SDL_renderer_gles.c Thu Feb 03 15:49:37 2011 -0800 @@ -202,7 +202,6 @@ renderer->DestroyTexture = GLES_DestroyTexture; renderer->DestroyRenderer = GLES_DestroyRenderer; renderer->info = GL_ES_RenderDriver.info; - renderer->window = window; renderer->driverdata = data; renderer->info.flags = SDL_RENDERER_ACCELERATED; diff -r 2b1989f59674 -r 4d39eeaad00b src/render/software/SDL_blendline.c --- a/src/render/software/SDL_blendline.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/software/SDL_blendline.c Thu Feb 03 15:49:37 2011 -0800 @@ -23,6 +23,7 @@ #include "SDL_draw.h" #include "SDL_blendline.h" +#include "SDL_blendpoint.h" static void diff -r 2b1989f59674 -r 4d39eeaad00b src/render/software/SDL_drawline.c --- a/src/render/software/SDL_drawline.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/software/SDL_drawline.c Thu Feb 03 15:49:37 2011 -0800 @@ -23,6 +23,7 @@ #include "SDL_draw.h" #include "SDL_drawline.h" +#include "SDL_drawpoint.h" static void diff -r 2b1989f59674 -r 4d39eeaad00b src/render/software/SDL_renderer_sw.c --- a/src/render/software/SDL_renderer_sw.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/render/software/SDL_renderer_sw.c Thu Feb 03 15:49:37 2011 -0800 @@ -69,7 +69,7 @@ SW_CreateRenderer, { "software", - (SDL_RENDERER_PRESENTVSYNC), + 0, 8, { SDL_PIXELFORMAT_RGB555, @@ -87,61 +87,19 @@ typedef struct { - Uint32 format; SDL_bool updateSize; - SDL_Texture *texture; - SDL_Surface surface; - SDL_Renderer *renderer; + SDL_Surface *surface; } SW_RenderData; -static SDL_Texture * -CreateTexture(SDL_Renderer * renderer, Uint32 format, int w, int h) -{ - SDL_Texture *texture; - - texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); - if (!texture) { - SDL_OutOfMemory(); - return NULL; - } - - texture->format = format; - texture->access = SDL_TEXTUREACCESS_STREAMING; - texture->w = w; - texture->h = h; - texture->renderer = renderer; - - if (renderer->CreateTexture(renderer, texture) < 0) { - SDL_free(texture); - return NULL; - } - return texture; -} - -static void -DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) -{ - renderer->DestroyTexture(renderer, texture); - SDL_free(texture); -} SDL_Renderer * -SW_CreateRenderer(SDL_Window * window, Uint32 flags) +SW_CreateRendererForSurface(SDL_Surface * surface) { SDL_Renderer *renderer; SW_RenderData *data; - int i; - int w, h; - Uint32 format; - int bpp; - Uint32 Rmask, Gmask, Bmask, Amask; - Uint32 renderer_flags; - const char *desired_driver; - format = SDL_GetWindowPixelFormat(window); - if (!SDL_PixelFormatEnumToMasks - (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { - SDL_SetError("Unknown display format"); + if (!surface) { + SDL_SetError("Can't create renderer for NULL surface"); return NULL; } @@ -157,6 +115,8 @@ SDL_OutOfMemory(); return NULL; } + data->surface = surface; + renderer->WindowEvent = SW_WindowEvent; renderer->CreateTexture = SW_CreateTexture; renderer->SetTextureColorMod = SW_SetTextureColorMod; @@ -174,80 +134,34 @@ renderer->RenderPresent = SW_RenderPresent; renderer->DestroyRenderer = SW_DestroyRenderer; renderer->info = SW_RenderDriver.info; - renderer->info.flags = 0; - renderer->window = window; renderer->driverdata = data; - data->format = format; - - /* Find a render driver that we can use to display data */ - renderer_flags = 0; - if (flags & SDL_RENDERER_PRESENTVSYNC) { - renderer_flags |= SDL_RENDERER_PRESENTVSYNC; - } - desired_driver = SDL_getenv("SDL_VIDEO_RENDERER_SWDRIVER"); - for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) { - SDL_RendererInfo info; - SDL_GetRenderDriverInfo(i, &info); - if (SDL_strcmp(info.name, SW_RenderDriver.info.name) == 0) { - continue; - } - if (desired_driver - && SDL_strcasecmp(desired_driver, info.name) != 0) { - continue; - } - data->renderer = SDL_CreateRenderer(window, i, renderer_flags); - if (data->renderer) { - break; - } - } - if (i == SDL_GetNumRenderDrivers()) { - SW_DestroyRenderer(renderer); - SDL_SetError("Couldn't find display render driver"); - return NULL; - } - if (data->renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) { - renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; - } - - /* Create the textures we'll use for display */ - SDL_GetWindowSize(window, &w, &h); - data->texture = CreateTexture(data->renderer, data->format, w, h); - if (!data->texture) { - SW_DestroyRenderer(renderer); - return NULL; - } - - /* Create a surface we'll use for rendering */ - data->surface.flags = SDL_PREALLOC; - data->surface.format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask); - if (!data->surface.format) { - SW_DestroyRenderer(renderer); - return NULL; - } - return renderer; } -static SDL_Texture * +SDL_Renderer * +SW_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + SDL_Surface *surface; + + surface = SDL_GetWindowSurface(window); + if (!surface) { + return NULL; + } + return SW_CreateRendererForSurface(surface); +} + +static SDL_Surface * SW_ActivateRenderer(SDL_Renderer * renderer) { SW_RenderData *data = (SW_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; if (data->updateSize) { - /* Recreate the textures for the new window size */ - int w, h; - if (data->texture) { - DestroyTexture(data->renderer, data->texture); - } - SDL_GetWindowSize(window, &w, &h); - data->texture = CreateTexture(data->renderer, data->format, w, h); - if (data->texture) { - data->updateSize = SDL_FALSE; - } + data->surface = SDL_GetWindowSurface(window); + data->updateSize = SDL_FALSE; } - return data->texture; + return data->surface; } static void @@ -356,264 +270,130 @@ SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, int count) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Texture *texture = SW_ActivateRenderer(renderer); - SDL_Rect rect; - int i; - int x, y; - int status = 0; - - if (!texture) { - return -1; - } + SDL_Surface *surface = SW_ActivateRenderer(renderer); - /* Get the smallest rectangle that contains everything */ - rect.x = 0; - rect.y = 0; - rect.w = texture->w; - rect.h = texture->h; - if (!SDL_EnclosePoints(points, count, &rect, &rect)) { - /* Nothing to draw */ - return 0; - } - - if (data->renderer->LockTexture(data->renderer, texture, &rect, - &data->surface.pixels, - &data->surface.pitch) < 0) { + if (!surface) { return -1; } - data->surface.clip_rect.w = data->surface.w = rect.w; - data->surface.clip_rect.h = data->surface.h = rect.h; - /* Draw the points! */ if (renderer->blendMode == SDL_BLENDMODE_NONE) { - Uint32 color = SDL_MapRGBA(data->surface.format, + Uint32 color = SDL_MapRGBA(surface->format, renderer->r, renderer->g, renderer->b, renderer->a); - for (i = 0; i < count; ++i) { - x = points[i].x - rect.x; - y = points[i].y - rect.y; - - status = SDL_DrawPoint(&data->surface, x, y, color); - } + return SDL_DrawPoints(surface, points, count, color); } else { - for (i = 0; i < count; ++i) { - x = points[i].x - rect.x; - y = points[i].y - rect.y; - - status = SDL_BlendPoint(&data->surface, x, y, - renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } + return SDL_BlendPoints(surface, points, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); } - - data->renderer->UnlockTexture(data->renderer, texture); - - return status; } static int SW_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, int count) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Texture *texture = SW_ActivateRenderer(renderer); - SDL_Rect clip, rect; - int i; - int x1, y1, x2, y2; - int status = 0; - - if (!texture) { - return -1; - } + SDL_Surface *surface = SW_ActivateRenderer(renderer); - /* Get the smallest rectangle that contains everything */ - clip.x = 0; - clip.y = 0; - clip.w = texture->w; - clip.h = texture->h; - SDL_EnclosePoints(points, count, NULL, &rect); - if (!SDL_IntersectRect(&rect, &clip, &rect)) { - /* Nothing to draw */ - return 0; - } - - if (data->renderer->LockTexture(data->renderer, texture, &rect, - &data->surface.pixels, - &data->surface.pitch) < 0) { + if (!surface) { return -1; } - data->surface.clip_rect.w = data->surface.w = rect.w; - data->surface.clip_rect.h = data->surface.h = rect.h; - - /* Draw the points! */ + /* Draw the lines! */ if (renderer->blendMode == SDL_BLENDMODE_NONE) { - Uint32 color = SDL_MapRGBA(data->surface.format, + Uint32 color = SDL_MapRGBA(surface->format, renderer->r, renderer->g, renderer->b, renderer->a); - for (i = 1; i < count; ++i) { - x1 = points[i-1].x - rect.x; - y1 = points[i-1].y - rect.y; - x2 = points[i].x - rect.x; - y2 = points[i].y - rect.y; - - status = SDL_DrawLine(&data->surface, x1, y1, x2, y2, color); - } + return SDL_DrawLines(surface, points, count, color); } else { - for (i = 1; i < count; ++i) { - x1 = points[i-1].x - rect.x; - y1 = points[i-1].y - rect.y; - x2 = points[i].x - rect.x; - y2 = points[i].y - rect.y; - - status = SDL_BlendLine(&data->surface, x1, y1, x2, y2, - renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } + return SDL_BlendLines(surface, points, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); } - - data->renderer->UnlockTexture(data->renderer, texture); - - return status; } static int SW_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Texture *texture = SW_ActivateRenderer(renderer); - SDL_Rect clip, rect; - Uint32 color = 0; - int i; - int status = 0; + SDL_Surface *surface = SW_ActivateRenderer(renderer); - if (!texture) { + if (!surface) { return -1; } - clip.x = 0; - clip.y = 0; - clip.w = texture->w; - clip.h = texture->h; - if (renderer->blendMode == SDL_BLENDMODE_NONE) { - color = SDL_MapRGBA(data->surface.format, - renderer->r, renderer->g, renderer->b, - renderer->a); + Uint32 color = SDL_MapRGBA(surface->format, + renderer->r, renderer->g, renderer->b, + renderer->a); + return SDL_FillRects(surface, rects, count, color); + } else { + return SDL_BlendFillRects(surface, rects, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); } - - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - /* Nothing to draw */ - continue; - } - - if (data->renderer->LockTexture(data->renderer, texture, &rect, - &data->surface.pixels, - &data->surface.pitch) < 0) { - return -1; - } - - data->surface.clip_rect.w = data->surface.w = rect.w; - data->surface.clip_rect.h = data->surface.h = rect.h; - - if (renderer->blendMode == SDL_BLENDMODE_NONE) { - status = SDL_FillRect(&data->surface, NULL, color); - } else { - status = SDL_BlendFillRect(&data->surface, NULL, - renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } - - data->renderer->UnlockTexture(data->renderer, texture); - } - return status; } static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_Rect * dstrect) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Surface *surface; - SDL_Rect real_srcrect; - SDL_Rect real_dstrect; - int status; + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Surface *src = (SDL_Surface *) texture->driverdata; + SDL_Rect final_rect = *dstrect; - if (!SW_ActivateRenderer(renderer)) { + if (!surface) { return -1; } - - if (data->renderer->LockTexture(data->renderer, data->texture, dstrect, - &data->surface.pixels, - &data->surface.pitch) < 0) { - return -1; - } - - surface = (SDL_Surface *) texture->driverdata; - real_srcrect = *srcrect; - - data->surface.w = dstrect->w; - data->surface.h = dstrect->h; - data->surface.clip_rect.w = dstrect->w; - data->surface.clip_rect.h = dstrect->h; - real_dstrect = data->surface.clip_rect; - - status = SDL_LowerBlit(surface, &real_srcrect, &data->surface, &real_dstrect); - data->renderer->UnlockTexture(data->renderer, data->texture); - return status; + return SDL_BlitSurface(src, srcrect, surface, &final_rect); } static int SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, void * pixels, int pitch) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SDL_Surface *surface = SW_ActivateRenderer(renderer); + Uint32 src_format; + void *src_pixels; - if (!SW_ActivateRenderer(renderer)) { + if (!surface) { return -1; } - if (data->renderer->LockTexture(data->renderer, data->texture, rect, - &data->surface.pixels, - &data->surface.pitch) < 0) { + if (rect->x < 0 || rect->x+rect->w > surface->w || + rect->y < 0 || rect->y+rect->h > surface->h) { + SDL_SetError("Tried to read outside of surface bounds"); return -1; } - SDL_ConvertPixels(rect->w, rect->h, - data->format, data->surface.pixels, data->surface.pitch, - format, pixels, pitch); + src_format = SDL_MasksToPixelFormatEnum( + surface->format->BitsPerPixel, + surface->format->Rmask, surface->format->Gmask, + surface->format->Bmask, surface->format->Amask); - data->renderer->UnlockTexture(data->renderer, data->texture); - return 0; + src_pixels = (void*)((Uint8 *) surface->pixels + + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel); + + return SDL_ConvertPixels(rect->w, rect->h, + src_format, src_pixels, surface->pitch, + format, pixels, pitch); } static void SW_RenderPresent(SDL_Renderer * renderer) { SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Texture *texture = SW_ActivateRenderer(renderer); - SDL_Rect rect; - - if (!texture) { - return; - } + SDL_Window *window = renderer->window; - /* Send the data to the display */ - rect.x = 0; - rect.y = 0; - rect.w = texture->w; - rect.h = texture->h; - data->renderer->RenderCopy(data->renderer, texture, &rect, &rect); - data->renderer->RenderPresent(data->renderer); + if (window) { + SDL_UpdateWindowSurface(window); + } } static void @@ -628,18 +408,8 @@ SW_DestroyRenderer(SDL_Renderer * renderer) { SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; if (data) { - if (data->texture) { - DestroyTexture(data->renderer, data->texture); - } - if (data->surface.format) { - SDL_FreeFormat(data->surface.format); - } - if (data->renderer) { - data->renderer->DestroyRenderer(data->renderer); - } SDL_free(data); } SDL_free(renderer); diff -r 2b1989f59674 -r 4d39eeaad00b src/render/software/SDL_renderer_sw_c.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/render/software/SDL_renderer_sw_c.h Thu Feb 03 15:49:37 2011 -0800 @@ -0,0 +1,25 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface); + +/* vi: set ts=4 sw=4 expandtab: */ diff -r 2b1989f59674 -r 4d39eeaad00b src/video/SDL_sysvideo.h --- a/src/video/SDL_sysvideo.h Thu Feb 03 11:16:57 2011 -0800 +++ b/src/video/SDL_sysvideo.h Thu Feb 03 15:49:37 2011 -0800 @@ -80,6 +80,8 @@ SDL_DisplayMode fullscreen_mode; + SDL_Surface *surface; + SDL_WindowShaper *shaper; SDL_WindowUserData *data; @@ -190,7 +192,10 @@ void (*RestoreWindow) (_THIS, SDL_Window * window); void (*SetWindowGrab) (_THIS, SDL_Window * window); void (*DestroyWindow) (_THIS, SDL_Window * window); - + int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); + int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, int numrects, SDL_Rect * rects); + void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window); + /* * * */ /* * Shaped-window functions @@ -344,6 +349,7 @@ extern void SDL_OnWindowShown(SDL_Window * window); extern void SDL_OnWindowHidden(SDL_Window * window); +extern void SDL_OnWindowResized(SDL_Window * window); extern void SDL_OnWindowMinimized(SDL_Window * window); extern void SDL_OnWindowRestored(SDL_Window * window); extern void SDL_OnWindowFocusGained(SDL_Window * window); diff -r 2b1989f59674 -r 4d39eeaad00b src/video/SDL_video.c --- a/src/video/SDL_video.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/video/SDL_video.c Thu Feb 03 15:49:37 2011 -0800 @@ -95,6 +95,130 @@ /* Various local functions */ static void SDL_UpdateWindowGrab(SDL_Window * window); +/* Support for framebuffer emulation using an accelerated renderer */ + +#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" + +typedef struct { + SDL_Renderer *renderer; + SDL_Texture *texture; + void *pixels; + int pitch; +} SDL_WindowTextureData; + +static int +SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +{ + SDL_WindowTextureData *data; + SDL_Renderer *renderer; + SDL_RendererInfo info; + Uint32 i; + + data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data) { + data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data)); + if (!data) { + SDL_OutOfMemory(); + return -1; + } + SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data); + } + + renderer = data->renderer; + if (!renderer) { + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + if (!renderer) { + return -1; + } + data->renderer = renderer; + } + + /* Free any old texture and pixel data */ + if (data->texture) { + SDL_DestroyTexture(data->texture); + data->texture = NULL; + } + if (data->pixels) { + SDL_free(data->pixels); + data->pixels = NULL; + } + + if (SDL_GetRendererInfo(renderer, &info) < 0) { + return -1; + } + + /* Find the first format without an alpha channel */ + *format = info.texture_formats[0]; + for (i = 0; i < info.num_texture_formats; ++i) { + if (!SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) { + *format = info.texture_formats[i]; + break; + } + } + + data->texture = SDL_CreateTexture(renderer, *format, + SDL_TEXTUREACCESS_STREAMING, + window->w, window->h); + if (!data->texture) { + return -1; + } + + /* Create framebuffer data */ + data->pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); + data->pixels = SDL_malloc(window->h * data->pitch); + if (!data->pixels) { + SDL_OutOfMemory(); + return -1; + } + + *pixels = data->pixels; + *pitch = data->pitch; + return 0; +} + +static int +SDL_UpdateWindowTexture(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects) +{ + SDL_WindowTextureData *data; + + data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data || !data->texture) { + SDL_SetError("No window texture data"); + return -1; + } + + if (SDL_UpdateTexture(data->texture, NULL, data->pixels, data->pitch) < 0) { + return -1; + } + if (SDL_RenderCopy(data->renderer, data->texture, NULL, NULL) < 0) { + return -1; + } + SDL_RenderPresent(data->renderer); + return 0; +} + +static void +SDL_DestroyWindowTexture(_THIS, SDL_Window * window) +{ + SDL_WindowTextureData *data; + + data = SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, NULL); + if (!data) { + return; + } + if (data->texture) { + SDL_DestroyTexture(data->texture); + } + if (data->renderer) { + SDL_DestroyRenderer(data->renderer); + } + if (data->pixels) { + SDL_free(data->pixels); + } + SDL_free(data); +} + + static int cmpmodes(const void *A, const void *B) { @@ -228,6 +352,7 @@ SDL_VideoQuit(); return -1; } + /* Make sure some displays were added */ if (_this->num_displays == 0) { SDL_SetError("The video driver did not add any displays"); @@ -235,6 +360,13 @@ return (-1); } + /* Add the renderer framebuffer emulation if needed */ + if (!_this->CreateWindowFramebuffer) { + _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; + _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; + _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; + } + /* We're ready to go! */ return 0; } @@ -1216,6 +1348,69 @@ return 0; } +static SDL_Surface * +SDL_CreateWindowFramebuffer(SDL_Window * window) +{ + Uint32 format; + void *pixels; + int pitch; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) { + return NULL; + } + + if (_this->CreateWindowFramebuffer(_this, window, &format, &pixels, &pitch) < 0) { + return NULL; + } + + if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + return NULL; + } + + return SDL_CreateRGBSurfaceFrom(pixels, window->w, window->h, bpp, pitch, Rmask, Gmask, Bmask, Amask); +} + +SDL_Surface * +SDL_GetWindowSurface(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, NULL); + + if (!window->surface) { + window->surface = SDL_CreateWindowFramebuffer(window); + } + return window->surface; +} + +int +SDL_UpdateWindowSurface(SDL_Window * window) +{ + SDL_Rect full_rect; + + CHECK_WINDOW_MAGIC(window, -1); + + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = window->w; + full_rect.h = window->h; + return SDL_UpdateWindowSurfaceRects(window, 1, &full_rect); +} + +int +SDL_UpdateWindowSurfaceRects(SDL_Window * window, + int numrects, SDL_Rect * rects) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (!window->surface) { + SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface"); + return -1; + } + + return _this->UpdateWindowFramebuffer(_this, window, numrects, rects); +} + void SDL_SetWindowGrab(SDL_Window * window, int mode) { @@ -1262,6 +1457,15 @@ } void +SDL_OnWindowResized(SDL_Window * window) +{ + if (window->surface) { + SDL_FreeSurface(window->surface); + window->surface = NULL; + } +} + +void SDL_OnWindowMinimized(SDL_Window * window) { SDL_UpdateFullscreenMode(window, SDL_FALSE); @@ -1336,6 +1540,9 @@ /* Restore video mode, etc. */ SDL_UpdateFullscreenMode(window, SDL_FALSE); + if (_this->DestroyWindowFramebuffer) { + _this->DestroyWindowFramebuffer(_this, window); + } if (_this->DestroyWindow) { _this->DestroyWindow(_this, window); } diff -r 2b1989f59674 -r 4d39eeaad00b src/video/dummy/SDL_nullframebuffer.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/video/dummy/SDL_nullframebuffer.c Thu Feb 03 15:49:37 2011 -0800 @@ -0,0 +1,90 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#include "../SDL_sysvideo.h" + + +#define DUMMY_SURFACE "_SDL_DummySurface" + +int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +{ + SDL_Surface *surface; + const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; + int w, h; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + /* Free the old framebuffer surface */ + surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE); + if (surface) { + SDL_FreeSurface(surface); + } + + /* Create a new one */ + SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); + SDL_GetWindowSize(window, &w, &h); + surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask); + if (!surface) { + return -1; + } + + /* Save the info and return! */ + SDL_SetWindowData(window, DUMMY_SURFACE, surface); + *format = surface_format; + *pixels = surface->pixels; + *pitch = surface->pitch; + return 0; +} + +int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects) +{ + static int frame_number; + SDL_Surface *surface; + + surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE); + if (!surface) { + SDL_SetError("Couldn't find dummy surface for window"); + return -1; + } + + /* Send the data to the display */ + if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) { + char file[128]; + SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp", + SDL_GetWindowID(window), ++frame_number); + SDL_SaveBMP(surface, file); + } + return 0; +} + +void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +{ + SDL_Surface *surface; + + surface = (SDL_Surface *) SDL_SetWindowData(window, DUMMY_SURFACE, NULL); + if (surface) { + SDL_FreeSurface(surface); + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff -r 2b1989f59674 -r 4d39eeaad00b src/video/dummy/SDL_nullframebuffer_c.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/video/dummy/SDL_nullframebuffer_c.h Thu Feb 03 15:49:37 2011 -0800 @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); +extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int numrects, SDL_Rect * rects); +extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window); + +/* vi: set ts=4 sw=4 expandtab: */ diff -r 2b1989f59674 -r 4d39eeaad00b src/video/dummy/SDL_nullvideo.c --- a/src/video/dummy/SDL_nullvideo.c Thu Feb 03 11:16:57 2011 -0800 +++ b/src/video/dummy/SDL_nullvideo.c Thu Feb 03 15:49:37 2011 -0800 @@ -44,6 +44,7 @@ #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" +#include "SDL_nullframebuffer_c.h" #define DUMMYVID_DRIVER_NAME "dummy" @@ -91,6 +92,9 @@ device->VideoQuit = DUMMY_VideoQuit; device->SetDisplayMode = DUMMY_SetDisplayMode; device->PumpEvents = DUMMY_PumpEvents; + device->CreateWindowFramebuffer = SDL_DUMMY_CreateWindowFramebuffer; + device->UpdateWindowFramebuffer = SDL_DUMMY_UpdateWindowFramebuffer; + device->DestroyWindowFramebuffer = SDL_DUMMY_DestroyWindowFramebuffer; device->free = DUMMY_DeleteDevice;