Commit Graph

9945 Commits

Author SHA1 Message Date
David Ludwig 70438be272 WinRT: fixed bug whereby SDL would override an app's default orientation
WinRT apps can set a default, preferred orientation via a .appxmanifest file.
SDL was overriding this on app startup, and making the app use all possible
orientations (landscape and portrait).

Thanks to Eric Wing for the heads up on this!
2014-12-03 10:55:23 -05:00
Alex Szpakowski 6d85f52228 The iOS OpenGL ES context's color Renderbuffer Object is no longer completely destroyed and recreated in layoutSubviews. Its storage is now only reallocated when the actual size of the layer changes. The framebuffer object and renderbuffer object binding states are no longer clobbered by the storage reallocation code in layoutSubviews. 2014-11-21 10:03:02 -04:00
Alex Szpakowski 38c6e9d13b Added debug labels for the OpenGL ES objects created with SDL_GL_CreateContext on iOS.
More misc. code cleanup.
2014-11-21 03:29:57 -04:00
Alex Szpakowski feb2ab1e85 Minor objective-c code style improvements 2014-11-20 18:45:04 -04:00
Alex Szpakowski 650ace88ca Fixed mismatching orientations for the window width and height on iOS when the window is created or the app is brought to the foreground, when SDL_HINT_ORIENTATIONS or SDL_WINDOW_FULLSCREEN is used. 2014-11-20 17:19:26 -04:00
Alex Szpakowski 0b02de757d Merged default into iOS-improvements 2014-11-15 22:59:16 -04:00
David Ludwig e695ec907e WinRT: updated README-winrt.md to detail Visual Studio 2013 Community support 2014-11-15 15:07:55 -05:00
David Ludwig 646025b6c2 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 e6cca5e929 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
Ryan C. Gordon 8366bbdd7b Fixed gcc-fat.sh failing to build Objective-C sources correctly.
This would fail if the compiler was given a .m file _and_ no "-o" option; it
would fail to automatically calculate the correct .o filename in this
situation.

Thanks to Ethan Lee for the help tracking this one down!
2014-11-14 11:21:15 -05:00
David Ludwig 49c9b48ed9 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
Philipp Wiesemann 743ba2f499 Added missing brackets in test source assert messages. 2014-11-07 10:02:45 +01:00
Philipp Wiesemann e11969a72f Fixed two typos in test source. 2014-11-07 10:01:20 +01:00
David Ludwig b561f20316 WinRT: removed '-' from build script file names
Most of the other build scripts don't include a '-' in their file names.  This
change makes the WinRT build scripts use the same convention.
2014-11-03 13:07:51 -05:00
David Ludwig f055ea70f8 WinRT: added scripts to build Release copies of SDL for all WinRT variants
These variants include:
 - Windows 8.0 for x86
 - Windows 8.0 for x64
 - Windows 8.0 for ARM
 - Windows 8.1 for x86
 - Windows 8.1 for x64
 - Windows 8.1 for ARM
 - Windows Phone 8.0 for x86 (for use with the Windows Phone emulator)
 - Windows Phone 8.0 for ARM
 - Windows Phone 8.1 for x86 (for use with the Windows Phone emulator)
 - Windows Phone 8.1 for ARM
2014-11-03 08:58:49 -05:00
Eric Wing ef559ddb4c iOS: Added support for iOS 8 LaunchScreen NIBs.
iOS 8 introduces LaunchScreen NIBs which use autolayout to handle all devices and orientations with a single NIB instead of multiple launch images. This is also the only way to get the App Store badge "Optimized for iPhone 6 and iPhone 6 Plus". So if the application is running on iOS 8 or greater AND has specified a LaunchScreen in their Info.plist, this patch will use the NIB as the launch screen. Otherwise, the code falls back to the legacy code path.

Note: Upon audit of the legacy path, it appears that it does not properly handle the UILaunchImages Info.plist convention. I've added comments inline to the code about this. However, in about a year from now, nobody is going to care about this path since everybody should be using LaunchScreen NIBs.
2014-11-02 20:55:13 -08:00
David Ludwig ecc014740a WinRT: added SDL_HINT_WINRT_PREF_PATH_ROOT
SDL_HINT_WINRT_PREF_PATH_ROOT allows WinRT apps to alter the path that
SDL_GetPrefPath() returns.  Setting it to "local" uses the app's
OS-defined Local folder, setting it to "roaming" uses the app's OS-defined
Roaming folder.

Roaming folder support is not available in Windows Phone 8.0.  Attempts to
make SDL_GetPrefPath() return a Roaming folder on this OS will be ignored.

Various bits of documentation on this were added to SDL_hints.h, and to
README-winrt.md
2014-11-27 09:55:34 -05:00
David Ludwig 506a1efc22 WinRT: removed a completed TODO item from an inline comment 2014-11-27 08:50:11 -05:00
David Ludwig 6a5b3bb425 WinRT: added initial SDL_TEXTINPUT support
Further support regarding IME and on-screen keyboards is pending, some of
which might not be 100% compatible with other platforms, given WinRT platform
restrictions.  An MSDN article at http://msdn.microsoft.com/en-us/library/windows/apps/hh465404.aspx
indicates that on-screen keyboard display requires that the user first tap on
a Windows/XAML text control.

This change adds basic SDL_TEXTINPUT support, with input coming from hardware
keyboards, at a minimum, and without the need for XAML integration (which is
still pending integration into SDL, by and large).
2014-11-26 21:34:15 -05:00
Philipp Wiesemann 5bdc9913ac Corrected header file guard comments. 2014-11-25 22:37:12 +01:00
Philipp Wiesemann 8cab5ae300 Fixed limitation for number of custom main() arguments on Android.
Limitation was size of the reference table because local refs were not deleted.
2014-11-25 22:31:14 +01:00
J?rgen P. Tjern? 94539137a2 Mac: Add drag & drop support.
Fixes bug https://bugzilla.libsdl.org/show_bug.cgi?id=2757

Thanks to Alex Szpakowski for the patch!
2014-11-24 11:46:20 -08:00
Edward Rudd 084642d3f4 Cocoa: add in handling of "lost" touches on OS X. [bug #2635]
This scenario can occur, for example, when the 4-finger touch sequence is used to switch spaces.  the SDL window does not receive the touch up events and ends up thinking there are far more fingers on the pad than there are.

So the solution here is everytime a new "touch" appears we can through and check if there are any existing known touches by the OS and if there are none, abut SDL things there are, we simply go through and cancel the SDL touches.

Side affects.
- the "touch up" won't occur until the users sends a new touch (could be well after the actual release really did occur)
2014-11-23 15:48:52 -05:00
Edward Rudd 8c9341b92d add "i" shortcut to testgesture tool to log # of fingers down on the touch devices. 2014-11-23 15:39:28 -05:00
Edward Rudd d7cc6fabee add controllermap program to SDLTest xcode project 2014-11-23 15:21:49 -05:00
Philipp Wiesemann 43e5c9ee00 Fixed doxygen tags in header file documentation comments. 2014-11-23 20:46:34 +01:00
Philipp Wiesemann c0165972c3 Fixed typos in header file documentation comments. 2014-11-23 20:40:48 +01:00
Philipp Wiesemann 097ad55000 Fixed local reference leaks in messagebox implementation for Android. 2014-11-23 20:38:18 +01:00
Philipp Wiesemann c121ff7f9a Added name for second Java Thread on Android. 2014-11-23 20:35:51 +01:00
David Ludwig d9a42c76b1 WinRT: fixed an invalid comment in SDL_GetPrefPath() (for WinRT) 2014-11-23 08:59:01 -05:00
David Ludwig 13c511697c 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
Philipp Wiesemann a690944e44 Fixed typo in header file documentation comment. 2014-11-23 11:26:46 +01:00
David Ludwig 5575948b37 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
Philipp Wiesemann 9c398852e6 Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
David Ludwig 167b3bb4cd WinRT: updated docs to include details of recently-expanded GLES2 support 2014-11-02 11:26:54 -05:00
David Ludwig 577ef5e0b6 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 bbe1df0d51 WinRT: enabled OpenGL ES 2 support on Windows Phone
The "future-dev" branch of MSOpenTech's ANGLE/WinRT repository (at
https://github.com/msopentech/angle) includes support for Windows Phone 8.1.
This change allows it to be used in conjunction with SDL's OpenGL functions.
2014-11-02 10:32:25 -05:00
David Ludwig 18ecc34dfd WinRT: updated an OpenGL-related code-comment 2014-11-02 09:02:01 -05:00
David Ludwig 0bcc254e4f 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
David Ludwig 1c85ba23df WinRT: moved documentation + setup related TODO items out of README-winrt.md
The TODO items were moved to SDL Bugzilla, case 2775 (https://bugzilla.libsdl.org/show_bug.cgi?id=2775).
2014-11-01 11:41:18 -04:00
David Ludwig 796f7bbf0c WinRT: made README-winrt.md slightly easier to read in an 80-column text editor 2014-11-01 11:17:07 -04:00
David Ludwig 438a55a49c WinRT: added details of the port's status, to README-winrt.md 2014-11-01 11:14:46 -04:00
Ryan C. Gordon 43ad9670e6 Patched to compile on pre-C99 compilers. 2014-10-30 13:44:31 -04:00
Dmitry Rekman 3a916c6d7b 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 37720dd5f2 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 0c60f023f5 Removed unnecessary NULL check. 2014-10-29 22:41:01 +01:00
Philipp Wiesemann 2bdc5c9d7a Updated gamecontroller database sorting script to work with Python 3. 2014-10-29 20:35:21 +01:00
Philipp Wiesemann 032b14e7b6 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 2a46a9df21 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
Alex Szpakowski fb6d185a8a Merged default into iOS-improvements 2014-10-28 18:36:29 -03:00