Commit Graph

373 Commits

Author SHA1 Message Date
David Ludwig
3b082a24b3 Fixed broken rotation detection routines on WinRT
Rotation detection and handling should now work across all, publicly-released,
WinRT-based platforms (Windows 8.0, Windows 8.1, and Windows Phone 8.0).
2014-03-15 14:54:23 -04:00
David Ludwig
40ab193a0d Fixed a crash on Windows Phone 8 that occurred after rotating a device
This changeset prevents IDXGISwapChain::ResizeBuffers from being invoked on
Windows Phone 8, a function that isn't available on the platform (but is
available on other Windows platforms).  The call would fail, which ultimately
led to a crash.

This changeset also attempts to make sure that the D3D11 swap chain is created
at the correct size, when using Windows Phone 8.

Still TODO: make sure rotation-querying works across relevant Windows
platforms (that support Direct3D 11.x).
2014-03-15 13:27:18 -04:00
Sam Lantinga
b0e0446659 Added missing copyright notices 2014-03-13 21:21:26 -07:00
Sam Lantinga
6800e72d96 Fixed the copyright date on files contributed by David Ludwig 2014-03-13 00:40:08 -07:00
David Ludwig
4ba15b7979 Merged various WinRT build fixes 2014-03-12 12:12:20 -04:00
David Ludwig
55712a534c Fixed various build and runtime errors when using WinRT with VS2012. 2014-03-12 11:57:15 -04:00
Sam Lantinga
846b841569 Fixed compiling Windows RT code on Visual Studio 2013 2014-03-12 07:26:07 -07:00
David Ludwig
3195c8a91a 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.
2014-03-11 12:40:31 -04:00
David Ludwig
6183af20ef Made VS2012 build the D3D11 renderer
This change is currently limited to Win32/Windows-Desktop builds.  Build fixes
for WinRT + VS2012 are still pending.
2014-03-10 22:53:03 -04:00
Sam Lantinga
757405f2e2 Fixed D3D9 initialization on Windows 8, which doesn't have D3DX 2014-03-10 17:19:19 -07:00
Sam Lantinga
ba9226f22c Implemented fullscreen <-> windowed transition on Windows 8 2014-03-10 15:00:59 -07:00
Sam Lantinga
e4b5491e76 Fixed line endings 2014-03-10 14:35:37 -07:00
Sam Lantinga
279247db34 Fixed creating the rendering context on a specific device 2014-03-10 12:49:15 -07:00
Sam Lantinga
4d18b48a5b Implemented YV12 and IYUV texture support for the D3D11 renderer 2014-03-10 05:44:34 -07:00
Sam Lantinga
bceba2662d Minor style tweaks 2014-03-10 02:13:44 -07:00
Sam Lantinga
6b5a5ea12a 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.
2014-03-10 01:51:03 -07:00
Sam Lantinga
6de1873c6f Fixed renderer flags to include support for target textures after the renderer is created. 2014-03-09 22:48:38 -07:00
Sam Lantinga
0ae88759fb Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
32547d0c59 Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
Gabriel Jacobo
296eeedbcc Improve window recreation logic in OpenGL* renderers 2014-02-27 20:21:46 -03:00
Gabriel Jacobo
0b4a7a6d0d Fixes #2308, recreate window if GL requirements for the renderer are not met
If the window has been created with values for SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION not matching those
required by the renderer, attempt to recreate the window.
This is needed on platforms where both GL and GLES 1/2 surfaces are supported
by the video backend, requiring that the window be recreated when switching
between context types.
2014-02-25 17:42:34 -03:00
David Ludwig
71967374d7 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
8702636c40 WinRT: minor header file usage cleanup in the d3d11 renderer 2013-12-26 11:04:35 -05:00
David Ludwig
a4caf2df88 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
82452cc1b0 WinRT: implemented SDL_RenderSetClipRect for the d3d11 renderer 2013-12-26 10:18:33 -05:00
David Ludwig
91b45c3a8c WinRT: corrected a minor error in an end-of-file comment 2013-12-25 23:46:19 -05:00
David Ludwig
337bf4817a WinRT: minor rotation/orientation code cleanup in the d3d11 renderer 2013-12-25 23:45:07 -05:00
David Ludwig
8038f0abe9 WinRT: removed a bit of dead d3d11 code 2013-12-25 23:25:25 -05:00
David Ludwig
0ab5b2e9fa 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
931f21a162 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
ecb3e116ad 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
b2af020432 WinRT: added a TODO note regarding texture-[un]locking in the d3d11 renderer 2013-12-25 14:20:40 -05:00
David Ludwig
053ce13c58 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
75b6ebed62 WinRT: moved contents of the d3d11 renderer's header file into its implementation file 2013-12-25 13:13:15 -05:00
David Ludwig
c0f5f2e58f WinRT: simplified a potentially-common error message from D3D11_SetRenderTarget 2013-12-25 13:00:41 -05:00
David Ludwig
a11653b075 WinRT: removed an unnecessary use of std::string in the d3d11 renderer 2013-12-25 12:58:37 -05:00
David Ludwig
333c827831 WinRT: utilized SDL_SetError's return value in the d3d11 renderer 2013-12-25 12:52:16 -05:00
David Ludwig
48c72ea3c7 WinRT: minor d3d11 code cleanups 2013-12-25 12:48:47 -05:00
David Ludwig
6d89d46b02 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
4e3a952407 WinRT: made d3d11-spawned error messages include the function name of failed calls 2013-12-25 12:43:26 -05:00
David Ludwig
e7fd02d52b WinRT: better rendering performance via D3D11_USAGE_DYNAMIC 2013-12-22 21:13:35 -05:00
CarniBlood
fbffbaf12e fixed gles/gles2 renderer creation fail on Android when default major/minor version doesn't match 2013-12-19 06:01:18 +09:00
Sam Lantinga
7eb65fd8d2 Fixed crash if the input data pitch is larger than the locked texture pitch 2014-02-25 10:04:49 -08:00
Gabriel Jacobo
797a5bf665 Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel Bünzli) 2014-02-24 18:57:22 -03:00
Sam Lantinga
634b16cfd6 Fixed infinite recursion in D3D_Reset() 2014-02-20 21:07:56 -08:00
Sam Lantinga
67c2c9e664 Fixed resetting the current render target if the D3D device is reset while using a non-default render target. 2014-02-17 22:20:33 -08:00
Sam Lantinga
21707536ae Fixed crash if render target textures are used while the device is lost 2014-02-10 13:40:02 -08:00
Sam Lantinga
bac409c888 Recreate render target textures when the D3D device is being reset, and notify the application using the SDL_RENDER_TARGETS_RESET event when this happens. 2014-02-10 10:02:51 -08:00
Sam Lantinga
10deb7fb9f Fixed bug 2385 - error: unknown type name 'IDirect3DDevice9'
Sandu Liviu Catalin

I'm unable to compile the latest SDL (directly from the repository) even though I disabled every DirectX option since I don't need DirectX.

I allways het these errors:
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1897:1: error: unknown type name 'IDirect3DDevice9'
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1898:25: error: unknown type name 'SDL_Renderer'
2014-02-09 01:56:41 -08:00
Sam Lantinga
96705398c1 Fixed bug 2354 - [ES 2.0] SDL_RenderClear clears render target with wrong color
ny00

SDL_RenderClear clears a render target with the wrong color, if the opengles2 renderer driver is used and the target texture's format is SDL_PIXELFORMAT_ARGB8888.

The bug is *not* reproduced if SDL_PIXELFORMAT_ABGR8888 is used as the texture format (the first from the renderer's list).
It is further not reproduced using any of the following renderer drivers: opengl, opengles (apparently powered by Gallium3D), software.
Finally, the correct color can be drawn using SDL_RenderFillRect (instead of SDL_RenderClear).

A few details about the current setup:
- OS: Ubuntu 12.04 for x86_64
- GPU: GeForce GTX 460
- GPU driver version: 331.20-0ubuntu1~xedgers~precise1 (from the xorg-edgers PPA)


---

Seth Williams

Sam,

It appears that the clear just needs to take the render target format into consideration.

Seth.
2014-02-09 01:49:01 -08:00