Commit graph

8252 commits

Author SHA1 Message Date
Alex Szpakowski
91e517df33 Fixed the window offset on iOS when resuming an app with a borderless or fullscreen window that has the on-screen keyboard visible. 2015-05-05 16:20:11 -03:00
Alex Szpakowski
01874284f5 Fixed a crash on iOS when none of the orientations in Info.plist match the SDL window's actual orientation.
Fixes bug #2967.
2015-05-05 16:16:10 -03:00
Sam Lantinga
e983d40007 Fixed bug 2976 - Fix RGBA<->RGBA blit that was broken with the optimization from Bug 11
id.zeta

The optimization from Bug 11 added a code branch on cases where the source RGB masks match the destination RGB masks and a optimized blit function Blit4to4MaskAlpha that always overrides the source alpha info would be chosen. Unfortunately, the branch also errorneously took over the RGBA<->RGBA blitting cases where the source alpha info should be copied, while they would instead get overriden in Blit4to4MaskAlpha.

The attached patch fixes that by handling the RGBA<->RGBA cases correctly in that branch with the original BlitNtoNCopyAlpha as well as uses an optimized Blit4to4CopyAlpha along the same vein.
2015-05-04 21:47:40 -07:00
Ryan C. Gordon
289d6600ff X11: send keypress events before textinput events. 2015-05-01 01:20:28 -04:00
Ryan C. Gordon
0291892654 checkkeys: report SDL_TEXTEDITING events. 2015-05-01 01:19:00 -04:00
Ryan C. Gordon
b78f3a3d40 checkkeys: Readded the KEYUP event test. 2015-05-01 01:12:48 -04:00
Philipp Wiesemann
8dcfd98d27 Android: Deactivated debug log messages on joystick device events. 2015-04-30 21:45:29 +02:00
Dimitris Zenios
e1eebca097 X11: Use our own cut-buffer for intermediate clipboard storage.
XA_CUTBUFFER0 is not defined for holding UTF8 strings.
2015-04-26 13:53:46 +03:00
Sam Lantinga
2dc85e7ed4 Moved code signature step to after the framework build step is complete, and don't hardcode the codesign identity 2015-04-26 20:46:07 -07:00
Sam Lantinga
168076ba13 Turn off code signing by default
Code signature can be added after build with the following command line:
codesign --force --sign 76BB5ACAC44CA5EFA5F879434D157B81DA842CFB SDL2.framework/Versions/A
2015-04-26 20:21:06 -07:00
Sam Lantinga
7a341245a5 Updated project and added code signing for release builds 2015-04-26 15:47:40 -07:00
Ryan C. Gordon
dee33f6150 Only check for Linux-specific input APIs on Linux targets (thanks, Marcus!).
This is only for the configure script. The CMake project files already make
this Linux-exclusive.

Fixes Bugzilla #2659.
2015-04-25 20:49:26 -04:00
Reto Schneider
0970b3829d Remove trailing spaces in Android source code. 2015-04-08 12:14:36 +02:00
Wander Lairson Costa
f2bf946168 Add an entry for X11 "/" key for Brazilian keyboard.
SDL2 reports the following message when we type the "/" on br-abnt2 keyboards:

The key you just pressed is not recognized by SDL. \
To help get this fixed, please report this to the SDL mailing list \
<sdl@libsdl.org> X11 KeyCode 97 (89), X11 KeySym 0x2F (slash).

That's because the corresponding entry in the scancodes table is
marked with value SDL_SCANCODE_UNKNOWN.

This commit fixes that adding the value SDL_SCANCODE_SLASH for this entry.
2014-06-05 11:55:37 -03:00
Ryan C. Gordon
9607613a10 CMake: Slightly better fix for installation target (thanks, Anthony!).
Fixes Bugzilla #2474.

--HG--
extra : rebase_source : cb0c8062e17b7d6d0bb4761e4ad3512a34b0a806
2015-04-22 20:25:19 -04:00
Philipp Wiesemann
8b6cdd0682 Fixed typos in header file documentation comments. 2015-04-22 21:43:22 +02:00
Philipp Wiesemann
958b71701a Fixed SDL_GameControllerOpen() and SDL_JoystickOpen() documentation in header. 2015-04-20 20:03:40 +02:00
Philipp Wiesemann
e67a50bc77 Fixed unsupported doxygen tag in header file. 2015-04-20 20:03:26 +02:00
Ryan C. Gordon
2ec615f2d3 Cleaned up the macro salsa in the Windows timer code.
- Removed USE_GETTICKCOUNT code; it's never used now.
- Reduced the number of preprocessor checks for WinRT.
- Renamed timeSetPeriod() so it doesn't look like a Win32 API call.
2015-04-20 13:43:24 -04:00
Ryan C. Gordon
baad636dfe Windows: Always set the system timer resolution to 1ms by default.
An existing hint lets apps that don't need the timer resolution changed avoid
this, to save battery, etc, but this fixes several problems in timing, audio
callbacks not firing fast enough, etc.

Fixes Bugzilla #2944.

--HG--
extra : rebase_source : 42542a47baca5460939d3aab79b433ec450b5f91
extra : amend_source : 2c057ab8e81da3fcfbcda0bfc47986b1e023881b
2015-04-20 12:22:44 -04:00
Philipp Wiesemann
27ed732abc Fixed return value of SDL_SaveBMP_RW() depending on set errors after NULL input.
If SDL_SaveBMP_RW() was called with NULL passed as SDL_RWops argument, different
values were returned depending on SDL_GetError(). If no error was set before the
call (or SDL_ClearError() was called) then 0 was returned. This is wrong because
nothing was saved. If an error was set before the call then -1 was returned.

This was fixed by directly returning -1 for NULL input instead of deciding based
on SDL_GetError(). No new error is set because this would otherwise override a
maybe more useful error set in SDL_RWFromFile() which is used by SDL_SaveBMP().
2015-04-16 22:04:35 +02:00
Philipp Wiesemann
1244c2068c Linux: Removed not needed platform info from two entries of controller database.
Not needed because entries of this file are selected by conditional compilation.
2015-04-16 22:02:03 +02:00
Philipp Wiesemann
fc24a2d81e Fixed typo in internal joystick documentation comments. 2015-04-15 21:29:55 +02:00
Philipp Wiesemann
bb9dd1ec0c Emscripten: Simplified implementation of joystick update function.
The function was implemented using four loops but only needed two.
2015-04-15 21:27:10 +02:00
Philipp Wiesemann
2a45a031a7 Emscripten: Fixed memory leak if SDL_GetPrefPath() failed. 2015-04-15 21:25:15 +02:00
Philipp Wiesemann
5491fe7094 Android: Fixed lint warning about order of elements in AndroidManifest.xml. 2015-04-13 20:52:38 +02:00
Philipp Wiesemann
e5fe1c05e0 WinRT: Fixed format string for error message. 2015-04-13 20:52:18 +02:00
Ryan C. Gordon
02bb727c9e Patched to compile on C89 compilers. 2015-04-12 21:02:21 -04:00
Ryan C. Gordon
5115ae3f94 Make X11 and Wayland ProcessHitTest() code less verbose. 2015-04-12 20:59:48 -04:00
Ryan C. Gordon
ce193a6e20 Implemented SetWindowHitTest() for Wayland (thanks, x414e54!).
Fixes Bugzilla #2941.

--HG--
extra : amend_source : 23d08e52de2c9db8636ad47043c4fcd334ed30a7
2015-04-12 20:40:06 -04:00
Ryan C. Gordon
3a2b97db0e Merged. 2015-04-12 20:28:28 -04:00
Alex Szpakowski
9dc4eb71f5 Fixed orientation issues in the iOS extended launch screen.
--HG--
extra : rebase_source : 21d5c5d55bc803d31bb08f614afb236d31bcd70e
2015-04-12 01:50:28 -03:00
Rohit Nirmal
1089aa259c Ignore some more test binaries. 2015-04-10 22:31:52 -05:00
Philipp Wiesemann
4225abc296 Windows: Fixed format string for error message. 2015-04-11 20:43:11 +02:00
Philipp Wiesemann
91a602526b Mac: Fixed typo in two error messages. 2015-04-11 20:41:49 +02:00
Ryan C. Gordon
64accce776 Some Raspberry Pi build fixes (including Raspberry Pi 2 support).
Fixes Bugzilla #2879.

--HG--
extra : rebase_source : b9b8a69e971e5bf910c0dc592b5d9bf3c15e13ca
2015-04-11 05:58:37 +00:00
Alex Szpakowski
29b1cab6e1 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
--HG--
extra : rebase_source : 8082e18faee33d41e50ef90a53be8a42679f6fb3
2015-04-10 23:30:31 -03:00
Ryan C. Gordon
beb96e3199 Placate static analysis with an assertion. 2015-04-10 21:40:50 -04:00
Ryan C. Gordon
8b83017158 Fixed memory leak in failure case that static analysis found. 2015-04-10 21:15:51 -04:00
Philipp Wiesemann
fc65a70a85 PSP: Removed empty statement. 2015-04-10 23:45:13 +02:00
Philipp Wiesemann
844ac0dbed Wayland: Removed empty statement. 2015-04-10 23:44:55 +02:00
Ryan C. Gordon
b2002bd0e5 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
58fb5ed781 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
Philipp Wiesemann
620a06dec9 Backed out changeset 84407b33fe1e 2015-04-09 22:14:05 +02:00
Philipp Wiesemann
3d3885f7bb Wayland: Fixed not freeing memory if initialization failed. 2015-04-09 21:13:41 +02:00
Philipp Wiesemann
060eee3c4f 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
fa7a33f5f3 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
0f74f5f039 Android: Fixed calling a getter method twice. 2015-04-08 22:24:33 +02:00
Philipp Wiesemann
742fdb475d Android: Fixed creating mouse coordinates which are not needed if hint is set. 2015-04-08 22:18:10 +02:00
Philipp Wiesemann
a817381653 Android: Fixed not resetting mouse pointer state if hint was changed at runtime. 2015-04-08 22:15:25 +02:00