Commit Graph

8405 Commits

Author SHA1 Message Date
Philipp Wiesemann 3f51758ec5 Emscripten: Fixed touch coordinates not being normalized. 2015-05-06 21:10:48 +02:00
Philipp Wiesemann 5715097a0c Fixed implicit function declaration in test program. 2015-05-06 21:09:33 +02:00
Alex Szpakowski ac27b511bf Fixed SDL_GL_GetAttribute queries for framebuffer component sizes in Core Profile OpenGL contexts.
Fixes bugzilla #2060.
2015-05-06 12:54:51 -03:00
Alex Szpakowski c4fe8c80c8 Fixed building the iOS Demo files in debug mode 2015-05-06 12:42:14 -03:00
Alex Szpakowski 4fc4026660 Replaced all remaining uses of NSAutoreleasePool with @autoreleasepool blocks (bugzilla #2680.) 2015-05-05 19:01:55 -03:00
Alex Szpakowski 6c20b68257 Fixed a warning when SDL_syswm.h is included in code compiled for iOS with clang. 2015-05-05 16:24:05 -03:00
Alex Szpakowski d1372bb92c 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 d603bb30e6 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 74d83ead35 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 589c46dd65 X11: send keypress events before textinput events. 2015-05-01 01:20:28 -04:00
Ryan C. Gordon 0045e2e622 checkkeys: report SDL_TEXTEDITING events. 2015-05-01 01:19:00 -04:00
Ryan C. Gordon 423262789b checkkeys: Readded the KEYUP event test. 2015-05-01 01:12:48 -04:00
Philipp Wiesemann 9979bab20b Android: Deactivated debug log messages on joystick device events. 2015-04-30 21:45:29 +02:00
Dimitris Zenios d9d1a1b980 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 93bd476de9 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 931f6e4ee5 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 43692a0021 Updated project and added code signing for release builds 2015-04-26 15:47:40 -07:00
Ryan C. Gordon 5c09bf73b2 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 e5f9c347ef Remove trailing spaces in Android source code. 2015-04-08 12:14:36 +02:00
Ryan C. Gordon 77ccc412f5 CMake: Minor cleanup up on the new SDL_*_ENABLED_BY_DEFAULT vars. 2014-12-13 02:40:52 -05:00
Ryan C. Gordon fe40a17224 Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.

This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
2014-12-18 00:19:52 -05:00
Ryan C. Gordon a228b67d88 CMake: Replace "else(condition)" with "else()", etc.
Bumped required CMake version to 2.8.

Thanks to the SDL/Emscripten porting team for this cleanup.
2014-12-13 02:33:52 -05:00
Sam Lantinga 708a43f50e Treat any key device as a keyboard
This matches commit d325f1bbbab4 for when udev is not running
2014-12-13 13:20:19 -08:00
Philipp Wiesemann b9707732e3 Removed unused includes and functions from test program. 2014-12-12 21:51:30 +01:00
Philipp Wiesemann 269c2476b6 Replaced sqrt() with SDL_sqrt() in test program. 2014-12-12 21:02:46 +01:00
Philipp Wiesemann 701c97074f Removed global variable from test program.
On Android starting the application after a previous quit did not always work.
Android keeps VM processes for a faster restart and therefore the loaded *.so.
2014-12-12 21:00:25 +01:00
Philipp Wiesemann e2a5c1d203 Removed extern declaration of not existing SDL_numhaptics from internal header. 2014-12-11 23:38:02 +01:00
Philipp Wiesemann 0f87761bf3 Removed dependency to stdbool.h in implementation file for Android.
This reduced mixing of different types in the file (bool, jboolean, SDL_bool).
2014-12-10 21:20:41 +01:00
Philipp Wiesemann d99911544f Fixed setting text to clipboard in controllermap program. 2014-12-10 21:13:43 +01:00
Philipp Wiesemann 45fa5642ea Added comments in example program. 2014-12-10 21:10:55 +01:00
Philipp Wiesemann fbbd593230 Fixed bug 2811 - [patch] Android core: Fix JNI 'nativeGetHint' symbol not being exported
Jonas Kulla

I don't see a reason why this shouldn't be exported. Currently a strip -s on the final application library eats it.
2014-12-09 22:49:16 +01:00
Philipp Wiesemann a830fbc70f Fixed warnings about possible loss of data in conversion. 2014-12-06 00:17:52 +01:00
Philipp Wiesemann 4f26e7760a Replaced free() with SDL_free() because related allocation also uses wrapper. 2014-12-04 21:41:30 +01:00
Philipp Wiesemann 8dc56f2b31 Corrected header file guard comment. 2014-12-04 21:33:59 +01:00
Ryan C. Gordon ec6b9b27a6 Fixed some paths in the new buildbot windows zipper script. 2014-12-04 02:24:22 -05:00
Ryan C. Gordon 5789cb4a3b Added a script to handle packing up Windows builds for the buildbot. 2014-12-04 02:09:07 -05:00
Edward Rudd 623b9d6d91 ugh.. stray character 2014-12-03 12:47:39 -05:00
Edward Rudd 06d357fb17 fix SDL_PRIs64 on windows compilers.. (should end in d) 2014-12-03 12:45:04 -05:00
Edward Rudd 73daadb74e switch to use SDL_PRI* macros for long long formatting everywhere. 2014-12-03 12:23:17 -05:00
Edward Rudd 7810d19812 fix incorrect struct member name in test code for wheel direction 2014-12-03 11:04:07 -05:00
Eric Wing 313881175d Adds support to control the scaling policy/mode of SDL_RenderSetLogicalSize for both letterbox (current behavior) and a new overscan mode (expand to fill the entire screen, even if some parts draw off the screen).
The expected use case is for games that are designed with multiple aspect ratios already in mind and leave optional margins on the edges of the game which won't hurt if they are cut off.

An example use case is a game is designed for wide-screen/16:9, but then wants to deploy on an iPad which is 4:3. Normally, SDL will letterbox, which will shrink things and result in wasted space. But the designer already thought about 4:3 and designed the edges of the game so they could be cut off without any functional loss. So rather than wasting space with letterboxing, "overscan" mode will zoom the rendering to fill up the entire screen. Parts on the edges will be drawn offscreen, but since the game was already designed with this in mind, it is fine. The end result is the iPad (4:3) experience is much better since it feels like a game designed for that screen aspect ratio.

This patch introduces a new SDL_hint: SDL_HINT_RENDER_LOGICAL_SIZE_MODE.
Valid values are "letterbox" or "0" for letterboxing and "overscan" or "1" for overscan.
The default mode is letterbox to preserve existing behavior.

// Example usage:
SDL_SetHint(SDL_HINT_RENDER_LOGICAL_SIZE_MODE, "overscan");
SDL_RenderSetLogicalSize(renderer, SCREEN_WIDTH, SCREEN_HEIGHT);
2014-12-03 04:41:26 -08:00
David Ludwig 5fee84f24b WinRT: removed SDL_HINT_WINRT_PREF_PATH_ROOT (introduced post-2.0.3 & pre-2.0.4)
A WinRT app's Roaming folder-path can still be retrieved via calls to
SDL_WinRTGetFSPathUTF8() or SDL_WinRTGetFSPathUNICODE(), if need be.
2014-12-02 21:18:50 -05:00
Alex Szpakowski cc0631a095 Merged default into iOS-improvements 2014-12-02 02:52:45 -04:00
Alex Szpakowski ba6392d79d Fixed SDL_GetRendererOutputSize on iOS when high-DPI mode is enabled on a Retina device. 2014-12-01 07:31:22 -04:00
Andreas Schiffler 52760dcdf1 Fix assert format strings/parameters in testautomation modules; improve output of SDL_CompareSurfaces to aid debugging; update platform_testSetErrorInvalidInput for SDL changes 2014-11-30 20:55:27 -08:00
Philipp Wiesemann 0d38073a54 Removed generated doxygen output of visual test suite.
The files may be generated again by running doxygen locally (like SDL's docs).
2014-11-30 22:17:12 +01:00
Sam Lantinga f86af130f5 Fixed bug 2795 - SDL library detection selects the wrong lib
Chris Beck

When creating a homebrew recipe for wesnoth, I discovered that the SDL image configuration routine does not detect libpng properly -- if you have multiple instances of libpng on your system, and you use environment variables to select an instance which is not in your system directory, the build can be broken, because it will run configuration tests against the system installed version, but deduce that it should use the filename of the system-installed version. In a vanilla build of wesnoth using homebrew, this results in segfaults at runtime, because you end up linking against two different versions of libpng, which is also needed independently of SDL.

The problem is essentially in the "find_lib" routine in the configure file:



find_lib()
{
    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
    env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`]
    for path in $gcc_bin_path $gcc_lib_path $env_lib_path /usr/lib /usr/local/lib; do
        lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
        if test x$lib != x; then
            echo $lib
            return
        fi
    done
}



Because the for loop goes over the system directories before the environment directories, any system-installed lib will shadow the lib selected via environment variables. This is contrary to the behavior of the configuration tests earlier in the script, which prefers the environment variable libs over the system-installed libs. The 'for' loop should instead be:



    for path in $env_lib_path $gcc_bin_path $gcc_lib_path /usr/lib /usr/local/lib; do



You can see the full discussion on the Homebrew / linuxbrew issue tracker here: https://github.com/Homebrew/linuxbrew/issues/172

I have checked that this bug also affects SDL 1.2.15, SDL_mixer and SDL_ttf 1.2, which all use this same "find_lib" routine. I have not determined if the bug affects SDL 2.0, which seems not to use this exact routine.
2014-11-29 14:41:18 -08:00
Sam Lantinga 265b219e3e Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase handled as time instead of angle; + direction clarification
Elias Vanderstuyft

Remove the dependency of the calculation of Linux "phase" on "period",
currently the "phase" parameter is interpreted as a time shift, instead of a phase shift.
The Linux input documentation is not clear about the exact units of the "phase" parameter (see http://lxr.free-electrons.com/source/include/uapi/linux/input.h?v=3.17#L1075 ),
but we're about to standardize the 'phase shift' interpretation into the Linux input documentation,
since this will ease the job of a driver to recalculate the effect's state when the user dynamically updates the "period" parameter.
2014-11-29 11:51:13 -08:00
Sam Lantinga a5ce9c1113 Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase handled as time instead of angle; + direction clarification
Elias Vanderstuyft

"Horizontal" is not very precise, use "Positive phase" instead.
"Positive" because it's actually waveform(2*pi*t + phase) instead of waveform(2*pi*t - phase).
2014-11-29 11:49:58 -08:00
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