Commit 5897ef7d authored by Sam Lantinga's avatar Sam Lantinga

Moved the rendering code out to a separate directory in the hope that it can...

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.

--HG--
rename : src/video/windows/SDL_d3drender.c => src/render/direct3d/SDL_d3drender.c
rename : src/video/SDL_renderer_gl.c => src/render/opengl/SDL_renderer_gl.c
rename : src/video/SDL_renderer_gles.c => src/render/opengles/SDL_renderer_gles.c
rename : src/video/SDL_renderer_sw.c => src/render/software/SDL_renderer_sw.c
parent 96236803
......@@ -30,7 +30,7 @@
<Tool
Name="VCPreBuildEventTool"
Description="Making sure basic SDL headers are in place..."
CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadfood&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;xcopy /d /q /y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
......@@ -201,7 +201,7 @@
<Tool
Name="VCPreBuildEventTool"
Description="Making sure basic SDL headers are in place..."
CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadfood&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;xcopy /d /q /y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
......@@ -385,6 +385,10 @@
RelativePath="..\..\include\SDL_audio.h"
>
</File>
<File
RelativePath="..\..\include\SDL_blendmode.h"
>
</File>
<File
RelativePath="..\..\include\SDL_clipboard.h"
>
......@@ -421,10 +425,18 @@
RelativePath="..\..\include\SDL_events.h"
>
</File>
<File
RelativePath="..\..\include\SDL_gesture.h"
>
</File>
<File
RelativePath="..\..\include\SDL_haptic.h"
>
</File>
<File
RelativePath="..\..\include\SDL_input.h"
>
</File>
<File
RelativePath="..\..\include\SDL_joystick.h"
>
......@@ -485,6 +497,10 @@
RelativePath="..\..\include\SDL_rect.h"
>
</File>
<File
RelativePath="..\..\include\SDL_render.h"
>
</File>
<File
RelativePath="..\..\include\SDL_revision.h"
>
......@@ -497,6 +513,10 @@
RelativePath="..\..\include\SDL_scancode.h"
>
</File>
<File
RelativePath="..\..\include\SDL_shape.h"
>
</File>
<File
RelativePath="..\..\include\SDL_stdinc.h"
>
......@@ -517,6 +537,10 @@
RelativePath="..\..\include\SDL_timer.h"
>
</File>
<File
RelativePath="..\..\include\SDL_touch.h"
>
</File>
<File
RelativePath="..\..\include\SDL_types.h"
>
......@@ -751,11 +775,7 @@
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_d3drender.c"
>
</File>
<File
RelativePath="..\..\src\video\windows\SDL_d3drender.h"
RelativePath="..\..\src\render\direct3d\SDL_d3drender.c"
>
</File>
<File
......@@ -942,14 +962,6 @@
RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
>
</File>
<File
RelativePath="..\..\src\video\dummy\SDL_nullrender.c"
>
</File>
<File
RelativePath="..\..\src\video\dummy\SDL_nullrender_c.h"
>
</File>
<File
RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
>
......@@ -987,19 +999,15 @@
>
</File>
<File
RelativePath="..\..\src\video\SDL_renderer_gl.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_renderer_gl.h"
RelativePath="..\..\src\render\SDL_render.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_renderer_sw.c"
RelativePath="..\..\src\render\opengl\SDL_renderer_gl.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_renderer_sw.h"
RelativePath="..\..\src\render\software\SDL_renderer_sw.c"
>
</File>
<File
......@@ -1074,6 +1082,10 @@
RelativePath="..\..\src\power\windows\SDL_syspower.c"
>
</File>
<File
RelativePath="..\..\src\render\SDL_sysrender.h"
>
</File>
<File
RelativePath="..\..\src\thread\windows\SDL_syssem.c"
>
......
......@@ -75,7 +75,7 @@
<PreBuildEvent>
<Message>Making sure basic SDL headers are in place...</Message>
<Command>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" &gt;"$(ProjectDir)\..\..\include\SDL_r
<PreBuildEvent>
<Message>Making sure basic SDL headers are in place...</Message>
<Command>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" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_compat.h" />
<ClInclude Include="..\..\include\SDL_config.h" />
......@@ -240,7 +241,9 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_input.h" />
<ClInclude Include="..\..\include\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL_keysym.h" />
......@@ -256,6 +259,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\include\SDL_power.h" />
<ClInclude Include="..\..\include\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL_render.h" />
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
......@@ -265,6 +269,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\include\SDL_syswm.h" />
<ClInclude Include="..\..\include\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" />
......@@ -277,6 +282,7 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\libm\math.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
<ClInclude Include="..\..\src\video\mmx.h" />
<ClInclude Include="..\..\src\video\SDL_alphamult.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
......@@ -287,7 +293,6 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\windows\SDL_d3drender.h" />
<ClInclude Include="..\..\src\audio\windib\SDL_dibaudio.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\video\SDL_draw.h" />
......@@ -306,12 +311,9 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClInclude Include="..\..\src\audio\SDL_mixer_MMX_VC.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullrender_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_renderer_gl.h" />
<ClInclude Include="..\..\src\video\SDL_renderer_sw.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_stretch_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
......@@ -360,6 +362,10 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_d3drender.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_renderer_gl.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\software\SDL_renderer_sw.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\video\SDL_alphamult.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
......@@ -386,7 +392,6 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
<ClCompile Include="..\..\src\video\SDL_shape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_d3drender.c" />
<ClCompile Include="..\..\src\audio\windib\SDL_dibaudio.c" />
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
<ClCompile Include="..\..\src\video\SDL_drawline.c" />
......@@ -413,15 +418,12 @@ echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_r
<ClCompile Include="..\..\src\joystick\windows\SDL_mmjoystick.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullrender.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_renderer_gl.c" />
<ClCompile Include="..\..\src\video\SDL_renderer_sw.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
......
......@@ -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}
......
......@@ -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}
......
This diff is collapsed.
......@@ -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"
......
......@@ -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* */
......
......@@ -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.
......
......@@ -116,8 +116,6 @@ SDL_StopEventLoop(void)
int
SDL_StartEventLoop(void)
{
int retcode;
/* Clean out the event queue */
SDL_EventQ.lock = NULL;
SDL_StopEventLoop();
......
This diff is collapsed.
/*
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: */
......@@ -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 <OpenGL/OpenGL.h>
......@@ -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);
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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: */
......@@ -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)
......
/*
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: */
/*
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: */
/*
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: */
/*
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: */
......@@ -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);
......
This diff is collapsed.
......@@ -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 ... */
......
This diff is collapsed.
/*
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: */
......@@ -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);
......
......@@ -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"
......
......@@ -35,7 +35,6 @@
#import "SDL_uikitappdelegate.h"
#import "SDL_uikitopenglview.h"
#import "SDL_renderer_sw.h"
#include <Foundation/Foundation.h>
......
/*
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: */
......@@ -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 */
......
......@@ -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);
......
This diff is collapsed.
......@@ -24,6 +24,8 @@
#ifndef _SDL_x11video_h
#define _SDL_x11video_h
#include "SDL_keysym.h"
#include "../SDL_sysvideo.h"
#include <X11/Xlib.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment