Commit graph

80 commits

Author SHA1 Message Date
Sam Lantinga
ad407b378a Fixed compiling Windows RT code on Visual Studio 2013
--HG--
rename : src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp => src/render/direct3d11/SDL_render_winrt.cpp
rename : src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h => src/render/direct3d11/SDL_render_winrt.h
2014-03-12 07:26:07 -07:00
David Ludwig
5007e2996e Fixed compiler errors in the D3D11 renderer when building for WinRT
Still TODO: fix other build errors, especially linker errors, when building
SDL/WinRT, then fix any runtime errors that pop up.

--HG--
extra : rebase_source : dec261a0a61ffe463455f7d0a639f4c087e975ba
2014-03-11 12:40:31 -04:00
David Ludwig
cfebd21bdc Made VS2012 build the D3D11 renderer
This change is currently limited to Win32/Windows-Desktop builds.  Build fixes
for WinRT + VS2012 are still pending.

--HG--
extra : rebase_source : 1ba34b2a9a394347f5d95730eeabc3f0d7e4f197
2014-03-10 22:53:03 -04:00
Sam Lantinga
d16a9a6781 Fixed D3D9 initialization on Windows 8, which doesn't have D3DX 2014-03-10 17:19:19 -07:00
Sam Lantinga
1d203bd13f Implemented fullscreen <-> windowed transition on Windows 8 2014-03-10 15:00:59 -07:00
Sam Lantinga
9d421197ef Fixed line endings 2014-03-10 14:35:37 -07:00
Sam Lantinga
0879cd423c Fixed creating the rendering context on a specific device 2014-03-10 12:49:15 -07:00
Sam Lantinga
aceab387be Implemented YV12 and IYUV texture support for the D3D11 renderer 2014-03-10 05:44:34 -07:00
Sam Lantinga
5e7f7c7f4b Minor style tweaks 2014-03-10 02:13:44 -07:00
Sam Lantinga
1348631206 Converted David Ludwig's D3D11 renderer to C and optimized it.
The D3D11 renderer is now slightly faster than D3D9 on my Windows 8 machine (testsprite2 runs at 3400 FPS vs 3100 FPS)
This will need tweaking to fix the Windows RT build.

--HG--
rename : src/render/direct3d11/SDL_render_d3d11.cpp => src/render/direct3d11/SDL_render_d3d11.c
2014-03-10 01:51:03 -07:00
Sam Lantinga
211b54deef Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
David Ludwig
02d00dd07d WinRT: d3d11 blend mode bug fixes
The destination target's alpha wasn't getting set correctly in many cases.  Among other problems, this prevented some alpha-blended textures from displaying correctly in Windows Phone 8's multitasking screen.

The d3d11 renderer now uses the same blending settings found in the d3d9 renderer.
2013-12-30 11:59:04 -05:00
David Ludwig
ad7caf3267 WinRT: minor header file usage cleanup in the d3d11 renderer 2013-12-26 11:04:35 -05:00
David Ludwig
fd6014b877 WinRT: simplified the d3d11 vertex shader a bit
The projection and view matrices are now computed ahead of time, as they both get computed in the same spot, and typically not often.  If this does, however, become a performance problem later on, this change can always be reverted.
2013-12-26 11:03:43 -05:00
David Ludwig
a408c61485 WinRT: implemented SDL_RenderSetClipRect for the d3d11 renderer 2013-12-26 10:18:33 -05:00
David Ludwig
32da5a8500 WinRT: corrected a minor error in an end-of-file comment 2013-12-25 23:46:19 -05:00
David Ludwig
51e5bb14f4 WinRT: minor rotation/orientation code cleanup in the d3d11 renderer 2013-12-25 23:45:07 -05:00
David Ludwig
ccae63527b WinRT: removed a bit of dead d3d11 code 2013-12-25 23:25:25 -05:00
David Ludwig
0dabf1d751 WinRT: d3d11 compiled-shader code cleanup
I'm surprised this code even compiled, before this change.  It did, but regardless, here's a cleanup.
2013-12-25 22:27:58 -05:00
David Ludwig
481dfa1d54 WinRT: made sure d3d11 debug mode doesn't get enabled by default
D3D11 debug mode got inadvertently enabled, in all cases, via changeset c0e68f3.  This change reverts that.
2013-12-25 22:05:18 -05:00
David Ludwig
c836d9ffc2 WinRT: compiled the d3d11 renderer's shaders into SDL itself
Previously, the shaders would get compiled separately, the output of which would need to be packaged into the app.  This change should make SDL's dll be the only binary needed to include SDL in a WinRT app.
2013-12-25 21:39:48 -05:00
David Ludwig
eb6020c6bc WinRT: added a TODO note regarding texture-[un]locking in the d3d11 renderer 2013-12-25 14:20:40 -05:00
David Ludwig
79d7f0dee2 WinRT: renamed d3d11-internal struct, SDL_VertexShaderConstants, to just VertexShaderConstants
This is primarily to keep naming consistent with other shader-bound structs.
2013-12-25 14:17:49 -05:00
David Ludwig
1f740f328b WinRT: moved contents of the d3d11 renderer's header file into its implementation file 2013-12-25 13:13:15 -05:00
David Ludwig
bbd8e31737 WinRT: simplified a potentially-common error message from D3D11_SetRenderTarget 2013-12-25 13:00:41 -05:00
David Ludwig
788d61ec6b WinRT: removed an unnecessary use of std::string in the d3d11 renderer 2013-12-25 12:58:37 -05:00
David Ludwig
1b770842fc WinRT: utilized SDL_SetError's return value in the d3d11 renderer 2013-12-25 12:52:16 -05:00
David Ludwig
5fac22c332 WinRT: minor d3d11 code cleanups 2013-12-25 12:48:47 -05:00
David Ludwig
255cf99d66 WinRT: made d3d11-spawned error messages trickle down
Some error messages had the potential to be overwritten/obscured.
2013-12-25 12:47:39 -05:00
David Ludwig
326ecc4ed6 WinRT: made d3d11-spawned error messages include the function name of failed calls 2013-12-25 12:43:26 -05:00
David Ludwig
f5ca4203fb WinRT: better rendering performance via D3D11_USAGE_DYNAMIC 2013-12-22 21:13:35 -05:00
David Ludwig
1df5dccd9a WinRT: fixed bug: SDL_RenderReadPixels didn't work with certain orientations of the physical display 2013-12-10 22:34:08 -05:00
David Ludwig
23f6ff5673 WinRT: added support for SDL_HINT_RENDER_SCALE_QUALITY 2013-11-01 22:54:39 -04:00
David Ludwig
69cd08bc13 WinRT: made the Direct3D 11.x 'Debug Layer' be enable-able in any app via a hint
To enable the Debug Layer, set the hint, SDL_HINT_RENDER_DIRECT3D11_DEBUG to '1'.

The Debug Layer will be turned off by default, both in Release and Debug builds (of SDL).
2013-10-25 20:31:43 -04:00
David Ludwig
1dfe43a8b1 WinRT: fixed a line-rendering bug in the D3D 11.1 backend 2013-09-16 00:31:01 -04:00
David Ludwig
d5622eb2df WinRT: made rendering work with orientation changes on Windows Phone
Pointer event geometry still needs to be adjusted on Windows Phone, to note.
2013-08-28 15:27:01 -04:00
David Ludwig
591af1b9f8 WinRT: removed a comment regarding a dealt-with TODO 2013-08-28 12:45:43 -04:00
David Ludwig
a5667cf3ba WinRT: rendering orientation fixes for Windows Phone, part 1
This change should allow apps to render correctly in Portrait mode, at minimum,

Support for orientation changes is pending.

Thanks to Pierre-Yves for assistance!
2013-08-28 12:38:30 -04:00
David Ludwig
179a4d0367 WinRT: fixed a potential memory-related crash in SDL_Renderer on Windows Phone 2013-08-28 11:46:02 -04:00
David Ludwig
5248a0701d WinRT: experimental and preliminary support for XAML-based overlays on Windows 8/RT
The XAML support here is still rudimentary.  Bugs do exist.  You've been warned.

XAML support in Windows Phone 8 is not yet available (in SDL/WinRT).
2013-08-27 21:21:09 -04:00
David Ludwig
1cfe2a9412 WinRT: made all WinRT-related TODO comments use the same prefix, "TODO, WinRT" 2013-08-27 13:03:43 -04:00
David Ludwig
45a13dac17 WinRT: renamed SDL_SYSWM_WINDOWSRT to SDL_SYSWM_WINRT
This is part of an overall effort to use the name, "WinRT", rather than "WindowsRT" (or "Windows RT"), as the shorthand name often seems to mean something different than the longhand name.  (WinRT is an API, Windows RT is a product name)
2013-08-27 11:44:43 -04:00
David Ludwig
a49f0e4f74 WinRT: added a stub implementation of UpdateClipRect to the D3D 11.1 renderer 2013-08-13 20:33:15 -04:00
David Ludwig
52a3b9b1f5 WinRT: made SDL's inner WinRT CoreWindow be accessible to non-C++/CX code, in theory 2013-04-16 23:40:03 -04:00
David Ludwig
e40e111591 WinRT: added render-to-texture support for D3D 11.1, via SDL_SetRenderTarget 2013-04-13 23:03:46 -04:00
David Ludwig
b74856f7b7 WinRT: added texture channel color-modulation support for D3D 11.1
--HG--
rename : src/render/direct3d11/SDL_D3D11_PixelShader_TextureCopy.hlsl => src/render/direct3d11/SDL_D3D11_PixelShader_TextureColored.hlsl
2013-04-07 22:35:58 -04:00
David Ludwig
b1b2ba3f09 WinRT: removed a bit of unused code from the D3D 11.1 renderer 2013-04-02 00:21:01 -04:00
David Ludwig
b7887dd326 WinRT: added rotation support to SDL_RenderCopyEx via D3D 11.1 2013-04-02 00:09:49 -04:00
David Ludwig
5230205e27 WinRT: implemented SDL_RenderCopyEx, w/ SDL_RendererFlip support, in D3D 11.1 2013-04-01 22:33:37 -04:00
David Ludwig
33ab98ccee WinRT: implemented SDL_RenderReadPixels in Direct3D 11.1 2013-04-01 21:34:47 -04:00