Commit graph

7350 commits

Author SHA1 Message Date
Sam Lantinga
492dbb3124 Fixed XInput haptic support on Windows 8
It turns out the XBox 360 controller driver never reports force feedback capability, so we'll try to set 0 state and see if that succeeds.
2014-03-29 12:29:38 -07:00
Sam Lantinga
07f74cbbcc Fixed assertion loading button.bmp in testgamecontroller 2014-03-29 12:27:27 -07:00
Sam Lantinga
b2f1b89fbd Added testrumble to the Visual Studio 2013 solution 2014-03-29 12:27:02 -07:00
Ryan C. Gordon
ee2b15aebc Raspberry Pi builds should upload as .tar.xz instead of .tar.bz2.
Makes the archive about 40-50% smaller!

--HG--
extra : rebase_source : adac7393b54fb8c05cb868858c968da87f3d7199
2014-03-28 09:59:32 -04:00
Ryan C. Gordon
c36617ceb6 Changed a C++ single-line comment to /* */ style. 2014-03-26 16:19:52 -04:00
Pierre-Loup A. Griffais
6f15c8a12c Remove the RaiseWindow call from OnWindowRestored for now.
It seems like a net improvement in all the scenarios Sam and I could
think of, and looking at hg history it was added for fullscreen
window management specifically. Much of that code has changed since
then, but maybe it needs to stay there for that and simply be moved
to a fullscreen condition check.

It would solve this issue:

https://bugzilla.libsdl.org/show_bug.cgi?id=2439

As well as cases where on SteamOS, we hide/show specific Steam
overlay windows while expecting them to stay in the background, since
changing the window stacking order really angers the NVIDIA driver.

CR: Sam.
2014-03-26 12:54:51 -07:00
Brandon Schaefer
a08cc19712 Ignore unused mir event functions, need headers in Ubuntu 14.04 to use them. 2014-03-25 15:24:43 -07:00
Brandon Schaefer
61f0c01d38 Remove two unused variables, causing compiler warnings. 2014-03-25 15:18:18 -07:00
Brandon Schaefer
fdf9b30018 Re-enable Mir/Wayland support now that 2.0.3 has been released. 2014-03-25 14:33:34 -07:00
David Ludwig
0755238527 WinRT: Call IDXGIDevice3::Trim before app-suspend, as required on Windows 8.1
Thanks to Sylvain Becker for pointing this out!
2014-03-24 22:51:03 -04:00
David Ludwig
710797c3dd WinRT: Line ending fixes (CRLF to LF) 2014-03-24 22:12:38 -04:00
Gabriel Jacobo
e79e6a8637 Fixes #2456, controllermap's undo does not work correctly (by Bogdan Marinov) 2014-03-24 11:42:09 -03:00
Gabriel Jacobo
5d949ece7b Emit SDL_RENDER_DEVICE_RESET on Android when the GLES context is recreated 2014-03-24 11:04:42 -03:00
Ryan C. Gordon
b515741ed4 Added an assert to help static analyzer. 2014-03-24 07:12:26 -04:00
Sam Lantinga
c0e9a9afaf Added an event SDL_RENDER_DEVICE_RESET, which is triggered on Direct3D 11 when the device has been lost and all textures need to be recreated. 2014-03-23 23:09:22 -07:00
Sam Lantinga
4d02b5b07d Fixed warning on Mac OS X 2014-03-23 23:08:26 -07:00
Sam Lantinga
ce92ee5307 Fixing Alt-Enter handling, submitted by Nader Golbaz
I encountered a little issue: DXGI monitors application's message queue and this behavior interferes with SDL if the application already handles Alt-Enter sequence. I think it is necessary to disable this behavior.
bb174540%28v=vs.85%29.aspx
2014-03-23 22:53:50 -07:00
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