From 57b16eede6ec90f60380867e2421408024cbd550 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 2 Feb 2011 14:34:54 -0800 Subject: [PATCH] Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library. --- VisualC/SDL/SDL_VS2008.vcproj | 56 +- VisualC/SDL/SDL_VS2010.vcxproj | 24 +- VisualC/SDL_VS2008.sln | 16 - VisualC/SDL_VS2010.sln | 15 - .../SDL/SDLiPhoneOS.xcodeproj/project.pbxproj | 129 +- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 141 +- configure.in | 4 +- include/SDL_rect.h | 35 + include/SDL_video.h | 5 + src/events/SDL_events.c | 2 - src/render/SDL_render.c | 1113 ++++++++++++++++ src/render/SDL_sysrender.h | 133 ++ .../direct3d}/SDL_d3drender.c | 183 ++- .../opengl}/SDL_renderer_gl.c | 44 +- .../opengles}/SDL_renderer_gles.c | 39 +- .../software}/SDL_renderer_sw.c | 71 +- src/video/SDL_pixels_c.h | 1 + src/video/SDL_rect.c | 3 +- src/video/SDL_rect_c.h | 40 - src/video/SDL_renderer_gl.h | 28 - src/video/SDL_renderer_gles.h | 28 - src/video/SDL_renderer_sw.h | 31 - src/video/SDL_sysvideo.h | 97 -- src/video/SDL_video.c | 1146 +---------------- src/video/directfb/SDL_DirectFB_render.c | 1 - src/video/dummy/SDL_nullrender.c | 288 ----- src/video/dummy/SDL_nullrender_c.h | 28 - src/video/dummy/SDL_nullvideo.c | 2 - src/video/uikit/SDL_uikitvideo.m | 3 - src/video/uikit/SDL_uikitwindow.m | 1 - src/video/windows/SDL_d3drender.h | 28 - src/video/windows/SDL_windowskeyboard.c | 44 +- src/video/windows/SDL_windowsvideo.c | 11 - src/video/windows/SDL_windowsvideo.h | 13 - src/video/x11/SDL_x11video.h | 2 + 35 files changed, 1621 insertions(+), 2184 deletions(-) create mode 100644 src/render/SDL_render.c create mode 100644 src/render/SDL_sysrender.h rename src/{video/windows => render/direct3d}/SDL_d3drender.c (90%) rename src/{video => render/opengl}/SDL_renderer_gl.c (97%) rename src/{video => render/opengles}/SDL_renderer_gles.c (97%) rename src/{video => render/software}/SDL_renderer_sw.c (94%) delete mode 100644 src/video/SDL_rect_c.h delete mode 100644 src/video/SDL_renderer_gl.h delete mode 100644 src/video/SDL_renderer_gles.h delete mode 100644 src/video/SDL_renderer_sw.h delete mode 100644 src/video/dummy/SDL_nullrender.c delete mode 100644 src/video/dummy/SDL_nullrender_c.h delete mode 100644 src/video/windows/SDL_d3drender.h diff --git a/VisualC/SDL/SDL_VS2008.vcproj b/VisualC/SDL/SDL_VS2008.vcproj index 5f8ef3451..8c583a11e 100644 --- a/VisualC/SDL/SDL_VS2008.vcproj +++ b/VisualC/SDL/SDL_VS2008.vcproj @@ -30,7 +30,7 @@ + + @@ -421,10 +425,18 @@ RelativePath="..\..\include\SDL_events.h" > + + + + @@ -485,6 +497,10 @@ RelativePath="..\..\include\SDL_rect.h" > + + @@ -497,6 +513,10 @@ RelativePath="..\..\include\SDL_scancode.h" > + + @@ -517,6 +537,10 @@ RelativePath="..\..\include\SDL_timer.h" > + + @@ -751,11 +775,7 @@ > - - - - - - @@ -987,19 +999,15 @@ > - - + + diff --git a/VisualC/SDL/SDL_VS2010.vcxproj b/VisualC/SDL/SDL_VS2010.vcxproj index 2a0ea40bf..25c780c87 100644 --- a/VisualC/SDL/SDL_VS2010.vcxproj +++ b/VisualC/SDL/SDL_VS2010.vcxproj @@ -75,7 +75,7 @@ Making sure basic SDL headers are in place... echo Copying SDL_config_windows.h to SDL_config.h... -copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h" +xcopy /d /q /y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h" if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY echo Creating stub SDL_revision.h file... @@ -153,7 +153,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r Making sure basic SDL headers are in place... echo Copying SDL_config_windows.h to SDL_config.h... -copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h" +xcopy /d /q /y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h" if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY echo Creating stub SDL_revision.h file... @@ -231,6 +231,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + @@ -240,7 +241,9 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + + @@ -256,6 +259,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + @@ -265,6 +269,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + @@ -277,6 +282,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + @@ -287,7 +293,6 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r - @@ -306,12 +311,9 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r - - - @@ -360,6 +362,10 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r + + + + @@ -386,7 +392,6 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r - @@ -413,15 +418,12 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r - - - @@ -456,4 +458,4 @@ echo #define SDL_REVISION "hg-0:baadf00d" >"$(ProjectDir)\..\..\include\SDL_r - + \ No newline at end of file diff --git a/VisualC/SDL_VS2008.sln b/VisualC/SDL_VS2008.sln index 7ab5d67b5..bd9fef211 100644 --- a/VisualC/SDL_VS2008.sln +++ b/VisualC/SDL_VS2008.sln @@ -84,12 +84,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testo {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpalette", "tests\testpalette\testpalette_VS2008.vcproj", "{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" ProjectSection(ProjectDependencies) = postProject {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} @@ -301,15 +295,6 @@ Global {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32 {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32 {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.ActiveCfg = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.Build.0 = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|x64.ActiveCfg = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.Build.0 = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|x64.ActiveCfg = Release|Win32 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|Win32 @@ -418,7 +403,6 @@ Global {55812185-D13C-4022-9C81-32E0F4A08304} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {9E320A14-B443-4DD7-8725-B7020DCFF730} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {5D0930C0-7C91-4ECE-9014-7B7DDE9502E5} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} diff --git a/VisualC/SDL_VS2010.sln b/VisualC/SDL_VS2010.sln index ee39bdd72..203fd014a 100644 --- a/VisualC/SDL_VS2010.sln +++ b/VisualC/SDL_VS2010.sln @@ -49,12 +49,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testj {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpalette", "tests\testpalette\testpalette_VS2010.vcxproj", "{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvidinfo", "tests\testvidinfo\testvidinfo_VS2010.vcxproj", "{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}" ProjectSection(ProjectDependencies) = postProject {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} @@ -230,14 +224,6 @@ Global {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32 {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32 {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.ActiveCfg = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.Build.0 = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|x64.ActiveCfg = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release_NoSTDIO|x64.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.Build.0 = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|x64.ActiveCfg = Release|Win32 {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.ActiveCfg = Debug|Win32 {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.Build.0 = Debug|Win32 {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|x64.ActiveCfg = Debug|Win32 @@ -361,7 +347,6 @@ Global {D974A0DF-3E2E-445C-A2EB-E899E9B582CB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {55812185-D13C-4022-9C81-32E0F4A08304} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {575FD095-EDAB-4BD4-B733-CD4A874F6FB0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {0FFD1A21-11DB-492C-A989-E4F195B0C441} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} diff --git a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj index 06043549d..63aae640b 100755 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj @@ -62,6 +62,11 @@ 0098A5631195B4D900343137 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5621195B4D900343137 /* OpenGLES.framework */; }; 0098A5651195B4D900343137 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5641195B4D900343137 /* UIKit.framework */; }; 0098A5851195B5E200343137 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5841195B5E200343137 /* QuartzCore.framework */; }; + 041B2CD912FA0E9E0087D585 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CD812FA0E9E0087D585 /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 041B2CF012FA0F680087D585 /* SDL_renderer_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CE912FA0F680087D585 /* SDL_renderer_gles.c */; }; + 041B2CF112FA0F680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; }; + 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; }; + 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 */; }; @@ -69,8 +74,8 @@ 043DD77110FD8A0000DED673 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */; }; 043DD77210FD8A0000DED673 /* SDL_drawrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 043DD76E10FD8A0000DED673 /* SDL_drawrect.c */; }; 04461DEE0EA76BA3006C462D /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04461DED0EA76BA3006C462D /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 044E5FB511E6069F0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB311E6069F0076F181 /* SDL_clipboard.h */; }; - 044E5FB611E6069F0076F181 /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5FB411E6069F0076F181 /* SDL_input.h */; }; + 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 */; }; @@ -86,10 +91,6 @@ 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */; }; 0495E68A0E97408800152DFE /* SDL_glesfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0495E6840E97408800152DFE /* SDL_glesfuncs.h */; }; 0495E68B0E97408800152DFE /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0495E6850E97408800152DFE /* SDL_glfuncs.h */; }; - 0495E68C0E97408800152DFE /* SDL_renderer_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0495E6860E97408800152DFE /* SDL_renderer_gl.c */; }; - 0495E68D0E97408800152DFE /* SDL_renderer_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0495E6870E97408800152DFE /* SDL_renderer_gl.h */; }; - 0495E68E0E97408800152DFE /* SDL_renderer_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0495E6880E97408800152DFE /* SDL_renderer_gles.c */; }; - 0495E68F0E97408800152DFE /* SDL_renderer_gles.h in Headers */ = {isa = PBXBuildFile; fileRef = 0495E6890E97408800152DFE /* SDL_renderer_gles.h */; }; 04B2ECEC1025CE4800F9BC5F /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04B2ECE61025CE4800F9BC5F /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; }; 04B2ECED1025CE4800F9BC5F /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = 04B2ECE71025CE4800F9BC5F /* SDL_power.h */; settings = {ATTRIBUTES = (Public, ); }; }; 04B2ECEE1025CE4800F9BC5F /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = 04B2ECE81025CE4800F9BC5F /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -98,16 +99,15 @@ 04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; }; 04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */; }; 04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; }; - 04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */; }; - 04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */; }; - 04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; }; - 04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; }; + 04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 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 */; }; 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 */; }; - 04FFAB9712E23BDC00BA343D /* SDL_scalemode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9412E23BDC00BA343D /* SDL_scalemode.h */; }; - 04FFAB9812E23BDC00BA343D /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9512E23BDC00BA343D /* SDL_shape.h */; }; + 04FFAB9612E23BDC00BA343D /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 04FFAB9812E23BDC00BA343D /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FFAB9512E23BDC00BA343D /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; }; 56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; }; 56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; }; FD24846D0E5655AE0021E198 /* SDL_uikitkeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = FD24846B0E5655AE0021E198 /* SDL_uikitkeyboard.h */; }; @@ -198,7 +198,6 @@ FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; }; FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; }; FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */; }; - FD6C83B60DEA66E500ABEE55 /* SDL_systimer.h in Headers */ = {isa = PBXBuildFile; fileRef = FD99BA2D0DD52EDC00FB1D6B /* SDL_systimer.h */; }; FD8BD7AC0E27DCA400B52CD5 /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = FD8BD7AB0E27DCA400B52CD5 /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; }; FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; }; FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683000DF2374E00F98A1A /* SDL_blit.c */; }; @@ -218,9 +217,6 @@ FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; }; FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */; }; FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; }; - FDA6845F0DF2374E00F98A1A /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683120DF2374E00F98A1A /* SDL_rect_c.h */; }; - FDA684600DF2374E00F98A1A /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683130DF2374E00F98A1A /* SDL_renderer_sw.c */; }; - FDA684610DF2374E00F98A1A /* SDL_renderer_sw.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683140DF2374E00F98A1A /* SDL_renderer_sw.h */; }; FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */; }; FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */; }; FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683170DF2374E00F98A1A /* SDL_stretch.c */; }; @@ -232,8 +228,6 @@ FDA6846B0DF2374E00F98A1A /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA6831E0DF2374E00F98A1A /* SDL_yuv_sw_c.h */; }; FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F50DF244C800F98A1A /* SDL_nullevents.c */; }; FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */; }; - FDA685FD0DF244C800F98A1A /* SDL_nullrender.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F70DF244C800F98A1A /* SDL_nullrender.c */; }; - FDA685FE0DF244C800F98A1A /* SDL_nullrender_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685F80DF244C800F98A1A /* SDL_nullrender_c.h */; }; FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; }; FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */; }; FDC656480E560DF800311C8E /* jumphack.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC656440E560DF800311C8E /* jumphack.c */; }; @@ -323,6 +317,11 @@ 0098A5621195B4D900343137 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 0098A5641195B4D900343137 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 0098A5841195B5E200343137 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 041B2CD812FA0E9E0087D585 /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_render.h; path = ../../include/SDL_render.h; sourceTree = SOURCE_ROOT; }; + 041B2CE912FA0F680087D585 /* SDL_renderer_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gles.c; sourceTree = ""; }; + 041B2CEA12FA0F680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = ""; }; + 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; }; + 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 = ""; }; @@ -347,10 +346,6 @@ 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; }; 0495E6840E97408800152DFE /* SDL_glesfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glesfuncs.h; sourceTree = ""; }; 0495E6850E97408800152DFE /* SDL_glfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glfuncs.h; sourceTree = ""; }; - 0495E6860E97408800152DFE /* SDL_renderer_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gl.c; sourceTree = ""; }; - 0495E6870E97408800152DFE /* SDL_renderer_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_gl.h; sourceTree = ""; }; - 0495E6880E97408800152DFE /* SDL_renderer_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gles.c; sourceTree = ""; }; - 0495E6890E97408800152DFE /* SDL_renderer_gles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_gles.h; sourceTree = ""; }; 04B2ECE61025CE4800F9BC5F /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_atomic.h; path = ../../include/SDL_atomic.h; sourceTree = SOURCE_ROOT; }; 04B2ECE71025CE4800F9BC5F /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_power.h; path = ../../include/SDL_power.h; sourceTree = SOURCE_ROOT; }; 04B2ECE81025CE4800F9BC5F /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_revision.h; path = ../../include/SDL_revision.h; sourceTree = SOURCE_ROOT; }; @@ -367,7 +362,6 @@ 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; }; - 04FFAB9412E23BDC00BA343D /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_scalemode.h; path = ../../include/SDL_scalemode.h; sourceTree = SOURCE_ROOT; }; 04FFAB9512E23BDC00BA343D /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_shape.h; path = ../../include/SDL_shape.h; sourceTree = SOURCE_ROOT; }; 56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; }; 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; }; @@ -458,7 +452,6 @@ FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = ""; }; FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = ""; }; FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = ""; }; - FD99B9910DD52EDC00FB1D6B /* scancodes_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_win32.h; sourceTree = ""; }; FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = ""; }; FD99B9930DD52EDC00FB1D6B /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = ""; }; FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = ""; }; @@ -486,7 +479,6 @@ FD99BA140DD52EDC00FB1D6B /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = ""; }; FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = ""; }; FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = ""; }; - FD99BA2D0DD52EDC00FB1D6B /* SDL_systimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systimer.h; sourceTree = ""; }; FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = ""; }; FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = ""; }; FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = ""; }; @@ -507,9 +499,6 @@ FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = ""; }; FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = ""; }; FDA683110DF2374E00F98A1A /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = ""; }; - FDA683120DF2374E00F98A1A /* SDL_rect_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_c.h; sourceTree = ""; }; - FDA683130DF2374E00F98A1A /* SDL_renderer_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_sw.c; sourceTree = ""; }; - FDA683140DF2374E00F98A1A /* SDL_renderer_sw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw.h; sourceTree = ""; }; FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = ""; }; FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = ""; }; FDA683170DF2374E00F98A1A /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = ""; }; @@ -521,8 +510,6 @@ FDA6831E0DF2374E00F98A1A /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; }; FDA685F50DF244C800F98A1A /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = ""; }; FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; - FDA685F70DF244C800F98A1A /* SDL_nullrender.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullrender.c; sourceTree = ""; }; - FDA685F80DF244C800F98A1A /* SDL_nullrender_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullrender_c.h; sourceTree = ""; }; FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = ""; }; FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = ""; }; FDC261780E3A3FC8001C4554 /* keyinfotable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyinfotable.h; sourceTree = ""; }; @@ -668,6 +655,34 @@ path = cocoa; sourceTree = ""; }; + 041B2CE312FA0F680087D585 /* render */ = { + isa = PBXGroup; + children = ( + 041B2CE812FA0F680087D585 /* opengles */, + 041B2CEA12FA0F680087D585 /* SDL_render.c */, + 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */, + 041B2CEC12FA0F680087D585 /* software */, + ); + name = render; + path = ../../src/render; + sourceTree = SOURCE_ROOT; + }; + 041B2CE812FA0F680087D585 /* opengles */ = { + isa = PBXGroup; + children = ( + 041B2CE912FA0F680087D585 /* SDL_renderer_gles.c */, + ); + path = opengles; + sourceTree = ""; + }; + 041B2CEC12FA0F680087D585 /* software */ = { + isa = PBXGroup; + children = ( + 041B2CED12FA0F680087D585 /* SDL_renderer_sw.c */, + ); + path = software; + sourceTree = ""; + }; 047677B60EA769DF008ABAF1 /* haptic */ = { isa = PBXGroup; children = ( @@ -849,15 +864,13 @@ FD99B8BC0DD52E5C00FB1D6B /* Public Headers */ = { isa = PBXGroup; children = ( - 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */, - 04FFAB9412E23BDC00BA343D /* SDL_scalemode.h */, - 04FFAB9512E23BDC00BA343D /* SDL_shape.h */, FD99B8CC0DD52EB400FB1D6B /* begin_code.h */, FD99B8CD0DD52EB400FB1D6B /* close_code.h */, FD99B8F50DD52EB400FB1D6B /* SDL.h */, 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */, 04B2ECE61025CE4800F9BC5F /* SDL_atomic.h */, FD99B8CF0DD52EB400FB1D6B /* SDL_audio.h */, + 04FFAB9312E23BDC00BA343D /* SDL_blendmode.h */, 044E5FB311E6069F0076F181 /* SDL_clipboard.h */, FD99B8D10DD52EB400FB1D6B /* SDL_compat.h */, 04B2ED061025CF9E00F9BC5F /* SDL_config.h */, @@ -885,9 +898,11 @@ 04B2ECE71025CE4800F9BC5F /* SDL_power.h */, FD99B8E90DD52EB400FB1D6B /* SDL_quit.h */, FD99B8EA0DD52EB400FB1D6B /* SDL_rect.h */, + 041B2CD812FA0E9E0087D585 /* SDL_render.h */, 04B2ECE81025CE4800F9BC5F /* SDL_revision.h */, FD99B8EB0DD52EB400FB1D6B /* SDL_rwops.h */, FD99B8EC0DD52EB400FB1D6B /* SDL_scancode.h */, + 04FFAB9512E23BDC00BA343D /* SDL_shape.h */, FD99B8ED0DD52EB400FB1D6B /* SDL_stdinc.h */, FD99B8EE0DD52EB400FB1D6B /* SDL_surface.h */, FD99B8EF0DD52EB400FB1D6B /* SDL_syswm.h */, @@ -904,13 +919,6 @@ FD99B8BD0DD52E6D00FB1D6B /* Library Source */ = { isa = PBXGroup; children = ( - 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */, - FD99B9D30DD52EDC00FB1D6B /* SDL_compat.c */, - FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */, - FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */, - FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */, - FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */, - FD99B9D80DD52EDC00FB1D6B /* SDL.c */, 04B2ECEF1025CEB900F9BC5F /* atomic */, FD99B8FB0DD52EDC00FB1D6B /* audio */, FD99B98A0DD52EDC00FB1D6B /* cpuinfo */, @@ -920,10 +928,18 @@ FD5F9D080E0E08B3008E885B /* joystick */, FD8BD8150E27E25900B52CD5 /* loadso */, 56ED04DE118A8E9A00A56AA6 /* power */, + 041B2CE312FA0F680087D585 /* render */, FD3F4A6F0DEA620800C5B771 /* stdlib */, FD99B9E00DD52EDC00FB1D6B /* thread */, FD99BA1E0DD52EDC00FB1D6B /* timer */, FDA682420DF2374D00F98A1A /* video */, + 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */, + FD99B9D30DD52EDC00FB1D6B /* SDL_compat.c */, + FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */, + FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */, + FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */, + FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */, + FD99B9D80DD52EDC00FB1D6B /* SDL.c */, ); name = "Library Source"; sourceTree = ""; @@ -982,7 +998,6 @@ FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */, FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */, FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */, - FD99B9910DD52EDC00FB1D6B /* scancodes_win32.h */, FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */, 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */, 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */, @@ -1039,10 +1054,9 @@ FD99BA1E0DD52EDC00FB1D6B /* timer */ = { isa = PBXGroup; children = ( - FD99BA2D0DD52EDC00FB1D6B /* SDL_systimer.h */, + FD99BA300DD52EDC00FB1D6B /* unix */, FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */, FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */, - FD99BA300DD52EDC00FB1D6B /* unix */, ); name = timer; path = ../../src/timer; @@ -1059,15 +1073,10 @@ FDA682420DF2374D00F98A1A /* video */ = { isa = PBXGroup; children = ( - 044E5FB711E606EB0076F181 /* SDL_clipboard.c */, FD689F090E26E5D900F90B21 /* uikit */, FDA685F40DF244C800F98A1A /* dummy */, 0495E6850E97408800152DFE /* SDL_glfuncs.h */, 0495E6840E97408800152DFE /* SDL_glesfuncs.h */, - 0495E6860E97408800152DFE /* SDL_renderer_gl.c */, - 0495E6870E97408800152DFE /* SDL_renderer_gl.h */, - 0495E6880E97408800152DFE /* SDL_renderer_gles.c */, - 0495E6890E97408800152DFE /* SDL_renderer_gles.h */, 043DD76B10FD8A0000DED673 /* SDL_alphamult.c */, 043DD76C10FD8A0000DED673 /* SDL_alphamult.h */, 043DD76D10FD8A0000DED673 /* SDL_blendfillrect.c */, @@ -1087,6 +1096,7 @@ FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */, 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 */, @@ -1097,9 +1107,6 @@ FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */, FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */, FDA683110DF2374E00F98A1A /* SDL_rect.c */, - FDA683120DF2374E00F98A1A /* SDL_rect_c.h */, - FDA683130DF2374E00F98A1A /* SDL_renderer_sw.c */, - FDA683140DF2374E00F98A1A /* SDL_renderer_sw.h */, FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */, FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */, FDA683170DF2374E00F98A1A /* SDL_stretch.c */, @@ -1119,8 +1126,6 @@ children = ( FDA685F50DF244C800F98A1A /* SDL_nullevents.c */, FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */, - FDA685F70DF244C800F98A1A /* SDL_nullrender.c */, - FDA685F80DF244C800F98A1A /* SDL_nullrender_c.h */, FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */, FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */, ); @@ -1134,7 +1139,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - FD6C83B60DEA66E500ABEE55 /* SDL_systimer.h in Headers */, FD3F495C0DEA5B2100C5B771 /* begin_code.h in Headers */, FD3F495D0DEA5B2100C5B771 /* close_code.h in Headers */, FD3F495F0DEA5B2100C5B771 /* SDL_audio.h in Headers */, @@ -1173,13 +1177,10 @@ FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */, FDA6845B0DF2374E00F98A1A /* SDL_leaks.h in Headers */, FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */, - FDA6845F0DF2374E00F98A1A /* SDL_rect_c.h in Headers */, - FDA684610DF2374E00F98A1A /* SDL_renderer_sw.h in Headers */, FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */, FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */, FDA6846B0DF2374E00F98A1A /* SDL_yuv_sw_c.h in Headers */, FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */, - FDA685FE0DF244C800F98A1A /* SDL_nullrender_c.h in Headers */, FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */, FD5F9D300E0E08B3008E885B /* SDL_joystick_c.h in Headers */, FD5F9D310E0E08B3008E885B /* SDL_sysjoystick.h in Headers */, @@ -1196,8 +1197,6 @@ FD24846D0E5655AE0021E198 /* SDL_uikitkeyboard.h in Headers */, 0495E68A0E97408800152DFE /* SDL_glesfuncs.h in Headers */, 0495E68B0E97408800152DFE /* SDL_glfuncs.h in Headers */, - 0495E68D0E97408800152DFE /* SDL_renderer_gl.h in Headers */, - 0495E68F0E97408800152DFE /* SDL_renderer_gles.h in Headers */, 047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */, 04461DEE0EA76BA3006C462D /* SDL_haptic.h in Headers */, 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */, @@ -1218,8 +1217,9 @@ 04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */, 04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */, 04FFAB9612E23BDC00BA343D /* SDL_blendmode.h in Headers */, - 04FFAB9712E23BDC00BA343D /* SDL_scalemode.h in Headers */, 04FFAB9812E23BDC00BA343D /* SDL_shape.h in Headers */, + 041B2CD912FA0E9E0087D585 /* SDL_render.h in Headers */, + 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1423,7 +1423,6 @@ FDA6845A0DF2374E00F98A1A /* SDL_gamma.c in Sources */, FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */, FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */, - FDA684600DF2374E00F98A1A /* SDL_renderer_sw.c in Sources */, FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */, FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */, FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */, @@ -1431,7 +1430,6 @@ FDA684690DF2374E00F98A1A /* SDL_yuv_mmx.c in Sources */, FDA6846A0DF2374E00F98A1A /* SDL_yuv_sw.c in Sources */, FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */, - FDA685FD0DF244C800F98A1A /* SDL_nullrender.c in Sources */, FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */, FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */, FD689EFB0E26E57800F90B21 /* SDL_coreaudio_iphone.c in Sources */, @@ -1446,8 +1444,6 @@ FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */, FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */, FDC656480E560DF800311C8E /* jumphack.c in Sources */, - 0495E68C0E97408800152DFE /* SDL_renderer_gl.c in Sources */, - 0495E68E0E97408800152DFE /* SDL_renderer_gles.c in Sources */, 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */, 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */, 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */, @@ -1470,6 +1466,9 @@ 04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */, 04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */, 04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */, + 041B2CF012FA0F680087D585 /* SDL_renderer_gles.c in Sources */, + 041B2CF112FA0F680087D585 /* SDL_render.c in Sources */, + 041B2CF312FA0F680087D585 /* SDL_renderer_sw.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 76f5c4137..882a2dd7a 100755 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -121,12 +121,20 @@ 00D8DA281195093100638393 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA151195093100638393 /* SDL_at.c */; }; 00D8DA291195093100638393 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA181195093100638393 /* surface.c */; }; 00D8DA2A1195093100638393 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA1A1195093100638393 /* testsdl.c */; }; + 041B2C9512FA0D2A0087D585 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9412FA0D2A0087D585 /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 041B2C9612FA0D2A0087D585 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9412FA0D2A0087D585 /* SDL_render.h */; }; + 041B2CA312FA0D680087D585 /* SDL_renderer_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9B12FA0D680087D585 /* SDL_renderer_gl.c */; }; + 041B2CA512FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; }; + 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; }; + 041B2CA712FA0D680087D585 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */; }; + 041B2CA912FA0D680087D585 /* SDL_renderer_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9B12FA0D680087D585 /* SDL_renderer_gl.c */; }; + 041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; }; + 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; }; + 041B2CAD12FA0D680087D585 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */; }; 044E5F8511E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; 044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; }; 0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0469A10C12EE4BF100B846D6 /* SDL_scalemode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; }; - 0469A10E12EE4BF100B846D6 /* SDL_scalemode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */; }; 04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; }; 04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; @@ -155,7 +163,6 @@ 04BD004312E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; }; 04BD004412E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; }; 04BD004512E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; }; - 04BD004612E6671800899322 /* scancodes_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDA12E6671700899322 /* scancodes_win32.h */; }; 04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; }; 04BD004812E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; }; 04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; }; @@ -212,7 +219,6 @@ 04BD00C912E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; }; 04BD00CA12E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; }; 04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; }; - 04BD00D612E6671800899322 /* SDL_systimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE9E12E6671800899322 /* SDL_systimer.h */; }; 04BD00D712E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; }; 04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; }; 04BD00D912E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; }; @@ -236,8 +242,6 @@ 04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; }; 04BD011712E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; }; 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; - 04BD011912E6671800899322 /* SDL_nullrender.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEA12E6671800899322 /* SDL_nullrender.c */; }; - 04BD011A12E6671800899322 /* SDL_nullrender_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEEB12E6671800899322 /* SDL_nullrender_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 */; }; 04BD013212E6671800899322 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF0412E6671800899322 /* mmx.h */; }; @@ -273,13 +277,6 @@ 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; }; 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; }; 04BD018E12E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; }; - 04BD018F12E6671800899322 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6812E6671800899322 /* SDL_rect_c.h */; }; - 04BD019012E6671800899322 /* SDL_renderer_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6912E6671800899322 /* SDL_renderer_gl.c */; }; - 04BD019112E6671800899322 /* SDL_renderer_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6A12E6671800899322 /* SDL_renderer_gl.h */; }; - 04BD019212E6671800899322 /* SDL_renderer_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6B12E6671800899322 /* SDL_renderer_gles.c */; }; - 04BD019312E6671800899322 /* SDL_renderer_gles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6C12E6671800899322 /* SDL_renderer_gles.h */; }; - 04BD019412E6671800899322 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6D12E6671800899322 /* SDL_renderer_sw.c */; }; - 04BD019512E6671800899322 /* SDL_renderer_sw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6E12E6671800899322 /* SDL_renderer_sw.h */; }; 04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; }; 04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; }; 04BD019812E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; }; @@ -311,8 +308,6 @@ 04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; }; 04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; }; 04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; }; - 04BD01EF12E6671800899322 /* SDL_x11render.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCC12E6671800899322 /* SDL_x11render.c */; }; - 04BD01F012E6671800899322 /* SDL_x11render.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCD12E6671800899322 /* SDL_x11render.h */; }; 04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; }; 04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; }; 04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; }; @@ -381,7 +376,6 @@ 04BD025E12E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; }; 04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; }; 04BD026012E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; }; - 04BD026112E6671800899322 /* scancodes_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDA12E6671700899322 /* scancodes_win32.h */; }; 04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; }; 04BD026312E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; }; 04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; }; @@ -438,7 +432,6 @@ 04BD02E312E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; }; 04BD02E412E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; }; 04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; }; - 04BD02F012E6671800899322 /* SDL_systimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE9E12E6671800899322 /* SDL_systimer.h */; }; 04BD02F112E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; }; 04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; }; 04BD02F312E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; }; @@ -462,8 +455,6 @@ 04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; }; 04BD033112E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; }; 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; - 04BD033312E6671800899322 /* SDL_nullrender.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEA12E6671800899322 /* SDL_nullrender.c */; }; - 04BD033412E6671800899322 /* SDL_nullrender_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEEB12E6671800899322 /* SDL_nullrender_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 */; }; 04BD034C12E6671800899322 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF0412E6671800899322 /* mmx.h */; }; @@ -499,13 +490,6 @@ 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; }; 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; }; 04BD03A812E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; }; - 04BD03A912E6671800899322 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6812E6671800899322 /* SDL_rect_c.h */; }; - 04BD03AA12E6671800899322 /* SDL_renderer_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6912E6671800899322 /* SDL_renderer_gl.c */; }; - 04BD03AB12E6671800899322 /* SDL_renderer_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6A12E6671800899322 /* SDL_renderer_gl.h */; }; - 04BD03AC12E6671800899322 /* SDL_renderer_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6B12E6671800899322 /* SDL_renderer_gles.c */; }; - 04BD03AD12E6671800899322 /* SDL_renderer_gles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6C12E6671800899322 /* SDL_renderer_gles.h */; }; - 04BD03AE12E6671800899322 /* SDL_renderer_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6D12E6671800899322 /* SDL_renderer_sw.c */; }; - 04BD03AF12E6671800899322 /* SDL_renderer_sw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6E12E6671800899322 /* SDL_renderer_sw.h */; }; 04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; }; 04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; }; 04BD03B212E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; }; @@ -537,8 +521,6 @@ 04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; }; 04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; }; 04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; }; - 04BD040712E6671800899322 /* SDL_x11render.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCC12E6671800899322 /* SDL_x11render.c */; }; - 04BD040812E6671800899322 /* SDL_x11render.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCD12E6671800899322 /* SDL_x11render.h */; }; 04BD040912E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; }; 04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; }; 04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; }; @@ -714,9 +696,13 @@ 00D8DA191195093100638393 /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = ""; }; 00D8DA1A1195093100638393 /* testsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsdl.c; path = ../../test/automated/testsdl.c; sourceTree = SOURCE_ROOT; }; 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; sourceTree = ""; }; + 041B2C9412FA0D2A0087D585 /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_render.h; path = ../../include/SDL_render.h; sourceTree = SOURCE_ROOT; }; + 041B2C9B12FA0D680087D585 /* SDL_renderer_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gl.c; sourceTree = ""; }; + 041B2C9E12FA0D680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = ""; }; + 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; }; + 041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_sw.c; sourceTree = ""; }; 044E5F8411E6051C0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; }; 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; }; - 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_scalemode.h; path = ../../include/SDL_scalemode.h; sourceTree = SOURCE_ROOT; }; 04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = ""; }; 04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; }; 04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = ""; }; @@ -747,7 +733,6 @@ 04BDFDD712E6671700899322 /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = ""; }; 04BDFDD812E6671700899322 /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = ""; }; 04BDFDD912E6671700899322 /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = ""; }; - 04BDFDDA12E6671700899322 /* scancodes_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_win32.h; sourceTree = ""; }; 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = ""; }; 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; }; 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; }; @@ -804,7 +789,6 @@ 04BDFE8B12E6671800899322 /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = ""; }; 04BDFE8C12E6671800899322 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = ""; }; 04BDFE8D12E6671800899322 /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = ""; }; - 04BDFE9E12E6671800899322 /* SDL_systimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systimer.h; sourceTree = ""; }; 04BDFE9F12E6671800899322 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = ""; }; 04BDFEA012E6671800899322 /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = ""; }; 04BDFEA212E6671800899322 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = ""; }; @@ -828,8 +812,6 @@ 04BDFED312E6671800899322 /* SDL_cocoawindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoawindow.m; sourceTree = ""; }; 04BDFEE812E6671800899322 /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = ""; }; 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; - 04BDFEEA12E6671800899322 /* SDL_nullrender.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullrender.c; sourceTree = ""; }; - 04BDFEEB12E6671800899322 /* SDL_nullrender_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullrender_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 = ""; }; 04BDFF0412E6671800899322 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; }; @@ -865,13 +847,6 @@ 04BDFF6512E6671800899322 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = ""; }; 04BDFF6612E6671800899322 /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = ""; }; 04BDFF6712E6671800899322 /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = ""; }; - 04BDFF6812E6671800899322 /* SDL_rect_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_c.h; sourceTree = ""; }; - 04BDFF6912E6671800899322 /* SDL_renderer_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gl.c; sourceTree = ""; }; - 04BDFF6A12E6671800899322 /* SDL_renderer_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_gl.h; sourceTree = ""; }; - 04BDFF6B12E6671800899322 /* SDL_renderer_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_gles.c; sourceTree = ""; }; - 04BDFF6C12E6671800899322 /* SDL_renderer_gles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_gles.h; sourceTree = ""; }; - 04BDFF6D12E6671800899322 /* SDL_renderer_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_renderer_sw.c; sourceTree = ""; }; - 04BDFF6E12E6671800899322 /* SDL_renderer_sw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_renderer_sw.h; sourceTree = ""; }; 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = ""; }; 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = ""; }; 04BDFF7112E6671800899322 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = ""; }; @@ -903,8 +878,6 @@ 04BDFFC912E6671800899322 /* SDL_x11opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengl.h; sourceTree = ""; }; 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11opengles.c; sourceTree = ""; }; 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengles.h; sourceTree = ""; }; - 04BDFFCC12E6671800899322 /* SDL_x11render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11render.c; sourceTree = ""; }; - 04BDFFCD12E6671800899322 /* SDL_x11render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11render.h; sourceTree = ""; }; 04BDFFCE12E6671800899322 /* SDL_x11shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11shape.c; sourceTree = ""; }; 04BDFFCF12E6671800899322 /* SDL_x11shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11shape.h; sourceTree = ""; }; 04BDFFD012E6671800899322 /* SDL_x11sym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11sym.h; sourceTree = ""; }; @@ -969,7 +942,6 @@ 0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; }; 0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; }; 453773811207C518002F0F45 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_shape.h; path = ../../include/SDL_shape.h; sourceTree = SOURCE_ROOT; }; - 8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "gestureSDLTest-Info.plist"; sourceTree = ""; }; 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; }; 8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = ../../include/SDL_touch.h; sourceTree = SOURCE_ROOT; }; B29A290D04E5B28700A80002 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_loadso.h; path = ../../include/SDL_loadso.h; sourceTree = ""; }; @@ -1180,9 +1152,9 @@ 00CFA67E106B44CE00758660 /* SDL_power.h */, 0C5AF5F701191D2B7F000001 /* SDL_quit.h */, 00CFA67F106B44CE00758660 /* SDL_rect.h */, + 041B2C9412FA0D2A0087D585 /* SDL_render.h */, 00A6EBD91078D569001EEA06 /* SDL_revision.h */, 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */, - 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */, 00CFA680106B44CE00758660 /* SDL_scancode.h */, 453773811207C518002F0F45 /* SDL_shape.h */, 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */, @@ -1211,6 +1183,34 @@ name = Products; sourceTree = ""; }; + 041B2C9712FA0D680087D585 /* render */ = { + isa = PBXGroup; + children = ( + 041B2C9A12FA0D680087D585 /* opengl */, + 041B2CA012FA0D680087D585 /* software */, + 041B2C9E12FA0D680087D585 /* SDL_render.c */, + 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */, + ); + name = render; + path = ../../src/render; + sourceTree = SOURCE_ROOT; + }; + 041B2C9A12FA0D680087D585 /* opengl */ = { + isa = PBXGroup; + children = ( + 041B2C9B12FA0D680087D585 /* SDL_renderer_gl.c */, + ); + path = opengl; + sourceTree = ""; + }; + 041B2CA012FA0D680087D585 /* software */ = { + isa = PBXGroup; + children = ( + 041B2CA112FA0D680087D585 /* SDL_renderer_sw.c */, + ); + path = software; + sourceTree = ""; + }; 04BDFD7312E6671700899322 /* atomic */ = { isa = PBXGroup; children = ( @@ -1292,7 +1292,6 @@ 04BDFDD712E6671700899322 /* default_cursor.h */, 04BDFDD812E6671700899322 /* scancodes_darwin.h */, 04BDFDD912E6671700899322 /* scancodes_linux.h */, - 04BDFDDA12E6671700899322 /* scancodes_win32.h */, 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */, 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */, 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */, @@ -1462,7 +1461,6 @@ isa = PBXGroup; children = ( 04BDFEA112E6671800899322 /* unix */, - 04BDFE9E12E6671800899322 /* SDL_systimer.h */, 04BDFE9F12E6671800899322 /* SDL_timer.c */, 04BDFEA012E6671800899322 /* SDL_timer_c.h */, ); @@ -1518,13 +1516,6 @@ 04BDFF6512E6671800899322 /* SDL_pixels.c */, 04BDFF6612E6671800899322 /* SDL_pixels_c.h */, 04BDFF6712E6671800899322 /* SDL_rect.c */, - 04BDFF6812E6671800899322 /* SDL_rect_c.h */, - 04BDFF6912E6671800899322 /* SDL_renderer_gl.c */, - 04BDFF6A12E6671800899322 /* SDL_renderer_gl.h */, - 04BDFF6B12E6671800899322 /* SDL_renderer_gles.c */, - 04BDFF6C12E6671800899322 /* SDL_renderer_gles.h */, - 04BDFF6D12E6671800899322 /* SDL_renderer_sw.c */, - 04BDFF6E12E6671800899322 /* SDL_renderer_sw.h */, 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */, 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */, 04BDFF7112E6671800899322 /* SDL_shape.c */, @@ -1571,8 +1562,6 @@ children = ( 04BDFEE812E6671800899322 /* SDL_nullevents.c */, 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */, - 04BDFEEA12E6671800899322 /* SDL_nullrender.c */, - 04BDFEEB12E6671800899322 /* SDL_nullrender_c.h */, 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */, 04BDFEED12E6671800899322 /* SDL_nullvideo.h */, ); @@ -1602,8 +1591,6 @@ 04BDFFC912E6671800899322 /* SDL_x11opengl.h */, 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */, 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */, - 04BDFFCC12E6671800899322 /* SDL_x11render.c */, - 04BDFFCD12E6671800899322 /* SDL_x11render.h */, 04BDFFCE12E6671800899322 /* SDL_x11shape.c */, 04BDFFCF12E6671800899322 /* SDL_x11shape.h */, 04BDFFD012E6671800899322 /* SDL_x11sym.h */, @@ -1715,7 +1702,6 @@ BECDF66B0761BA81005FE872 /* Info-Framework.plist */, BEC562FE0761C0E800A33029 /* Linked Frameworks */, 00D8D9F11195090700638393 /* testsdl-Info.plist */, - 8C93F0EA11F803710014F54D /* gestureSDLTest-Info.plist */, ); comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n"; name = SDLFramework; @@ -1740,6 +1726,7 @@ 04BDFDFF12E6671700899322 /* joystick */, 04BDFE2F12E6671700899322 /* loadso */, 04BDFE4512E6671700899322 /* power */, + 041B2C9712FA0D680087D585 /* render */, 04BDFE5D12E6671700899322 /* stdlib */, 04BDFE6412E6671800899322 /* thread */, 04BDFE9512E6671800899322 /* timer */, @@ -1872,7 +1859,6 @@ 04BD004312E6671800899322 /* default_cursor.h in Headers */, 04BD004412E6671800899322 /* scancodes_darwin.h in Headers */, 04BD004512E6671800899322 /* scancodes_linux.h in Headers */, - 04BD004612E6671800899322 /* scancodes_win32.h in Headers */, 04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */, 04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */, 04BD004B12E6671800899322 /* SDL_events_c.h in Headers */, @@ -1895,7 +1881,6 @@ 04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */, 04BD00C912E6671800899322 /* SDL_systhread.h in Headers */, 04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */, - 04BD00D612E6671800899322 /* SDL_systimer.h in Headers */, 04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */, 04BD00F312E6671800899322 /* SDL_cocoaclipboard.h in Headers */, 04BD00F512E6671800899322 /* SDL_cocoaevents.h in Headers */, @@ -1907,7 +1892,6 @@ 04BD010112E6671800899322 /* SDL_cocoavideo.h in Headers */, 04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */, 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */, - 04BD011A12E6671800899322 /* SDL_nullrender_c.h in Headers */, 04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */, 04BD013212E6671800899322 /* mmx.h in Headers */, 04BD017012E6671800899322 /* SDL_alphamult.h in Headers */, @@ -1920,10 +1904,6 @@ 04BD018A12E6671800899322 /* SDL_glfuncs.h in Headers */, 04BD018B12E6671800899322 /* SDL_leaks.h in Headers */, 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */, - 04BD018F12E6671800899322 /* SDL_rect_c.h in Headers */, - 04BD019112E6671800899322 /* SDL_renderer_gl.h in Headers */, - 04BD019312E6671800899322 /* SDL_renderer_gles.h in Headers */, - 04BD019512E6671800899322 /* SDL_renderer_sw.h in Headers */, 04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */, 04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */, 04BD019C12E6671800899322 /* SDL_sysvideo.h in Headers */, @@ -1938,7 +1918,6 @@ 04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */, 04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */, 04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */, - 04BD01F012E6671800899322 /* SDL_x11render.h in Headers */, 04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */, 04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */, 04BD01F512E6671800899322 /* SDL_x11touch.h in Headers */, @@ -1961,7 +1940,8 @@ 04BD020812E6671800899322 /* Xvproto.h in Headers */, 04BD021512E6671800899322 /* Xvlibint.h in Headers */, 0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */, - 0469A10C12EE4BF100B846D6 /* SDL_scalemode.h in Headers */, + 041B2C9512FA0D2A0087D585 /* SDL_render.h in Headers */, + 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2002,7 +1982,6 @@ 04BD025E12E6671800899322 /* default_cursor.h in Headers */, 04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */, 04BD026012E6671800899322 /* scancodes_linux.h in Headers */, - 04BD026112E6671800899322 /* scancodes_win32.h in Headers */, 04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */, 04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */, 04BD026612E6671800899322 /* SDL_events_c.h in Headers */, @@ -2025,7 +2004,6 @@ 04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */, 04BD02E312E6671800899322 /* SDL_systhread.h in Headers */, 04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */, - 04BD02F012E6671800899322 /* SDL_systimer.h in Headers */, 04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */, 04BD030D12E6671800899322 /* SDL_cocoaclipboard.h in Headers */, 04BD030F12E6671800899322 /* SDL_cocoaevents.h in Headers */, @@ -2037,7 +2015,6 @@ 04BD031B12E6671800899322 /* SDL_cocoavideo.h in Headers */, 04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */, 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */, - 04BD033412E6671800899322 /* SDL_nullrender_c.h in Headers */, 04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */, 04BD034C12E6671800899322 /* mmx.h in Headers */, 04BD038A12E6671800899322 /* SDL_alphamult.h in Headers */, @@ -2050,10 +2027,6 @@ 04BD03A412E6671800899322 /* SDL_glfuncs.h in Headers */, 04BD03A512E6671800899322 /* SDL_leaks.h in Headers */, 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */, - 04BD03A912E6671800899322 /* SDL_rect_c.h in Headers */, - 04BD03AB12E6671800899322 /* SDL_renderer_gl.h in Headers */, - 04BD03AD12E6671800899322 /* SDL_renderer_gles.h in Headers */, - 04BD03AF12E6671800899322 /* SDL_renderer_sw.h in Headers */, 04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */, 04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */, 04BD03B612E6671800899322 /* SDL_sysvideo.h in Headers */, @@ -2068,7 +2041,6 @@ 04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */, 04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */, 04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */, - 04BD040812E6671800899322 /* SDL_x11render.h in Headers */, 04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */, 04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */, 04BD040D12E6671800899322 /* SDL_x11touch.h in Headers */, @@ -2091,7 +2063,8 @@ 04BD042012E6671800899322 /* Xvproto.h in Headers */, 04BD042C12E6671800899322 /* Xvlibint.h in Headers */, 0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */, - 0469A10E12EE4BF100B846D6 /* SDL_scalemode.h in Headers */, + 041B2C9612FA0D2A0087D585 /* SDL_render.h in Headers */, + 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2411,7 +2384,6 @@ 04BD010212E6671800899322 /* SDL_cocoavideo.m in Sources */, 04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */, 04BD011712E6671800899322 /* SDL_nullevents.c in Sources */, - 04BD011912E6671800899322 /* SDL_nullrender.c in Sources */, 04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */, 04BD016F12E6671800899322 /* SDL_alphamult.c in Sources */, 04BD017112E6671800899322 /* SDL_blendfillrect.c in Sources */, @@ -2435,9 +2407,6 @@ 04BD018812E6671800899322 /* SDL_gamma.c in Sources */, 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */, 04BD018E12E6671800899322 /* SDL_rect.c in Sources */, - 04BD019012E6671800899322 /* SDL_renderer_gl.c in Sources */, - 04BD019212E6671800899322 /* SDL_renderer_gles.c in Sources */, - 04BD019412E6671800899322 /* SDL_renderer_sw.c in Sources */, 04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */, 04BD019812E6671800899322 /* SDL_shape.c in Sources */, 04BD019A12E6671800899322 /* SDL_stretch.c in Sources */, @@ -2455,7 +2424,6 @@ 04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */, 04BD01EB12E6671800899322 /* SDL_x11opengl.c in Sources */, 04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */, - 04BD01EF12E6671800899322 /* SDL_x11render.c in Sources */, 04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */, 04BD01F412E6671800899322 /* SDL_x11touch.c in Sources */, 04BD01F612E6671800899322 /* SDL_x11video.c in Sources */, @@ -2472,6 +2440,9 @@ 04BD021312E6671800899322 /* VisCmap.c in Sources */, 04BD021412E6671800899322 /* Xv.c in Sources */, 04BD021612E6671800899322 /* XF86VMode.c in Sources */, + 041B2CA312FA0D680087D585 /* SDL_renderer_gl.c in Sources */, + 041B2CA512FA0D680087D585 /* SDL_render.c in Sources */, + 041B2CA712FA0D680087D585 /* SDL_renderer_sw.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2540,7 +2511,6 @@ 04BD031C12E6671800899322 /* SDL_cocoavideo.m in Sources */, 04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */, 04BD033112E6671800899322 /* SDL_nullevents.c in Sources */, - 04BD033312E6671800899322 /* SDL_nullrender.c in Sources */, 04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */, 04BD038912E6671800899322 /* SDL_alphamult.c in Sources */, 04BD038B12E6671800899322 /* SDL_blendfillrect.c in Sources */, @@ -2564,9 +2534,6 @@ 04BD03A212E6671800899322 /* SDL_gamma.c in Sources */, 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */, 04BD03A812E6671800899322 /* SDL_rect.c in Sources */, - 04BD03AA12E6671800899322 /* SDL_renderer_gl.c in Sources */, - 04BD03AC12E6671800899322 /* SDL_renderer_gles.c in Sources */, - 04BD03AE12E6671800899322 /* SDL_renderer_sw.c in Sources */, 04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */, 04BD03B212E6671800899322 /* SDL_shape.c in Sources */, 04BD03B412E6671800899322 /* SDL_stretch.c in Sources */, @@ -2584,7 +2551,6 @@ 04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */, 04BD040312E6671800899322 /* SDL_x11opengl.c in Sources */, 04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */, - 04BD040712E6671800899322 /* SDL_x11render.c in Sources */, 04BD040912E6671800899322 /* SDL_x11shape.c in Sources */, 04BD040C12E6671800899322 /* SDL_x11touch.c in Sources */, 04BD040E12E6671800899322 /* SDL_x11video.c in Sources */, @@ -2601,6 +2567,9 @@ 04BD042A12E6671800899322 /* VisCmap.c in Sources */, 04BD042B12E6671800899322 /* Xv.c in Sources */, 04BD042D12E6671800899322 /* XF86VMode.c in Sources */, + 041B2CA912FA0D680087D585 /* SDL_renderer_gl.c in Sources */, + 041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */, + 041B2CAD12FA0D680087D585 /* SDL_renderer_sw.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/configure.in b/configure.in index fac0e4769..fb3e07dba 100644 --- a/configure.in +++ b/configure.in @@ -330,11 +330,13 @@ fi # Standard C sources SOURCES="$SOURCES $srcdir/src/*.c" -SOURCES="$SOURCES $srcdir/src/audio/*.c" SOURCES="$SOURCES $srcdir/src/atomic/*.c" +SOURCES="$SOURCES $srcdir/src/audio/*.c" SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c" SOURCES="$SOURCES $srcdir/src/events/*.c" SOURCES="$SOURCES $srcdir/src/file/*.c" +SOURCES="$SOURCES $srcdir/src/render/*.c" +SOURCES="$SOURCES $srcdir/src/render/*/*.c" SOURCES="$SOURCES $srcdir/src/stdlib/*.c" SOURCES="$SOURCES $srcdir/src/thread/*.c" SOURCES="$SOURCES $srcdir/src/timer/*.c" diff --git a/include/SDL_rect.h b/include/SDL_rect.h index 4229d34db..d4f3b626c 100644 --- a/include/SDL_rect.h +++ b/include/SDL_rect.h @@ -69,6 +69,25 @@ typedef struct SDL_Rect int w, h; } SDL_Rect; +/** + * \brief A structure used to track dirty rectangles + * + * \sa SDL_AddDirtyRect + * \sa SDL_ClearDirtyRects + * \sa SDL_FreeDirtyRects + */ +typedef struct SDL_DirtyRect +{ + SDL_Rect rect; + struct SDL_DirtyRect *next; +} SDL_DirtyRect; + +typedef struct SDL_DirtyRectList +{ + SDL_DirtyRect *list; + SDL_DirtyRect *free; +} SDL_DirtyRectList; + /** * \brief Returns true if the rectangle has no area. */ @@ -124,6 +143,22 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * int *Y1, int *X2, int *Y2); +/** + * \brief Add a rectangle to a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect); + +/** + * \brief Remove all rectangles associated with a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_ClearDirtyRects(SDL_DirtyRectList * list); + +/** + * \brief Free memory associated with a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_FreeDirtyRects(SDL_DirtyRectList * list); + + /* Ends C function definitions when using C++ */ #ifdef __cplusplus /* *INDENT-OFF* */ diff --git a/include/SDL_video.h b/include/SDL_video.h index cef1502f5..bff95f81f 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -355,6 +355,11 @@ extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode); +/** + * \brief Get the pixel format associated with the window. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + /** * \brief Set the gamma correction for each of the color channels on the * currently selected display. diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index e197ca59a..b179b3732 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -116,8 +116,6 @@ SDL_StopEventLoop(void) int SDL_StartEventLoop(void) { - int retcode; - /* Clean out the event queue */ SDL_EventQ.lock = NULL; SDL_StopEventLoop(); diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c new file mode 100644 index 000000000..0bcc6ee83 --- /dev/null +++ b/src/render/SDL_render.c @@ -0,0 +1,1113 @@ +/* + 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" + +/* The SDL 2D rendering system */ + +#include "SDL_render.h" +#include "SDL_sysrender.h" +#include "../video/SDL_pixels_c.h" + + +#define CHECK_RENDERER_MAGIC(renderer, retval) \ + if (!renderer || renderer->magic != &renderer_magic) { \ + SDL_SetError("Invalid renderer"); \ + return retval; \ + } + +#define CHECK_TEXTURE_MAGIC(texture, retval) \ + if (!texture || texture->magic != &texture_magic) { \ + SDL_SetError("Invalid texture"); \ + return retval; \ + } + + +static const SDL_RenderDriver *render_drivers[] = { +#if SDL_VIDEO_RENDER_D3D + &D3D_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_OGL + &GL_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_OGL_ES + &GL_ES_RenderDriver, +#endif + &SW_RenderDriver +}; +static char renderer_magic; +static char texture_magic; + +int +SDL_GetNumRenderDrivers(void) +{ + return SDL_arraysize(render_drivers); +} + +int +SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info) +{ + if (index < 0 || index >= SDL_GetNumRenderDrivers()) { + SDL_SetError("index must be in the range of 0 - %d", + SDL_GetNumRenderDrivers() - 1); + return -1; + } + *info = render_drivers[index]->info; + return 0; +} + +static int +SDL_RendererEventWatch(void *userdata, SDL_Event *event) +{ + SDL_Renderer *renderer = (SDL_Renderer *)userdata; + + if (event->type == SDL_WINDOWEVENT && renderer->WindowEvent) { + SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); + if (window == renderer->window) { + renderer->WindowEvent(renderer, &event->window); + } + } + return 0; +} + +SDL_Renderer * +SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) +{ + SDL_Renderer *renderer = NULL; + int n = SDL_GetNumRenderDrivers(); + + if (index < 0) { + char *override = SDL_getenv("SDL_VIDEO_RENDERER"); + + if (override) { + for (index = 0; index < n; ++index) { + const SDL_RenderDriver *driver = render_drivers[index]; + + if (SDL_strcasecmp(override, driver->info.name) == 0) { + /* Create a new renderer instance */ + renderer = driver->CreateRenderer(window, flags); + break; + } + } + } else { + for (index = 0; index < n; ++index) { + const SDL_RenderDriver *driver = render_drivers[index]; + + if ((driver->info.flags & flags) == flags) { + /* Create a new renderer instance */ + renderer = driver->CreateRenderer(window, flags); + if (renderer) { + /* Yay, we got one! */ + break; + } + } + } + } + if (index == n) { + SDL_SetError("Couldn't find matching render driver"); + return NULL; + } + } else { + if (index >= SDL_GetNumRenderDrivers()) { + SDL_SetError("index must be -1 or in the range of 0 - %d", + SDL_GetNumRenderDrivers() - 1); + return NULL; + } + /* Create a new renderer instance */ + renderer = render_drivers[index]->CreateRenderer(window, flags); + } + + if (renderer) { + renderer->magic = &renderer_magic; + + SDL_AddEventWatch(SDL_RendererEventWatch, renderer); + } + return renderer; +} + +int +SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + *info = renderer->info; + return 0; +} + +SDL_Texture * +SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h) +{ + SDL_Texture *texture; + + CHECK_RENDERER_MAGIC(renderer, NULL); + + if (w <= 0 || h <= 0) { + SDL_SetError("Texture dimensions can't be 0"); + return 0; + } + texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); + if (!texture) { + SDL_OutOfMemory(); + return 0; + } + texture->magic = &texture_magic; + texture->format = format; + texture->access = access; + texture->w = w; + texture->h = h; + texture->r = 255; + texture->g = 255; + texture->b = 255; + texture->a = 255; + texture->renderer = renderer; + texture->next = renderer->textures; + if (renderer->textures) { + renderer->textures->prev = texture; + } + renderer->textures = texture; + + if (renderer->CreateTexture(renderer, texture) < 0) { + SDL_DestroyTexture(texture); + return 0; + } + return texture; +} + +SDL_Texture * +SDL_CreateTextureFromSurface(SDL_Renderer * renderer, Uint32 format, SDL_Surface * surface) +{ + SDL_Texture *texture; + Uint32 requested_format = format; + SDL_PixelFormat *fmt; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + CHECK_RENDERER_MAGIC(renderer, NULL); + + if (!surface) { + SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface"); + return NULL; + } + fmt = surface->format; + + if (format) { + if (!SDL_PixelFormatEnumToMasks + (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + SDL_SetError("Unknown pixel format"); + return 0; + } + } else { + SDL_bool hasColorkey; + SDL_BlendMode blendMode; + SDL_bool hasBlending; + + hasColorkey = (SDL_GetColorKey(surface, NULL) == 0); + + SDL_GetSurfaceBlendMode(surface, &blendMode); + hasBlending = (blendMode == SDL_BLENDMODE_BLEND); + + if (surface->format->Amask || (!hasColorkey && !hasBlending)) { + Uint32 it; + int pfmt; + + /* Pixel formats, sorted by best first */ + static const Uint32 sdl_pformats[] = { + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_BGR888, + SDL_PIXELFORMAT_RGB24, + SDL_PIXELFORMAT_BGR24, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_BGR565, + SDL_PIXELFORMAT_ARGB1555, + SDL_PIXELFORMAT_RGBA5551, + SDL_PIXELFORMAT_ABGR1555, + SDL_PIXELFORMAT_BGRA5551, + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_BGR555, + SDL_PIXELFORMAT_ARGB4444, + SDL_PIXELFORMAT_RGBA4444, + SDL_PIXELFORMAT_ABGR4444, + SDL_PIXELFORMAT_BGRA4444, + SDL_PIXELFORMAT_RGB444, + SDL_PIXELFORMAT_ARGB2101010, + SDL_PIXELFORMAT_RGB332, + SDL_PIXELFORMAT_UNKNOWN + }; + + bpp = fmt->BitsPerPixel; + Rmask = fmt->Rmask; + Gmask = fmt->Gmask; + Bmask = fmt->Bmask; + Amask = fmt->Amask; + + format = + SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); + if (!format) { + SDL_SetError("Unknown pixel format"); + return 0; + } + + /* Search requested format in the supported texture */ + /* formats by current renderer */ + for (it = 0; it < renderer->info.num_texture_formats; it++) { + if (renderer->info.texture_formats[it] == format) { + break; + } + } + + /* If requested format can't be found, search any best */ + /* format which renderer provides */ + if (it == renderer->info.num_texture_formats) { + pfmt = 0; + for (;;) { + if (sdl_pformats[pfmt] == SDL_PIXELFORMAT_UNKNOWN) { + break; + } + + for (it = 0; it < renderer->info.num_texture_formats; + it++) { + if (renderer->info.texture_formats[it] == + sdl_pformats[pfmt]) { + break; + } + } + + if (it != renderer->info.num_texture_formats) { + /* The best format has been found */ + break; + } + pfmt++; + } + + /* If any format can't be found, then return an error */ + if (it == renderer->info.num_texture_formats) { + SDL_SetError + ("Any of the supported pixel formats can't be found"); + return 0; + } + + /* Convert found pixel format back to color masks */ + if (SDL_PixelFormatEnumToMasks + (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask, + &Bmask, &Amask) != SDL_TRUE) { + SDL_SetError("Unknown pixel format"); + return 0; + } + } + } else { + /* Need a format with alpha */ + Uint32 it; + int apfmt; + + /* Pixel formats with alpha, sorted by best first */ + static const Uint32 sdl_alpha_pformats[] = { + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_ARGB1555, + SDL_PIXELFORMAT_RGBA5551, + SDL_PIXELFORMAT_ABGR1555, + SDL_PIXELFORMAT_BGRA5551, + SDL_PIXELFORMAT_ARGB4444, + SDL_PIXELFORMAT_RGBA4444, + SDL_PIXELFORMAT_ABGR4444, + SDL_PIXELFORMAT_BGRA4444, + SDL_PIXELFORMAT_ARGB2101010, + SDL_PIXELFORMAT_UNKNOWN + }; + + if (surface->format->Amask) { + /* If surface already has alpha, then try an original */ + /* surface format first */ + bpp = fmt->BitsPerPixel; + Rmask = fmt->Rmask; + Gmask = fmt->Gmask; + Bmask = fmt->Bmask; + Amask = fmt->Amask; + } else { + bpp = 32; + Rmask = 0x00FF0000; + Gmask = 0x0000FF00; + Bmask = 0x000000FF; + Amask = 0xFF000000; + } + + format = + SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); + if (!format) { + SDL_SetError("Unknown pixel format"); + return 0; + } + + /* Search this format in the supported texture formats */ + /* by current renderer */ + for (it = 0; it < renderer->info.num_texture_formats; it++) { + if (renderer->info.texture_formats[it] == format) { + break; + } + } + + /* If this format can't be found, search any best */ + /* compatible format with alpha which renderer provides */ + if (it == renderer->info.num_texture_formats) { + apfmt = 0; + for (;;) { + if (sdl_alpha_pformats[apfmt] == SDL_PIXELFORMAT_UNKNOWN) { + break; + } + + for (it = 0; it < renderer->info.num_texture_formats; + it++) { + if (renderer->info.texture_formats[it] == + sdl_alpha_pformats[apfmt]) { + break; + } + } + + if (it != renderer->info.num_texture_formats) { + /* Compatible format has been found */ + break; + } + apfmt++; + } + + /* If compatible format can't be found, then return an error */ + if (it == renderer->info.num_texture_formats) { + SDL_SetError("Compatible pixel format can't be found"); + return 0; + } + + /* Convert found pixel format back to color masks */ + if (SDL_PixelFormatEnumToMasks + (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask, + &Bmask, &Amask) != SDL_TRUE) { + SDL_SetError("Unknown pixel format"); + return 0; + } + } + } + + format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); + if (!format) { + SDL_SetError("Unknown pixel format"); + return 0; + } + } + + texture = + SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, + surface->w, surface->h); + if (!texture && !requested_format) { + SDL_DisplayMode desktop_mode; + SDL_GetDesktopDisplayMode(&desktop_mode); + format = desktop_mode.format; + texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, + surface->w, surface->h); + } + if (!texture) { + return 0; + } + if (bpp == fmt->BitsPerPixel && Rmask == fmt->Rmask && Gmask == fmt->Gmask + && Bmask == fmt->Bmask && Amask == fmt->Amask) { + if (SDL_MUSTLOCK(surface)) { + SDL_LockSurface(surface); + SDL_UpdateTexture(texture, NULL, surface->pixels, + surface->pitch); + SDL_UnlockSurface(surface); + } else { + SDL_UpdateTexture(texture, NULL, surface->pixels, + surface->pitch); + } + } else { + SDL_PixelFormat dst_fmt; + SDL_Surface *dst = NULL; + + /* Set up a destination surface for the texture update */ + SDL_InitFormat(&dst_fmt, bpp, Rmask, Gmask, Bmask, Amask); + dst = SDL_ConvertSurface(surface, &dst_fmt, 0); + if (dst) { + SDL_UpdateTexture(texture, NULL, dst->pixels, dst->pitch); + SDL_FreeSurface(dst); + } + if (!dst) { + SDL_DestroyTexture(texture); + return 0; + } + } + + { + Uint8 r, g, b, a; + SDL_BlendMode blendMode; + + SDL_GetSurfaceColorMod(surface, &r, &g, &b); + SDL_SetTextureColorMod(texture, r, g, b); + + SDL_GetSurfaceAlphaMod(surface, &a); + SDL_SetTextureAlphaMod(texture, a); + + if (SDL_GetColorKey(surface, NULL) == 0) { + /* We converted to a texture with alpha format */ + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + } else { + SDL_GetSurfaceBlendMode(surface, &blendMode); + SDL_SetTextureBlendMode(texture, blendMode); + } + } + return texture; +} + +int +SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, + int *w, int *h) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (format) { + *format = texture->format; + } + if (access) { + *access = texture->access; + } + if (w) { + *w = texture->w; + } + if (h) { + *h = texture->h; + } + return 0; +} + +int +SDL_QueryTexturePixels(SDL_Texture * texture, void **pixels, int *pitch) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (!renderer->QueryTexturePixels) { + SDL_Unsupported(); + return -1; + } + return renderer->QueryTexturePixels(renderer, texture, pixels, pitch); +} + +int +SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (r < 255 || g < 255 || b < 255) { + texture->modMode |= SDL_TEXTUREMODULATE_COLOR; + } else { + texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR; + } + texture->r = r; + texture->g = g; + texture->b = b; + if (renderer->SetTextureColorMod) { + return renderer->SetTextureColorMod(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, + Uint8 * b) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (r) { + *r = texture->r; + } + if (g) { + *g = texture->g; + } + if (b) { + *b = texture->b; + } + return 0; +} + +int +SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (alpha < 255) { + texture->modMode |= SDL_TEXTUREMODULATE_ALPHA; + } else { + texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA; + } + texture->a = alpha; + if (renderer->SetTextureAlphaMod) { + return renderer->SetTextureAlphaMod(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (alpha) { + *alpha = texture->a; + } + return 0; +} + +int +SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + texture->blendMode = blendMode; + if (renderer->SetTextureBlendMode) { + return renderer->SetTextureBlendMode(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (blendMode) { + *blendMode = texture->blendMode; + } + return 0; +} + +int +SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, + const void *pixels, int pitch) +{ + SDL_Renderer *renderer; + SDL_Rect full_rect; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (!renderer->UpdateTexture) { + SDL_Unsupported(); + return -1; + } + if (!rect) { + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = texture->w; + full_rect.h = texture->h; + rect = &full_rect; + } + return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch); +} + +int +SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, int markDirty, + void **pixels, int *pitch) +{ + SDL_Renderer *renderer; + SDL_Rect full_rect; + + CHECK_TEXTURE_MAGIC(texture, -1); + + if (texture->access != SDL_TEXTUREACCESS_STREAMING) { + SDL_SetError("SDL_LockTexture(): texture must be streaming"); + return -1; + } + renderer = texture->renderer; + if (!renderer->LockTexture) { + SDL_Unsupported(); + return -1; + } + if (!rect) { + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = texture->w; + full_rect.h = texture->h; + rect = &full_rect; + } + return renderer->LockTexture(renderer, texture, rect, markDirty, pixels, + pitch); +} + +void +SDL_UnlockTexture(SDL_Texture * texture) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, ); + + if (texture->access != SDL_TEXTUREACCESS_STREAMING) { + return; + } + renderer = texture->renderer; + if (!renderer->UnlockTexture) { + return; + } + renderer->UnlockTexture(renderer, texture); +} + +void +SDL_DirtyTexture(SDL_Texture * texture, int numrects, + const SDL_Rect * rects) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, ); + + if (texture->access != SDL_TEXTUREACCESS_STREAMING) { + return; + } + renderer = texture->renderer; + if (!renderer->DirtyTexture) { + return; + } + renderer->DirtyTexture(renderer, texture, numrects, rects); +} + +int +SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->r = r; + renderer->g = g; + renderer->b = b; + renderer->a = a; + return 0; +} + +int +SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (r) { + *r = renderer->r; + } + if (g) { + *g = renderer->g; + } + if (b) { + *b = renderer->b; + } + if (a) { + *a = renderer->a; + } + return 0; +} + +int +SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->blendMode = blendMode; + return 0; +} + +int +SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + *blendMode = renderer->blendMode; + return 0; +} + +int +SDL_RenderClear(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!renderer->RenderClear) { + SDL_BlendMode blendMode = renderer->blendMode; + int status; + + if (blendMode >= SDL_BLENDMODE_BLEND) { + SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + } + + status = SDL_RenderFillRect(renderer, NULL); + + if (blendMode >= SDL_BLENDMODE_BLEND) { + SDL_SetRenderDrawBlendMode(renderer, blendMode); + } + return status; + } + return renderer->RenderClear(renderer); +} + +int +SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y) +{ + SDL_Point point; + + point.x = x; + point.y = y; + return SDL_RenderDrawPoints(renderer, &point, 1); +} + +int +SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!points) { + SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points"); + return -1; + } + if (count < 1) { + return 0; + } + return renderer->RenderDrawPoints(renderer, points, count); +} + +int +SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) +{ + SDL_Point points[2]; + + points[0].x = x1; + points[0].y = y1; + points[1].x = x2; + points[1].y = y2; + return SDL_RenderDrawLines(renderer, points, 2); +} + +int +SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!points) { + SDL_SetError("SDL_RenderDrawLines(): Passed NULL points"); + return -1; + } + if (count < 2) { + return 0; + } + return renderer->RenderDrawLines(renderer, points, count); +} + +int +SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + SDL_Rect full_rect; + SDL_Point points[5]; + + CHECK_RENDERER_MAGIC(renderer, -1); + + /* If 'rect' == NULL, then outline the whole surface */ + if (!rect) { + SDL_Window *window = renderer->window; + + full_rect.x = 0; + full_rect.y = 0; + SDL_GetWindowSize(window, &full_rect.w, &full_rect.h); + rect = &full_rect; + } + + points[0].x = rect->x; + points[0].y = rect->y; + points[1].x = rect->x+rect->w-1; + points[1].y = rect->y; + points[2].x = rect->x+rect->w-1; + points[2].y = rect->y+rect->h-1; + points[3].x = rect->x; + points[3].y = rect->y+rect->h-1; + points[4].x = rect->x; + points[4].y = rect->y; + return SDL_RenderDrawLines(renderer, points, 5); +} + +int +SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect ** rects, int count) +{ + int i; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!rects) { + SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects"); + return -1; + } + if (count < 1) { + return 0; + } + + /* Check for NULL rect, which means fill entire window */ + for (i = 0; i < count; ++i) { + if (SDL_RenderDrawRect(renderer, rects[i]) < 0) { + return -1; + } + } + return 0; +} + +int +SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + return SDL_RenderFillRects(renderer, &rect, 1); +} + +int +SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect ** rects, int count) +{ + int i; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!rects) { + SDL_SetError("SDL_RenderFillRects(): Passed NULL rects"); + return -1; + } + if (count < 1) { + return 0; + } + + /* Check for NULL rect, which means fill entire window */ + for (i = 0; i < count; ++i) { + if (rects[i] == NULL) { + SDL_Window *window = renderer->window; + SDL_Rect full_rect; + const SDL_Rect *rect; + + full_rect.x = 0; + full_rect.y = 0; + SDL_GetWindowSize(window, &full_rect.w, &full_rect.h); + rect = &full_rect; + return renderer->RenderFillRects(renderer, &rect, 1); + } + } + return renderer->RenderFillRects(renderer, rects, count); +} + +int +SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_Rect * dstrect) +{ + SDL_Window *window; + SDL_Rect real_srcrect; + SDL_Rect real_dstrect; + + CHECK_RENDERER_MAGIC(renderer, -1); + CHECK_TEXTURE_MAGIC(texture, -1); + + if (renderer != texture->renderer) { + SDL_SetError("Texture was not created with this renderer"); + return -1; + } + window = renderer->window; + + real_srcrect.x = 0; + real_srcrect.y = 0; + real_srcrect.w = texture->w; + real_srcrect.h = texture->h; + if (srcrect) { + if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) { + return 0; + } + } + + real_dstrect.x = 0; + real_dstrect.y = 0; + SDL_GetWindowSize(window, &real_dstrect.w, &real_dstrect.h); + if (dstrect) { + if (!SDL_IntersectRect(dstrect, &real_dstrect, &real_dstrect)) { + return 0; + } + /* Clip srcrect by the same amount as dstrect was clipped */ + if (dstrect->w != real_dstrect.w) { + int deltax = (real_dstrect.x - dstrect->x); + int deltaw = (real_dstrect.w - dstrect->w); + real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w; + real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w; + } + if (dstrect->h != real_dstrect.h) { + int deltay = (real_dstrect.y - dstrect->y); + int deltah = (real_dstrect.h - dstrect->h); + real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h; + real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h; + } + } + + return renderer->RenderCopy(renderer, texture, &real_srcrect, + &real_dstrect); +} + +int +SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch) +{ + SDL_Window *window; + SDL_Rect real_rect; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!renderer->RenderReadPixels) { + SDL_Unsupported(); + return -1; + } + window = renderer->window; + + if (!format) { + format = SDL_GetWindowPixelFormat(window); + } + + real_rect.x = 0; + real_rect.y = 0; + SDL_GetWindowSize(window, &real_rect.w, &real_rect.h); + if (rect) { + if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) { + return 0; + } + if (real_rect.y > rect->y) { + pixels = (Uint8 *)pixels + pitch * (real_rect.y - rect->y); + } + if (real_rect.x > rect->x) { + int bpp = SDL_BYTESPERPIXEL(SDL_GetWindowPixelFormat(window)); + pixels = (Uint8 *)pixels + bpp * (real_rect.x - rect->x); + } + } + + return renderer->RenderReadPixels(renderer, &real_rect, + format, pixels, pitch); +} + +int +SDL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, const void * pixels, int pitch) +{ + SDL_Window *window; + SDL_Rect real_rect; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!renderer->RenderWritePixels) { + SDL_Unsupported(); + return -1; + } + window = renderer->window; + + if (!format) { + format = SDL_GetWindowPixelFormat(window); + } + + real_rect.x = 0; + real_rect.y = 0; + SDL_GetWindowSize(window, &real_rect.w, &real_rect.h); + if (rect) { + if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) { + return 0; + } + if (real_rect.y > rect->y) { + pixels = (const Uint8 *)pixels + pitch * (real_rect.y - rect->y); + } + if (real_rect.x > rect->x) { + int bpp = SDL_BYTESPERPIXEL(SDL_GetWindowPixelFormat(window)); + pixels = (const Uint8 *)pixels + bpp * (real_rect.x - rect->x); + } + } + + return renderer->RenderWritePixels(renderer, &real_rect, + format, pixels, pitch); +} + +void +SDL_RenderPresent(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + renderer->RenderPresent(renderer); +} + +void +SDL_DestroyTexture(SDL_Texture * texture) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, ); + texture->magic = NULL; + + renderer = texture->renderer; + if (texture->next) { + texture->next->prev = texture->prev; + } + if (texture->prev) { + texture->prev->next = texture->next; + } else { + renderer->textures = texture->next; + } + + renderer->DestroyTexture(renderer, texture); + SDL_free(texture); +} + +void +SDL_DestroyRenderer(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + SDL_DelEventWatch(SDL_RendererEventWatch, renderer); + + /* Free existing textures for this renderer */ + while (renderer->textures) { + SDL_DestroyTexture(renderer->textures); + } + + /* It's no longer magical... */ + renderer->magic = NULL; + + /* Free the renderer instance */ + renderer->DestroyRenderer(renderer); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h new file mode 100644 index 000000000..54e1735cd --- /dev/null +++ b/src/render/SDL_sysrender.h @@ -0,0 +1,133 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_sysrender_h +#define _SDL_sysrender_h + +#include "SDL_render.h" +#include "SDL_events.h" + +/* The SDL 2D rendering system */ + +typedef struct SDL_RenderDriver SDL_RenderDriver; + +/* Define the SDL texture structure */ +struct SDL_Texture +{ + const void *magic; + Uint32 format; /**< The pixel format of the texture */ + int access; /**< SDL_TextureAccess */ + int w; /**< The width of the texture */ + int h; /**< The height of the texture */ + int modMode; /**< The texture modulation mode */ + SDL_BlendMode blendMode; /**< The texture blend mode */ + Uint8 r, g, b, a; /**< Texture modulation values */ + + SDL_Renderer *renderer; + + void *driverdata; /**< Driver specific texture representation */ + + SDL_Texture *prev; + SDL_Texture *next; +}; + +/* Define the SDL renderer structure */ +struct SDL_Renderer +{ + const void *magic; + + void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event); + int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture, + void **pixels, int *pitch); + int (*SetTextureColorMod) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*SetTextureAlphaMod) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*SetTextureBlendMode) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); + int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, int markDirty, void **pixels, + int *pitch); + void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture, + int numrects, const SDL_Rect * rects); + int (*RenderClear) (SDL_Renderer * renderer); + int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points, + int count); + int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points, + int count); + int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects, + int count); + int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_Rect * dstrect); + int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch); + int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, const void * pixels, int pitch); + void (*RenderPresent) (SDL_Renderer * renderer); + void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + + void (*DestroyRenderer) (SDL_Renderer * renderer); + + /* The current renderer info */ + SDL_RendererInfo info; + + /* The window associated with the renderer */ + SDL_Window *window; + + /* The list of textures */ + SDL_Texture *textures; + + Uint8 r, g, b, a; /**< Color for drawing operations values */ + SDL_BlendMode blendMode; /**< The drawing blend mode */ + + void *driverdata; +}; + +/* Define the SDL render driver structure */ +struct SDL_RenderDriver +{ + SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags); + + /* Info about the renderer capabilities */ + SDL_RendererInfo info; +}; + +#if SDL_VIDEO_RENDER_D3D +extern SDL_RenderDriver D3D_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_OGL +extern SDL_RenderDriver GL_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_OGL_ES +extern SDL_RenderDriver GL_ES_RenderDriver; +#endif +extern SDL_RenderDriver SW_RenderDriver; + +#endif /* _SDL_sysrender_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_d3drender.c b/src/render/direct3d/SDL_d3drender.c similarity index 90% rename from src/video/windows/SDL_d3drender.c rename to src/render/direct3d/SDL_d3drender.c index 2e50bc3b6..6cc2b40e6 100644 --- a/src/video/windows/SDL_d3drender.c +++ b/src/render/direct3d/SDL_d3drender.c @@ -23,8 +23,17 @@ #if SDL_VIDEO_RENDER_D3D -#include "SDL_windowsvideo.h" -#include "../SDL_yuv_sw_c.h" +#include "../../core/windows/SDL_windows.h" + +#include "SDL_loadso.h" +#include "SDL_syswm.h" +#include "../SDL_sysrender.h" +#include "../../video/SDL_yuv_sw_c.h" + +#if SDL_VIDEO_RENDER_D3D +#define D3D_DEBUG_INFO +#include +#endif #ifdef ASSEMBLE_SHADER /////////////////////////////////////////////////////////////////////////// @@ -89,7 +98,6 @@ HRESULT WINAPI #endif static SDL_Renderer *D3D_CreateRenderer(SDL_Window * window, Uint32 flags); -static int D3D_DisplayModeChanged(SDL_Renderer * renderer); static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); static int D3D_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, @@ -134,6 +142,7 @@ SDL_RenderDriver D3D_RenderDriver = { typedef struct { + void* d3dDLL; IDirect3D9 *d3d; IDirect3DDevice9 *device; UINT adapter; @@ -272,47 +281,19 @@ PixelFormatToD3DFMT(Uint32 format) } } -static UINT D3D_FindAdapter(IDirect3D9 * d3d, SDL_VideoDisplay * display) -{ - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; - UINT adapter, count; - - count = IDirect3D9_GetAdapterCount(d3d); - for (adapter = 0; adapter < count; ++adapter) { - HRESULT result; - D3DADAPTER_IDENTIFIER9 info; - char *name; - - result = IDirect3D9_GetAdapterIdentifier(d3d, adapter, 0, &info); - if (FAILED(result)) { - continue; - } - name = WIN_StringToUTF8(displaydata->DeviceName); - if (SDL_strcmp(name, info.DeviceName) == 0) { - SDL_free(name); - return adapter; - } - SDL_free(name); - } - - /* This should never happen, but just in case... */ - return D3DADAPTER_DEFAULT; -} - static SDL_bool D3D_IsTextureFormatAvailable(IDirect3D9 * d3d, UINT adapter, - Uint32 display_format, - Uint32 texture_format) + D3DFORMAT display_format, + D3DFORMAT texture_format) { HRESULT result; result = IDirect3D9_CheckDeviceFormat(d3d, adapter, D3DDEVTYPE_HAL, - PixelFormatToD3DFMT(display_format), + display_format, 0, D3DRTYPE_TEXTURE, - PixelFormatToD3DFMT - (texture_format)); + texture_format); return FAILED(result) ? SDL_FALSE : SDL_TRUE; } @@ -346,64 +327,42 @@ UpdateYUVTextureData(SDL_Texture * texture) IDirect3DTexture9_UnlockRect(data->texture, 0); } -void -D3D_AddRenderDriver(_THIS) +static void +D3D_AddTextureFormats(D3D_RenderData *data, SDL_RendererInfo *info) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; - SDL_RendererInfo *info = &D3D_RenderDriver.info; - - if (data->d3d) { - int i, j; - int formats[] = { - SDL_PIXELFORMAT_RGB332, - SDL_PIXELFORMAT_RGB444, - SDL_PIXELFORMAT_RGB555, - SDL_PIXELFORMAT_ARGB4444, - SDL_PIXELFORMAT_ARGB1555, - SDL_PIXELFORMAT_RGB565, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ARGB2101010, - }; - - for (i = 0; i < _this->num_displays; ++i) { - SDL_VideoDisplay *display = &_this->displays[i]; - SDL_DisplayMode *mode = &display->desktop_mode; - UINT adapter = D3D_FindAdapter(data->d3d, display); - - /* Get the matching D3D adapter for this display */ - info->num_texture_formats = 0; - for (j = 0; j < SDL_arraysize(formats); ++j) { - if (D3D_IsTextureFormatAvailable - (data->d3d, adapter, mode->format, formats[j])) { - info->texture_formats[info->num_texture_formats++] = - formats[j]; - } - } - info->texture_formats[info->num_texture_formats++] = - SDL_PIXELFORMAT_YV12; - info->texture_formats[info->num_texture_formats++] = - SDL_PIXELFORMAT_IYUV; - info->texture_formats[info->num_texture_formats++] = - SDL_PIXELFORMAT_YUY2; - info->texture_formats[info->num_texture_formats++] = - SDL_PIXELFORMAT_UYVY; - info->texture_formats[info->num_texture_formats++] = - SDL_PIXELFORMAT_YVYU; - - SDL_AddRenderDriver(display, &D3D_RenderDriver); + int i; + int formats[] = { + SDL_PIXELFORMAT_RGB332, + SDL_PIXELFORMAT_RGB444, + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_ARGB4444, + SDL_PIXELFORMAT_ARGB1555, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ARGB2101010, + }; + + info->num_texture_formats = 0; + for (i = 0; i < SDL_arraysize(formats); ++i) { + if (D3D_IsTextureFormatAvailable + (data->d3d, data->adapter, data->pparams.BackBufferFormat, PixelFormatToD3DFMT(formats[i]))) { + info->texture_formats[info->num_texture_formats++] = formats[i]; } } + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YV12; + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_IYUV; + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YUY2; + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_UYVY; + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YVYU; } SDL_Renderer * D3D_CreateRenderer(SDL_Window * window, Uint32 flags) { - SDL_VideoDisplay *display = window->display; - SDL_VideoData *videodata = (SDL_VideoData *) display->device->driverdata; - SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata; SDL_Renderer *renderer; D3D_RenderData *data; + SDL_SysWMinfo windowinfo; HRESULT result; D3DPRESENT_PARAMETERS pparams; IDirect3DSwapChain9 *chain; @@ -417,15 +376,33 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data)); if (!data) { - D3D_DestroyRenderer(renderer); + SDL_free(renderer); SDL_OutOfMemory(); return NULL; } - data->d3d = videodata->d3d; - videodata->render = RENDER_D3D; + data->d3dDLL = SDL_LoadObject("D3D9.DLL"); + if (data->d3dDLL) { + IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion); + + D3DCreate = + (IDirect3D9 * (WINAPI *) (UINT)) SDL_LoadFunction(data->d3dDLL, + "Direct3DCreate9"); + if (D3DCreate) { + data->d3d = D3DCreate(D3D_SDK_VERSION); + } + if (!data->d3d) { + SDL_UnloadObject(data->d3dDLL); + data->d3dDLL = NULL; + } + } + if (!data->d3d) { + SDL_free(renderer); + SDL_free(data); + SDL_SetError("Unable to create Direct3D interface"); + return NULL; + } - renderer->DisplayModeChanged = D3D_DisplayModeChanged; renderer->CreateTexture = D3D_CreateTexture; renderer->QueryTexturePixels = D3D_QueryTexturePixels; renderer->UpdateTexture = D3D_UpdateTexture; @@ -447,7 +424,11 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = SDL_RENDERER_ACCELERATED; + SDL_VERSION(&windowinfo.version); + SDL_GetWindowWMInfo(window, &windowinfo); + SDL_zero(pparams); + pparams.hDeviceWindow = windowinfo.info.win.window; pparams.BackBufferWidth = window->w; pparams.BackBufferHeight = window->h; if (window->flags & SDL_WINDOW_FULLSCREEN) { @@ -473,13 +454,13 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; } - data->adapter = D3D_FindAdapter(videodata->d3d, display); - IDirect3D9_GetDeviceCaps(videodata->d3d, data->adapter, - D3DDEVTYPE_HAL, &caps); + /* FIXME: Which adapter? */ + data->adapter = D3DADAPTER_DEFAULT; + IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps); - result = IDirect3D9_CreateDevice(videodata->d3d, data->adapter, + result = IDirect3D9_CreateDevice(data->d3d, data->adapter, D3DDEVTYPE_HAL, - windowdata->hwnd, + pparams.hDeviceWindow, (caps. DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) ? @@ -513,6 +494,8 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) } data->pparams = pparams; + D3D_AddTextureFormats(data, &renderer->info); + IDirect3DDevice9_GetDeviceCaps(data->device, &caps); renderer->info.max_texture_width = caps.MaxTextureWidth; renderer->info.max_texture_height = caps.MaxTextureHeight; @@ -573,6 +556,8 @@ D3D_Reset(SDL_Renderer * renderer) return 0; } +/* FIXME: This needs to be called... when? */ +#if 0 static int D3D_DisplayModeChanged(SDL_Renderer * renderer) { @@ -590,14 +575,14 @@ D3D_DisplayModeChanged(SDL_Renderer * renderer) } return D3D_Reset(renderer); } +#endif static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; - SDL_VideoDisplay *display = window->display; - Uint32 display_format = display->current_mode.format; + D3DFORMAT display_format = renderdata->pparams.BackBufferFormat; D3D_TextureData *data; HRESULT result; @@ -612,16 +597,16 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (SDL_ISPIXELFORMAT_FOURCC(texture->format) && (texture->format != SDL_PIXELFORMAT_YUY2 || !D3D_IsTextureFormatAvailable(renderdata->d3d, renderdata->adapter, - display_format, texture->format)) + display_format, PixelFormatToD3DFMT(texture->format))) && (texture->format != SDL_PIXELFORMAT_YVYU || !D3D_IsTextureFormatAvailable(renderdata->d3d, renderdata->adapter, - display_format, texture->format))) { + display_format, PixelFormatToD3DFMT(texture->format)))) { data->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h); if (!data->yuv) { return -1; } - data->format = display->current_mode.format; + data->format = SDL_GetWindowPixelFormat(window); } else { data->format = texture->format; } @@ -1261,6 +1246,10 @@ D3D_DestroyRenderer(SDL_Renderer * renderer) if (data->device) { IDirect3DDevice9_Release(data->device); } + if (data->d3d) { + IDirect3D9_Release(data->d3d); + SDL_UnloadObject(data->d3dDLL); + } SDL_free(data); } SDL_free(renderer); diff --git a/src/video/SDL_renderer_gl.c b/src/render/opengl/SDL_renderer_gl.c similarity index 97% rename from src/video/SDL_renderer_gl.c rename to src/render/opengl/SDL_renderer_gl.c index e91b14c12..a8998e19f 100644 --- a/src/video/SDL_renderer_gl.c +++ b/src/render/opengl/SDL_renderer_gl.c @@ -23,12 +23,8 @@ #if SDL_VIDEO_RENDER_OGL -#include "SDL_video.h" #include "SDL_opengl.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_rect_c.h" -#include "SDL_yuv_sw_c.h" +#include "../SDL_sysrender.h" #ifdef __MACOSX__ #include @@ -62,6 +58,8 @@ bytes_per_pixel(const Uint32 format) } } +/* Used to re-create the window with OpenGL capability */ +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); static const float inv255f = 1.0f / 255.0f; @@ -136,7 +134,7 @@ typedef struct /* OpenGL functions */ #define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; -#include "SDL_glfuncs.h" +#include "../../video/SDL_glfuncs.h" #undef SDL_PROC void (*glTextureRangeAPPLE) (GLenum target, GLsizei length, @@ -224,7 +222,7 @@ GL_LoadFunctions(GL_RenderData * data) } while ( 0 ); #endif /* __SDL_NOGETPROCADDR__ */ -#include "SDL_glfuncs.h" +#include "../../video/SDL_glfuncs.h" #undef SDL_PROC return 0; } @@ -235,15 +233,11 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_Renderer *renderer; GL_RenderData *data; GLint value; + Uint32 window_flags; - /* Render directly to the window, unless we're compositing */ -#ifndef __MACOSX__ - if (flags & SDL_RENDERER_SINGLEBUFFER) { - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); - } -#endif - if (!(window->flags & SDL_WINDOW_OPENGL)) { - if (SDL_RecreateWindow(window, window->flags | SDL_WINDOW_OPENGL) < 0) { + window_flags = SDL_GetWindowFlags(window); + if (!(window_flags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) { return NULL; } } @@ -388,13 +382,15 @@ GL_ActivateRenderer(SDL_Renderer * renderer) SDL_CurrentContext = data->context; } if (data->updateSize) { + int w, h; + + SDL_GetWindowSize(window, &w, &h); data->glMatrixMode(GL_PROJECTION); data->glLoadIdentity(); data->glMatrixMode(GL_MODELVIEW); data->glLoadIdentity(); - data->glViewport(0, 0, window->w, window->h); - data->glOrtho(0.0, (GLdouble) window->w, - (GLdouble) window->h, 0.0, 0.0, 1.0); + data->glViewport(0, 0, w, h); + data->glOrtho(0.0, (GLdouble) w, (GLdouble) h, 0.0, 0.0, 1.0); data->updateSize = SDL_FALSE; } return 0; @@ -1145,7 +1141,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, GLint internalFormat; GLenum format, type; Uint8 *src, *dst, *tmp; - int length, rows; + int w, h, length, rows; GL_ActivateRenderer(renderer); @@ -1155,11 +1151,13 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return -1; } + SDL_GetWindowSize(window, &w, &h); + data->glPixelStorei(GL_PACK_ALIGNMENT, 1); data->glPixelStorei(GL_PACK_ROW_LENGTH, (pitch / bytes_per_pixel(pixel_format))); - data->glReadPixels(rect->x, (window->h-rect->y)-rect->h, rect->w, rect->h, + data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h, format, type, pixels); /* Flip the rows to be top-down */ @@ -1189,7 +1187,7 @@ GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, GLint internalFormat; GLenum format, type; Uint8 *src, *dst, *tmp; - int length, rows; + int w, h, length, rows; GL_ActivateRenderer(renderer); @@ -1199,6 +1197,8 @@ GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, return -1; } + SDL_GetWindowSize(window, &w, &h); + data->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); data->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / bytes_per_pixel(pixel_format))); @@ -1215,7 +1215,7 @@ GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, src -= pitch; } - data->glRasterPos2i(rect->x, (window->h-rect->y)); + data->glRasterPos2i(rect->x, (h-rect->y)); data->glDrawPixels(rect->w, rect->h, format, type, tmp); SDL_stack_free(tmp); diff --git a/src/video/SDL_renderer_gles.c b/src/render/opengles/SDL_renderer_gles.c similarity index 97% rename from src/video/SDL_renderer_gles.c rename to src/render/opengles/SDL_renderer_gles.c index e146e7ded..2e5d89dc8 100644 --- a/src/video/SDL_renderer_gles.c +++ b/src/render/opengles/SDL_renderer_gles.c @@ -23,12 +23,8 @@ #if SDL_VIDEO_RENDER_OGL_ES -#include "SDL_video.h" #include "SDL_opengles.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_rect_c.h" -#include "SDL_yuv_sw_c.h" +#include "../SDL_sysrender.h" #if defined(SDL_VIDEO_DRIVER_PANDORA) @@ -44,6 +40,9 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ +/* Used to re-create the window with OpenGL capability */ +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + static const float inv255f = 1.0f / 255.0f; static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags); @@ -83,6 +82,7 @@ SDL_RenderDriver GL_ES_RenderDriver = { { "opengl_es", (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), + 6, { /* OpenGL ES 1.x supported formats list */ SDL_PIXELFORMAT_RGBA4444, @@ -181,10 +181,11 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_Renderer *renderer; GLES_RenderData *data; GLint value; - int doublebuffer; + Uint32 window_flags; - if (!(window->flags & SDL_WINDOW_OPENGL)) { - if (SDL_RecreateWindow(window, window->flags | SDL_WINDOW_OPENGL) < 0) { + window_flags = SDL_GetWindowFlags(window); + if (!(window_flags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) { return NULL; } } @@ -246,11 +247,6 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } - if (SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doublebuffer) == 0) { - if (!doublebuffer) { - renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER; - } - } #if SDL_VIDEO_DRIVER_PANDORA data->GL_OES_draw_texture_supported = SDL_FALSE; data->useDrawTexture = SDL_FALSE; @@ -297,13 +293,15 @@ GLES_ActivateRenderer(SDL_Renderer * renderer) SDL_CurrentContext = data->context; } if (data->updateSize) { + int w, h; + + SDL_GetWindowSize(window, &w, &h); data->glMatrixMode(GL_PROJECTION); data->glLoadIdentity(); data->glMatrixMode(GL_MODELVIEW); data->glLoadIdentity(); - data->glViewport(0, 0, window->w, window->h); - data->glOrthof(0.0, (GLfloat) window->w, (GLfloat) window->h, 0.0, - 0.0, 1.0); + data->glViewport(0, 0, w, h); + data->glOrthof(0.0, (GLfloat) w, (GLfloat) h, 0.0, 0.0, 1.0); data->updateSize = SDL_FALSE; } return 0; @@ -736,16 +734,19 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if (data->GL_OES_draw_texture_supported && data->useDrawTexture) { /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */ - SDL_Window *window = renderer->window; GLint cropRect[4]; + int w, h; + SDL_Window *window = renderer->window; + + SDL_GetWindowSize(window, &w, &h); cropRect[0] = srcrect->x; cropRect[1] = srcrect->y + srcrect->h; cropRect[2] = srcrect->w; cropRect[3] = -srcrect->h; data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect); - data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h, - 0, dstrect->w, dstrect->h); + data->glDrawTexiOES(dstrect->x, h - dstrect->y - dstrect->h, 0, + dstrect->w, dstrect->h); } else { minx = dstrect->x; diff --git a/src/video/SDL_renderer_sw.c b/src/render/software/SDL_renderer_sw.c similarity index 94% rename from src/video/SDL_renderer_sw.c rename to src/render/software/SDL_renderer_sw.c index 92435a2ad..64dbc5a6a 100644 --- a/src/video/SDL_renderer_sw.c +++ b/src/render/software/SDL_renderer_sw.c @@ -21,12 +21,9 @@ */ #include "SDL_config.h" -#include "SDL_video.h" -#include "SDL_sysvideo.h" -#include "SDL_pixels_c.h" -#include "SDL_rect_c.h" -#include "SDL_yuv_sw_c.h" -#include "SDL_renderer_sw.h" +#include "../SDL_sysrender.h" +#include "../../video/SDL_pixels_c.h" +#include "../../video/SDL_yuv_sw_c.h" /* SDL surface based renderer implementation */ @@ -133,44 +130,21 @@ DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_free(texture); } -void -Setup_SoftwareRenderer(SDL_Renderer * renderer) -{ - renderer->CreateTexture = SW_CreateTexture; - renderer->QueryTexturePixels = SW_QueryTexturePixels; - renderer->SetTextureColorMod = SW_SetTextureColorMod; - renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; - renderer->SetTextureBlendMode = SW_SetTextureBlendMode; - renderer->UpdateTexture = SW_UpdateTexture; - renderer->LockTexture = SW_LockTexture; - renderer->UnlockTexture = SW_UnlockTexture; - renderer->DestroyTexture = SW_DestroyTexture; - - renderer->info.num_texture_formats = - SW_RenderDriver.info.num_texture_formats; - SDL_memcpy(renderer->info.texture_formats, - SW_RenderDriver.info.texture_formats, - sizeof(renderer->info.texture_formats));; - renderer->info.max_texture_width = SW_RenderDriver.info.max_texture_width; - renderer->info.max_texture_height = - SW_RenderDriver.info.max_texture_height; -} - SDL_Renderer * SW_CreateRenderer(SDL_Window * window, Uint32 flags) { - SDL_VideoDisplay *display = window->display; - SDL_DisplayMode *displayMode = &display->current_mode; SDL_Renderer *renderer; SW_RenderData *data; - int i, n; + int i; + Uint32 format; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; Uint32 renderer_flags; const char *desired_driver; + format = SDL_GetWindowPixelFormat(window); if (!SDL_PixelFormatEnumToMasks - (displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { SDL_SetError("Unknown display format"); return NULL; } @@ -188,7 +162,15 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } renderer->WindowEvent = SW_WindowEvent; - + renderer->CreateTexture = SW_CreateTexture; + renderer->QueryTexturePixels = SW_QueryTexturePixels; + renderer->SetTextureColorMod = SW_SetTextureColorMod; + renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; + renderer->SetTextureBlendMode = SW_SetTextureBlendMode; + renderer->UpdateTexture = SW_UpdateTexture; + renderer->LockTexture = SW_LockTexture; + renderer->UnlockTexture = SW_UnlockTexture; + renderer->DestroyTexture = SW_DestroyTexture; renderer->RenderDrawPoints = SW_RenderDrawPoints; renderer->RenderDrawLines = SW_RenderDrawLines; renderer->RenderFillRects = SW_RenderFillRects; @@ -197,14 +179,12 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->RenderWritePixels = SW_RenderWritePixels; renderer->RenderPresent = SW_RenderPresent; renderer->DestroyRenderer = SW_DestroyRenderer; - renderer->info.name = SW_RenderDriver.info.name; + renderer->info = SW_RenderDriver.info; renderer->info.flags = 0; renderer->window = window; renderer->driverdata = data; - Setup_SoftwareRenderer(renderer); - n = 1; - data->format = displayMode->format; + data->format = format; /* Find a render driver that we can use to display data */ renderer_flags = 0; @@ -212,21 +192,22 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags) renderer_flags |= SDL_RENDERER_PRESENTVSYNC; } desired_driver = SDL_getenv("SDL_VIDEO_RENDERER_SWDRIVER"); - for (i = 0; i < display->num_render_drivers; ++i) { - SDL_RenderDriver *driver = &display->render_drivers[i]; - if (driver->info.name == SW_RenderDriver.info.name) { + 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, driver->info.name) != 0) { + && SDL_strcasecmp(desired_driver, info.name) != 0) { continue; } - data->renderer = driver->CreateRenderer(window, renderer_flags); + data->renderer = SDL_CreateRenderer(window, i, renderer_flags); if (data->renderer) { break; } } - if (i == display->num_render_drivers) { + if (i == SDL_GetNumRenderDrivers()) { SW_DestroyRenderer(renderer); SDL_SetError("Couldn't find display render driver"); return NULL; @@ -725,8 +706,6 @@ SW_DestroyRenderer(SDL_Renderer * renderer) { SW_RenderData *data = (SW_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; - SDL_VideoDisplay *display = window->display; - int i; if (data) { if (data->texture) { diff --git a/src/video/SDL_pixels_c.h b/src/video/SDL_pixels_c.h index f307400e9..a8c1cc66f 100644 --- a/src/video/SDL_pixels_c.h +++ b/src/video/SDL_pixels_c.h @@ -47,4 +47,5 @@ extern void SDL_DitherColors(SDL_Color * colors, int bpp); extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b); extern void SDL_ApplyGamma(Uint16 * gamma, SDL_Color * colors, SDL_Color * output, int ncolors); + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index cb84e6ee6..a4cd6b861 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -21,8 +21,7 @@ */ #include "SDL_config.h" -#include "SDL_video.h" -#include "SDL_rect_c.h" +#include "SDL_rect.h" SDL_bool SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B) diff --git a/src/video/SDL_rect_c.h b/src/video/SDL_rect_c.h deleted file mode 100644 index 2f444760f..000000000 --- a/src/video/SDL_rect_c.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - 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" - -typedef struct SDL_DirtyRect -{ - SDL_Rect rect; - struct SDL_DirtyRect *next; -} SDL_DirtyRect; - -typedef struct SDL_DirtyRectList -{ - SDL_DirtyRect *list; - SDL_DirtyRect *free; -} SDL_DirtyRectList; - -extern void SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect); -extern void SDL_ClearDirtyRects(SDL_DirtyRectList * list); -extern void SDL_FreeDirtyRects(SDL_DirtyRectList * list); - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_renderer_gl.h b/src/video/SDL_renderer_gl.h deleted file mode 100644 index 6dd0a2362..000000000 --- a/src/video/SDL_renderer_gl.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - 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" - -/* OpenGL renderer implementation */ - -extern SDL_RenderDriver GL_RenderDriver; - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_renderer_gles.h b/src/video/SDL_renderer_gles.h deleted file mode 100644 index f86328d4e..000000000 --- a/src/video/SDL_renderer_gles.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - 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" - -/* OpenGL renderer implementation */ - -extern SDL_RenderDriver GL_ES_RenderDriver; - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_renderer_sw.h b/src/video/SDL_renderer_sw.h deleted file mode 100644 index 6a6daa8c3..000000000 --- a/src/video/SDL_renderer_sw.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2010 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* SDL surface based renderer implementation */ - -extern SDL_RenderDriver SW_RenderDriver; - -/* Set up SDL_Surface texture functions for a renderer */ -void Setup_SoftwareRenderer(SDL_Renderer * renderer); - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index a81ef183f..d805f903b 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -24,106 +24,15 @@ #ifndef _SDL_sysvideo_h #define _SDL_sysvideo_h -#include "SDL_events.h" -#include "SDL_mouse.h" -#include "SDL_keysym.h" -#include "SDL_render.h" #include "SDL_shape.h" /* The SDL video driver */ -typedef struct SDL_RenderDriver SDL_RenderDriver; typedef struct SDL_WindowShaper SDL_WindowShaper; typedef struct SDL_ShapeDriver SDL_ShapeDriver; typedef struct SDL_VideoDisplay SDL_VideoDisplay; typedef struct SDL_VideoDevice SDL_VideoDevice; -/* Define the SDL texture structure */ -struct SDL_Texture -{ - const void *magic; - Uint32 format; /**< The pixel format of the texture */ - int access; /**< SDL_TextureAccess */ - int w; /**< The width of the texture */ - int h; /**< The height of the texture */ - int modMode; /**< The texture modulation mode */ - SDL_BlendMode blendMode; /**< The texture blend mode */ - Uint8 r, g, b, a; /**< Texture modulation values */ - - SDL_Renderer *renderer; - - void *driverdata; /**< Driver specific texture representation */ - - SDL_Texture *prev; - SDL_Texture *next; -}; - -/* Define the SDL renderer structure */ -struct SDL_Renderer -{ - const void *magic; - - void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event); - int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); - int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture, - void **pixels, int *pitch); - int (*SetTextureColorMod) (SDL_Renderer * renderer, - SDL_Texture * texture); - int (*SetTextureAlphaMod) (SDL_Renderer * renderer, - SDL_Texture * texture); - int (*SetTextureBlendMode) (SDL_Renderer * renderer, - SDL_Texture * texture); - int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, - int pitch); - int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, int markDirty, void **pixels, - int *pitch); - void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); - void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture, - int numrects, const SDL_Rect * rects); - int (*RenderClear) (SDL_Renderer * renderer); - int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points, - int count); - int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points, - int count); - int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects, - int count); - int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect); - int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch); - int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, const void * pixels, int pitch); - void (*RenderPresent) (SDL_Renderer * renderer); - void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); - - void (*DestroyRenderer) (SDL_Renderer * renderer); - - /* The current renderer info */ - SDL_RendererInfo info; - - /* The window associated with the renderer */ - SDL_Window *window; - - /* The list of textures */ - SDL_Texture *textures; - - Uint8 r, g, b, a; /**< Color for drawing operations values */ - SDL_BlendMode blendMode; /**< The drawing blend mode */ - - void *driverdata; -}; - -/* Define the SDL render driver structure */ -struct SDL_RenderDriver -{ - SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags); - - /* Info about the renderer capabilities */ - SDL_RendererInfo info; -}; - /* Define the SDL window-shaper structure */ struct SDL_WindowShaper { @@ -193,9 +102,6 @@ struct SDL_VideoDisplay Uint16 *gamma; Uint16 *saved_gamma; /* (just offset into gamma) */ - int num_render_drivers; - SDL_RenderDriver *render_drivers; - SDL_Window *windows; SDL_Window *fullscreen_window; @@ -327,8 +233,6 @@ struct SDL_VideoDevice SDL_VideoDisplay *displays; int current_display; Uint8 window_magic; - Uint8 renderer_magic; - Uint8 texture_magic; Uint32 next_object_id; char * clipboard_text; @@ -427,7 +331,6 @@ extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode); extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue); extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue); -extern void SDL_AddRenderDriver(SDL_VideoDisplay *display, const SDL_RenderDriver * driver); extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index ef2941056..0793ae725 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -28,16 +28,8 @@ #include "SDL_sysvideo.h" #include "SDL_blit.h" #include "SDL_pixels_c.h" -#include "SDL_renderer_gl.h" -#include "SDL_renderer_gles.h" -#include "SDL_renderer_sw.h" #include "../events/SDL_events_c.h" -#if SDL_VIDEO_DRIVER_WINDOWS -#include "windows/SDL_windowsvideo.h" -extern void IME_Present(SDL_VideoData *videodata); -#endif - #if SDL_VIDEO_OPENGL_ES #include "SDL_opengles.h" #endif /* SDL_VIDEO_OPENGL_ES */ @@ -100,22 +92,6 @@ static SDL_VideoDevice *_this = NULL; return retval; \ } -#define CHECK_RENDERER_MAGIC(renderer, retval) \ - if (!renderer || renderer->magic != &_this->renderer_magic) { \ - SDL_SetError("Invalid renderer"); \ - return retval; \ - } - -#define CHECK_TEXTURE_MAGIC(texture, retval) \ - if (!_this) { \ - SDL_UninitializedVideo(); \ - return retval; \ - } \ - if (!texture || texture->magic != &_this->texture_magic) { \ - SDL_SetError("Invalid texture"); \ - return retval; \ - } - /* Various local functions */ static void SDL_UpdateWindowGrab(SDL_Window * window); @@ -258,21 +234,6 @@ SDL_VideoInit(const char *driver_name) SDL_VideoQuit(); return (-1); } - /* The software renderer is always available */ - for (i = 0; i < _this->num_displays; ++i) { - SDL_VideoDisplay *display = &_this->displays[i]; - if (_this->GL_CreateContext) { -#if SDL_VIDEO_RENDER_OGL - SDL_AddRenderDriver(display, &GL_RenderDriver); -#endif -#if SDL_VIDEO_RENDER_OGL_ES - SDL_AddRenderDriver(display, &GL_ES_RenderDriver); -#endif - } - if (display->num_render_drivers > 0) { - SDL_AddRenderDriver(display, &SW_RenderDriver); - } - } /* We're ready to go! */ return 0; @@ -723,6 +684,14 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) return 0; } +Uint32 +SDL_GetWindowPixelFormat(SDL_Window * window) +{ + SDL_VideoDisplay *display = window->display; + SDL_DisplayMode *displayMode = &display->current_mode; + return displayMode->format; +} + static void SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt) { @@ -1355,1100 +1324,6 @@ SDL_DestroyWindow(SDL_Window * window) SDL_free(window); } -void -SDL_AddRenderDriver(SDL_VideoDisplay * display, const SDL_RenderDriver * driver) -{ - SDL_RenderDriver *render_drivers; - - render_drivers = - SDL_realloc(display->render_drivers, - (display->num_render_drivers + - 1) * sizeof(*render_drivers)); - if (render_drivers) { - render_drivers[display->num_render_drivers] = *driver; - display->render_drivers = render_drivers; - display->num_render_drivers++; - } -} - -int -SDL_GetNumRenderDrivers(void) -{ - if (_this) { - return SDL_CurrentDisplay->num_render_drivers; - } - return 0; -} - -int -SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info) -{ - if (!_this) { - SDL_UninitializedVideo(); - return -1; - } - if (index < 0 || index >= SDL_GetNumRenderDrivers()) { - SDL_SetError("index must be in the range of 0 - %d", - SDL_GetNumRenderDrivers() - 1); - return -1; - } - *info = SDL_CurrentDisplay->render_drivers[index].info; - return 0; -} - -static int -SDL_RendererEventWatch(void *userdata, SDL_Event *event) -{ - SDL_Renderer *renderer = (SDL_Renderer *)userdata; - - if (event->type == SDL_WINDOWEVENT && renderer->WindowEvent) { - SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); - if (window == renderer->window) { - renderer->WindowEvent(renderer, &event->window); - } - } - return 0; -} - -SDL_Renderer * -SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) -{ - SDL_Renderer *renderer = NULL; - - CHECK_WINDOW_MAGIC(window, NULL); - - if (index < 0) { - char *override = SDL_getenv("SDL_VIDEO_RENDERER"); - int n = SDL_GetNumRenderDrivers(); - -#if SDL_VIDEO_RENDER_OGL - if (!override && (window->flags & SDL_WINDOW_OPENGL)) { - override = "opengl"; - } -#endif /* SDL_VIDEO_RENDER_OGL */ -#if SDL_VIDEO_RENDER_OGL_ES - if (!override && (window->flags & SDL_WINDOW_OPENGL)) { - override = "opengl_es"; - } -#endif /* SDL_VIDEO_RENDER_OGL_ES */ - if (override) { - for (index = 0; index < n; ++index) { - SDL_RenderDriver *driver = - &SDL_CurrentDisplay->render_drivers[index]; - - if (SDL_strcasecmp(override, driver->info.name) == 0) { - /* Create a new renderer instance */ - renderer = driver->CreateRenderer(window, flags); - break; - } - } - } else { - for (index = 0; index < n; ++index) { - SDL_RenderDriver *driver = - &SDL_CurrentDisplay->render_drivers[index]; - - if ((driver->info.flags & flags) == flags) { - /* Create a new renderer instance */ - renderer = driver->CreateRenderer(window, flags); - if (renderer) { - /* Yay, we got one! */ - break; - } - } - } - } - if (index == n) { - SDL_SetError("Couldn't find matching render driver"); - return NULL; - } - } else { - if (index >= SDL_GetNumRenderDrivers()) { - SDL_SetError("index must be -1 or in the range of 0 - %d", - SDL_GetNumRenderDrivers() - 1); - return NULL; - } - /* Create a new renderer instance */ - renderer = SDL_CurrentDisplay->render_drivers[index].CreateRenderer(window, flags); - } - - if (renderer) { - renderer->magic = &_this->renderer_magic; - - SDL_AddEventWatch(SDL_RendererEventWatch, renderer); - } - return renderer; -} - -int -SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - *info = renderer->info; - return 0; -} - -SDL_Texture * -SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h) -{ - SDL_Texture *texture; - - CHECK_RENDERER_MAGIC(renderer, NULL); - - if (w <= 0 || h <= 0) { - SDL_SetError("Texture dimensions can't be 0"); - return 0; - } - texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); - if (!texture) { - SDL_OutOfMemory(); - return 0; - } - texture->magic = &_this->texture_magic; - texture->format = format; - texture->access = access; - texture->w = w; - texture->h = h; - texture->r = 255; - texture->g = 255; - texture->b = 255; - texture->a = 255; - texture->renderer = renderer; - texture->next = renderer->textures; - if (renderer->textures) { - renderer->textures->prev = texture; - } - renderer->textures = texture; - - if (renderer->CreateTexture(renderer, texture) < 0) { - SDL_DestroyTexture(texture); - return 0; - } - return texture; -} - -SDL_Texture * -SDL_CreateTextureFromSurface(SDL_Renderer * renderer, Uint32 format, SDL_Surface * surface) -{ - SDL_Texture *texture; - Uint32 requested_format = format; - SDL_PixelFormat *fmt; - int bpp; - Uint32 Rmask, Gmask, Bmask, Amask; - - CHECK_RENDERER_MAGIC(renderer, NULL); - - if (!surface) { - SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface"); - return NULL; - } - fmt = surface->format; - - if (format) { - if (!SDL_PixelFormatEnumToMasks - (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { - SDL_SetError("Unknown pixel format"); - return 0; - } - } else { - if (surface->format->Amask - || !(surface->map->info.flags & - (SDL_COPY_COLORKEY | SDL_COPY_BLEND))) { - Uint32 it; - int pfmt; - - /* Pixel formats, sorted by best first */ - static const Uint32 sdl_pformats[] = { - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_BGR888, - SDL_PIXELFORMAT_RGB24, - SDL_PIXELFORMAT_BGR24, - SDL_PIXELFORMAT_RGB565, - SDL_PIXELFORMAT_BGR565, - SDL_PIXELFORMAT_ARGB1555, - SDL_PIXELFORMAT_RGBA5551, - SDL_PIXELFORMAT_ABGR1555, - SDL_PIXELFORMAT_BGRA5551, - SDL_PIXELFORMAT_RGB555, - SDL_PIXELFORMAT_BGR555, - SDL_PIXELFORMAT_ARGB4444, - SDL_PIXELFORMAT_RGBA4444, - SDL_PIXELFORMAT_ABGR4444, - SDL_PIXELFORMAT_BGRA4444, - SDL_PIXELFORMAT_RGB444, - SDL_PIXELFORMAT_ARGB2101010, - SDL_PIXELFORMAT_RGB332, - SDL_PIXELFORMAT_UNKNOWN - }; - - bpp = fmt->BitsPerPixel; - Rmask = fmt->Rmask; - Gmask = fmt->Gmask; - Bmask = fmt->Bmask; - Amask = fmt->Amask; - - format = - SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); - if (!format) { - SDL_SetError("Unknown pixel format"); - return 0; - } - - /* Search requested format in the supported texture */ - /* formats by current renderer */ - for (it = 0; it < renderer->info.num_texture_formats; it++) { - if (renderer->info.texture_formats[it] == format) { - break; - } - } - - /* If requested format can't be found, search any best */ - /* format which renderer provides */ - if (it == renderer->info.num_texture_formats) { - pfmt = 0; - for (;;) { - if (sdl_pformats[pfmt] == SDL_PIXELFORMAT_UNKNOWN) { - break; - } - - for (it = 0; it < renderer->info.num_texture_formats; - it++) { - if (renderer->info.texture_formats[it] == - sdl_pformats[pfmt]) { - break; - } - } - - if (it != renderer->info.num_texture_formats) { - /* The best format has been found */ - break; - } - pfmt++; - } - - /* If any format can't be found, then return an error */ - if (it == renderer->info.num_texture_formats) { - SDL_SetError - ("Any of the supported pixel formats can't be found"); - return 0; - } - - /* Convert found pixel format back to color masks */ - if (SDL_PixelFormatEnumToMasks - (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask, - &Bmask, &Amask) != SDL_TRUE) { - SDL_SetError("Unknown pixel format"); - return 0; - } - } - } else { - /* Need a format with alpha */ - Uint32 it; - int apfmt; - - /* Pixel formats with alpha, sorted by best first */ - static const Uint32 sdl_alpha_pformats[] = { - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_ARGB1555, - SDL_PIXELFORMAT_RGBA5551, - SDL_PIXELFORMAT_ABGR1555, - SDL_PIXELFORMAT_BGRA5551, - SDL_PIXELFORMAT_ARGB4444, - SDL_PIXELFORMAT_RGBA4444, - SDL_PIXELFORMAT_ABGR4444, - SDL_PIXELFORMAT_BGRA4444, - SDL_PIXELFORMAT_ARGB2101010, - SDL_PIXELFORMAT_UNKNOWN - }; - - if (surface->format->Amask) { - /* If surface already has alpha, then try an original */ - /* surface format first */ - bpp = fmt->BitsPerPixel; - Rmask = fmt->Rmask; - Gmask = fmt->Gmask; - Bmask = fmt->Bmask; - Amask = fmt->Amask; - } else { - bpp = 32; - Rmask = 0x00FF0000; - Gmask = 0x0000FF00; - Bmask = 0x000000FF; - Amask = 0xFF000000; - } - - format = - SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); - if (!format) { - SDL_SetError("Unknown pixel format"); - return 0; - } - - /* Search this format in the supported texture formats */ - /* by current renderer */ - for (it = 0; it < renderer->info.num_texture_formats; it++) { - if (renderer->info.texture_formats[it] == format) { - break; - } - } - - /* If this format can't be found, search any best */ - /* compatible format with alpha which renderer provides */ - if (it == renderer->info.num_texture_formats) { - apfmt = 0; - for (;;) { - if (sdl_alpha_pformats[apfmt] == SDL_PIXELFORMAT_UNKNOWN) { - break; - } - - for (it = 0; it < renderer->info.num_texture_formats; - it++) { - if (renderer->info.texture_formats[it] == - sdl_alpha_pformats[apfmt]) { - break; - } - } - - if (it != renderer->info.num_texture_formats) { - /* Compatible format has been found */ - break; - } - apfmt++; - } - - /* If compatible format can't be found, then return an error */ - if (it == renderer->info.num_texture_formats) { - SDL_SetError("Compatible pixel format can't be found"); - return 0; - } - - /* Convert found pixel format back to color masks */ - if (SDL_PixelFormatEnumToMasks - (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask, - &Bmask, &Amask) != SDL_TRUE) { - SDL_SetError("Unknown pixel format"); - return 0; - } - } - } - - format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); - if (!format) { - SDL_SetError("Unknown pixel format"); - return 0; - } - } - - texture = - SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, - surface->w, surface->h); - if (!texture && !requested_format) { - SDL_DisplayMode desktop_mode; - SDL_GetDesktopDisplayMode(&desktop_mode); - format = desktop_mode.format; - texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, - surface->w, surface->h); - } - if (!texture) { - return 0; - } - if (bpp == fmt->BitsPerPixel && Rmask == fmt->Rmask && Gmask == fmt->Gmask - && Bmask == fmt->Bmask && Amask == fmt->Amask) { - if (SDL_MUSTLOCK(surface)) { - SDL_LockSurface(surface); - SDL_UpdateTexture(texture, NULL, surface->pixels, - surface->pitch); - SDL_UnlockSurface(surface); - } else { - SDL_UpdateTexture(texture, NULL, surface->pixels, - surface->pitch); - } - } else { - SDL_PixelFormat dst_fmt; - SDL_Surface *dst = NULL; - - /* Set up a destination surface for the texture update */ - SDL_InitFormat(&dst_fmt, bpp, Rmask, Gmask, Bmask, Amask); - dst = SDL_ConvertSurface(surface, &dst_fmt, 0); - if (dst) { - SDL_UpdateTexture(texture, NULL, dst->pixels, dst->pitch); - SDL_FreeSurface(dst); - } - if (!dst) { - SDL_DestroyTexture(texture); - return 0; - } - } - - { - Uint8 r, g, b, a; - SDL_BlendMode blendMode; - - SDL_GetSurfaceColorMod(surface, &r, &g, &b); - SDL_SetTextureColorMod(texture, r, g, b); - - SDL_GetSurfaceAlphaMod(surface, &a); - SDL_SetTextureAlphaMod(texture, a); - - if (surface->map->info.flags & SDL_COPY_COLORKEY) { - /* We converted to a texture with alpha format */ - SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); - } else { - SDL_GetSurfaceBlendMode(surface, &blendMode); - SDL_SetTextureBlendMode(texture, blendMode); - } - } - return texture; -} - -int -SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, - int *w, int *h) -{ - CHECK_TEXTURE_MAGIC(texture, -1); - - if (format) { - *format = texture->format; - } - if (access) { - *access = texture->access; - } - if (w) { - *w = texture->w; - } - if (h) { - *h = texture->h; - } - return 0; -} - -int -SDL_QueryTexturePixels(SDL_Texture * texture, void **pixels, int *pitch) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (!renderer->QueryTexturePixels) { - SDL_Unsupported(); - return -1; - } - return renderer->QueryTexturePixels(renderer, texture, pixels, pitch); -} - -int -SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (r < 255 || g < 255 || b < 255) { - texture->modMode |= SDL_TEXTUREMODULATE_COLOR; - } else { - texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR; - } - texture->r = r; - texture->g = g; - texture->b = b; - if (renderer->SetTextureColorMod) { - return renderer->SetTextureColorMod(renderer, texture); - } else { - return 0; - } -} - -int -SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, - Uint8 * b) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (r) { - *r = texture->r; - } - if (g) { - *g = texture->g; - } - if (b) { - *b = texture->b; - } - return 0; -} - -int -SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (alpha < 255) { - texture->modMode |= SDL_TEXTUREMODULATE_ALPHA; - } else { - texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA; - } - texture->a = alpha; - if (renderer->SetTextureAlphaMod) { - return renderer->SetTextureAlphaMod(renderer, texture); - } else { - return 0; - } -} - -int -SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) -{ - CHECK_TEXTURE_MAGIC(texture, -1); - - if (alpha) { - *alpha = texture->a; - } - return 0; -} - -int -SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - texture->blendMode = blendMode; - if (renderer->SetTextureBlendMode) { - return renderer->SetTextureBlendMode(renderer, texture); - } else { - return 0; - } -} - -int -SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) -{ - CHECK_TEXTURE_MAGIC(texture, -1); - - if (blendMode) { - *blendMode = texture->blendMode; - } - return 0; -} - -int -SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, - const void *pixels, int pitch) -{ - SDL_Renderer *renderer; - SDL_Rect full_rect; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (!renderer->UpdateTexture) { - SDL_Unsupported(); - return -1; - } - if (!rect) { - full_rect.x = 0; - full_rect.y = 0; - full_rect.w = texture->w; - full_rect.h = texture->h; - rect = &full_rect; - } - return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch); -} - -int -SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, int markDirty, - void **pixels, int *pitch) -{ - SDL_Renderer *renderer; - SDL_Rect full_rect; - - CHECK_TEXTURE_MAGIC(texture, -1); - - if (texture->access != SDL_TEXTUREACCESS_STREAMING) { - SDL_SetError("SDL_LockTexture(): texture must be streaming"); - return -1; - } - renderer = texture->renderer; - if (!renderer->LockTexture) { - SDL_Unsupported(); - return -1; - } - if (!rect) { - full_rect.x = 0; - full_rect.y = 0; - full_rect.w = texture->w; - full_rect.h = texture->h; - rect = &full_rect; - } - return renderer->LockTexture(renderer, texture, rect, markDirty, pixels, - pitch); -} - -void -SDL_UnlockTexture(SDL_Texture * texture) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, ); - - if (texture->access != SDL_TEXTUREACCESS_STREAMING) { - return; - } - renderer = texture->renderer; - if (!renderer->UnlockTexture) { - return; - } - renderer->UnlockTexture(renderer, texture); -} - -void -SDL_DirtyTexture(SDL_Texture * texture, int numrects, - const SDL_Rect * rects) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, ); - - if (texture->access != SDL_TEXTUREACCESS_STREAMING) { - return; - } - renderer = texture->renderer; - if (!renderer->DirtyTexture) { - return; - } - renderer->DirtyTexture(renderer, texture, numrects, rects); -} - -int -SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, Uint8 a) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - renderer->r = r; - renderer->g = g; - renderer->b = b; - renderer->a = a; - return 0; -} - -int -SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - if (r) { - *r = renderer->r; - } - if (g) { - *g = renderer->g; - } - if (b) { - *b = renderer->b; - } - if (a) { - *a = renderer->a; - } - return 0; -} - -int -SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - renderer->blendMode = blendMode; - return 0; -} - -int -SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - *blendMode = renderer->blendMode; - return 0; -} - -int -SDL_RenderClear(SDL_Renderer * renderer) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!renderer->RenderClear) { - SDL_BlendMode blendMode = renderer->blendMode; - int status; - - if (blendMode >= SDL_BLENDMODE_BLEND) { - SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); - } - - status = SDL_RenderFillRect(renderer, NULL); - - if (blendMode >= SDL_BLENDMODE_BLEND) { - SDL_SetRenderDrawBlendMode(renderer, blendMode); - } - return status; - } - return renderer->RenderClear(renderer); -} - -int -SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y) -{ - SDL_Point point; - - point.x = x; - point.y = y; - return SDL_RenderDrawPoints(renderer, &point, 1); -} - -int -SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!points) { - SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points"); - return -1; - } - if (count < 1) { - return 0; - } - return renderer->RenderDrawPoints(renderer, points, count); -} - -int -SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) -{ - SDL_Point points[2]; - - points[0].x = x1; - points[0].y = y1; - points[1].x = x2; - points[1].y = y2; - return SDL_RenderDrawLines(renderer, points, 2); -} - -int -SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count) -{ - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!points) { - SDL_SetError("SDL_RenderDrawLines(): Passed NULL points"); - return -1; - } - if (count < 2) { - return 0; - } - return renderer->RenderDrawLines(renderer, points, count); -} - -int -SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect) -{ - SDL_Rect full_rect; - SDL_Point points[5]; - - CHECK_RENDERER_MAGIC(renderer, -1); - - /* If 'rect' == NULL, then outline the whole surface */ - if (!rect) { - SDL_Window *window = renderer->window; - - full_rect.x = 0; - full_rect.y = 0; - full_rect.w = window->w; - full_rect.h = window->h; - rect = &full_rect; - } - - points[0].x = rect->x; - points[0].y = rect->y; - points[1].x = rect->x+rect->w-1; - points[1].y = rect->y; - points[2].x = rect->x+rect->w-1; - points[2].y = rect->y+rect->h-1; - points[3].x = rect->x; - points[3].y = rect->y+rect->h-1; - points[4].x = rect->x; - points[4].y = rect->y; - return SDL_RenderDrawLines(renderer, points, 5); -} - -int -SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count) -{ - int i; - - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!rects) { - SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects"); - return -1; - } - if (count < 1) { - return 0; - } - - /* Check for NULL rect, which means fill entire window */ - for (i = 0; i < count; ++i) { - if (SDL_RenderDrawRect(renderer, rects[i]) < 0) { - return -1; - } - } - return 0; -} - -int -SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) -{ - return SDL_RenderFillRects(renderer, &rect, 1); -} - -int -SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count) -{ - int i; - - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!rects) { - SDL_SetError("SDL_RenderFillRects(): Passed NULL rects"); - return -1; - } - if (count < 1) { - return 0; - } - - /* Check for NULL rect, which means fill entire window */ - for (i = 0; i < count; ++i) { - if (rects[i] == NULL) { - SDL_Window *window = renderer->window; - SDL_Rect full_rect; - const SDL_Rect *rect; - - full_rect.x = 0; - full_rect.y = 0; - full_rect.w = window->w; - full_rect.h = window->h; - rect = &full_rect; - return renderer->RenderFillRects(renderer, &rect, 1); - } - } - return renderer->RenderFillRects(renderer, rects, count); -} - -int -SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect) -{ - SDL_Window *window; - SDL_Rect real_srcrect; - SDL_Rect real_dstrect; - - CHECK_RENDERER_MAGIC(renderer, -1); - CHECK_TEXTURE_MAGIC(texture, -1); - - if (renderer != texture->renderer) { - SDL_SetError("Texture was not created with this renderer"); - return -1; - } - window = renderer->window; - - real_srcrect.x = 0; - real_srcrect.y = 0; - real_srcrect.w = texture->w; - real_srcrect.h = texture->h; - if (srcrect) { - if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) { - return 0; - } - } - - real_dstrect.x = 0; - real_dstrect.y = 0; - real_dstrect.w = window->w; - real_dstrect.h = window->h; - if (dstrect) { - if (!SDL_IntersectRect(dstrect, &real_dstrect, &real_dstrect)) { - return 0; - } - /* Clip srcrect by the same amount as dstrect was clipped */ - if (dstrect->w != real_dstrect.w) { - int deltax = (real_dstrect.x - dstrect->x); - int deltaw = (real_dstrect.w - dstrect->w); - real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w; - real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w; - } - if (dstrect->h != real_dstrect.h) { - int deltay = (real_dstrect.y - dstrect->y); - int deltah = (real_dstrect.h - dstrect->h); - real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h; - real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h; - } - } - - return renderer->RenderCopy(renderer, texture, &real_srcrect, - &real_dstrect); -} - -int -SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) -{ - SDL_Window *window; - SDL_Rect real_rect; - - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!renderer->RenderReadPixels) { - SDL_Unsupported(); - return -1; - } - window = renderer->window; - - if (!format) { - format = window->display->current_mode.format; - } - - real_rect.x = 0; - real_rect.y = 0; - real_rect.w = window->w; - real_rect.h = window->h; - if (rect) { - if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) { - return 0; - } - if (real_rect.y > rect->y) { - pixels = (Uint8 *)pixels + pitch * (real_rect.y - rect->y); - } - if (real_rect.x > rect->x) { - Uint32 format = SDL_CurrentDisplay->current_mode.format; - int bpp = SDL_BYTESPERPIXEL(format); - pixels = (Uint8 *)pixels + bpp * (real_rect.x - rect->x); - } - } - - return renderer->RenderReadPixels(renderer, &real_rect, - format, pixels, pitch); -} - -int -SDL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, const void * pixels, int pitch) -{ - SDL_Window *window; - SDL_Rect real_rect; - - CHECK_RENDERER_MAGIC(renderer, -1); - - if (!renderer->RenderWritePixels) { - SDL_Unsupported(); - return -1; - } - window = renderer->window; - - if (!format) { - format = window->display->current_mode.format; - } - - real_rect.x = 0; - real_rect.y = 0; - real_rect.w = window->w; - real_rect.h = window->h; - if (rect) { - if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) { - return 0; - } - if (real_rect.y > rect->y) { - pixels = (const Uint8 *)pixels + pitch * (real_rect.y - rect->y); - } - if (real_rect.x > rect->x) { - Uint32 format = SDL_CurrentDisplay->current_mode.format; - int bpp = SDL_BYTESPERPIXEL(format); - pixels = (const Uint8 *)pixels + bpp * (real_rect.x - rect->x); - } - } - - return renderer->RenderWritePixels(renderer, &real_rect, - format, pixels, pitch); -} - -void -SDL_RenderPresent(SDL_Renderer * renderer) -{ - CHECK_RENDERER_MAGIC(renderer, ); - -#if SDL_VIDEO_DRIVER_WINDOWS - IME_Present((SDL_VideoData *)_this->driverdata); -#endif - renderer->RenderPresent(renderer); -} - -void -SDL_DestroyTexture(SDL_Texture * texture) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, ); - texture->magic = NULL; - - renderer = texture->renderer; - if (texture->next) { - texture->next->prev = texture->prev; - } - if (texture->prev) { - texture->prev->next = texture->next; - } else { - renderer->textures = texture->next; - } - - renderer->DestroyTexture(renderer, texture); - SDL_free(texture); -} - -void -SDL_DestroyRenderer(SDL_Renderer * renderer) -{ - CHECK_RENDERER_MAGIC(renderer, ); - - SDL_DelEventWatch(SDL_RendererEventWatch, renderer); - - /* Free existing textures for this renderer */ - while (renderer->textures) { - SDL_DestroyTexture(renderer->textures); - } - - /* It's no longer magical... */ - renderer->magic = NULL; - - /* Free the renderer instance */ - renderer->DestroyRenderer(renderer); -} - SDL_bool SDL_IsScreenSaverEnabled() { @@ -2511,11 +1386,6 @@ SDL_VideoQuit(void) while (display->windows) { SDL_DestroyWindow(display->windows); } - if (display->render_drivers) { - SDL_free(display->render_drivers); - display->render_drivers = NULL; - } - display->num_render_drivers = 0; } _this->VideoQuit(_this); diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index 01f34bce6..8918ef56a 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -26,7 +26,6 @@ #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_render.h" -#include "../SDL_rect_c.h" #include "../SDL_yuv_sw_c.h" /* the following is not yet tested ... */ diff --git a/src/video/dummy/SDL_nullrender.c b/src/video/dummy/SDL_nullrender.c deleted file mode 100644 index 0375771d5..000000000 --- a/src/video/dummy/SDL_nullrender.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2010 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_video.h" -#include "../SDL_sysvideo.h" -#include "../SDL_yuv_sw_c.h" -#include "../SDL_renderer_sw.h" - - -/* SDL surface based renderer implementation */ - -static SDL_Renderer *SDL_DUMMY_CreateRenderer(SDL_Window * window, - Uint32 flags); -static int SDL_DUMMY_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count); -static int SDL_DUMMY_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count); -static int SDL_DUMMY_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count); -static int SDL_DUMMY_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); -static int SDL_DUMMY_RenderReadPixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - void * pixels, int pitch); -static int SDL_DUMMY_RenderWritePixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - const void * pixels, int pitch); -static void SDL_DUMMY_RenderPresent(SDL_Renderer * renderer); -static void SDL_DUMMY_DestroyRenderer(SDL_Renderer * renderer); - - -SDL_RenderDriver SDL_DUMMY_RenderDriver = { - SDL_DUMMY_CreateRenderer, - { - "dummy", - (0), - } -}; - -typedef struct -{ - SDL_Surface *screen; -} SDL_DUMMY_RenderData; - -SDL_Renderer * -SDL_DUMMY_CreateRenderer(SDL_Window * window, Uint32 flags) -{ - SDL_VideoDisplay *display = window->display; - SDL_DisplayMode *displayMode = &display->current_mode; - SDL_Renderer *renderer; - SDL_DUMMY_RenderData *data; - int bpp; - Uint32 Rmask, Gmask, Bmask, Amask; - - if (!SDL_PixelFormatEnumToMasks - (displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { - SDL_SetError("Unknown display format"); - return NULL; - } - - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (SDL_DUMMY_RenderData *) SDL_malloc(sizeof(*data)); - if (!data) { - SDL_DUMMY_DestroyRenderer(renderer); - SDL_OutOfMemory(); - return NULL; - } - SDL_zerop(data); - - renderer->RenderDrawPoints = SDL_DUMMY_RenderDrawPoints; - renderer->RenderDrawLines = SDL_DUMMY_RenderDrawLines; - renderer->RenderFillRects = SDL_DUMMY_RenderFillRects; - renderer->RenderCopy = SDL_DUMMY_RenderCopy; - renderer->RenderReadPixels = SDL_DUMMY_RenderReadPixels; - renderer->RenderWritePixels = SDL_DUMMY_RenderWritePixels; - renderer->RenderPresent = SDL_DUMMY_RenderPresent; - renderer->DestroyRenderer = SDL_DUMMY_DestroyRenderer; - renderer->info.name = SDL_DUMMY_RenderDriver.info.name; - renderer->info.flags = 0; - renderer->window = window; - renderer->driverdata = data; - Setup_SoftwareRenderer(renderer); - - data->screen = - SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask, - Bmask, Amask); - if (!data->screen) { - SDL_DUMMY_DestroyRenderer(renderer); - return NULL; - } - - return renderer; -} - -static int -SDL_DUMMY_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Surface *target = data->screen; - - if (renderer->blendMode == SDL_BLENDMODE_NONE) { - Uint32 color = SDL_MapRGBA(target->format, - renderer->r, renderer->g, renderer->b, - renderer->a); - - return SDL_DrawPoints(target, points, count, color); - } else { - return SDL_BlendPoints(target, points, count, renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } -} - -static int -SDL_DUMMY_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Surface *target = data->screen; - - if (renderer->blendMode == SDL_BLENDMODE_NONE) { - Uint32 color = SDL_MapRGBA(target->format, - renderer->r, renderer->g, renderer->b, - renderer->a); - - return SDL_DrawLines(target, points, count, color); - } else { - return SDL_BlendLines(target, points, count, renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } -} - -static int -SDL_DUMMY_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, - int count) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Surface *target = data->screen; - - if (renderer->blendMode == SDL_BLENDMODE_NONE) { - Uint32 color = SDL_MapRGBA(target->format, - renderer->r, renderer->g, renderer->b, - renderer->a); - - return SDL_FillRects(target, rects, count, color); - } else { - return SDL_BlendFillRects(target, rects, count, - renderer->blendMode, - renderer->r, renderer->g, renderer->b, - renderer->a); - } -} - -static int -SDL_DUMMY_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; - SDL_VideoDisplay *display = window->display; - - if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { - SDL_Surface *target = data->screen; - void *pixels = - (Uint8 *) target->pixels + dstrect->y * target->pitch + - dstrect->x * target->format->BytesPerPixel; - return SDL_SW_CopyYUVToRGB((SDL_SW_YUVTexture *) texture->driverdata, - srcrect, display->current_mode.format, - dstrect->w, dstrect->h, pixels, - target->pitch); - } else { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; - SDL_Surface *target = data->screen; - SDL_Rect real_srcrect = *srcrect; - SDL_Rect real_dstrect = *dstrect; - - return SDL_LowerBlit(surface, &real_srcrect, target, &real_dstrect); - } -} - -static int -SDL_DUMMY_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; - SDL_VideoDisplay *display = window->display; - SDL_Surface *screen = data->screen; - Uint32 screen_format = display->current_mode.format; - Uint8 *screen_pixels = (Uint8 *) screen->pixels + - rect->y * screen->pitch + - rect->x * screen->format->BytesPerPixel; - int screen_pitch = screen->pitch; - - return SDL_ConvertPixels(rect->w, rect->h, - screen_format, screen_pixels, screen_pitch, - format, pixels, pitch); -} - -static int -SDL_DUMMY_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, const void * pixels, int pitch) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; - SDL_VideoDisplay *display = window->display; - SDL_Surface *screen = data->screen; - Uint32 screen_format = display->current_mode.format; - Uint8 *screen_pixels = (Uint8 *) screen->pixels + - rect->y * screen->pitch + - rect->x * screen->format->BytesPerPixel; - int screen_pitch = screen->pitch; - - return SDL_ConvertPixels(rect->w, rect->h, - format, pixels, pitch, - screen_format, screen_pixels, screen_pitch); -} - -static void -SDL_DUMMY_RenderPresent(SDL_Renderer * renderer) -{ - static int frame_number; - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - - /* Send the data to the display */ - if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) { - char file[128]; - SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp", - renderer->window->id, ++frame_number); - SDL_SaveBMP(data->screen, file); - } -} - -static void -SDL_DUMMY_DestroyRenderer(SDL_Renderer * renderer) -{ - SDL_DUMMY_RenderData *data = - (SDL_DUMMY_RenderData *) renderer->driverdata; - int i; - - if (data) { - if (data->screen) { - SDL_FreeSurface(data->screen); - } - SDL_free(data); - } - SDL_free(renderer); -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/dummy/SDL_nullrender_c.h b/src/video/dummy/SDL_nullrender_c.h deleted file mode 100644 index f3366f05f..000000000 --- a/src/video/dummy/SDL_nullrender_c.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2010 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* SDL surface based renderer implementation */ - -extern SDL_RenderDriver SDL_DUMMY_RenderDriver; - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index 840d12e3b..e279e167a 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -44,7 +44,6 @@ #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" -#include "SDL_nullrender_c.h" #define DUMMYVID_DRIVER_NAME "dummy" @@ -118,7 +117,6 @@ DUMMY_VideoInit(_THIS) if (SDL_AddBasicVideoDisplay(&mode) < 0) { return -1; } - SDL_AddRenderDriver(&_this->displays[0], &SDL_DUMMY_RenderDriver); SDL_zero(mode); SDL_AddDisplayMode(&_this->displays[0], &mode); diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 5d6708171..02d2c91df 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -35,9 +35,6 @@ #include "SDL_uikitwindow.h" #include "SDL_uikitopengles.h" -#include "SDL_renderer_sw.h" -#include "SDL_renderer_gles.h" - #include "SDL_assert.h" #define UIKITVID_DRIVER_NAME "uikit" diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 33d24f7cd..92011b866 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -35,7 +35,6 @@ #import "SDL_uikitappdelegate.h" #import "SDL_uikitopenglview.h" -#import "SDL_renderer_sw.h" #include diff --git a/src/video/windows/SDL_d3drender.h b/src/video/windows/SDL_d3drender.h deleted file mode 100644 index 16d81aa38..000000000 --- a/src/video/windows/SDL_d3drender.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - 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" - -#if SDL_VIDEO_RENDER_D3D -extern void D3D_AddRenderDriver(_THIS); -#endif - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index af43c9e53..c107f4970 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -116,7 +116,6 @@ WIN_InitKeyboard(_THIS) data->ime_candlistindexbase = 0; data->ime_candvertical = SDL_TRUE; - data->ime_candtex = NULL; data->ime_dirty = SDL_FALSE; SDL_memset(&data->ime_rect, 0, sizeof(data->ime_rect)); SDL_memset(&data->ime_candlistrect, 0, sizeof(data->ime_candlistrect)); @@ -1274,36 +1273,6 @@ StopDrawToBitmap(HDC hdc, HBITMAP *hhbm) } } -static void -BitmapToTexture(HBITMAP hbm, BYTE *bits, int width, int height, SDL_Texture **texture) -{ - SDL_Surface *surface = NULL; - BITMAP bm = {0}; - - if (GetObject(hbm, sizeof(bm), &bm) == 0) - return; - - if (bits && texture) { - /* - For transparency: - - const Uint8 alpha = 130; - unsigned long *p = (unsigned long *)bits; - unsigned long *end = (unsigned long *)(bits + (bm.bmWidthBytes * bm.bmHeight)); - while (p < end) { - *p = RGB(GetRValue(*p), GetGValue(*p), GetBValue(*p)) | (alpha << 24); - ++p; - } - surface = SDL_CreateRGBSurfaceFrom(bits, width, height, bm.bmBitsPixel, bm.bmWidthBytes, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); - */ - surface = SDL_CreateRGBSurfaceFrom(bits, width, height, bm.bmBitsPixel, bm.bmWidthBytes, 0x00ff0000, 0x0000ff00, 0x000000ff, 0); - if (surface) { - *texture = SDL_CreateTextureFromSurface(0, surface); - SDL_FreeSurface(surface); - } - } -} - /* This draws only within the specified area and fills the entire region. */ static void DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) @@ -1317,19 +1286,9 @@ DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) Rectangle(hdc, left, top, right, bottom); } -static void -DestroyTexture(SDL_Texture **texture) -{ - if (texture && *texture) { - SDL_DestroyTexture(*texture); - *texture = NULL; - } -} - static void IME_DestroyTextures(SDL_VideoData *videodata) { - DestroyTexture(&videodata->ime_candtex); } #define SDL_swap(a,b) { \ @@ -1544,7 +1503,6 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) DrawRect(hdc, left, top, right, bottom, candborder); ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, SDL_wcslen(s), NULL); } - BitmapToTexture(hbm, bits, size.cx, size.cy, &videodata->ime_candtex); StopDrawToBitmap(hdc, &hbm); DeleteObject(listpen); @@ -1576,7 +1534,7 @@ void IME_Present(SDL_VideoData *videodata) if (videodata->ime_dirty) IME_Render(videodata); - SDL_RenderCopy(videodata->ime_candtex, NULL, &videodata->ime_candlistrect); + // FIXME: Need to show the IME bitmap } #endif /* SDL_DISABLE_WINDOWS_IME */ diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 78794c387..acceb0f01 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -29,7 +29,6 @@ #include "SDL_windowsvideo.h" #include "SDL_windowsshape.h" -#include "SDL_d3drender.h" /* Initialization/Query functions */ static int WIN_VideoInit(_THIS); @@ -50,12 +49,6 @@ WIN_DeleteDevice(SDL_VideoDevice * device) SDL_VideoData *data = (SDL_VideoData *) device->driverdata; SDL_UnregisterApp(); -#if SDL_VIDEO_RENDER_D3D - if (data->d3d) { - IDirect3D9_Release(data->d3d); - SDL_UnloadObject(data->d3dDLL); - } -#endif #ifdef _WIN32_WCE if(data->hAygShell) { SDL_UnloadObject(data->hAygShell); @@ -175,10 +168,6 @@ WIN_VideoInit(_THIS) return -1; } -#if SDL_VIDEO_RENDER_D3D - D3D_AddRenderDriver(_this); -#endif - WIN_InitKeyboard(_this); WIN_InitMouse(_this); diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 54a6c0930..2303c9ffe 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -39,12 +39,6 @@ #define MAX_CANDLIST 10 #define MAX_CANDLENGTH 256 -#if SDL_VIDEO_RENDER_D3D -//#include -#define D3D_DEBUG_INFO -#include "d3d9.h" -#endif - #include "SDL_windowsclipboard.h" #include "SDL_windowsevents.h" #include "SDL_windowsgamma.h" @@ -57,8 +51,6 @@ #include "SDL_loadso.h" -enum { RENDER_NONE, RENDER_D3D }; - #if WINVER < 0x0601 /* Touch input definitions */ #define TWF_FINETOUCH 1 @@ -125,10 +117,6 @@ typedef struct SDL_VideoData { int render; -#if SDL_VIDEO_RENDER_D3D - void* d3dDLL; - IDirect3D9 *d3d; -#endif #ifdef _WIN32_WCE void* hAygShell; PFNSHFullScreen SHFullScreen; @@ -166,7 +154,6 @@ typedef struct SDL_VideoData int ime_candlistindexbase; SDL_bool ime_candvertical; - SDL_Texture *ime_candtex; SDL_bool ime_dirty; SDL_Rect ime_rect; SDL_Rect ime_candlistrect; diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 2a8e547f6..a23e3b7f8 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -24,6 +24,8 @@ #ifndef _SDL_x11video_h #define _SDL_x11video_h +#include "SDL_keysym.h" + #include "../SDL_sysvideo.h" #include