Commit graph

102 commits

Author SHA1 Message Date
Stefan
d9927c706c rpi video - Use dispmanx scaling (#1)
* Use dispmanx scaling
* There is the new SDL hint SDL_VIDEO_RPI_SCALE_MODE. There are three values.
 * The variable can be set to the following values:
 *   "0"       - Window resolution is desktop resolution.
 *               This is the behaviour of SDL <= 2.0.4. (default)
 *   "1"       - Requested video resolution will be scaled to desktop resolution.
 *               Aspect ratio of requested video resolution will be respected.
 *   "2"       - Requested video resolution will be scaled to desktop resolution
 *   "3"       - Integer scaling. dst_rect is an integral multiple of src_rect. Should prevent scaling artifacts.
* Add aspect ratio hint
2017-03-13 17:01:30 +00:00
Sam Lantinga
8bc6a7ef95 Fixed bug 3369 - RaspberryPI ability to specify a Dispmanx layer
Albert Casals

On a RaspberryPI, it might become convenient to specify the Dispmanx layer SDL uses.
Currently, it is hardcoded to be 10000 to sit above most applications.

This can be specially useful when integrating other graphical apps and frameworks like OMXplayer, QT5 etc.. in order to have more flexibility on their Z-order.
2016-10-18 23:24:49 -07:00
Sam Lantinga
1b032a0419 Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Ethan Lee
98fbc3fc5d SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING 2016-09-30 09:26:57 -04:00
Philipp Wiesemann
c81f11101f Added brackets to function names in header comments so that doxygen links them. 2016-10-02 22:32:18 +02:00
Sam Lantinga
b8f456007d Fixed bug 3352 - Adding alpha mask support to SDL_SaveBMP_RW
Simon Hug

The current SDL_SaveBMP_RW function that saves surfaces to a BMP uses an old bitmap header which doesn't officially support alpha channels. Applications just ignore the byte where the alpha is stored. This can easily be extended by using a newer header version and setting the alpha mask.

The attached patch has these changes:

- Extending the description of the function in the SDL_surface.h header with the supported formats.
- Refining when surfaces get stored to a 32-bit BMP. (Must have bit depth of 8 or higher and must have an alpha mask or colorkey.)
- Fixing a small bug that saves 24-bit BGR surfaces with a colorkey in a 24-bit BMP.
- Adding code that switches to the bitmap header version 4 if the surface has an alpha mask or colorkey. (I chose version 4 because Microsoft didn't lose its documentation behind a file cabinet like they did with version 3.)
- Adding a hint that can disable the use of the version 4 header. This is for people that need the legacy header or like the old behavior better. (I'm not sure about the hint name, though. May need changing if there are any rules to that.)
2016-10-01 11:29:13 -07:00
Sam Lantinga
5d60a58a8b Generalized the hint for whether the application gets a mouse event when clicking on the window to activate it, and is now named SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.
The behavior is defined to not receive the click event, and this hint allows you to override that.
2016-09-29 13:34:49 -07:00
Alex Szpakowski
bc55781bff Updated URL in a comment 2016-09-17 01:36:29 -03:00
Alex Szpakowski
3a2d9cee43 Added a new hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.
When set to "1", the orientation of the Apple TV remote affects the axes of the corresponding SDL joystick. It is "0" (disabled) by default.
2016-09-17 01:31:07 -03:00
Alex Szpakowski
398a513d09 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Philipp Wiesemann
9cb82d5ff2 Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
Philipp Wiesemann
788f608230 Updated documentation of SDL_HINT_THREAD_STACK_SIZE in header file. 2016-05-05 22:04:16 +02:00
Alex Szpakowski
bcb782f88c Add a new hint SDL_HINT_MAC_MOUSE_FOCUS_CLICKTHROUGH, which allows mouse click events to occur when clicking to focus a window in Mac OS X.
Fixes bug #3300.
2016-04-02 11:54:05 -03:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
9b526d28cb Add SDL_HINT_VIDEO_X11_NET_WM_PING to allow disabling
_NET_WM_PING protocol handling in CreateWindow if
desired.
2015-10-27 11:18:04 -07:00
Philipp Wiesemann
374505fcdb Android: Added to APK expansion file hint documentation in header file. 2015-09-17 22:21:12 +02:00
andrewb@andrewb-linux.valvesoftware.com
9f0c34896d Add SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to SDL so that Reborn can keep running through Alt+F4. 2015-08-03 11:37:03 -07:00
Alfred Reynolds
fd04003739 SDL
- add a new SDL_HINT_MAC_BACKGROUND_APP hint, when set or set to 1 don't force the app to be foreground
2015-07-29 17:19:15 -07:00
Philipp Wiesemann
d183a00458 Fixed typo in header file documentation comment. 2015-05-29 22:24:38 +02:00
Ryan C. Gordon
6ff4d48902 Stack hint should look for 0, not -1, and not care about environment variables. 2015-05-26 21:19:23 -04:00
Ryan C. Gordon
12bbb8e161 Added a hint to specify new thread stack size (thanks, Gabriel!).
Fixes Bugzilla #2019.

(we'll do a better fix when we break the API in SDL 2.1.)
2015-05-26 21:13:27 -04:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Alex Szpakowski
58e77377c6 iOS: Added support for SDL_DisableScreenSaver and SDL_EnableScreenSaver. 2015-05-16 16:55:56 -03:00
Alex Szpakowski
0bacddf42e Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-04-06 15:26:37 -03:00
Joseba García Etxebarria
3dcf5c743f * Improve mouse support in Android. These changes require Android API v12 to compile 2015-03-24 20:45:29 +01:00
Ryan C. Gordon
77d434ab89 Make the signal handler hint more generic. 2015-03-24 14:36:36 -04:00
Ryan C. Gordon
d9474bba87 Added a hint to prevent SDL from installing signal handlers.
Fixes Bugzilla #2431.
2015-03-24 14:29:25 -04:00
Alex Szpakowski
f2452bba77 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-01-15 01:15:24 -04:00
Philipp Wiesemann
f77a082faa Fixed typo in header file documentation comment. 2014-12-25 22:05:48 +01:00
Ryan C. Gordon
de88474dda 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!)

--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
David Ludwig
594785a021 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
dcfb9a729a Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-12-02 02:52:45 -04:00
David Ludwig
cba7a719d8 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
David Ludwig
fda1375d4e 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
Alex Szpakowski
0cac1b6415 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-10-28 18:36:29 -03:00
David Ludwig
b43fc928e6 WinRT: expanded the documentation on SDL_HINT_WINRT_HANDLE_BACK_BUTTON 2014-10-04 14:59:41 -04:00
Alex Szpakowski
240928cf85 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-09-10 18:10:37 -03:00
Philipp Wiesemann
c27fbbc30b Corrected hint documentation. 2014-08-27 23:27:42 +02:00
Alex Szpakowski
fdce275074 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-08-20 17:20:22 -03:00
Sam Lantinga
c34f97dd89 Changed the name of the IME hint to match the naming convention in SDL 2014-08-19 21:59:56 -07:00
Alex Baines
417f3be8cd Add a SDL_IM_INTERNAL_EDITING event to make IMs like iBus render editing text in its own UI instead of sending TEXTEDITING events.
This is useful for applications that handle TEXTINPUT events but not TEXTEDITING events.
2014-08-19 23:31:50 +01:00
Alex Szpakowski
2e0c23e436 Added support for SDL_SetWindowBordered on iOS. Worked around a bug with rotating the device on iOS 8.
--HG--
branch : iOS-improvements
2014-07-29 00:05:48 -03:00
Alex Szpakowski
701d88bb5b iOS now respects SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
--HG--
branch : iOS-improvements
2014-07-15 02:01:43 -03:00
Sam Lantinga
dc434901da Fixed bug 2553 - Add support to all XInput devices
This adds support for all XInput devices, exposed through the SDL joystick API.
The button and axis reporting for XInput devices has been changed to match DirectInput and other platforms.
The game controller xinput mapping has been updated so this change is seamless.
There is a new hint, SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, for any applications that have hardcoded the old xinput button and axis set. This hint will be removed in SDL 2.1.
2014-06-24 13:31:25 -07:00
Sam Lantinga
f5054661e6 Merged changes from Alexey Petruchik to support Android obb files
http://developer.android.com/google/play/expansion-files.html
2014-06-21 20:35:36 -07:00
Sam Lantinga
de9397e6ae Added a hint to disable windows message processing in SDL_PumpEvents()
SDL_SetHint( SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, "0" );
2014-06-04 10:52:34 -07:00
Sam Lantinga
deada6ba6d Added a hint to disable window frame and title bar interaction when the cursor is hidden 2014-06-04 10:50:32 -07:00
stopiccot
20623e3dad Fixing issues discovered by Philipp Wiesemann
--HG--
branch : apk
2014-04-23 03:42:32 +03:00
stopiccot
a41b3ce38b inital apk extension support
--HG--
branch : apk
2014-04-07 21:20:39 +03:00
Philipp Wiesemann
bbfa480b80 Fixed names of four hint environment variables. 2014-04-05 23:32:41 +02:00