Commit graph

1078 commits

Author SHA1 Message Date
Gabriel Jacobo
ef4a588d99 Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Sam Lantinga
7960e55671 Fixed warnings building with gcc 2 and gcc 4 on Haiku 2013-08-18 23:18:11 -07:00
Philipp Wiesemann
7a4e8a1021 Replaced introduction in header file with more recent version from README.txt. 2013-08-18 11:15:30 +02:00
Philipp Wiesemann
dbd31e454a Corrected file names in header file comments. 2013-08-18 11:12:46 +02:00
Philipp Wiesemann
8900fb0a7e Changed some documentation comments in header files to be used by doxygen. 2013-08-18 11:08:52 +02:00
Philipp Wiesemann
ba31f59f54 Removed SDL_HAPTIC_SQUARE from comments in header to prevent doxygen confusion. 2013-08-10 23:14:20 +02:00
Ryan C. Gordon
c35c4a6f18 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Ryan C. Gordon
24097af6ac Fixed some typos in the headers. 2013-08-10 13:20:45 -04:00
Sam Lantinga
b47f785f57 Fixed whitespace 2013-08-08 12:20:22 -07:00
Sam Lantinga
da3326eb95 The return value of SDL_MostSignificantBitIndex32(0) is defined as -1.
--HG--
extra : rebase_source : b9f0ed0a769617991e6eadf9d6a3efa17112d1a4
2013-08-07 16:32:51 -07:00
Ryan C. Gordon
6b504a4f01 Removed function signature that doesn't actually exist yet.
--HG--
extra : rebase_source : ffcdb6b32d54d18c3eb02f0dd46adcdac7e7bb4a
2013-08-06 18:23:46 -07:00
Ryan C. Gordon
a052fa0ae8 Removed anisotropic option from SDL_HINT_RENDER_SCALE_QUALITY.
Anisotropic filtering is meant to be used for textures at a stark
 angle, not perpendicular to the camera.

--HG--
extra : rebase_source : e01c4da3bae7f1628de7c049f31f1208dbbbb24c
2013-08-06 00:23:04 -04:00
Sam Lantinga
3b4b3c17ea Fixed stack smashing crash when using the GCC compiled DLL with Visual Studio. 2013-07-29 23:28:25 -07:00
Sam Lantinga
56c6743a1b Added documentation saying the render API isn't for multi-threading. 2013-07-28 11:24:16 -07:00
Ryan C. Gordon
fac63fa2e4 Fixed return value documentation for SDL_HapticUpdateEffect().
It was a cut-and-paste error from SDL_HapticNewEffect(), right above it.
2013-07-27 13:18:54 -04:00
Sam Lantinga
0754901ca9 Fixed bug 1983 - SDL_thread.h broken under MinGW crosscompiling environment
q66

after updating SDL2 to the latest RC I'm unable to build my game engine under mingw crosscompiling environment for Windows (32bit, hosted on freebsd 64bit).

The error is in SDL_thread.h with messages like this: http://codepad.org/jEQXd3Yq

The problem is, while _beginthreadex return type is correctly mapped to uintptr_t (as specified by Microsoft), the return type under mingw is unsigned long int (same size, different signature), resulting in the error above.

The reason it didn't error before is this: http://codepad.org/8FAbKAxz

You can see the _beginthreadex case is only used without HAVE_LIBC defined; at one point though, SDL_config_windows.h was changed like this:

-/* Enabled for SDL 1.2 (binary compatibility) */
-#define HAVE_LIBC     1
+/* This is disabled by default to avoid C runtime dependencies and manifest requirements */

resulting in these errors.
2013-07-27 03:44:03 -07:00
Jørgen P. Tjernø
b01b128353 Mac: Codify SDK and OS requirements, and clean up.
This #errors if you're using an SDK or deployment target that is less
than 10.6 and 10.5, respectively, and cleans up uses of
MAC_OS_X_VERSION_MIN_REQUIRED and MAC_OS_X_VERSION_MAX_ALLOWED according
to those requirements.
2013-07-23 17:38:59 -07:00
Sam Lantinga
32188834b5 Updated blend semantics so blending uses the following formula:
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))
This allows proper compositing semantics without requiring premultiplied alpha.

Needs full unit test coverage and bug fixes!
2013-07-23 08:06:49 -07:00
Sam Lantinga
ef291a943f Fixed building with cygwin
Note that building with cygwin gcc results in a DLL that depends on cygwin1.dll
2013-07-21 23:01:01 -07:00
Ryan C. Gordon
30b6bedb57 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Philipp Wiesemann
5875c163cf Changed documentation comment for SDL_CreateShapedWindow().
See bug #1667.
2013-07-20 21:55:15 +02:00
Jørgen P. Tjernø
e5ffe6b633 Fix #1667: Docs about SDL_CreateWindow and flags.
Updates the docs to say you can use SDL_WINDOW_HIDDEN, instead of (the ignored)
SDL_WINDOW_SHOWN.
2013-07-14 15:46:43 -07:00
Sam Lantinga
c43e19485b Fixed code example for SDL_GetWindowWMInfo() 2013-07-14 11:57:01 -07:00
Sam Lantinga
6956070880 Added a hint to control the Windows timer resolution: SDL_HINT_TIMER_RESOLUTION
Added an API to watch hint changes: SDL_AddHintCallback(), SDL_DelHintCallback()
You can now dynamically set the joystick background event hint.
2013-07-13 03:13:41 -07:00
Dimitris Zenios
852321d7a2 Fixed gcc warnings for apps using SDL headers with -Wstrict-prototypes flag. 2013-07-12 09:55:58 +03:00
Sam Lantinga
1e21e522e1 Fixed Azamat's patch for SIZEOF_VOIDP in SDL_config.h.in 2013-07-11 23:16:47 -07:00
Azamat H. Hackimov
8e19a2982d Define universal answer of SIZEOF_VOIDP for 32/64-bit architectures.
This commit makes SDL_config.h universal, so it can be used with mixed
32 and 64 enviroment simultaneously.
2013-06-05 12:28:53 +06:00
Sam Lantinga
35275fc714 Fixed bug 1946 - OpenGL contexts in threads
The SDL OpenGL context code is now properly thread aware.  There are two new functions which return the current OpenGL window and context for the current thread.

There are still places in the cocoa driver where the OpenGL context needs to be updated when the view changes.  These will need a different solution and still use the last globally set context to avoid changing behavior.
2013-07-11 22:59:20 -07:00
Sam Lantinga
f80a6e7ee5 Added PowerPC and ARM versions of the memory barrier functions. 2013-07-10 20:17:20 -07:00
Sam Lantinga
557bbf3fe6 Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
2013-07-10 18:31:17 -07:00
Sam Lantinga
bfcb08d569 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Ryan C. Gordon
2740a12ae3 Backout hg changset 898992405fa7; lots of things still use SDL_types.h. :/
Will remove this again at some point in the future, though.
2013-07-09 11:57:32 -04:00
Sam Lantinga
9c43b29ef9 Made the SDL_memset4() comment even clearer so we don't accidentally replace it with memset() in the future. 2013-07-09 08:01:40 -07:00
Sam Lantinga
98053e8a85 Backed out commit 898992405fa7 because memset() does a byte fill and SDL_memset4() does a uint32 fill and this change breaks SDL_FillRect() 2013-07-09 07:13:58 -07:00
Ryan C. Gordon
7afed3e5ae Removed deprecated SDL_types.h header.
Fixes Bugzilla #1945.
2013-07-08 23:37:00 -04:00
Ryan C. Gordon
287d2529bd Replaced SDL_memset4() implementation with a call to SDL_memset().
The implementation was slower than the C runtime on Mac OS X, Linux, and
 Windows...quite a bit slower when using the C fallback instead of the inline
 asm, too.

Fixes Bugzilla #1755.
2013-07-08 23:22:36 -04:00
Philipp Wiesemann
764d957232 Corrected name of constant in header file comment. 2013-07-07 16:15:21 +02:00
Ryan C. Gordon
bbe065f50f Added an SDL2 OpenBSD sndio(7) audio target.
--HG--
extra : rebase_source : 5ad387265cff73c1635ca4f2c3635848ba722614
2013-07-07 02:03:07 -04:00
Sam Lantinga
91452f6355 Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
Sam Lantinga
156a8638f0 Make it possible to use SDL events separately from the video subsystem. 2013-07-06 12:28:57 -07:00
Sam Lantinga
cfd541e89c Removed the inline functions from SDL_stdinc.h
Having the SDL functions inline is causing build issues, and in the case of malloc(), etc. causing malloc/free mismatches, if the application build environment differs from the SDL build environment.

In the interest of safety and consistency, the functions will always be in the SDL library and will only be redirected to the C library there, if they are available.

See the following threads on the SDL mailing list for the gruesome details:
* SDL_stdinc.h inlines problematic when application not compiled in exact same feature environment
* Error compiling program against SDL2 with -std=c++11 g++ flag
2013-07-05 23:57:19 -07:00
Sam Lantinga
197f525783 Added SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS to the documentation for the joystick and game controller APIs 2013-07-03 12:31:40 -07:00
Sam Lantinga
78a7a1b54e Not using SDLmain on Windows is just fine, don't fail the initialization if the program implements WinMain() and then doesn't call SDL_SetMainReady().
This broke Steam's Big Picture game controller support.

I also added some more documentation so people know why main() is overridden on various platforms.
2013-06-28 22:44:49 -07:00
Jørgen P. Tjernø
b066315e36 Remove / update references to 1.2.
--HG--
extra : histedit_source : 374adabd4332afcb1a85517ef8b82fe997f830c1
2013-06-27 17:07:24 -07:00
Sam Lantinga
9293678409 Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Philipp Wiesemann

SDL_Keysym contains a deprecated field for unicode which may be removed for SDL 2.0 release.

As far as I can tell the field is not set on all "major" platforms and therefore will not be useful for most users. Its existence in a public header therefore becomes (in my opinion) only confusing.
2013-06-18 00:39:47 -07:00
Philipp Wiesemann
05c75b191f Changed comment to be used by doxygen. 2013-06-16 12:00:54 +02:00
Sam Lantinga
6971a5dd1c Allow users to define SDL_STDINC_NO_INLINES if they don't want the inline functions defined.
This is useful, for example, if the standard config defines HAVE_SETENV but you're building with C99 that doesn't include that feature.
2013-06-13 22:30:02 -07:00
Sam Lantinga
5aa3492ef8 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Philipp Wiesemann
ad82c94c55 Updated names of README files in source comments. 2013-06-09 11:58:31 +02:00
Sam Lantinga
5a85d1d29a This patch isn't needed because you have the window and can do [nswindow contentView] yourself.
I'm rolling this back so we minimize the things exposed that we have to keep consistent in the API.
2013-06-05 21:31:22 -07:00