Commit graph

7333 commits

Author SHA1 Message Date
David Ludwig
0e9811178e WinRT: Implemented SDL_ShowMessageBox for Windows 8.x/RT hosts
This change does not include message box support for Windows Phone 8, which does
not offer the same message box APIs that Windows 8.x/RT does.

--HG--
extra : rebase_source : 2047c915117c6711c7cfdc2c1ba3f89450435b8e
2014-03-23 22:07:01 -04:00
Ryan C. Gordon
11f6490bf5 Tossed in some SDL_asserts to make static analyzer happier.
(Most of its complaints here are that these ints can be negative, although
they wouldn't been in sane cases. Checking sanity is what assertions do, and
it placates the analyzer appropriately.)

--HG--
extra : rebase_source : 26cde4bbb2ae5fc232d49493c5b9775dcb52c9d7
2014-03-23 18:56:47 -04:00
David Ludwig
519432a55f D3D11: Fixed a crash after a GPU device-reset on Win32 2014-03-23 16:08:32 -04:00
David Ludwig
48ecbf8800 D3D11: Added code to handle GPU-device-removed scenarios
These scenarios can happen when a GPU is switched, its driver updated, or in
some virtual machines (such as Parallels) are suspended and then resumed.  In
these cases, all GPU resources will already be lost, and it's up to the app to
recover.

For now, SDL's D3D11 renderer will handle this by freeing all GPU resources,
including all textures, and then sending a SDL_RENDER_TARGETS_RESET event.
It's currently up to an app to intercept this event, destroy all of its
textures, then recreate them from scratch.
2014-03-23 13:48:16 -04:00
Sam Lantinga
2876cd7415 Better keyboard detection when some of the keys are remapped, thanks to Lewis Wall 2014-03-23 09:44:04 -07:00
David Ludwig
9898ec50d5 WinRT: Miscellaneous app-backgrounding/restoring event fixes and additions
SDL_WINDOWEVENT_FOCUS_LOST is now sent when an app's native window is hidden.
Likewise, SDL_WINDOWEVENT_FOCUS_GAINED is sent when an app's window is shown.
This mimicks behavior seen on iOS and Android.

SDL_WINDOWEVENT_MINIMIZED and SDL_WINDOWEVENT_RESTORED are now sent when the
app's native window is hidden and shown.  Previously, these were sent when an
app was suspended and resumed.  On Windows 8.x/RT, an app may be sent to the
background without being suspended, which previously meant that
SDL_WINDOWEVENT_MINIMIZED might never have been sent.  (On Windows Phone 8,
however, this seems to be different, whereby apps sent to the background appear
to always get suspended.)
2014-03-23 11:04:47 -04:00
David Ludwig
6fb0bd3874 WinRT: Made app-backgrounded events get sent at separate, distinct times.
SDL_APP_WILLENTERBACKGROUND is now sent as soon as the app is told that it is
about to go to the background.  SDL_APP_DIDENTERBACKGROUND is sent via a WinRT
'deferral operation', which is how WinRT gives apps a bit of extra time
(multiple seconds worth) to prepare for an app-backgrounding.

The distinction may be important as the deferral operation's code is always run
in a separate thread.  For Direct3D-only apps, this means that between the
two SDL app-backgrounded events, SDL_APP_WILLENTERBACKGROUND will be the only
one run from the main thread.  Given that some WinRT operations can only be done
on the main thread (operations to the CoreWindow fall into this category), this
could be important.

It is important to note that pre-deferral code may only have a very short bit of
time to execute code, less so than code run in the deferral operation (where
SDL_APP_DIDENTERBACKGROUND is sent from), which usually gets several seconds to
run.
2014-03-23 08:56:52 -04:00
David Ludwig
325241ac85 WinRT globals cleanup: Removed WINRT_GlobalSDLVideoDevice 2014-03-22 21:08:05 -04:00
David Ludwig
65440f863b WinRT: Got OpenGL ES 2 working with the latest version of ANGLE/WinRT.
SDL/WinRT did have support for OpenGL ES 2 via an older version of ANGLE/WinRT,
however its API changed a few months ago, and SDL/WinRT would crash when trying
to use it.  It would also occasionally crash when using the older version.

This changeset should make SDL/WinRT work with the latest version, as
available via MS Open Tech's git repository of it at
https://github.com/msopentech/angle

Older versions of ANGLE/WinRT (from either https://github.com/stammen/angleproject
or https://bitbucket.org/DavidLudwig/angleproject) will need to be updated to
MS Open Tech's latest version.

--HG--
extra : rebase_source : 4dbab8a703aaa1d9820bd45297ebbb1ccc895883
2014-03-22 20:48:18 -04:00
Ryan C. Gordon
a433ec8983 Static analysis fix: more cleanups of unused variables, etc, in blitters. 2014-03-21 10:40:15 -04:00
Ryan C. Gordon
3fcb7daf2b Static analysis fix: more dead stores. 2014-03-21 00:57:43 -04:00
Ryan C. Gordon
1f04999dcd Patched to compile on C89 compilers, removed more streamer code. 2014-03-20 18:00:41 -04:00
Ryan C. Gordon
ebc9d00ccb Static analysis fix: clean up unused variables and dead stores in blitters. 2014-03-20 17:55:24 -04:00
Ryan C. Gordon
828d505ab7 #ifdef'd out the audio streamer code.
It's been hardcoded out forever now, but I've now forcibly removed it with
the preprocessor so static analysis doesn't complain about it for now.

Eventually I want to rewrite or remove this code.
2014-03-20 17:00:33 -04:00
Ryan C. Gordon
45e017fadd Static analysis fix: Removed unused variable.
(We don't care if closing the device fails anyhow).

--HG--
extra : histedit_source : 10cc228c321d46e93ff27225d8cacf91fbf5fa30
2014-03-20 16:56:37 -04:00
Ryan C. Gordon
f0639e7060 Static analysis fix: uninitialized data.
(This is Clang not knowing that SDL_SetError() always returns -1.)
2014-03-20 16:54:20 -04:00
Ryan C. Gordon
1cf04be2fe Static analysis fix: uninitialized data.
(Clang doesn't know that "_this" was already checked for NULLness elsewhere.)
2014-03-20 16:25:30 -04:00
Ryan C. Gordon
d8bed6eede Static analysis fix: uninitialized value.
(A false positive: clang doesn't know SDL_SetError() always returns -1.)
2014-03-20 16:23:18 -04:00
Ryan C. Gordon
aad162873a Static analysis fix: leaking Objective-C object. 2014-03-20 16:05:57 -04:00
Ryan C. Gordon
a4908f6b1b Static analysis fix: dereference of a NULL pointer. 2014-03-20 11:22:57 -04:00
Ryan C. Gordon
dc1ff19a6a Static analysis fix: let clang know _this->displays isn't NULL.
--HG--
extra : histedit_source : 99316ad09963ca7e5928612b373cbb83dfda8530
2014-03-20 11:14:02 -04:00
Ryan C. Gordon
a23e431952 Static analysis fix: division by zero.
--HG--
extra : histedit_source : 6f8f18284e016f09e4950279524047f97da0294a
2014-03-20 11:14:44 -04:00
Ryan C. Gordon
b006893d9c Static analysis fix: uninitialized variables.
This is actually a false-positive, in this case, since Clang doesn't know
 that SDL_SetError() only ever returns -1. Feature request to improve that,
 with explanation about these specific SDL patches, is here:

   http://llvm.org/bugs/show_bug.cgi?id=19208

--HG--
extra : amend_source : 7f0edf8fe0831e961cf800278174eebe915b3974
extra : histedit_source : 6c84fc38936198a2208e3e66b55130eb63262990
2014-03-20 10:41:47 -04:00
Ryan C. Gordon
01e9ab7668 Static analysis fix: Fixed leaking Objective-C object.
--HG--
extra : histedit_source : 0da11a53d41a0313aad9dc207f6b65ac5644128d
2014-03-20 10:04:23 -04:00
Ryan C. Gordon
9fd0bfe53f Static analysis fix: bad release.
(object is already init'd at this point, so -[obj init] destroys
 existing reference count.)

--HG--
extra : rebase_source : 31469af85f9f02d0697fc91d16fbb59834d86849
2014-03-19 23:19:34 -04:00
Andreas Schiffler
5c3a763f09 Fix visualstudio build break introduced by changeset 8645 2014-03-19 21:48:32 -07:00
Andreas Schiffler
721340f510 Add input validation to SDL_getenv/SDL_setenv; update Stdlib testsuite; add Hints testsuite 2014-03-19 21:39:55 -07:00
Ryan C. Gordon
4dd6e749db Minor comment cleanups in checker-buildbot.sh 2014-03-19 22:43:30 -04:00
Ryan C. Gordon
320c2fa386 Static analysis fix: division by zero. 2014-03-19 18:25:21 -04:00
Ryan C. Gordon
db491f9a33 Static analysis fix: Value stored to '[bcd]' is never read. 2014-03-19 16:55:38 -04:00
Ryan C. Gordon
3c3e834e3f Static analysis fix: "Value stored to 'p' is never read" 2014-03-19 16:52:26 -04:00
Ryan C. Gordon
e66b7588ad Don't overwrite SDL_dynapi.h in checker-buildbot.sh. 2014-03-19 16:02:25 -04:00
Ryan C. Gordon
c40596908d Make checker-buildbot.sh work just about anywhere Clang is installed. 2014-03-19 15:25:27 -04:00
Ryan C. Gordon
1adad7a85d Reenable static builds for now with static analysis. 2014-03-19 13:22:09 -04:00
Ryan C. Gordon
4e85b2db83 Buildbot static analysis script: use configure script instead of cmake. 2014-03-19 03:29:14 -04:00
Ryan C. Gordon
c02d339a3b Just build shared libraries for static analysis.
Building the static libs just does the same work twice.
2014-03-19 03:04:04 -04:00
Ryan C. Gordon
d728e934bf Added a script to let buildslaves run Clang static analysis. 2014-03-19 00:58:32 -04:00
Ryan C. Gordon
ba24873506 Fixed SDL_HapticNewEffect() failing on various DirectInput devices. 2014-03-18 17:16:28 -04:00
Ryan C. Gordon
7721c23652 Fixed PS4 game controller config on Windows. 2014-03-18 12:53:01 -04:00
Ryan C. Gordon
1c0cf697c4 Whitespace fix. 2014-03-18 12:52:51 -04:00
Ryan C. Gordon
14e7c1e341 controllermap: Don't treat SDL_HAT_CENTERED as a valid input.
--HG--
extra : rebase_source : d3d69e6f0f44f04fb8bf910b5888a5040be579d3
2014-03-18 12:33:57 -04:00
David Ludwig
c984e9107a Fixed a build error in SDL_platform.h when using Code Blocks and MinGW
winapifamily.h, a header file specific to Microsoft's Windows 8 SDK, wasn't
getting found, which was leading to a build error.

--HG--
extra : rebase_source : 59ca0a462a0c2bb578d70553a53e9421f6cfb926
2014-03-18 12:08:49 -04:00
Ryan C. Gordon
15dc860cfe Fixed SDL_HapticOpenFromJoystick() with DirectInput devices. 2014-03-17 19:11:18 -04:00
Sam Lantinga
e4f4a38c99 Added tag release-2.0.3 for changeset 704a0bfecf75 2014-03-15 19:31:20 -07:00
Sam Lantinga
d83e91f738 Fixed iOS build 2014-03-15 19:30:52 -07:00
Sam Lantinga
c2e37c48e7 Added tag release-2.0.3 for changeset f285b9487756 2014-03-15 16:48:32 -07:00
Sam Lantinga
993135ec8b Added a patch note for 2.0.3 2014-03-15 16:43:58 -07:00
Sam Lantinga
dfd9c3a58e Fixed bug 2450 - Crosscompiling for Win32 with MinGW fails due to WM_UNICHAR undeclared 2014-03-15 16:32:45 -07:00
Sam Lantinga
ecc7d16d69 Only show the window if it's supposed to be shown. 2014-03-15 16:27:06 -07:00
Ryan C. Gordon
598897b601 Mac: Make sure window is still showing when we exit a fullscreen space.
--HG--
extra : histedit_source : 59238ebf154158241e31d46137ff70fd81f20d94
2014-03-15 15:35:15 -04:00