Commit Graph

10682 Commits

Author SHA1 Message Date
Sam Lantinga
ef7c0b7e35 Added a hint to enable the screensaver by default 2014-02-28 14:23:41 -08:00
Ryan C. Gordon
cd05b015bc Disable the screensaver by default.
Fixes Bugzilla #2218.
2014-02-27 22:06:41 -05:00
Gabriel Jacobo
296eeedbcc Improve window recreation logic in OpenGL* renderers 2014-02-27 20:21:46 -03:00
Jørgen P. Tjernø
532dccfbc1 Mac: Forgot return value in last commit. 2014-02-26 16:27:03 -08:00
Jørgen P. Tjernø
6492cbd011 Mac: Don't disassociate cursor if window is moving / doesn't have focus.
Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
2014-02-26 16:10:52 -08:00
Jørgen P. Tjernø
027b16bfb4 Mac: Redo cursor warp handling.
This fixes bugs related to getting unnaturally large xrel/yrel for
SDL_MOUSEMOTION after warps and enabling / disabling relative mode.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=1836
2014-02-26 11:35:02 -08:00
Jørgen P. Tjernø
d348541bf0 Mac: Improve moving relative mode windows.
This makes it possible to move windows by their title bar, even if they're in
relative mode, if you click the title bar when the window does not have focus.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
2014-02-25 17:27:41 -08:00
Jørgen P. Tjernø
2ccfd3e029 Mac: Fix error message for haptic subsystem.
We were calling SDL_Error instead of SDL_SetError when the haptic subsystem
wasn't initialized.
2014-02-25 17:25:49 -08:00
Jørgen P. Tjernø
50c4b640c0 Mac: Immediately update current OpenGL context's shape.
Previously we were postponing our -[NSOpenGLContext update] call to the next
SDL_GL_SwapWindow, even if the context was current on the current thread. This
changes it so that we will do the update immediately if it's the current
context.

If you're rendering on another thread, you need to call SDL_GL_SwapWindow once
after a resize event to ensure your drawable will produce non-garbage data.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2339
2014-02-25 15:28:12 -08: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
f1438cb55e WinRT: simulate keyboard events on Windows Phone 8 back-button presses
Pressing the hardware back button on a Windows Phone 8 device will now cause SDL to emit a pair of key-down and key-up events, with the SDL scancode, SDL_SCANCODE_AC_BACK.

By default, if WinRT's native back-button-press events are not explicitly marked as 'handled', then Windows Phone will terminate the app.  More details on Microsoft's reasoning behind this can be found on MSDN, at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx

To mark back-button-press events as 'handled', set SDL_HINT_WINRT_HANDLE_BACK_BUTTON to 1.  Setting it to anything else will cause these events to not be marked as 'handled'.

Due to limitations in Windows Phone's APIs, SDL will emit a virtual key-up event immediately after the back button's key-down event is registered.  Unfortunately, Windows Phone 8 only allows one to register for back-button-press events, and not back-button-release events.
2014-01-26 08:06:36 -05:00
David Ludwig
dd661ff38c WinRT: added a means to display a privacy policy link via the Settings charm
This change is only relevant for Windows 8, 8.1, and RT apps, and only for those that are network-enabled.  Such apps must feature a link to a privacy policy, which must be displayed via the Windows Settings charm.  This is needed to pass Windows Store app-certification.

Using SDL_SetHint, along with SDL_HINT_WINRT_PRIVACY_POLICY_URL and optionally SDL_HINT_WINRT_PRIVACY_POLICY_LABEL, will cause SDL/WinRT to create a link inside the Windows Settings charm, as invoked from within an SDL-based app.

Network-enabled Windows Phone apps do not need to set this hint, and should provide some sort of in-app means to display their privacy policy.  Microsoft does not appear to provide an OS-integrated means for displaying such on Windows Phone.
2014-01-01 16:05:37 -05: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
32aff9ef57 WinRT: minor error cleanup regarding OpenGL init 2013-12-26 14:21:47 -05:00
David Ludwig
26f1b2240b WinRT: took out some dead comments from SDL_winrtopengles.cpp 2013-12-26 14:13:20 -05:00
David Ludwig
ec33828507 WinRT: fixed crash on ARM and x64 during OpenGL window init 2013-12-26 13:59:01 -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
96060da8b4 WinRT: prevented a potential race condition in the XInput backend
The race condition could've been triggered on device removal.
2013-12-25 14:42:38 -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
cc7718dccb WinRT: moved ill-performing XInput device-detection calls to a separate thread 2013-12-24 21:28:31 -05:00
David Ludwig
428a107fd5 WinRT: bug fix: game-controller/joystick button-down events weren't getting sent 2013-12-24 21:08:11 -05:00
David Ludwig
e7fd02d52b WinRT: better rendering performance via D3D11_USAGE_DYNAMIC 2013-12-22 21:13:35 -05:00
David Ludwig
9ddee1ffb6 WinRT: enabled OpenGL ES 2 support by default
A copy of ANGLE/WinRT is still needed to run OpenGL content, but is not needed to compile SDL/WinRT.
2013-12-21 10:08:11 -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
Sam Lantinga
e250736ffe Don't warp the mouse while we're doing a modal interaction 2014-02-24 23:09:35 -08:00
Sam Lantinga
1e8c71db5d Make sure we don't clip the cursor while clicking on the window title bar 2014-02-24 22:49:30 -08:00
Sam Lantinga
957110296c Fixed relative mouse mode with multiple windows.
The window cursor clipping will be taken care of when SDL_UpdateWindowGrab() is called.
2014-02-24 22:37:58 -08:00
Sam Lantinga
a87878b988 Added a bunch of missing windows messages 2014-02-24 22:36:24 -08:00
Jørgen P. Tjernø
7430bc9fe0 Mac: Fix inconsistent repeat of SDL_TEXTINPUT events on 10.7+
Due to the new "tap and hold" IME in Mountain Lion and above, we were getting
inconsistent repeat of SDL_TEXTINPUT events. Disabling that functionality (since
you can't see the popover anyway) solves this.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2387
2014-02-24 16:42:08 -08:00
Gabriel Jacobo
797a5bf665 Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel Bünzli) 2014-02-24 18:57:22 -03:00
Ryan C. Gordon
4c05677cbf CMake: Fixed build on Mac OS X. 2014-02-24 11:24:48 -05:00
Gabriel Jacobo
08e6695494 Zero out haptic linked list items on creation
(thanks to Turo Lamminen for the report!)
2014-02-24 10:25:02 -03:00
Gabriel Jacobo
684673dff4 Fixes #2417, memory leak in SDL_gamecontroller.c (thanks Leonardo!) 2014-02-24 10:00:10 -03:00