Commit Graph

1211 Commits

Author SHA1 Message Date
Ryan C. Gordon 6ae7a20647 Placate static analysis with an assertion. 2015-04-10 21:40:50 -04:00
Ryan C. Gordon 2afa4aeda8 Fixed memory leak in failure case that static analysis found. 2015-04-10 21:15:51 -04:00
Philipp Wiesemann 7bd7221997 PSP: Removed empty statement. 2015-04-10 23:45:13 +02:00
Philipp Wiesemann ce2d5f70e4 Wayland: Removed empty statement. 2015-04-10 23:44:55 +02:00
Ryan C. Gordon 562414c74c Merged Alex Szpakowski's iOS-improvement branch to default.
Fixes Bugzilla #2798.
Fixes Bugzilla #2212.
Fixes Bugzilla #2826.
Fixes Bugzilla #2661.
Fixes Bugzilla #1885.
Fixes Bugzilla #1578.
Fixes Bugzilla #2751.

(whew!)

Notable changes, from Alex's notes:

- The SDL_WINDOW_ALLOW_HIGHDPI flag is now needed (along with SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize) to use Retina / high DPI resolutions, bringing SDL?s Retina-related behavior on iOS in line with Mac OS X. Window dimensions and display modes are now in the ?points? (non-high DPI) coordinate system rather than pixels, whereas SDL_GL_GetDrawableSize is in pixels.

- Reworked the custom extended launch screen code:
	- It now hides after the first SDL_PumpEvents call rather than SDL_CreateWindow, and it fades out in a similar manner to the system launch screen behavior.
	- It now mirrors the system launch screen behavior when deciding which image to display: it falls back to using the Launch Images dictionary in Info.plist if the iOS 8+ launch screen nib isn?t available, and if the Launch Images dictionary doesn?t exist it uses the old standard launch image names.
	- The extended launch screen can now be disabled via the SDL_IPHONE_LAUNCHSCREEN define in SDL_config_iphoneos.h.

- Added support for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.

- Added access to a window view's renderbuffer and framebuffer to syswm.

- Added OpenGL ES debug labels for the Renderbuffer and Framebuffer Objects created with SDL_GL_CreateContext.

- Added support for sRGB OpenGL ES contexts on iOS 7+.

- Updated OpenGL ES contexts to support native-resolution rendering (when SDL_WINDOW_ALLOW_HIGHDPI is enabled) on the iPhone 6 Plus, i.e. 1080x1920 rather than 1242x2208.

- Updated SDL_GL_CreateContext, SDL_GL_SwapWindow, SDL_GL_MakeCurrent, and SDL_GL_DeleteContext to be more robust.

- Updated SDL windows to display a UIView at all times, even when an OpenGL context is not active. This allows rotation, touch events, and other windowing-related events to work properly without an active OpenGL context. It also makes it easier to use SDL_GetWindowWMInfo after creating a SDL window.

- Updated the iOS-specific Objective-C code to use cleaner and more modern language features and APIs, including ARC instead of manual reference counting.

- Updated SDL_HINT_ORIENTATIONS to allow disabling custom orientations if the hint is set with no valid orientation names.

- Fixed several rotation and orientation bugs with windows and display modes, especially in iOS 8+.

- Fixed SDL_SetWindowFullscreen failing to update the status bar visibility on iOS 7+.

- Fixed the orientation of the offset applied to the window?s view when the onscreen keyboard is shown in iOS 8+.

- Fixed SDL_IsScreenKeyboardShown (patch by Phil Hassey.)

- Fixed several major memory leaks caused by missing autorelease pool blocks in the iOS-specific Objective-C code.

- Removed several dead code paths.

- The iOS 7 SDK (Xcode 5) or newer is now required to build SDL for iOS.
2015-04-09 22:28:37 -04:00
Alex Szpakowski c4035654a9 Added framebuffer and colorbuffer members to the uikit portion of the SDL_SysWMinfo struct, removed SDL_iOSGetViewRenderbuffer and SDL_iOSGetViewFramebuffer. 2015-04-09 19:28:00 -03:00
Philipp Wiesemann 67549d3320 Backed out changeset 064a1998a957 2015-04-09 22:14:05 +02:00
Philipp Wiesemann f87963488b Wayland: Fixed not freeing memory if initialization failed. 2015-04-09 21:13:41 +02:00
Philipp Wiesemann dc33fb942d Wayland: Fixed accessing not fully initialized subsystem if errors happened.
The VideoInit() implementation returned 0 on errors instead of -1.
2015-04-09 21:13:20 +02:00
Philipp Wiesemann 8a573844c9 Wayland: Fixed accessing not fully initialized window if no memory available.
The CreateWindow() implementation returned 0 on no more memory instead of -1.
2015-04-09 21:11:43 +02:00
Philipp Wiesemann 458b94da5f Android: Fixed creating mouse coordinates which are not needed if hint is set. 2015-04-08 22:18:10 +02:00
Philipp Wiesemann b473d30f19 Android: Fixed not resetting mouse pointer state if hint was changed at runtime. 2015-04-08 22:15:25 +02:00
Alex Szpakowski fcd0f06a88 Renamed SDL_iPhoneGetViewFramebuffer/Renderbuffer to SDL_iOSGetViewFramebuffer/Renderbuffer. Added #defines for SDL_iOSSetAnimationCallback and SDL_iOSSetEventPump, which point to SDL_iPhoneSetAnimationCallback and SDL_iPhoneSetEventPump. 2015-04-08 15:59:29 -03:00
Alex Szpakowski 1152a75954 Generated dynapi prototypes for the new iPhone functions. 2015-04-08 15:44:07 -03:00
Alex Szpakowski 26c28114ee Merged default into iOS-improvements 2015-04-08 15:35:07 -03:00
Ryan C. Gordon a210dbcb13 Removed unused variable. 2015-04-08 02:42:29 -04:00
Ryan C. Gordon 53287ad51c X11: Removed code to set "icon" title, since it was never used.
(Leftover from SDL 1.2, which let you specify this?)
2015-04-08 02:31:54 -04:00
Ryan C. Gordon 78026f5492 Patched to compile on Windows. 2015-04-08 02:24:17 -04:00
Ryan C. Gordon e0ad1021a5 Wayland: Patched to compile. 2015-04-08 02:22:28 -04:00
Ryan C. Gordon 785618afec DirectInput: ignore everything but joysticks and gamepads (thanks, Justin!).
Fixes Bugzilla #2460.
2015-04-08 02:14:59 -04:00
Ryan C. Gordon 6e53bc9b10 SDL_SetWindowTitle() should never set a NULL pointer for the title string.
Various backends reacted differently (or not at all) in the presence of a
NULL pointer. This simplifies things.

Fixes Bugzilla #2902.
2015-04-08 02:00:14 -04:00
Ryan C. Gordon 88e85f4ddd Patched to compile on C89 compilers. 2015-04-08 01:40:01 -04:00
Ryan C. Gordon 9a686aaa56 Wayland: changed a few "SetError(); return -1;" to "return SetError()". 2015-04-07 22:49:56 -04:00
Alex Szpakowski df98b11c47 Merged default into iOS-improvements 2015-04-06 15:26:37 -03:00
Ryan C. Gordon f3590aba15 X11: Always specify "True" if setting GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB.
Fixes Bugzilla #2897.
2015-04-06 00:11:58 -04:00
Ryan C. Gordon 83aeb31d12 This function can be static. 2015-04-06 00:10:54 -04:00
Ryan C. Gordon 2f3f328714 Make loading/saving dollar gesture templates endian clean (thanks, Martin!).
Fixes Bugzilla #2674.
2015-04-05 18:59:52 -04:00
Ryan C. Gordon 05a9206a4f Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!).
Fixes Bugzilla #2673.
2015-04-05 18:44:24 -04:00
Ryan C. Gordon 0713c1e53b Patched to compile on Android when audio subsystem is disabled (thanks, Jonas!)
Fixes Bugzilla #2797.
2015-04-05 15:52:37 -04:00
Sam Lantinga 3e4a8ce1c2 Fixed detecting the NVIDIA controller which shows up as both a mouse and a game controller 2015-04-01 19:18:56 -07:00
Sam Lantinga c5d9d1646f Added a game controller entry for the NVIDIA Controller 2015-04-01 18:22:42 -07:00
Edward Rudd c7ec9c1d85 handle the case where the ibus address can't be found. (prevents nasty crash) 2015-04-01 16:11:37 -04:00
Ryan C. Gordon 64237d7f01 Patched to compile on Android (I hope). 2015-04-01 14:45:09 -04:00
Ryan C. Gordon f9041771d5 Android: more separate-mouse-and-touch work.
This avoids a hint lookup for each mouse event we get by setting a static Java
variable from native code during our hint watcher callback.

Also attempts to do the right thing with mouse buttons if you happen to be
on an API14 (Ice Cream Sandwich, Android 4.0) or later device. We still
target API12 (Honeycomb MR1, Android 3.1) for SDL 2.0.4 though.

This isn't tested, so I'm pushing to see what the Android buildbot says. Stand
back, I'm a professional!
2015-04-01 12:14:56 -04:00
Sam Lantinga 236deab49b Fixed relative mouse motion moving farther and farther off screen. 2015-03-30 11:31:53 -07:00
Emmanuel Gil Peyrot b620df3ea7 Wayland: Specify the output we want to put our window on.
Fixes Bugzilla #2803.
2015-03-28 19:43:46 +01:00
Ryan C. Gordon a0e878aafb 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
Philipp Wiesemann e7a659ebcc Removed not needed call to SDL_free(). 2015-03-25 22:48:57 +01:00
Ryan C. Gordon 03f5185eff Make the Dynamic API master switch more clear. 2015-03-25 11:18:54 -04:00
Ryan C. Gordon 1270247ccd Add a hint watch callback for SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH. 2015-03-25 10:59:10 -04:00
Ryan C. Gordon 83a44680cb Removed unnecessary SDL_log.h include. 2015-03-25 10:48:59 -04:00
Joseba Garc?a Etxebarria ca7b18e43f * More Android patch work 2015-03-24 21:02:28 +01:00
Joseba Garc?a Etxebarria 387fa5dcfb * Improve mouse support in Android. These changes require Android API v12 to compile 2015-03-24 20:45:29 +01:00
Ryan C. Gordon 87ef19c44a Keep track of maximum number of events in-flight in the SDL queue at once. 2015-03-25 10:19:10 -04:00
Ryan C. Gordon 3f9f0027bc Patched to compile on C89 compilers. 2015-03-24 14:40:31 -04:00
Ryan C. Gordon 672ccb4f54 Make the signal handler hint more generic. 2015-03-24 14:36:36 -04:00
Ryan C. Gordon a91a5604cd Added a hint to prevent SDL from installing signal handlers.
Fixes Bugzilla #2431.
2015-03-24 14:29:25 -04:00
Ryan C. Gordon 162ef5eae9 Cleanups in the joystick code.
Removed some redundant state and other confusions.

Fixes Bugzilla #2738.
2015-03-24 13:52:01 -04:00
Ryan C. Gordon 4a071b311b Mac: patched to compile with haptic subsystem disabled (thanks, Rodrigo!).
Fixes Bugzilla #2717.
2015-03-24 03:24:57 -04:00
Ryan C. Gordon d9f378530b Make SDL error string formatting deal with nasty corner cases.
We continued looping while maxlen > 0, but maxlen was unsigned, so an overflow
 would make it a large number instead of negative. Fixed.

Some snprintf() implementations might return a negative value if there isn't
 enough space, and we now check for that.

Don't overrun the SDL error message buffer, if snprintf() returned the number
 of chars it wanted to write instead of the number it did.

snprintf is a portability mess, we should just never use the C runtime for it.

Fixes Bugzilla #2049.
2015-03-24 03:12:35 -04:00