Commit Graph

1016 Commits

Author SHA1 Message Date
Sam Lantinga
d464d16a8f Fixed Haiku build issue with missing extension support.
The visibility attribute warnings in Haiku gl.h can be fixed by editing gl.h and changing the line:
#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
to
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))

as described in: http://dev.haiku-os.org/ticket/8882
2013-05-21 22:48:50 -07:00
Ryan C. Gordon
723af2b82a Backed out changeset b69dfd56e1b0
This was clearly not the right fix.
2013-05-21 23:35:45 -04:00
Ryan C. Gordon
886e159e92 Attempt to fix Haiku buildbot (and other systems with an old glext.h). 2013-05-21 23:13:52 -04:00
Sam Lantinga
9f6a52c28a Fixed bug 1856 - (Patch) More bits for SDL_MouseMotionEvent.state
Gerry JJ

The state bitmask in SDL_MouseMotionEvent is stored in an Uint8. Unfortunately this doesn't actually have room for 8 buttons because SDL skips 4 button indices after the third mouse button (at least here on Linux x86-64, probably related to wheel handling?), so it's really just enough to track 4 buttons. For example, on a Logitech MX310 mouse I've got, even though the mouse has 6 buttons total, the left and right side buttons and extra middle button have indexes 8, 9 and 10, and the last two won't fit in the 8 bit button state.

The source of the button state (in SDL_Mouse) is already 32-bit, and the state field in SDL_MouseMotionEvent is 32-bit aligned and followed by three 8-bit padding fields. So simply changing the SDL_MouseMotionEvent state to an Uint32 and removing the padding fields fixes this, and I think it should be binary compatible, at least for little endian.
2013-05-20 23:57:10 -07:00
Sam Lantinga
91acc847ca Fixed bug 731 - No mechanism to extract the NSView for 3d library 2013-05-20 22:05:49 -07:00
Sam Lantinga
1063a72829 Fixed bug 1837 - Use error extension instead of glGetError()
Implemented support for GL_ARB_debug_output, but was unable to test it on Mac OS X.
2013-05-19 22:28:10 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
3beb70c4bc Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Andreas Schiffler
d99b036e08 Update test harness to handle test return codes; fix comment format in harness; update Main test suite to handle globally disabled features 2013-05-18 09:35:09 -07:00
Philipp Wiesemann
27e1a7ca41 Fixed Doxygen warnings. 2013-05-18 14:48:19 +02:00
Ryan C. Gordon
3928468bfa Made SDL_RectEmpty and SDL_RectEquals macros into SDL_FORCE_INLINE functions.
Fixes compiler warnings for things like this...

  if (SDL_RectEmpty(&rect)) {}

...where the macro turned into "if ( (!(&rect)) && etc )" which some compilers
thought might be a programmer mistake, as "&rect" is always "true".
2013-05-16 12:16:12 -04:00
Philipp Wiesemann
f9a69af2f0 Fixed Doxygen warnings. 2013-05-15 22:00:28 +02:00
Philipp Wiesemann
8da0b7d301 Corrected spelling in header file. 2013-05-13 23:00:50 +02:00
Philipp Wiesemann
d1cc72dd52 Fixed bug 1845 - SDL_GetNumTouchDevices() has incorrect prototype
nfxjfg

SDL_touch.h:63:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]

Is:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices();

Should be:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
2013-05-12 13:42:20 +02:00
Philipp Wiesemann
f38eef4c83 Fixed bug 1843 - SDL_RenderClear prototype doxygen missing
Martin Gerhardy

SDL_RenderClear prototype misses documentation for the return value
2013-05-12 13:25:34 +02:00
Sam Lantinga
7253832be1 First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Philipp Wiesemann
8708a0a38d Corrected spelling in header files. 2013-04-27 17:52:58 +02:00
Philipp Wiesemann
a4858757cc Corrected spelling header file comments. 2013-04-27 14:33:27 +02:00
Philipp Wiesemann
6868b550db Corrected comment in header file. 2013-04-27 13:42:56 +02:00
Jørgen P. Tjernø
01c74a11b7 Add SDL_GetDefaultCursor.
This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1798
Thanks to Alex Szpakowski for suggestion & patch.
2013-04-24 10:42:44 -07:00
Gabriel Jacobo
d1ec7f2e3c Moved warning about SDL_AndroidGetActivity to SDL_system.h 2013-04-23 16:44:54 -03:00
David Ludwig
95a3bba282 future-proofing for Microsoft's C++/CX extensions, whereby "generic" is a reserved keyword 2013-04-20 23:05:08 -04:00
Ryan C. Gordon
7cdcd5bebb Cleaned up the const_cast mess a little. 2013-04-16 01:38:08 -04:00
Ryan C. Gordon
98dc9306b5 Removed C++-style single-line comments from a public header (thanks, Martin!).
Fixes Bugzilla #1803.
2013-04-16 01:05:32 -04:00
Ryan C. Gordon
006f31e2ec 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
1e6e7727c6 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.
2013-04-13 20:43:32 -04:00
Ryan C. Gordon
a5ca62ea98 Fixed a typo (thanks, Ethan!). 2013-04-10 22:18:10 -04:00
Ryan C. Gordon
f77b979436 More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
76435d933b 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
7635069643 Fixed compiler warnings in Mac Xcode builds. 2013-04-03 11:58:04 -04:00
Ryan C. Gordon
f3c21ea99e Another attempt at fixing compiler warnings for SDLTest_SurfaceImage_t. 2013-04-03 11:49:25 -04:00
Ryan C. Gordon
09c6b9cdfb Possibly fix compiler warnings, simplify SDLTest_SurfaceImage_t definition. 2013-04-03 11:38:05 -04:00
Sam Lantinga
d7bd3b7307 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
16cdc59bab 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
171ad2ddcd Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Ryan C. Gordon
cf94d2de94 Don't use __builtin_clz() on gcc2. (thanks, Axel!)
Fixes Bugzilla #1771.
2013-03-29 21:16:30 -04:00
Ryan C. Gordon
a9eb1f14ea Fixed compiler warnings with SDL_FORCE_INLINE on gcc2. (Thanks, Axel!)
Fixes Bugzilla #1770.
2013-03-29 21:13:16 -04:00
Sam Lantinga
4d92e1780f 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
ba643a7daa Updated the license listed in the header, fixing bug 1768 2013-03-23 13:03:36 -07:00
Sam Lantinga
20218f7e77 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
4b50e8b609 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
96627b3e6b The platform define for the PSP is __PSP__ 2013-03-17 09:45:40 -07:00
Sam Lantinga
f0af9a3e70 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
a18bccd5f3 Add PSP support 2013-03-17 20:07:02 +08:00
Sam Lantinga
562dfede27 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
561c6ca3d6 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
ad801e12f4 Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
28a15d3609 Replace all the "static __inline__" functions with SDL_FORCE_INLINE. 2013-03-15 01:09:19 -04:00
Ryan C. Gordon
1fa34e72be 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
fae7c9cf7d Added an SDL_FORCE_INLINE macro. 2013-03-15 01:02:30 -04:00