Commit graph

1142 commits

Author SHA1 Message Date
Ryan C. Gordon
6bda63934d Make the new SDL_RWops::hidden::unknown::data2 field a void*, not an int. 2013-04-14 18:05:14 -04:00
Ryan C. Gordon
c865461ef8 Added a data2 field to the SDL_RWops::hidden::unknown.
This shouldn't change the ABI, since this struct had space left in the union.

--HG--
extra : rebase_source : 773ba0aa2ed9242d2259ed63384d23b98c33376a
2013-04-13 20:43:32 -04:00
Ryan C. Gordon
7c5943b1ee Fixed a typo (thanks, Ethan!). 2013-04-10 22:18:10 -04:00
Ryan C. Gordon
8d0b0c59bf More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
45592bbbee Corrected some stdinc inline functions (thanks, Martin!).
qsort() returns void, so remove the "return" keyword, plus some C++
 const_casting magic.

 Fixes Bugzilla #1785.
2013-04-04 11:35:22 -04:00
Ryan C. Gordon
7641f6840f Fixed compiler warnings in Mac Xcode builds. 2013-04-03 11:58:04 -04:00
Ryan C. Gordon
569de57dd7 Another attempt at fixing compiler warnings for SDLTest_SurfaceImage_t. 2013-04-03 11:49:25 -04:00
Ryan C. Gordon
9baec7cd8b Possibly fix compiler warnings, simplify SDLTest_SurfaceImage_t definition. 2013-04-03 11:38:05 -04:00
Sam Lantinga
888d367270 Fixed bug 1782 - SDL_opengl.h header disabled on FreeBSD
q66

The SDL_opengl.h header contains this:

#ifdef __FreeBSD__  /* !!! FIXME: temp compiler warning fix... */
#define NO_SDL_GLEXT 1
#endif

However, I can't seem to find what kind of compiler warning it was and it makes it unusable to use on FreeBSD. If I comment out these lines on my machine, everything works fine - I use FreeBSD 9-STABLE (x86_64, gcc and clang both, the same in a x86 chroot). All I could find is that this was causing an error on FreeBSD 8, but I can't test that on my machine (maybe if I set up some FreeBSD 8 chroot).

I set up a 8.2 chroot and investigated the problem. Apparently this issue was fixed in Mesa 7.6 (and in Git, June 4 2009, but it didn't get into 7.5). By the time those lines were added, FreeBSD contained the libGL port version 7.4.4, which suffered from the issue, but on April 2012 the version was updated to 7.6, which is available for FreeBSD 8 and FreeBSD 9 alike, which means those three lines should be safe to remove (it'll work fine for everyone with sufficiently up to date ports).
2013-04-01 23:15:21 -07:00
Ryan C. Gordon
4f438b70a2 Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Ryan C. Gordon
8c6b9f4743 Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Ryan C. Gordon
6432ccda7f Don't use __builtin_clz() on gcc2. (thanks, Axel!)
Fixes Bugzilla #1771.
2013-03-29 21:16:30 -04:00
Ryan C. Gordon
b7b75855ec Fixed compiler warnings with SDL_FORCE_INLINE on gcc2. (Thanks, Axel!)
Fixes Bugzilla #1770.
2013-03-29 21:13:16 -04:00
Sam Lantinga
e09b99c523 We're using the alpha component of the palette entries, let's name it appropriately. 2013-03-24 09:56:45 -07:00
Sam Lantinga
890d7ee576 Updated the license listed in the header, fixing bug 1768 2013-03-23 13:03:36 -07:00
Sam Lantinga
db141a68e8 Fixed bug 1764 - Integer Precision Loss During Compilation
Phil Sampson

/Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'
2013-03-19 22:02:34 -07:00
Sam Lantinga
fecccf1718 Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
Ryan C. Gordon

With this function...
   SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, int numrects);
...is there any reason rects isn't "const SDL_Rect *" ?
2013-03-19 21:53:33 -07:00
Sam Lantinga
e64abd6e47 The platform define for the PSP is __PSP__ 2013-03-17 09:45:40 -07:00
Sam Lantinga
3afbe992d5 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00
Captain Lex
47dac69dc7 Add PSP support 2013-03-17 20:07:02 +08:00
Sam Lantinga
f227d45db9 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
77815e31db Fixed const correctness issue with C++, and fixed building SDL_memcpy4 with 32-bit gcc. 2013-03-15 11:56:28 -07:00
Sam Lantinga
6ea7a3490d Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
a26645f7b1 Replace all the "static __inline__" functions with SDL_FORCE_INLINE. 2013-03-15 01:09:19 -04:00
Ryan C. Gordon
7e934f8f75 Improvements to stdlib.
All SDL_* functions are always available as real symbols, so you can always
link against them as a stable ABI. By default, however, all the things that
might have dithered down to macros in your application are now force-inlined,
to give you the same effect as before and theoretically better performance,
but still solve the classic macro problems.

Elsewhere, we provide real functions for these things that simply wrap the
inline functions, in case one needs to have a real function available.

Also: this exposed bugs: SDL_abs() does something different if you had the
macro vs the libc function, SDL_memcpy() returns a void* in the function
but not the macro, etc.
2013-03-15 01:01:20 -04:00
Ryan C. Gordon
e79e3b2343 Added an SDL_FORCE_INLINE macro. 2013-03-15 01:02:30 -04:00
Andreas Schiffler
42a673ce23 Fix bug 122 - SDL_RWops bug fixes: set RWops.type field, add input validation, add test coverage 2013-03-13 08:35:03 -07:00
Andreas Schiffler
6a2bff0cd1 Fix bug 1560 - SDL_RWFromConstMem write operation returns -1 but should return 0. 2013-03-12 09:10:37 -07:00
Ryan C. Gordon
3d572bdf89 First shot at Windows XInput haptics.
--HG--
extra : rebase_source : 52e691a0917d173e891e67714a135373daea0ef5
2013-03-10 13:05:47 -04:00
Andreas Schiffler
edbf26b139 Add parameter checking to SetWindowSize functions; add tests to video suite 2013-03-08 23:33:07 -08:00
Sam Lantinga
f41de44a36 Updated SDL_HINT_GAMECONTROLLERCONFIG documentation to reflect that it only takes effect before init. 2013-03-08 16:27:05 -08:00
Ryan C. Gordon
bd9fdb8099 Changed SDL_INIT_EVERYTHING to only request currently-known subsystems. 2013-03-08 11:38:08 -05:00
Sam Lantinga
7f2340dc6a Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization. 2013-03-08 10:09:51 -08:00
Sam Lantinga
1494812f7c Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library. 2013-03-07 20:42:55 -08:00
Sam Lantinga
c6388c87c1 Changed the name of SDL_mutexP() SDL_mutexV() 2013-03-07 20:12:40 -08:00
Sam Lantinga
69b8182419 The joystick events contain a joystick instance ID, which is a signed value, with -1 being invalid. 2013-03-06 11:59:21 -08:00
Sam Lantinga
85d6d00788 Removed multi-input events, since we removed the unimplemented API recently. 2013-03-06 11:59:15 -08:00
Edward Rudd
ac51aff110 Add SDL_TryLockMutex and implementations for all platforms 2013-03-05 18:54:55 -05:00
Edward Rudd
191718be44 add hint to allow disabling the use of Xinput. 2013-03-05 18:01:59 -05:00
Edward Rudd
5fd98b3297 add new gamecontroller APIs
- add mappings after init (or even before w/o using the hint)
- get string for axis
- get string for button
- get mapping string for controller or for GUID
- new event to notify when a controller is remapped. (e.g. mapping was changed via the AddMapping method)
2013-03-05 17:59:36 -05:00
Sam Lantinga
bb0752e573 Updated touch API
* Normalized touch coordinates as floats in the 0...1 range
* Removed unused touchpad concepts from the API
* Added API functions to get active touch devices and current finger state
2013-03-03 01:01:33 -08:00
Sam Lantinga
71ea3033fa Added a mouse ID to the mouse events, which set to the special value SDL_TOUCH_MOUSEID for mouse events simulated by touch input. 2013-03-02 20:44:16 -08:00
Sam Lantinga
c02018f852 Fixed the joystick id usage in the joystick and game controller events. 2013-03-02 17:51:32 -08:00
Sam Lantinga
43f89a9836 Updated the link to the USB usage page document 2013-02-28 20:01:17 -08:00
Sam Lantinga
2204530a1b Fixed gcc pedantic warnings in public headers 2013-02-26 20:41:28 -08:00
Jørgen P. Tjernø
a3482e3ac0 sdl2
- fix atomic header to compile happily under msvc 6.0
2013-02-25 16:52:48 -08:00
Jørgen P. Tjernø
cf58b77360 sdl2
- change the windows scancode logic to use the scan code value in lparam rather than VK's to get a stable scancode value across different KB layouts
2013-02-25 16:52:42 -08:00
Ryan C. Gordon
ad1d82cf83 Added SDL_GameControllerUpdate(). 2013-02-25 01:51:21 -05:00
Ryan C. Gordon
4de257c5d2 Added SDL_haptic.h to SDL.h. 2013-02-25 01:50:59 -05:00
Ryan C. Gordon
a5862a96a3 Changed the game controller enum types to match SDL naming conventions. 2013-02-25 00:56:21 -05:00