Commit Graph

67 Commits (551cdc8dec29d1aa09cc0d12e5945970ecc34ad2)

Author SHA1 Message Date
Philipp Wiesemann f8aa4291ca Added brackets to function names in header comments so that doxygen links them. 2016-10-02 22:32:18 +02:00
Sam Lantinga 614cb35a4d 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 bb24662c79 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 77305d47c2 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 9fff05f8d6 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 b7e45f8a1a 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 4f4c4b629f Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Sam Lantinga a13da2faa7 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 e45698d218 Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
Alex Szpakowski f31c7086d8 Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
Alex Szpakowski 459102a5c0 Updated URL in a comment 2016-09-17 01:36:29 -03:00
Alex Szpakowski a96b6f2104 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 7f28853b89 Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
Alex Szpakowski f050576665 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 2da1ec8354 Merge audio capture work back into the mainline. 2016-08-28 13:36:13 -04:00
Philipp Wiesemann f6f9350a3c Added link in header comment. 2016-08-17 21:05:00 +02:00
Ryan C. Gordon 7315390171 audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
Philipp Wiesemann 24bc00a831 Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02:00
Philipp Wiesemann a4abda0b70 Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
Alex Szpakowski 4a468739f8 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 6255c8584a 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 cfe3f26115 Updated documentation of SDL_CreateWindow() and SDL_CreateWindowFrom(). 2016-05-11 21:09:45 +02:00
Philipp Wiesemann 63f2ec8e57 Updated documentation of SDL_HINT_THREAD_STACK_SIZE in header file. 2016-05-05 22:04:16 +02:00
Philipp Wiesemann b1ce3799e9 Added missing links at documentation of SDL_FreeCursor() in header file. 2016-05-05 22:03:52 +02:00
Philipp Wiesemann bb9dcf5714 Android: Updated name of README file. 2016-04-25 22:17:38 +02:00
Alex Szpakowski 88372277b7 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 e5d575b933 Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
Ethan Lee 167cf14c1f SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
Philipp Wiesemann 1a26c0c838 Fixed doxygen warnings. 2016-01-06 22:38:35 +01:00
Ryan C. Gordon dc532c70e8 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.
2016-01-05 02:27:50 -05:00
Ryan C. Gordon aa4952fdef 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.
2015-04-21 10:10:59 -04:00
Ryan C. Gordon d4aedf9951 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.
2015-04-21 09:45:58 -04:00
Ryan C. Gordon e497e46515 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.
2016-01-05 02:28:56 -05:00
Ryan C. Gordon 3bdaf4c611 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.
2016-01-05 02:46:10 -05:00
Ryan C. Gordon 5696e88e6b 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.
2016-01-05 02:29:06 -05:00
Ryan C. Gordon 8e855f2fbc 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.
2016-01-05 01:42:00 -05:00
Ryan C. Gordon f2defe5e11 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.
2016-01-05 01:30:40 -05:00
Ryan C. Gordon f9b7379341 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.
2016-01-05 02:26:45 -05:00
Ryan C. Gordon c3114975db Added SDL_GetDisplayUsableBounds(). 2016-01-04 23:52:40 -05:00
Ryan C. Gordon e0e04542d0 Added a few FIXMEs. 2015-04-21 09:46:48 -04:00
Sam Lantinga 42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann 4a93dae4cd Added brackets to function names in header comments so doxygen links them. 2016-01-01 17:39:55 +01:00
Alex Szpakowski 4aae0290ea Updated some header comments and iOS documentation to better clarify high-dpi / retina support and screen-coordinate sizes versus pixel sizes. 2015-12-31 21:16:43 -04:00
Ryan C. Gordon 61518bce6b CMake: Changes to get CMake project to work with Android (thanks, Martin!).
Fixes Bugzilla #3194.

(but note that Bugzilla #3200 still needs to be resolved to get this really
going on Android, at a minimum.)
2015-12-29 00:57:24 -05:00
Philipp Wiesemann d3a841eb88 Pandora: Fixed deactivating no more available CD-ROM support in config header. 2015-12-07 21:41:55 +01:00
David Ludwig 25abce513d WinRT: added Win10/UWP (Universal Windows Platform) support
"UWP" appears to be Microsoft's new name for WinRT/Windows-Store APIs.

This set of changes updates SDL's WinRT backends to support the Win10 flavor
of WinRT.  It has been tested on Win10 on a desktop.  In theory, it should
also support Win10 on other devices (phone, Xbox One, etc.), however further
patches may be necessary.

This adds:
- a set of MSVC 2015 project files, for use in creating UWP apps
- modifications to various pieces of SDL, in order to compile via MSVC 2015 +
  the Win10 API set
- enables SDL_Window resizing and programmatic-fullscreen toggling, when using
  the WinRT backend
- WinRT README updates
2015-11-29 19:33:11 -05:00
David Ludwig fa2d5ab497 WinRT: bug-fix - SDL_SetThreadPriority() didn't work on WinRT 8.x platforms
WinRT 8.0 (Phone and non-Phone) didn't offer an API to set an already-created
thread's priority.  WinRT 8.1 offered this API, along with several other
Win32 thread functions that were previously unavailable (in WinRT).

This change makes WinRT 8.1+ platforms use SDL's Win32 backend.
2015-11-26 13:51:03 -05:00
David Ludwig 623898f70b WinRT: lots of display and windowing related fixes
This change-set fixes a lot of windowing related bugs, especially with
regards to Windows 8.x apps running on Windows 10 (which was the driver for
this work).  The primary fixes include:
* listed display modes were wrong, especially when launching apps into a
  non-fullscreen space
* reported window flags were often wrong, especially on Windows 10
* fullscreen/windowed mode switches weren't failing (they are not
  programmatically possible in Win 8.x apps).
2015-11-26 00:41:39 -05:00
Ryan C. Gordon f09d3750ea Minor whitespace fix. 2015-11-14 14:53:44 -05:00
Ryan C. Gordon e6ad29aec8 Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID(). 2015-11-14 12:35:45 -05:00