Commit Graph

6356 Commits (f487d63a6b4b1d18cbbafde5d99b0c32e377a96c)

Author SHA1 Message Date
Sam Lantinga ef8c3d89ce Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase handled as time instead of angle; + direction clarification
Elias Vanderstuyft

It's not obvious from the general "haptic direction" description what the SDL direction actually means in terms of force magnitude sign,
currently its meaning is only reflected by the example.
2014-11-29 11:48:43 -08:00
Sam Lantinga 48481c8e55 Improved the pitch variable description 2014-11-29 11:18:49 -08:00
David Ludwig ce64b4ad3a WinRT: bug and data-integrity fixes for SDL_GetPrefPath()
This change does a few things, all with regards to the WinRT implementation of
SDL_GetPrefPath():

1. it fixes a bug whereby SDL_GetPrefPath() did not create the directory it
returned.  On other SDL platforms, SDL_GetPrefPath() will create separate
directories for its 'org' and 'app' folders.  Without this, attempts to create
files in the pref-path would fail, unless those directories were first created
by the app, or by some other library the app used.  This change makes sure
that these directories get created, before SDL_GetPrefPath() returns to its
caller(s).


2. it defaults to having SDL_GetPrefPath() return a WinRT 'Local' folder
on all platforms.  Previously, for Windows Store apps, it would have used a
different, 'Roaming' folder.  Files in Roaming folders can be automatically,
and synchronized across multiple devices by Windows.  This synchronization can
happen while the app runs, with new files being copied into a running app's
pref-path.  Unless an app is specifically designed to handle this scenario,
there is a chance that save-data could be overwritten in unwanted or
unexpected ways.

The default is now to use a Local folder, which does not get synchronized, and
which is arguably a bit safer to use.  Apps that wish to use Roaming folders
can do so by setting SDL_HINT_WINRT_PREF_PATH_ROOT to "roaming", however it
is recommended that one first read Microsoft's documentation for Roaming
files, a link to which is provided in README-winrt.md.

To preserve older pref-path selection behavior (found in SDL 2.0.3, as well as
many pre-2.0.4 versions of SDL from hg.libsdl.org), which uses a Roaming path
in Windows Store apps, and a Local path in Windows Phone, set
SDL_HINT_WINRT_PREF_PATH_ROOT to "old".

Please note that Roaming paths are not supported on Windows Phone 8.0, due to
limitations in the OS itself.  Attempts to use this will fail.
(Windows Phone 8.1 does not have this limitation, however.)


3. It makes SDL_GetPrefPath(), when on Windows Phone 8.0, and when
SDL_HINT_WINRT_PREF_PATH_ROOT is set to "roaming", return NULL, rather than
silently defaulting to a Local path (then switching to a Roaming path if and
when the user upgraded to Windows Phone 8.1).
2014-11-29 10:09:30 -05:00
Sam Lantinga 4dab32a2bc Fixed bug 2786 - "UCS-2-INTERNAL" iconv encoding is not supported everywhere, use UTF-16LE instead
Jonas Kulla

src/main/windows/SDL_windows_main.c:137:
cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR));

I'm trying to compile an SDL2 application for windows using the mingw-w64 32bit toolchain provided by my distro (Fedora 19). However, even the simplest test program that does nothing at all fails to startup with a "Fatal error - out of memory" message because the mingw iconv library provided by my distro does not support the "UCS-2-INTERNAL" encoding and the conversion returns null.

From my little bit of research, it turns out that even though this encoding is supported by the external GNU libiconv library, some glibc versions (?) don't support it with their internal iconv routines, and will instead provide the native endian encoding when "UCS-2" is specified.

Nonetheless, I wonder why the native endianness is considered in the first place when Windows doesn't even run on any big endian archs (to my knowledge). And true enough, 'WIN_StringToUTF8' from core/windows/SDL_windows.h is used everywhere else in the windows backend, which is just a macro to iconv with "UTF-16LE" as source. Therefore it would IMO make sense to use this macro here as well, which would solve my problem (patch attached).
2014-11-28 04:51:33 -08:00
Sam Lantinga 767bb36364 Fixed bug 2676 - xdnd_version check issue in case ClientMessage
Nitz

I added xdnd_version check to XdndPosition case also
under DEBUG_XEVENTS macro.
by this we can get the action requested by user.

I analysed further and found out that removing xdnd_version check at XdndDrop case is a bad idea because
in XConvertSelection API timestamp should be passed if(xdnd_version >= 1)
otherwise CurrentTime should be passed
So xdnd_version check is important at XdndDrop case

I made xdnd_version as a static so that it can store the version in other cases also.
2014-11-28 04:42:46 -08:00
Sam Lantinga 7ed41da0b0 Fixed bug 2411 - Even if built with --enable-clock_gettime, SDL2 still calls gettimeofday()
Ben Swick

Makes SDL_syscond.c and SDL_syssem.c use clock_gettime(CLOCK_REALTIME) when HAVE_CLOCK_GETTIME is defined.
2014-11-28 04:37:50 -08:00
Alex Szpakowski bc4b6f061b Minor Objective-C code tweaks. 2014-11-27 20:25:54 -04:00
Alex Szpakowski 6df55c6608 Removed an ugly hack to make windows rotate properly on iOS 8+.
Recent commits apparently resolved the issue that made the hack necessary.
2014-11-23 23:29:24 -04:00
Alex Szpakowski 9b8a1768f2 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. 2014-11-23 23:23:47 -04:00
Edward Rudd bd4dd2b568 update logging of events in test core
- log unknown as HEX instead of int (makes it easier to identify)
- add dollar gesture and multi gesture events
- add scroll reverse for mouse wheel
2014-11-23 21:10:55 -05:00
Edward Rudd 5b5823eeb5 add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event 2014-11-23 21:09:54 -05:00
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