Commit Graph

5181 Commits

Author SHA1 Message Date
David Ludwig
18ca50d940 WinRT: fixed an invalid comment in SDL_GetPrefPath() (for WinRT) 2014-11-23 08:59:01 -05:00
David Ludwig
24f3efb13c WinRT: allowed 'roaming' and 'temp' folder paths to be retrieved on WinPhone 8.1
Windows Phone 8.0 either did not define, or provide access to, a 'RoamingFolder'
or 'TemporaryFolder' for apps to use.  Windows 8.0 and 8.1 do, as does
Windows Phone 8.1.  This change allows SDL-based Windows Phone 8.1 apps to
access these folders, via either the SDL_WinRTGetFSPathUNICODE() or
SDL_WinRTGetFSPathUTF8() functions.

SDL_GetPrefPath(), which on WinRT, is based on SDL_WinRTGetFSPathUTF8(), will
continue to return the app's 'local' folder, despite Windows 8.x
counterpart apps using the 'roaming' folder, in order to preserve compatibility
when 8.0-based Phone apps upgrade to 8.1-based Phone apps.
2014-11-23 08:52:10 -05:00
David Ludwig
ee8b8751ca Fixed bug 2726 - WinRT touches not setting 'which' field in virtual mouse events
This patch makes sure that any SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP, and
SDL_MOUSEMOTION events, as triggered by a touch event in a WinRT app, set the
event's 'which' field to SDL_TOUCH_MOUSEID.  Previously, this was getting set
to the same value as events from a real mouse, '0'.

Thanks to Diego for providing information on this bug, and to Tamas Hamor for
sending over a patch!
2014-11-22 21:13:46 -05:00
David Ludwig
574e2104c9 WinRT: made SDL_GetPlatform() return "WinRT" and not 'Unknown'
Thanks to Eric Wing for the heads-up on this!
2014-11-15 10:19:39 -05:00
David Ludwig
8bd7d187f4 WinRT: build fix for Visual C++ 2013 Update 4
Visual C++ 2013 Update 4 re-introduced the Sleep() function to WinRT apps (for
code that targets Windows 8.1 and Windows Phone 8.1).  This led to a build
error, as SDL was defining it's own Sleep() function (to make up for the lack
of a public Sleep() function).  The fix makes sure that SDL's custom Sleep()
function is only used when Windows' Sleep() is not available.

Many thanks go out to Sergiu Marian Gaina for the fix!
2014-11-15 10:12:36 -05:00
David Ludwig
4df353472a WinRT: fixed multi-touch bug whereby 2nd, 3rd, etc. fingers weren't moving
Only the first-pressed finger wpuld get reported as having moved (via SDL's
touch APIs).  Subsequently pressed fingers wouldn't report as being moved, even
though the OS was reporting (to SDL) that they had moved.
2014-11-09 14:20:53 -05:00
David Ludwig
6409f61890 WinRT: fixed crash when trying, and failing, to load the opengles2 renderer
The crash would occur when a WinRT app explicitly tried to create an
SDL_Renderer using the "opengles2" renderer (via SDL_HINT_RENDER_DRIVER), but
OpenGL ES 2 / ANGLE .dlls weren't packaged in the app.
2014-11-02 10:38:29 -05:00
David Ludwig
898c336f68 WinRT: updated an OpenGL-related code-comment 2014-11-02 09:02:01 -05:00
David Ludwig
9f8b82bde0 WinRT: expanded OpenGL ES 2 support to enable recent updates to ANGLE/WinRT
ANGLE for WinRT has at least two versions:
- an older version, which supports Windows 8.0 and 8.1.  This is currently
  the "winrt" branch in MSOpenTech's ANGLE repository (at
  https://github.com/msopentech/angle)
- a newer version, which drops support for Windows 8.0, but is under more
  active development (via MSOpenTech's "future-dev" branch), and which was
  recently merged into the ANGLE project's official "master" branch
  (at https://chromium.googlesource.com/angle/angle)

Both versions are setup using slightly different APIs.  SDL/WinRT will now
attempt to detect which version is being used, and configure it appropriately.
2014-11-02 08:47:05 -05:00
Ryan C. Gordon
50e0df35e1 Patched to compile on pre-C99 compilers. 2014-10-30 13:44:31 -04:00
Dmitry Rekman
840826c146 X11: Fixed SDL_GetGlobalMouseState() to work better with multimonitor configs.
Fixes Bugzilla #2770.

Thanks to Epic Games for contributing this fix.
2014-10-29 22:55:40 -04:00
Philipp Wiesemann
e4d80184c0 Fixed gamecontroller database sorting script not sorting the whole database.
The script was originally written for an SDL_gamecontrollerdb.h which had groups
of mappings separated by single lines starting with a "#". This was changed some
time ago to #endif/#if pairs. Because the script assumed only a single #endif in
the whole file it no longer worked correctly and only processed the first group.
2014-10-29 22:44:35 +01:00
Philipp Wiesemann
b7eb15acbc Removed unnecessary NULL check. 2014-10-29 22:41:01 +01:00
Philipp Wiesemann
a47443a61f Updated gamecontroller database sorting script to work with Python 3. 2014-10-29 20:35:21 +01:00
Philipp Wiesemann
85bb0cf8d1 Fixed SDL_AddHintCallback() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
Also added setting of error message for the other SDL_malloc() in this function.
2014-10-29 20:29:32 +01:00
Philipp Wiesemann
cf5c36917a Fixed bug 2647 - Memory leak in SDL_AddHintCallback function - SDL_hints.c
Nitz

Variable entry going out of scope leaks the storage it points to, at:

        /* Need to add a hint entry for this watcher */
        hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
        if (!hint) {
            return;
        }

Patch is attached.
2014-10-29 20:20:47 +01:00
Philipp Wiesemann
b93fb782e7 Added handling of NULL as input for SDL_GameControllerAddMapping(). 2014-10-26 23:28:45 +01:00
Philipp Wiesemann
f506b106fa Fixed SDL_GameControllerMappingForGUID() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID()
now either means "no mapping" (as before) or "no memory" (just crashed before).
2014-10-26 23:22:53 +01:00
Philipp Wiesemann
b2690cd072 Added handling of NULL as input for SDL_GameControllerMapping().
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
2014-10-26 17:53:16 +01:00
Philipp Wiesemann
e35f40e04a Removed two wrong documentation comments from gamecontroller source.
No replacement because correct documentation is already in SDL_gamecontroller.h.
2014-10-26 17:46:11 +01:00
Philipp Wiesemann
f9acf88916 Fixed wording in SDL_GameControllerAddMappingsFromRW() error message. 2014-10-26 17:44:00 +01:00
David Ludwig
e6d0ed34ff WinRT: more keyboard code cleanups
- made keycode listings a bit easier to read
- listed VK_ keycode names, where appropriate
- removed a few pieces of dead + commented-out code
- applied a common 'WINRT_' prefix to internal function names
2014-10-26 12:33:10 -04:00
David Ludwig
183be55350 WinRT: Fixed bug whereby key-detection code could call SDL_Log 2014-10-25 08:54:23 -04:00
David Ludwig
b7e6c450b1 WinRT: fallback to scancode key detection, if VirtualKey/VK detection fails 2014-10-25 08:50:41 -04:00
David Ludwig
d866c09bb8 WinRT: more keyboard code cleanups
- use SDL_arraysize where appropriate
- made long lines of debug-logging code span multiple lines, for easier reading
2014-10-25 08:43:51 -04:00
David Ludwig
7649e39bed WinRT: Fixed bug whereby a right-shift key might get reported as left-shift 2014-10-24 22:09:47 -04:00
David Ludwig
d3c265edf2 WinRT: minor keyboard code cleanup
An internally-used hash table was replaced with a plain switch statement.
2014-10-24 21:25:21 -04:00
Philipp Wiesemann
4b8f3325a0 Added new key codes from Android 4.4 (API 20) and 5.0 (API 21). 2014-10-24 19:50:29 +02:00
Brandon Schaefer
9641881d42 Remove unused variable. 2014-10-24 06:52:54 -07:00
Brandon Schaefer
7db5bc85bb Merge patch for bug 2750. Thanks Sylvain! 2014-10-24 06:50:09 -07:00
Philipp Wiesemann
ab7bcfc0a3 Fixed setting of screen saver state crashing on some version of Android.
Setting Window flags seems to affect Views and must be handled on UI thread.
2014-10-20 22:19:09 +02:00
Gabriel Jacobo
32120029aa Bug 2739 - [Android] No support for SDL_DisableScreenSaver by Martin Gerhardy 2014-10-20 10:10:39 -03:00
Philipp Wiesemann
fa7abca4ec Fixed bug 2476 - Allow custom main() arguments
rettichschnidi

I would like to pass custom arguments from my Java code (subclass of SDLActivity) to the native SDL2 binary.
2014-10-17 23:36:45 +02:00
Philipp Wiesemann
d4d1f23355 Fixed typo in source comment. 2014-10-17 23:26:02 +02:00
Sam Lantinga
5cc584ac32 Added a platform cleanup function for the Vivante video driver 2014-10-16 09:54:13 -07:00
Gabriel Jacobo
d9bcf961c1 [udev] Fixes #2654, ID_INPUT_KEY devices are ignored.
Also added some references to udev code where these flags are set.
2014-10-16 09:41:42 -03:00
Gabriel Jacobo
c3aa3618f7 [X11] Obey DISPLAY environment variable when selecting screen (Steaphan Greene)
Discussed in bug #2192, tested with Xvfb in dual head configuration.
2014-10-15 18:33:43 -03:00
David Ludwig
cb3ef93994 WinRT build fix 2014-10-15 15:50:35 -04:00
Sam Lantinga
a2b98844f2 Expanded the iMX6 video driver into a general Vivante video driver that works across multiple SoCs 2014-10-15 09:18:17 -07:00
Sam Lantinga
cf83cad757 Better error reporting for video drivers with less than full functionality. 2014-10-15 09:14:09 -07:00
Sam Lantinga
a06170f593 Fixed bug where EGL function pointers wouldn't get saved in optimized gcc builds 2014-10-15 09:13:36 -07:00
Sam Lantinga
67cbb818a0 Fixed spurious SDL error on shutdown if mouse capture isn't supported 2014-10-15 09:11:15 -07:00
Sam Lantinga
33e438b7be Fixed input device detection on systems that aren't running the udev daemon 2014-10-15 09:10:50 -07:00
Sam Lantinga
2af49b5e11 Fixed crash if the event subsystem didn't initialize properly 2014-10-15 09:09:57 -07:00
David Ludwig
d244d7c756 WinRT: fixed bug whereby offscreen-rendered content could get improperly rotated
Attributes on the host device's rotation were getting applied to offscreen
textures in an invalid manner.  This was causing some apps to look different,
depending on how the device was rotated.
2014-10-14 09:53:46 -04:00
Sam Lantinga
573933a9dd Fixed log typo 2014-10-13 14:10:41 -07:00
Sam Lantinga
bd3bb2468f Minor cleanups 2014-10-13 10:46:27 -07:00
Gabriel Jacobo
723a0bc355 [Android] Better fix for #2480, pause/resume audio 2014-09-18 11:03:34 -03:00
Ryan C. Gordon
4563873c18 Haptic: Deal with negative periodic magnitudes (thanks, Elias!).
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs

The periodic magnitude parameter of the SDL Haptic API is based on the Linux
 FF API, so it means they are not directly compatible:
    'dwMagnitude' is a 'DWORD', which is unsigned.

Fixes Bugzilla #2701.
2014-09-17 14:49:36 -04:00
Gabriel Jacobo
bcce626c90 [Android] Fixes #2480, music does not pause when process backgrounded
This modifies SDL_PauseAudio behavior to pause all audio devices instead of
just the default one (required on Android, at least for testmultiaudio on my
Nexus 4 which reported 2 audio devices).
It also changes SDL_PauseAudioDevice to retain the device lock from pause until
resume in order to save battery in mobile devices.
2014-09-17 11:41:12 -03:00