Commit Graph

10682 Commits

Author SHA1 Message Date
Ryan C. Gordon
1eb6627c4f Removed unused variable. 2015-03-19 23:45:34 -04:00
Ryan C. Gordon
35ea7a6c60 Make static analysis happy. 2015-03-19 23:44:47 -04:00
Ryan C. Gordon
5a6a48dfb0 Fixed a compiler warning on Visual Studio. 2015-03-19 23:39:53 -04:00
Ryan C. Gordon
c59cded03b Patched to compile on Windows. 2015-03-19 23:35:43 -04:00
Ryan C. Gordon
4b56f12266 Immediately minimize the goofy window in testaudiohotplug. 2015-03-19 22:20:12 -04:00
Ryan C. Gordon
c282471f28 Zero out the audio hotplug event structure, so the "padded" fields are sane.
Just in case we ever need those bits in the future.
2015-03-19 22:11:20 -04:00
Ryan C. Gordon
071bae1d10 PulseAudio: Hotplug support! 2015-03-19 22:08:12 -04:00
Ryan C. Gordon
373691d636 SDL_RemoveAudioDevice() should specify capture vs output.
This lets us reuse values between the two categories without conflicting, etc.
2015-03-19 15:43:00 -04:00
Ryan C. Gordon
610e8e6100 Removed the broken audio streaming code, other small cleanups. 2015-03-19 13:34:17 -04:00
Ryan C. Gordon
88f59ef370 Disconnected/broken/lost audio devices now continue to fire their callback.
The data produced by the callback is just thrown away and the audio thread
delays as if it's waiting for the hardware to drain.

This lets apps that rely on their audio callback firing regularly continue
to make progress to function as properly as possible in the face of disaster.
Apps that want to know that the device is really gone and deal with that
scenario can use the new hotplug functionality.
2015-03-19 13:27:10 -04:00
Ryan C. Gordon
a6a53d8930 Don't assert if an audio backend reports the same device disconnected twice. 2015-03-19 13:15:28 -04:00
Ryan C. Gordon
65670a3dd9 PulseAudio: Improved multidevice support.
Added capture device enumeration, report human-readable device name, other
cleanups.
2015-03-18 10:29:04 -04:00
Ryan C. Gordon
8fc13c2484 Bunch of reworking to how we manage audio devices.
Device enumeration now happens at startup and then is managed exclusively
through hotplugging instead of full redetection. The device name list now has
a unique "handle" associated with each item and SDL will pass this to the
backend so they don't have to figure out how a human readable name maps to
real hardware for a second time.

Other cleanups, fixes, improvements, plus all the audio backends updated to
the new interface...largely untested at this point, though.
2015-03-18 02:01:17 -04:00
Ryan C. Gordon
8dc3028044 Initial work on audio device hotplug support.
This fills in the core pieces and fully implements it for Mac OS X.

Most other platforms, at the moment, will report a disconnected device if
it fails to write audio, but don't notice if the system's device list changed
at all.
2015-03-16 02:11:39 -04:00
Ryan C. Gordon
2865754bd8 Changed some SDL_memset() calls to SDL_zero(). 2015-03-18 10:09:39 -04:00
Ryan C. Gordon
0984194bf7 Tweaked a couple comments, added some FIXMEs. 2015-03-18 10:09:23 -04:00
David Ludwig
bbf610ea8d WinRT: updated names, and references-to, various ANGLE/WinRT repositories 2015-03-18 12:03:32 -04:00
Ryan C. Gordon
d3525b5e42 Patched to compile on C89 compilers. 2015-03-18 10:05:36 -04:00
Ryan C. Gordon
6d3782cb49 PulseAudio: Added multiple device support, other cleanups.
Thanks to Dominik Frizel for most of the effort on this!

Fixes Bugzilla #2730.
2015-03-18 09:59:22 -04:00
Ryan C. Gordon
16e6ce9759 Fixed a compiler warning. 2015-03-18 00:56:33 -04:00
David Ludwig
388977ede4 WinRT: made OpenGL window-init work with latest round of ANGLE/WinRT updates
Various constants in ANGLE/WinRT, both in MSOpenTech's ms-master branch, and
in Google's branch, were changed again.  This change makes SDL/WinRT work with
them.

To note, the ms-master branch (of ANGLE) was updated via this merge:
bbd2eb0a9c (diff-d1377fbe747de154e1bfcf7221d3de67)
2015-03-17 19:45:47 -04:00
David Ludwig
4d6ae75723 WinRT: another ANGLE/OpenGL-initialization, error messaging tweak 2015-03-17 10:25:21 -04:00
David Ludwig
72c36417e7 WinRT: ANGLE/OpenGLES-initialization, error message improvements 2015-03-17 10:22:36 -04:00
Philipp Wiesemann
cb8c446d69 Updated name of assert type in test program. 2015-03-15 19:25:10 +01:00
Ryan C. Gordon
e72e4dae84 Cleaning out a silly coding style I used to use.
Changed all the "return (x);" lines to "return x;"
2015-03-13 12:20:17 -04:00
Ryan C. Gordon
21350d4865 Removed an unnecessary #ifdef. 2015-03-13 00:48:30 -04:00
Philipp Wiesemann
42985f8b4e Updated internal documentation comments. 2015-03-11 21:14:21 +01:00
Philipp Wiesemann
2d3e85e41f Windows: Fixed ignoring return value of internal function.
If the function WIN_ConvertUTF32toUTF8() failed (should currently not be
possible) a not terminated string would have been sent as text input event.

This also fixed converting characters more often than needed on key repetition.
2015-03-06 21:34:10 +01:00
Philipp Wiesemann
c58140a4b3 Emscripten: Fixed ignoring return value of internal function.
If the function Emscripten_ConvertUTF32toUTF8() failed (should currently not be
possible) a not terminated string would have been sent as text input event.
2015-03-06 21:29:25 +01:00
Philipp Wiesemann
e59e40b840 Emscripten: Partially fixed not removing key event callbacks if hint was used.
The key event callbacks were always removed from the same target although it is
possible to set them to different targets using the hint. This is only a partial
fix because it assumes that the hint is not changed to a different value later.
2015-03-06 21:26:37 +01:00
Ryan C. Gordon
a1b258c0a5 Fixed SDL_PRI?64 for 64-bit Linux.
64-bit Linux uses a "long" instead of "long long" for 64-bit ints.

Added a special-case this so SDL_PRI?64 doesn't trigger compiler warnings
when used with SDL's 64-bit datatypes on 64-bit Linux.
2015-03-02 21:36:45 -05:00
Alfred Reynolds
8f840757d7 SDL
- fix crash on OSX when removing a device. If the remove happened due to the CFRunLoopRunInMode call in SDL_SYS_JoystickDetect then we would delete the device right away, before SDL_SYS_JoystickUpdate could clean it up. So move the CFRunLoopRunInMode to after the cleanup logic, preventing this case. This does mean that adds and removes of joysticks now take 1 extra frame to show up.
2015-03-02 11:43:24 -08:00
David Ludwig
3382b8347e Fixed bug 2868 - SDL_FillRect can crash if surface's clip-rect is out-of-bounds
Thanks to John Skaller for the research into this, and for the fix!
2015-02-22 20:34:08 -05:00
Philipp Wiesemann
8947055cc3 Emscripten: Fixed out of range joystick device index after joystick disconnect.
After disconnecting a joystick the remaining kept their original device index.
This was not correct because the device index must be a number between 0 and
SDL_NumJoysticks(). It was fixed with ideas from SDL's joystick implementation
for Android. Some range checks were removed as the caller already checks them.
2015-02-22 23:21:32 +01:00
Philipp Wiesemann
331092ac44 Emscripten: Fixed sending button and motion events for not opened joysticks.
SDL_SYS_JoystickUpdate() was implemented incorrectly. For every call to it all
attached joysticks were checked. But actually only the given SDL_Joystick should
be checked then. This allowed sending broken events for attached but not opened
joysticks. It also checked the opened joysticks more often than actually needed.
2015-02-22 21:00:35 +01:00
Ryan C. Gordon
8b9d1a4a4a Fixed naming conventions in some SDL_assert types, added compat #defines.
Fixes Bugzilla #1997.
2015-02-21 00:33:25 -05:00
Ryan C. Gordon
1d50908bd0 Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!).
Fixes Bugzilla #2822.
2015-02-19 23:52:10 -05:00
Ryan C. Gordon
13a886b08d Windows: Added a FIXME. 2015-02-19 21:51:13 -05:00
Ryan C. Gordon
9f07d548f8 Windows: Free the argv we allocated for console_wmain(). 2015-02-19 21:50:40 -05:00
Ryan C. Gordon
7745b57434 Windows: Added a FIXME. 2015-02-19 21:49:30 -05:00
Ryan C. Gordon
838f951126 Windows: Make a distinction between ANSI mainline and UTF-8 mainline. 2015-02-19 21:49:15 -05:00
Ryan C. Gordon
ceb7c77af8 Windows: Support unicode arguments for console applications (thanks, Jorgen!).
Fixes Bugzilla #2864.
2015-02-19 21:44:41 -05:00
Ryan C. Gordon
563143b13f Mac OS X: replace some deprecated APIs with modern equivalents (thanks, Alex!).
Fixes Bugzilla #2858.
2015-02-19 19:55:30 -05:00
Edward Rudd
2fc8232419 SDL_SetWindowPosition respects display num for SDL_WINDOWPOS_CENTERED_DISPLAY.
This allows for this kind of code in an application:

int monitorID = 1;  // the second monitor!
SDL_SetWindowPosition(sdlWin,
                      SDL_WINDOWPOS_CENTERED_DISPLAY(monitorID),
                      SDL_WINDOWPOS_CENTERED_DISPLAY(monitorID));

Fixes Bugzilla #2849.
2015-02-19 19:40:58 -05:00
Alex Szpakowski
06c792a551 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-01-24 23:58:07 -04:00
Alex Szpakowski
1411f3e10d Fixed the extended launch screen causing minor visual issues when rotating the screen in some circumstances.
--HG--
branch : iOS-improvements
2015-01-24 23:53:41 -04:00
Philipp Wiesemann
0770f17f4f Fixed bug 2816 - [patch] Android: Expose screen refresh rate
Jonas Kulla

Display::getRefreshRate() is available on all API levels.
2015-01-23 20:29:08 +01:00
Ryan C. Gordon
cd309e763f CMake: Removed unused variable (thanks, Felix!).
"MACOSX_COREAUDIO" is actually an internal #define set up elsewhere, and
this CMake var is never exported past the CMake script anyhow.

Partially fixes Bugzilla #2807.
2015-01-18 02:50:14 -05:00
Felix H. Dahlke
fd9647d40b Fixed bug 2807 - Not using CoreAudio on OS X when built via CMake 2015-01-17 04:36:15 +01:00
Philipp Wiesemann
a485cc3215 Fixed wrong documentation in joystick implementation source. 2015-01-16 23:07:10 +01:00