Commit graph

1788 commits

Author SHA1 Message Date
Sam Lantinga
d53007ae0e Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h
Ryan C. Gordon

We still include iconv.h in SDL_stdinc.h, probably because this header might have referenced the native iconv functions and types directly. Since these are hidden behind a stable ABI now and never just a #define for the system iconv, we shouldn't need this header included from a public SDL header anymore, slowing down external apps compiles and pulling tons of stuff into the namespace.
2016-10-07 16:44:42 -07: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
2803a1f6b3 Fixed bug 3165 - define numbers don't match types in Swift
C.W. Betts

Swift is very strict with types, so much that those of different signedness/size must be cast. Most of the defines are imported as 32-bit signed integers, while the corresponding field in a struct is a 32-bit unsigned integer. Appending a "u" would cause the defined types to be imported as 32-bit unsigned integers.
2016-10-01 13:35:36 -07:00
Sam Lantinga
7963feb3d1 Fixed bug 3301 - IBus support on Linux with CMake
joe.gsoc16

I recently looked into Unicode support in SDL2 and realized that
SDL_TEXTEDITING doesn't get triggered at all (Japanese IME).
According to others on IRC it works fine on Windows/Mac but not
for me on (arch)Linux.
When compiling SDL with autotools, IBus support is enabled by
default but not so with CMake.
I never used CMake before but got it working and also included
that pkg-config determines flags for dbus (FIXME in CMakeLists).
2016-10-01 12:48:08 -07:00
Sam Lantinga
a64ed63bba Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect
Simon Hug

The description of the SDL_RenderClear function in the SDL_render.h header says the following:

"This function clears the entire rendering target, ignoring the viewport."

The word "entire" implies that the clipping rectangle set with SDL_RenderSetClipRect also gets ignored. This is left somewhat ambiguous if only the viewport is mentioned. Minor thing, but let's see what the implementations actually do.

The software renderer ignores the clipping rectangle when clearing. It even has a comment on this: /* By definition the clear ignores the clip rect */

Most other render drivers (opengl, opengles, opengles2, direct3d, and psp [I assume. Can't test it.]) use the scissor test for the ClipRect and don't disable it when clearing. Clearing will only happen within the clipping rectangle for these drivers.

An exception is direct3d11 which uses a clear function that ignores the scissor test.
2016-10-01 11:46:32 -07: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
b26da9ce71 Fixed bug 3336 - Failure to build with MinGW-w64
Kai Sterker
There are already patches available from mingw64 that fix the issue

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2

With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
2016-10-01 10:28:00 -07:00
Ryan C. Gordon
68abf12b7b Added SDL_SetWindowResizable(). (thanks, Ethan!)
--HG--
extra : rebase_source : a1929f1de6844265f3744a87384620703f960de9
2016-09-29 22:52:41 -04: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
Sam Lantinga
79485875b5 Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
Alex Szpakowski
ef9bde21c8 Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03: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
Sam Lantinga
a1e419f3ad Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07: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
Ryan C. Gordon
b8e34b3fa1 Merge audio capture work back into the mainline. 2016-08-28 13:36:13 -04:00
Philipp Wiesemann
7276d8862d Added link in header comment. 2016-08-17 21:05:00 +02:00
Ryan C. Gordon
42e7791e9e audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
Philipp Wiesemann
e0a678cddf Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02: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
Alex Szpakowski
e2f5a3023a Removed Mac OS 10.5 support (bug #3137). Also fixed a warning about deprecated Carbon code when using SDL_audio (bug #3127, thanks Dominik!) 2016-05-21 00:20:52 -03:00
Philipp Wiesemann
174644080b Updated documentation of SDL_IsScreenSaverEnabled().
The screensaver is deactivated by default since SDL 2.0.2.
2016-05-20 22:18:15 +02:00
Philipp Wiesemann
a34752c0b2 Updated documentation of SDL_CreateWindow() and SDL_CreateWindowFrom(). 2016-05-11 21:09:45 +02:00
Philipp Wiesemann
788f608230 Updated documentation of SDL_HINT_THREAD_STACK_SIZE in header file. 2016-05-05 22:04:16 +02:00
Philipp Wiesemann
75f76edd81 Added missing links at documentation of SDL_FreeCursor() in header file. 2016-05-05 22:03:52 +02:00
Philipp Wiesemann
f2cc87ed9a Android: Updated name of README file. 2016-04-25 22:17:38 +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
438241a969 Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
Ethan Lee
c93d43c4e0 SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
Philipp Wiesemann
ec0694a978 Fixed doxygen warnings. 2016-01-06 22:38:35 +01:00
Ryan C. Gordon
3230d74d35 Added SDL_WINDOWEVENT_TAKE_FOCUS.
This is for corner cases where a multi-window app is activated and wants to
make a decision about where focus should go.

This patch came from Unreal Engine 4's fork of SDL, compliments of Epic Games.

--HG--
extra : histedit_source : 6fd97aa1e055c3b27127ea1ca2fc2a2022f2a65f
2016-01-05 02:27:50 -05:00
Eric Wing
45f310fb48 merged SDL 2.0.4 rc2 2015-06-21 04:04:14 -07:00
Sam Lantinga
e144065e28 Android has clock_gettime() - thanks Michael Labbe! 2015-06-19 23:40:23 -07:00
Eric Wing
88a535d7ae merged SDL 2.0.4rc1+ 2015-06-17 20:03:08 -07:00
Ryan C. Gordon
c6c3f10445 Removed Edgar's name from SDL_haptic.h at his request.
--HG--
extra : rebase_source : 908ec7e72e9a1320ae5e6b15f32a991df5d22eb8
2015-06-17 12:59:12 -04:00
Sam Lantinga
b15e71afdc Partial fix for bug 2758 - Android issues with NDK r10c and API-21
Sylvain

When using API 21 and running on an old device (android < 5.0 ?) some function are missing.

functions are (at least) : signal, sigemptyset, atof, stpcpy (strcat and strcpy), srand, rand.


Very few modifications on SDL to get this working :

on SDL
======

Undefine android configuration :

HAVE_SIGNAL
HAVE_SIGACTION
HAVE_ATOF

In "SDL_systrhead.c", comment out the few block of lines with "sigemptyset".

Android.mk:
remove the compilation of "test" directory because it contains a few rand/srand calls

Also, there are more discussions about this in internet :
https://groups.google.com/forum/#!topic/android-ndk/RjO9WmG9pfE
http://stackoverflow.com/questions/25475055/android-ndk-load-library-cannot-locate-srand
2015-06-17 00:07:45 -07:00
Sam Lantinga
6c13c2bf5c Fixed bug 3009 - Cannot compile SDL2 on Windows
CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
2015-06-13 10:47:55 -07:00
Ryan C. Gordon
ce5063420d configure/cmake/x11: Removed SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 test.
This was the only thing that made SDL_config.h generate differently between
32 and 64-bit versions of Linux, so instead we force a function cast in our
X11 code to match our dynamic loader version, which removes the compile error
on some machines that prompted this test in the first place.

Xlib never wrote to this data, so if you're on an older Xlib where this param
wasn't const, your data should still be intact when we force the caller to
think it was actually const after all.

Fixes Bugzilla #1893.
2015-06-08 01:13:51 -04:00
Philipp Wiesemann
94fac461b4 Fixed comments at conditional compilation macro in header file. 2015-06-05 19:41:34 +02:00
Ryan C. Gordon
f7c1221947 Fixed SDL_ISPIXELFORMAT_ALPHA to check pixel orders that match pixel type.
Otherwise, SDL_PIXELFORMAT_BGR24 is reported as having alpha, because
 its SDL_ARRAYORDER_BGR pixel order uses the same integer value as
 SDL_PACKEDORDER_RGBA, since we weren't checking the pixel type to
 differentiate.

Fixes Bugzilla #2977.
2015-05-31 01:45:20 -04:00
Philipp Wiesemann
d183a00458 Fixed typo in header file documentation comment. 2015-05-29 22:24:38 +02:00
Ryan C. Gordon
8c55bb48fe Added SDL_WINDOWEVENT_HIT_TEST.
This lets windows know when they are dropping a mouse event because their
hit test reported something other than SDL_HITTEST_NORMAL. It lets them know
exactly where in the event queue this happened.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : 28a87f5e035dcf9b84e2a343c36e55795e2d4dcc
2015-04-21 10:10:59 -04:00
Ryan C. Gordon
cdd64f2020 Added SDL_SetWindowModalFor().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 645293aaac39f2f9740ead48719b5d285a53ba2c
extra : histedit_source : ab4c8f32ee931de00f9f632dd34d860f65279922
2015-04-21 09:45:58 -04:00
Ryan C. Gordon
19373e60da Added SDL_SetWindowInputFocus().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 730a99950b9cece544b7bebc4e5ae89a76ece0c8
extra : histedit_source : 2ade56ac0691a527638010cf47ed23467e38d21b
2016-01-05 02:28:56 -05:00
Ryan C. Gordon
2875d70eba Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 99ddce333d2a4de7d59adb88d5059b34d731d907
extra : histedit_source : 012e8cb2f7822cd55cbbc124f642ccc530e3f75b%2Cbddf95ecf18ca97e1e3d7840971ef14ca739c9da
2016-01-05 02:46:10 -05:00
Ryan C. Gordon
8afe3ca698 Added SDL_GetWindowBordersSize().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : dfbcf454974baeb9dea6aeee929dcecb14924e7c
extra : histedit_source : 9d688d7641ae624a1d0129796a338f4ff2b50896
2016-01-05 02:29:06 -05:00
Ryan C. Gordon
eb318de919 Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops.
This allows an app to know when a set of drops are coming in a grouping of
some sort (for example, a user selected multiple files and dropped them all
on the window with a single drag), and when that set is complete.

This also adds a window ID to the drop events, so the app can determine to
which window a given drop was delivered. For application-level drops (for
example, you launched an app by dropping a file on its icon), the window ID
will be zero.

--HG--
extra : amend_source : d117ff057792aa4827cd846e7786f863a5b55214
extra : histedit_source : e412d6129e61512374a548b1549cbb73de587b5b
2016-01-05 01:42:00 -05:00
Ryan C. Gordon
7344ea2528 Added special window type flags.
Specifically: always on top, skip taskbar, tooltip, utility, and popup menu.

This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : e9036b7eb9238337f3d98b9c610ff3e1ed027a70
2016-01-05 01:30:40 -05:00
Ryan C. Gordon
b8b82c170e Added SDL_DROPTEXT event, for dragging and dropping string data.
This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : e662a1d2d2a9bba6a75c799d9f7228303d654de1
2016-01-05 02:26:45 -05:00
Ryan C. Gordon
6a3cfbf68f Added SDL_GetDisplayUsableBounds().
--HG--
extra : histedit_source : 3c9c2d344e3e3ff20bd86035066b65810346ac3e
2016-01-04 23:52:40 -05:00