Commit Graph

76 Commits

Author SHA1 Message Date
Ryan C. Gordon
b1e646da0f Support for QNX 7.0 (thanks, Elad!).
Fixes Bugzilla #3686.
2017-07-01 17:50:47 -04:00
Ryan C. Gordon
bf09ce5fce stdlib: added SDL_utf8strlen(). 2017-05-29 03:01:05 -04:00
Sam Lantinga
e147ccd615 Added an API to get the joystick instance ID before opening the device: SDL_JoystickGetDeviceInstanceID() 2017-03-09 16:09:16 -08:00
Sam Lantinga
548c43b893 Make sure the memory barrier functions are always available, and now they are implemented on Android __ARM_ARCH_5TE__ 2017-02-10 11:21:15 -08:00
Sam Lantinga
9cff625c90 Added an API to get the type of a connected joystick 2017-01-27 05:59:58 -08:00
Sam Lantinga
1e81ac1559 Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value.
This is useful for controller mapping programs to determine an axis' zero state
2017-01-04 10:28:07 -08:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
5d0f852a47 Fixed updated return value for SDL_GL_SwapWindow()
Ozkan Sezer

http://hg.libsdl.org/SDL/rev/00fe449fbefe seems to have
forgotten removing the return from SDL_dynapi_procs.h, and this patch
does that. Without it, MSVC warns:
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow_DEFAULT' : 'void' function returning a value
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow' : 'void' function returning a value
2016-12-12 09:19:48 -08:00
Sam Lantinga
23ab0d83a2 Fixed ABI, don't change the return type of SDL_GL_SwapWindow() 2016-12-11 12:01:44 -08:00
Sam Lantinga
b505909719 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status
Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
2016-12-09 01:47:43 -08:00
Sam Lantinga
f660677b48 Added an API to iterate over game controller mappings 2016-11-29 06:36:57 -08:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Ryan C. Gordon
162885911a cpuinfo: first attempt at SDL_HasNEON() implementation. 2016-11-17 01:15:16 -05:00
Sam Lantinga
0d8dc91c1b Standardized the format of the SDL joystick GUID and added functions to retrieve the USB VID/PID from a joystick and game controller. 2016-11-10 17:19:34 -08:00
Sam Lantinga
9272bc5e41 Fixed bug 3478 - Patch Haiku to use dlopen instead of load_add_on
Kai Sterker

SDL2 on Haiku so far uses Haiku-specific APIs for loading dynamic objects as add-ons, instead of using dlopen to load them as libraries. This, for example, leads to SDL_mixer not being able to load its audio backends, when compiled with standard settings.

As discussed at https://www.freelists.org/post/haikuports/SDL2-mixer-ogg-music-not-playing-and-other-stuff,2 , the best way to deal with this would be using dlopen instead of load_add_on. The following patch implements this change by dropping the Haiku-specific bits and using dlopen instead.
2016-11-01 10:30:46 -07:00
Sam Lantinga
496ebf193c Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Sam Lantinga
627ea7840f Fixed bug 2924 - SDL_CreateRGBSurface[From] versions that take SDL_PIXELFORMAT enum
Daniel Gibson

Currently, SDL_CreateRGBSurface() and SDL_CreateRGBSurfaceFrom() take Uint32 masks for RGBA to "describe" the Pixelformat of the surface.
Internally those value are only used to map to one of the SDL_PIXELFORMAT_* enum values that are used for further processing.

I think it would be both handy and more efficient to be able to specify SDL_PIXELFORMAT_* yourself without using SDL_PixelFormatEnumToMasks() to create masks first, so I implemented functions that do that:
SDL_CreateRGBSurfaceWithFormat() and SDL_CreateRGBSurfaceWithFormatFrom() which are like the versions without "WithFormat" but instead of taking 4 Uint32s for R/G/B/A masks, they take one for a SDL_PIXELFORMAT_* enum value.

Together with https://bugzilla.libsdl.org/show_bug.cgi?id=2923 creating a SDL_Surface* from RGBA data (e.g. from stb_image)  is as easy as
  surf = SDL_SDL_CreateRGBSurfaceWithFormat(0, w, h, bppToUse*8, SDL_PIXELFORMAT_RGBA32);
2016-10-07 17:04:58 -07:00
Ryan C. Gordon
e5dd6e9985 Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Ryan C. Gordon
4d927d82ed audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
Philipp Wiesemann
c3e852012f Fixed compile warnings about evaluating undefined identifiers.
Partially fixes Bugzilla #3351.
2016-07-17 20:32:44 +02:00
Philipp Wiesemann
358ffa8be9 PSP: Deactivated dynamic API.
Thanks to Bugzilla #3240 for pointing this out.
2016-02-13 17:35:38 +01:00
Ryan C. Gordon
f3c5e0378f Updated dynamic API table. 2016-01-07 14:51:22 -05:00
Ryan C. Gordon
6e05fc7475 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
ba5c3a4e15 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
72069d9f3d 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
18612a605a 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
34581fedd1 Added SDL_GetDisplayUsableBounds(). 2016-01-04 23:52:40 -05:00
Ryan C. Gordon
0e7135739a Remove almost all instances of "volatile" keyword.
As Tiffany pointed out in Bugzilla, volatile is not useful for thread safety:

https://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/

Some of these volatiles didn't need to be, some were otherwise protected by
spinlocks or mutexes, and some got moved over to SDL_atomic_t data, etc.

Fixes Bugzilla #3220.
2016-01-03 06:50:50 -05:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Ryan C. Gordon
87c985cd18 Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID(). 2015-11-14 12:35:45 -05:00
Sam Lantinga
112e8da428 SDL - add dynapi entry points for SDL_JoystickCurrentPowerLevel 2015-09-30 15:38:18 -07:00
Alfred Reynolds
57f3c86ef9 Move GetDisplayDPI to the end of the file. 2015-07-29 17:19:06 -07:00
Alfred Reynolds
d1b2428816 Add SDL_GetDisplayDPI routine and implement for Windows. 2015-07-29 17:18:56 -07:00
Ryan C. Gordon
9d0bfb6d5c Fixed dynapi for new SDL_WarpMouseGlobal() function signature. 2015-07-18 00:04:49 -04:00
Ryan C. Gordon
fd638d4de7 SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be
implemented on!), and there's currently no way for an app to know this.

This shouldn't break ABI on apps that moved to a revision between 2.0.3 and
2.0.4.
2015-07-17 21:03:58 -04:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
ab8a05e9ce Added a userdata parameter to SDL_SetWindowsMessageHook() 2015-05-13 22:39:32 -07:00
Sam Lantinga
7aacea735d Fixed Mac and Linux builds 2015-05-13 22:39:27 -07:00
Sam Lantinga
af8c286153 Added SDL_SetWindowsMessageHook() to facilitate full IME support on Windows 2015-05-13 22:39:20 -07:00
Ryan C. Gordon
8873c00053 Minor input grab clarifications.
Clarify that grabbing the mouse only works with one window at a time; this was
always true at the system level, though SDL could previously get confused
by multiple simultaneous grabs, so now we explicitly break any existing
grab before starting a new one and document it as such.

Also track the window that is currently grabbed, and provide an API to query
for that window. This makes it easy to automate mouse ungrabbing at
breakpoints with gdb7's scripting, since the scripts can now know which window
to ungrab.

In 2.1, we should probably change this API to SDL_GrabInput(win) and
SDL_UngrabInput(void), or something.
2015-03-28 00:48:03 -04:00
Ryan C. Gordon
96771b8c31 Make the Dynamic API master switch more clear. 2015-03-25 11:18:54 -04:00
Ryan C. Gordon
15235dc21b Dynamic API: don't leak if a library loaded but didn't have the entry point. 2015-01-05 01:07:36 -05:00
Ryan C. Gordon
a9626cb76e 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
Sam Lantinga
47f40262b5 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga
18fc7db9e2 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07:00
Ryan C. Gordon
01187b701d Added audio device buffer queueing API. 2014-07-22 21:41:49 -04:00
Sam Lantinga
7f1561039c Fixed bug in AVX detection and added AVX2 detection 2014-07-11 22:02:50 -07:00
Ryan C. Gordon
e59e44ff6b Merged Ryan's SDL-gui-backend branch.
Adds three APIs, and implements them on X11, Cocoa, and Windows:

- SDL_CaptureMouse()
- SDL_GetGlobalMouseState()
- SDL_SetWindowHitTest()
2014-06-25 17:06:12 -04:00
Ryan C. Gordon
25c056b0ae Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState().
This matches naming conventions in the main repository, between
 SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
2014-06-25 16:16:55 -04:00
Sam Lantinga
e1683fad67 Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00