Commit Graph

1420 Commits

Author SHA1 Message Date
Ryan C. Gordon
fd638d4de7 SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be
implemented on!), and there's currently no way for an app to know this.

This shouldn't break ABI on apps that moved to a revision between 2.0.3 and
2.0.4.
2015-07-17 21:03:58 -04:00
Philipp Wiesemann
13564bca67 Fixed spaces in header file. 2015-07-16 21:48:35 +02:00
Philipp Wiesemann
d0a842f36e Fixed typo in test header file comment. 2015-07-15 21:12:04 +02:00
Sam Lantinga
5ac1d2ab15 Android has clock_gettime() - thanks Michael Labbe! 2015-06-19 23:40:23 -07:00
Ryan C. Gordon
a69df81fff Removed Edgar's name from SDL_haptic.h at his request. 2015-06-17 12:59:12 -04:00
Sam Lantinga
de541d5072 Partial fix for bug 2758 - Android issues with NDK r10c and API-21
Sylvain

When using API 21 and running on an old device (android < 5.0 ?) some function are missing.

functions are (at least) : signal, sigemptyset, atof, stpcpy (strcat and strcpy), srand, rand.


Very few modifications on SDL to get this working :

on SDL
======

Undefine android configuration :

HAVE_SIGNAL
HAVE_SIGACTION
HAVE_ATOF

In "SDL_systrhead.c", comment out the few block of lines with "sigemptyset".

Android.mk:
remove the compilation of "test" directory because it contains a few rand/srand calls

Also, there are more discussions about this in internet :
https://groups.google.com/forum/#!topic/android-ndk/RjO9WmG9pfE
http://stackoverflow.com/questions/25475055/android-ndk-load-library-cannot-locate-srand
2015-06-17 00:07:45 -07:00
Sam Lantinga
2c154373a4 Fixed bug 3009 - Cannot compile SDL2 on Windows
CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
2015-06-13 10:47:55 -07:00
Ryan C. Gordon
528959b843 configure/cmake/x11: Removed SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 test.
This was the only thing that made SDL_config.h generate differently between
32 and 64-bit versions of Linux, so instead we force a function cast in our
X11 code to match our dynamic loader version, which removes the compile error
on some machines that prompted this test in the first place.

Xlib never wrote to this data, so if you're on an older Xlib where this param
wasn't const, your data should still be intact when we force the caller to
think it was actually const after all.

Fixes Bugzilla #1893.
2015-06-08 01:13:51 -04:00
Philipp Wiesemann
1968212d51 Fixed comments at conditional compilation macro in header file. 2015-06-05 19:41:34 +02:00
Ryan C. Gordon
be33d2e4fc Fixed SDL_ISPIXELFORMAT_ALPHA to check pixel orders that match pixel type.
Otherwise, SDL_PIXELFORMAT_BGR24 is reported as having alpha, because
 its SDL_ARRAYORDER_BGR pixel order uses the same integer value as
 SDL_PACKEDORDER_RGBA, since we weren't checking the pixel type to
 differentiate.

Fixes Bugzilla #2977.
2015-05-31 01:45:20 -04:00
Philipp Wiesemann
08a1896f15 Fixed typo in header file documentation comment. 2015-05-29 22:24:38 +02:00
Ryan C. Gordon
ee52b70032 X11: Add Xdbe support to message boxes (thanks, Melker!).
Without this, message boxes with a lot of text will noticibly flicker as
you mouse over buttons.

Fixes Bugzilla #2343.
2015-05-28 00:30:21 -04:00
Ryan C. Gordon
906a4d69c1 Stack hint should look for 0, not -1, and not care about environment variables. 2015-05-26 21:19:23 -04:00
Ryan C. Gordon
bd539b9ed1 Added a hint to specify new thread stack size (thanks, Gabriel!).
Fixes Bugzilla #2019.

(we'll do a better fix when we break the API in SDL 2.1.)
2015-05-26 21:13:27 -04:00
Ryan C. Gordon
44e6e7d1d9 Properly report DX headers in the CMake project files (thanks, "MailMr_S"!).
Fixes Bugzilla #2900.
2015-05-26 21:09:48 -04:00
Ryan C. Gordon
5efa181331 Fix fallback define for DECLSPEC for non-Windows platforms.
Looks like it was a copy/paste error?

GCC doesn't support visibility attributes until gcc4, so just make it blank.

Fixes Bugzilla #2720.
2015-05-26 16:25:22 -04:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Alex Szpakowski
ebc3d92415 iOS: Added support for SDL_DisableScreenSaver and SDL_EnableScreenSaver. 2015-05-16 16:55:56 -03:00
Sam Lantinga
ab8a05e9ce Added a userdata parameter to SDL_SetWindowsMessageHook() 2015-05-13 22:39:32 -07:00
Sam Lantinga
af8c286153 Added SDL_SetWindowsMessageHook() to facilitate full IME support on Windows 2015-05-13 22:39:20 -07:00
Philipp Wiesemann
58f43d5ad1 Fixed SDL_TouchFingerEvent documentation in header file. 2015-05-08 21:53:02 +02:00
Alex Szpakowski
54454c2671 Fixed a warning when SDL_syswm.h is included in code compiled for iOS with clang. 2015-05-05 16:24:05 -03:00
Philipp Wiesemann
799609d230 Fixed typos in header file documentation comments. 2015-04-22 21:43:22 +02:00
Philipp Wiesemann
b7f2594c20 Fixed SDL_GameControllerOpen() and SDL_JoystickOpen() documentation in header. 2015-04-20 20:03:40 +02:00
Philipp Wiesemann
5a0e021241 Fixed unsupported doxygen tag in header file. 2015-04-20 20:03:26 +02:00
Alex Szpakowski
03a3b1872d Added framebuffer and colorbuffer members to the uikit portion of the SDL_SysWMinfo struct, removed SDL_iOSGetViewRenderbuffer and SDL_iOSGetViewFramebuffer.
--HG--
branch : iOS-improvements
2015-04-09 19:28:00 -03:00
Alex Szpakowski
7270f337cc Renamed SDL_iPhoneGetViewFramebuffer/Renderbuffer to SDL_iOSGetViewFramebuffer/Renderbuffer. Added #defines for SDL_iOSSetAnimationCallback and SDL_iOSSetEventPump, which point to SDL_iPhoneSetAnimationCallback and SDL_iPhoneSetEventPump.
--HG--
branch : iOS-improvements
2015-04-08 15:59:29 -03:00
Alex Szpakowski
89e1563688 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-04-08 15:35:07 -03:00
Ryan C. Gordon
a19e127cda Make SDL_stdinc.h work when compiling with -Wundef (thanks, Ben!).
Fixes Bugzilla #2664.
2015-04-08 01:42:47 -04:00
Ryan C. Gordon
7c14914a5b Do the "fix" for asserts with MSVC's /W4 warnings only on MSVC.
Naturally, this way generates a warning on GCC and Clang instead.  :)
2015-04-07 23:40:01 -04:00
Alex Szpakowski
182e206acd Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-04-06 15:26:37 -03:00
Ryan C. Gordon
8873c00053 Minor input grab clarifications.
Clarify that grabbing the mouse only works with one window at a time; this was
always true at the system level, though SDL could previously get confused
by multiple simultaneous grabs, so now we explicitly break any existing
grab before starting a new one and document it as such.

Also track the window that is currently grabbed, and provide an API to query
for that window. This makes it easy to automate mouse ungrabbing at
breakpoints with gdb7's scripting, since the scripts can now know which window
to ungrab.

In 2.1, we should probably change this API to SDL_GrabInput(win) and
SDL_UngrabInput(void), or something.
2015-03-28 00:48:03 -04:00
Joseba García Etxebarria
b1c3794e4b * Improve mouse support in Android. These changes require Android API v12 to compile 2015-03-24 20:45:29 +01:00
Ryan C. Gordon
effac13a3f Make the signal handler hint more generic. 2015-03-24 14:36:36 -04:00
Ryan C. Gordon
e2b33306a0 Added a hint to prevent SDL from installing signal handlers.
Fixes Bugzilla #2431.
2015-03-24 14:29:25 -04:00
Ryan C. Gordon
d5b50f68e2 Windows: Report window HDC in SDL_SysWMinfo.
Fixes Bugzilla #2668.
2015-03-23 19:47:08 -04:00
Philipp Wiesemann
ef6affb0bc Added missing SDL_DOLLARRECORD event type documentation in header. 2015-03-21 22:42:53 +01:00
Philipp Wiesemann
b8e4bd5254 Fixed confusing audio and touch events because of shared enumeration values. 2015-03-21 08:01:43 +01:00
Ryan C. Gordon
19347bf564 Another attempt to make MSVC's /W4 warning level cooperate with SDL_assert.
Fixes Bugzilla #2733.
2015-04-07 00:39:16 -04:00
Marc Di Luzio
d4df74cd6f Allow setting of GL_CONTEXT_RELEASE_BEHAVIOR when creating the GL context when GLX_ARB_context_flush_control is available.
This extension allows the user to specify whether a full flush is performed when making a context not current.
The only way to set this currently is at context creation, so this patch provides that functionality.
Defualt behaviour is set at FLUSH, as per the spec.

This patch does not contain the changes to WGL, appleGL or other platforms as I do not have access to GL 4.5 hardware on those platforms.

Full details on the use of KHR_context_flush_control can be found here:
https://www.opengl.org/registry/specs/KHR/context_flush_control.txt
2015-03-06 16:03:40 +00:00
Ryan C. Gordon
4f2bdb2f84 CMake project files no longer force you to link against Wayland or Mir libs. 2015-03-20 10:35:42 -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
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
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
Alex Szpakowski
d621a93a72 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-01-15 01:15:24 -04:00
Alex Szpakowski
b112eb83ab Several improvements to the iOS backend:
- Added new custom launch screen code. It uses the launch screen nib when available on iOS 8+, the launch images dictionary if the launch screen nib isn't available, and the old standard image names if the launch image dictionary isn't in the plist.
The launch screen is now hidden during the first call to SDL_PumpEvents rather than SDL_CreateWindow so apps can have the launch screen still visible if they do time-consuming loading after creating their window. It also fades out in roughly the same way as the system launch screen behavior.
It can be disabled by setting the SDL_IPHONE_LAUNCHSCREEN define in SDL_config_iphoneos.h to 0.

- A blank UIView is now created and displayed when the window is first created. The old behavior was to defer creating any view until SDL_GL_CreateContext, which prevented rotation, touch events, and other windowing-related things from working until then. This also makes it easier to use SDL_GetWindowWMInfo after creating a window.

- Moved the keyboard and animation callback code from SDL's UIView subclasses to its UIViewController subclass, which lets them work properly in all cases when a SDL window is valid, even before SDL_GL_CreateContext is called and after SDL_GL_DeleteContext is called.

- SDL_GL_CreateContext, SDL_GL_SwapWindow, SDL_GL_MakeCurrent, and SDL_GL_DeleteContext are more robust.

- Fixed some edge cases where SDL windows weren't rotating properly or their reported sizes were out of sync with their actual sizes.

- Removed all calls to [UIApplication setStatusBarOrientation:]. It doesn't seem to work as expected in all cases in recent iOS versions.

- Some code style cleanup.

--HG--
branch : iOS-improvements
2015-01-15 01:06:14 -04:00
Philipp Wiesemann
e617b0ea69 Added and fixed doxygen markup in header file. 2015-01-12 23:20:52 +01:00
Ryan C. Gordon
03e336ef9a Corrected documentation about triggers values in SDL_GameControllerGetAxis().
Fixes Bugzilla #2319.
2015-02-18 16:25:15 -05:00
Philipp Wiesemann
a4adcf6da5 Fix typos in header file documentation comments. 2015-01-30 23:20:15 +01:00
Philipp Wiesemann
89e3e4ea3e Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation
Jonas Kulla

The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c.

I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
2015-01-26 22:00:29 +01:00