Commit graph

7792 commits

Author SHA1 Message Date
Alex Szpakowski
38563c490c Fixed SDL_GetRendererOutputSize on iOS when high-DPI mode is enabled on a Retina device.
--HG--
branch : iOS-improvements
2014-12-01 07:31:22 -04:00
Alex Szpakowski
b79d62e004 Minor Objective-C code tweaks.
--HG--
branch : iOS-improvements
2014-11-27 20:25:54 -04:00
Alex Szpakowski
0239a50edb Removed an ugly hack to make windows rotate properly on iOS 8+.
Recent commits apparently resolved the issue that made the hack necessary.

--HG--
branch : iOS-improvements
2014-11-23 23:29:24 -04:00
Alex Szpakowski
3f0b28e9cc Cleaned up the iOS text input code, fixed the orientation of the view offset when the onscreen keyboard is shown in iOS 8+, and changed UIKit_SetTextInputRect to update the view offset if the keyboard is currently visible.
--HG--
branch : iOS-improvements
2014-11-23 23:23:47 -04:00
Alex Szpakowski
c7ca2d918e 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.
--HG--
branch : iOS-improvements
2014-11-21 10:03:02 -04:00
Alex Szpakowski
71b6fe20ae Added debug labels for the OpenGL ES objects created with SDL_GL_CreateContext on iOS.
More misc. code cleanup.

--HG--
branch : iOS-improvements
2014-11-21 03:29:57 -04:00
Alex Szpakowski
2f7811a0e7 Minor objective-c code style improvements
--HG--
branch : iOS-improvements
2014-11-20 18:45:04 -04:00
Alex Szpakowski
530dba51e0 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.
--HG--
branch : iOS-improvements
2014-11-20 17:19:26 -04:00
Alex Szpakowski
c2ceb279f1 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-11-15 22:59:16 -04:00
David Ludwig
53b5ab0011 WinRT: updated README-winrt.md to detail Visual Studio 2013 Community support 2014-11-15 15:07:55 -05:00
David Ludwig
32efa671e5 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
b6d1c08c22 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
241c43fac3 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!

--HG--
extra : rebase_source : 3620d161d8c52613e864e156379837db5b8b0be6
2014-11-14 11:21:15 -05:00
David Ludwig
d4f197e51b 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
92066ca133 Added missing brackets in test source assert messages. 2014-11-07 10:02:45 +01:00
Philipp Wiesemann
0ae0b60149 Fixed two typos in test source. 2014-11-07 10:01:20 +01:00
David Ludwig
f21e739e93 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.

--HG--
rename : build-scripts/winrt-build.bat => build-scripts/winrtbuild.bat
rename : build-scripts/winrt-build.ps1 => build-scripts/winrtbuild.ps1
2014-11-03 13:07:51 -05:00
David Ludwig
9358dcf12b 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

--HG--
extra : rebase_source : 776b8a3680350369ed85c7769540211274bf204e
2014-11-03 08:58:49 -05:00
David Ludwig
17e1ac0cc2 WinRT: updated docs to include details of recently-expanded GLES2 support 2014-11-02 11:26:54 -05:00
David Ludwig
6e126b3ffb 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
1415402579 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
879c643b32 WinRT: updated an OpenGL-related code-comment 2014-11-02 09:02:01 -05:00
David Ludwig
ca032ae7ae 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.

--HG--
extra : rebase_source : aba4c5ec99d0e13cff0c7a4c842c4d9d322e45e3
2014-11-02 08:47:05 -05:00
David Ludwig
126039f02f 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
b7fdd52261 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
c09730eaed WinRT: added details of the port's status, to README-winrt.md 2014-11-01 11:14:46 -04:00
Ryan C. Gordon
fbd33785bf Patched to compile on pre-C99 compilers. 2014-10-30 13:44:31 -04:00
Dmitry Rekman
1a73fdd109 X11: Fixed SDL_GetGlobalMouseState() to work better with multimonitor configs.
Fixes Bugzilla #2770.

Thanks to Epic Games for contributing this fix.

--HG--
extra : rebase_source : 99a461ce8585fe04bae8484f059a4b8e67bfbce6
extra : amend_source : e22ab83122073328d4f2a6c8f0349af134d5e9ee
2014-10-29 22:55:40 -04:00
Philipp Wiesemann
6579af8d57 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
c2c68ea945 Removed unnecessary NULL check. 2014-10-29 22:41:01 +01:00
Philipp Wiesemann
6c207f2522 Updated gamecontroller database sorting script to work with Python 3. 2014-10-29 20:35:21 +01:00
Philipp Wiesemann
290396bf46 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
0f7e05d107 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
0cac1b6415 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-10-28 18:36:29 -03:00
Alex Szpakowski
2e708de350 Switched to the core versions of OpenGL ES framebuffer object and renderbuffer functions.
Both the extension (OES) and the core versions work, but the core versions are more correct for GLES2+ and they're less verbose.

--HG--
branch : iOS-improvements
2014-10-28 01:34:40 -03:00
David Ludwig
2ccf9641c8 WinRT: detailed steps, via the WinRT README, to fix a common build error 2014-10-27 19:53:44 -04:00
Philipp Wiesemann
0492432d15 Fixed two typos in header file comment. 2014-10-27 12:53:47 +01:00
Philipp Wiesemann
76173b195e Added handling of NULL as input for SDL_GameControllerAddMapping(). 2014-10-26 23:28:45 +01:00
Philipp Wiesemann
bbbe3edca1 Fixed SDL_GameControllerMappingForGUID() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID()
now either means "no mapping" (as before) or "no memory" (just crashed before).
2014-10-26 23:22:53 +01:00
Philipp Wiesemann
8869fe78be Added handling of NULL as input for SDL_GameControllerMapping().
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
2014-10-26 17:53:16 +01:00
Philipp Wiesemann
81958288cc Removed two wrong documentation comments from gamecontroller source.
No replacement because correct documentation is already in SDL_gamecontroller.h.
2014-10-26 17:46:11 +01:00
Philipp Wiesemann
788b558bc8 Fixed wording in SDL_GameControllerAddMappingsFromRW() error message. 2014-10-26 17:44:00 +01:00
David Ludwig
a2d97fa398 WinRT: more keyboard code cleanups
- made keycode listings a bit easier to read
- listed VK_ keycode names, where appropriate
- removed a few pieces of dead + commented-out code
- applied a common 'WINRT_' prefix to internal function names
2014-10-26 12:33:10 -04:00
David Ludwig
896dd09b7e WinRT: Fixed bug whereby key-detection code could call SDL_Log 2014-10-25 08:54:23 -04:00
David Ludwig
f10f7bb06e WinRT: fallback to scancode key detection, if VirtualKey/VK detection fails 2014-10-25 08:50:41 -04:00
David Ludwig
21e4c95f1b WinRT: more keyboard code cleanups
- use SDL_arraysize where appropriate
- made long lines of debug-logging code span multiple lines, for easier reading
2014-10-25 08:43:51 -04:00
David Ludwig
19d42e504c WinRT: Fixed bug whereby a right-shift key might get reported as left-shift 2014-10-24 22:09:47 -04:00
David Ludwig
4cf559817c WinRT: minor keyboard code cleanup
An internally-used hash table was replaced with a plain switch statement.
2014-10-24 21:25:21 -04:00
Philipp Wiesemann
f268bb07a9 Added new key codes from Android 4.4 (API 20) and 5.0 (API 21). 2014-10-24 19:50:29 +02:00
Brandon Schaefer
03baaacff1 Remove unused variable. 2014-10-24 06:52:54 -07:00