Commit graph

6092 commits

Author SHA1 Message Date
Sam Lantinga
02cf3236ca Fixed bug 1743 - CMake produces libraries with wrong filename/SONAME
David Gow

As discussed on the list, the autotools build backend uses libtool's "release" option, giving us the SONAME libSDL2-2.0.so.0, whereas CMake doesn't, giving us libSDL2.so.0

While libSDL2.so.0 has some small advantages (being simpler and matching the names on some other OSes better), many products have already been developed expecting libSDL2-2.0.so.0, which better matches SDL 1.2's SONAME. It seems clear, therefore, that most developers prefer this name.

This patch emulates libtool's functionality, making libSDL2-2.0.so.0 the name of the shared library, while leaving libSDL2.a as the filename of the static library. Unlike with libtool, no libSDL2.so symlink is yet made. I also haven't tested this on anything but Linux, so it might break other platforms. :/
2013-07-27 02:50:19 -07:00
Sam Lantinga
dae53a0790 Improved error checking in the haptic system, preventing crashes in some cases.
Edgar Simo 2012-05-06 02:33:39 EDT

I recall that driver being buggy back in the day, but looking over the code there's a number of things being done wrong which I've fixed and it should now properly error out instead of crashing. Also make sure you initialize the haptic subsystem before using haptic commands (which I now more explicitly try to enforce).
2013-07-27 02:45:26 -07:00
Sam Lantinga
ec67327c73 Fixed bug 1919 - Window icon disappears as soon as a renderer is created
Sebastian

Setting a window icon works just fine until a renderer is added to the window.
After adding the renderer the icon disappears.

Reproduce by:
- Take the example code from the wiki: http://wiki.libsdl.org/moin.fcg/SDL_SetWindowIcon

- Add the following two lines after  SDL_FreeSurface(surface);
  SDL_Delay(1000);
  SDL_Renderer* ren = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);

-compile and run

You will see the window icon correctly at first. After the Delay the Icon will disappear.
2013-07-14 18:17:28 -07:00
Sam Lantinga
f1886b3c36 Fixed bug 1526 - X11 - XUnmapWindow should not be called directly
driedfruit

In X11_HideWindow, we call XUnmapWindow to unmap. According to ICCCN2.0, this should never happen, and XWithdrawWindow should be called instead.

http://www.tronche.com/gui/x/icccm/sec-4.html#s-4.1.4

"The reason for requiring the client to send a synthetic UnmapNotify event is to ensure that the window manager gets some notification of the client's desire to change state, ***even though the window may already be unmapped when the desire is expressed***."

Additionally, this can be observed at http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/Withdraw.c#n65

Failure to comply leads to "MapNotify" event never appearing on non-reparenting WMs after subsequent show-hide-show requests. (I'm currently observing this behavior, thus my bug report).
2013-07-27 00:49:34 -07:00
Jørgen P. Tjernø
089081d173 Fix cmake breakage (thanks Marcus)
My recent change broke the sdlcheck.cmake by not escaping some quotes properly.
Thanks to Marcus von Appen for pointing it out and providing the patch.
2013-07-26 13:30:24 -07:00
Gabriel Jacobo
7c9692c8c5 Consider the case where an attribute is set to EGL_DONT_CARE in eglChooseConfig
SDL doesn't currently use EGL_DONT_CARE, but it doesn' hurt to future proof.
2013-07-26 12:37:36 -03:00
Gabriel Jacobo
c73a37ac6f [Android] Bug 1827, select the best matching config provided by eglChooseConfig 2013-07-26 12:22:40 -03:00
Sam Lantinga
5623b2c61d Fixed crash and garbled output when converting from F32 to S16 audio. 2013-07-25 18:11:09 -07:00
Sam Lantinga
e2a14cf5dd Updated the copyright year for the test programs 2013-07-25 09:51:21 -07:00
Philipp Wiesemann
5cdb605a41 Corrected return value to be of correct type. 2013-07-24 22:25:17 +02:00
Philipp Wiesemann
adce8bf505 Corrected internal documentation in source.
The parameter silent is no longer optional.
2013-07-24 22:23:19 +02:00
Philipp Wiesemann
e722fd86e9 Removed unreachable code. 2013-07-24 22:20:03 +02:00
Philipp Wiesemann
e44d24ff29 Removed unused variables to fix warnings in test program. 2013-07-24 22:19:01 +02:00
Sam Lantinga
9583071066 Fix for recent GLX error bug
Lee Salzman

I messed up in the patch I sent you regarding gobbling up the GLX error codes signaled when trying to create a context. After reading the spec I realized those error codes are relative to a base error that needs to be queried when setting up the GLX extension...

So I have made a patch that fixes it for a user I had who was still getting the bug with my old patch.

Without this patch my previous one won't work, so it is recommended to merge this...
2013-07-23 19:20:03 -07:00
Sam Lantinga
ccb139c73a A little cleanup on the cleanup, just for consistency. 2013-07-23 19:18:01 -07:00
Jørgen P. Tjernø
aa5f318964 = {{0}} generates a memset() in MSVC, which isn't linked. Whoops! 2013-07-23 17:40:18 -07:00
Jørgen P. Tjernø
8c0d5be080 Fix build errors from last change. 2013-07-23 17:40:16 -07:00
Jørgen P. Tjernø
e007150b45 Fix some clang analyzer warnings.
This fixes some analyzer warnings and a couple of minor memory leaks.
2013-07-23 17:40:13 -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
defb16763d Add a timeout to the clipboard code to avoid hangs when using synergy. When a timeout is detected we set the clipboard so that we own it so that future timeouts are avoided. Testing has confirmed that this timeout and setting only occurs when the clipboard contains text from my Windows machine.
That is, if you copy from the Windows clipboard and then launch Dota and then repeatedly paste to a terminal window then the text will disappear when Dota hits the timeout. If you then select on the Linux side you can repeatedly paste. If you select again on Windows then the text will get cleared again.

Note that Dota only looks at the clipboard when it has focus.

CR: Saml
2013-07-23 12:59:29 -07:00
Sam Lantinga
08e8f26d62 Added Direct3D shader to hardware accelerate YV12 and IYUV textures. 2013-07-23 12:55:19 -07:00
Sam Lantinga
6f83bd0e2a Finished updating testoverlay2 for the new API and added it to the Visual Studio 2010 projects 2013-07-23 12:46:22 -07:00
Sam Lantinga
a7954b42d0 Fixed SDL printf output for 0x%.8x 2013-07-23 12:44:14 -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
Eric Wing
a99edf3519 Android: Removed all unnecessary dependencies on C++.
C++ is a bit of a minefield on Android. Much functionality still doesn't work, and Android can't decide on which C++ standard library to use, so it provides 3 different ones, all of which are incompatible with each other. (It looks like clang is coming too which will add a new compiler and a 4th standard library.)

As middleware, SDL might be distributed as a binary and intermixed with other projects already using C++. If C++ is intermixed in a bad way, bad things will happen. Removing dependencies on C++ will avoid this problem and downstream users won't have to worry/care.

--HG--
rename : src/core/android/SDL_android.cpp => src/core/android/SDL_android.c
rename : src/main/android/SDL_android_main.cpp => src/main/android/SDL_android_main.c
2013-07-22 02:51:45 -07:00
Philipp Wiesemann
e3b9fb7542 Corrected internal documentation in source. 2013-07-22 22:54:00 +02:00
Andreas Schiffler
a74537a5a9 Fix bug 1494: add missing test projects to VS2010/VS2010 solution 2013-07-22 06:00:41 -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
Philipp Wiesemann
588e67304c Removed not needed SDL_WINDOW_SHOWN from iOS example programs.
See bug #1667.
2013-07-21 22:09:00 +02:00
Sam Lantinga
188729834c Fixed bug 1813 - MouseMotion relative values do not respect renderer LogicalSize
driedfruit

A trivial issue, the xrel and yrel values of MouseMotion event struct are not adjusted to renderer logical size.
2013-07-21 12:54:27 -07:00
Sam Lantinga
fe2bb8805e Fixed bug 1973 - test/Makefile.in fails on Mac OS X with X11 enabled...
Ryan C. Gordon

If you have the X11 SDK installed on Mac OS X, you'll build with X11 support, but the Makefile doesn't build anything but the Cocoa testnative code for Mac OS X, which is fine, but then testnative fails to link because testnative.h enables the X11 support based on the SDL config header.

Building the testnativex11.c code on Mac OS X doesn't work because you need to explicitly link with "-L/usr/X11/lib -lX11" if this code is enabled, but you can't link with that by default because the X11 SDK might be missing.

So this needs a little configure magic to do the right thing (or forcibly disabling X11 support on Mac OS X in testnative.h).
2013-07-21 12:47:47 -07:00
Sam Lantinga
5ed40dea70 Added X include path so SDL_syswm.h works correctly on systems with X11 in a non-standard directory. 2013-07-21 12:37:43 -07:00
Sam Lantinga
080517ecba Fixed cursor leak when quitting the mouse subsystem 2013-07-21 12:21:22 -07:00
Sam Lantinga
958740dffc Fixed bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values
Edgar Simo

So basically the issue is that:

AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])

in sdl2.m4 shares the same variable (SDL_CONFIG) as sdl.m4:

AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])

What happens is if you run the AM_PATH_SDL2 and then AM_PATH_SDL to say fall back on SDL if SDL2 isn't found, the AM_PATH_PROG command gets cached (ac_cv_path_SDL_CONFIG) so that unless you unset this cache variable, the result for AM_PATH_SDL will be EXACTLY the same as for AM_PATH_SDL2.

To fix I would recommend renaming SDL_CONFIG to SDL2_CONFIG in sdl2.m4, replacing all instances so it won't cache to the same variable.
2013-07-21 11:52:16 -07:00
Jasper St. Pierre
223c2cfbd7 Add support for the _NET_WM_BYPASS_COMPOSITOR hint
This hints to window managers to unredirect the window to improve
performance.
2013-07-21 00:57:31 -04:00
Ryan C. Gordon
44a6ab168b Cursor mask was uninitialized data, causing problems.
Fixes Bugzilla #1461.
2013-07-21 00:07:43 -04:00
Ryan C. Gordon
0002acb775 Include SDL_assert.h to fix broken build. 2013-07-20 21:22:37 -04:00
Ryan C. Gordon
20b4bd0c6a Don't allocate memory if we're just going to fail when checking parameters. 2013-07-20 21:19:20 -04:00
Ryan C. Gordon
51ba788d0d Don't try to clear errors in GL_ActivateRenderer() before we MakeCurrent.
Otherwise, if we destroyed a different renderer, next time this one draws,
it'll clear errors forever (GL_INVALID_OPERATION for having no current
context, at least on Windows), hanging up the program in an infinite loop.

Fixes Bugzilla #1775.
2013-07-20 21:10:05 -04:00
Ryan C. Gordon
f2029f2af8 Fixed another compiler warning.
This one is compliments of the FreeBSD buildbot finally having the
 X11 libraries installed.  :)

--HG--
extra : amend_source : f57bb1d54a19cb773358f8caefd40d477c01b05f
2013-07-20 20:12:36 -04:00
Ryan C. Gordon
bc019db86e One more compiler warning. 2013-07-20 19:59:31 -04:00
Ryan C. Gordon
3a261795ed More compiler warning fixes. 2013-07-20 19:58:17 -04:00
Ryan C. Gordon
30b6bedb57 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Ryan C. Gordon
8328f33947 Make XInput haptic code respect effect timeouts.
This is really just a hack until this code expands to be a robust haptic mixer.

(This is also untested, beyond compiling. Sorry!)

--HG--
extra : rebase_source : 1ea0101273d96c6d82db9b603a575e265d4ee426
2013-07-20 18:51:49 -04:00
Philipp Wiesemann
5875c163cf Changed documentation comment for SDL_CreateShapedWindow().
See bug #1667.
2013-07-20 21:55:15 +02:00
Philipp Wiesemann
32e6f653b6 Replaced use of malloc()/free() with SDL_malloc()/SDL_free() in test program. 2013-07-20 21:51:53 +02:00
Philipp Wiesemann
62c31ff5c3 Removed not needed SDL_WINDOW_SHOWN from test programs.
See bug #1667.
2013-07-20 21:47:16 +02:00
Philipp Wiesemann
74e5c8cffd Replaced use of strcmp() with SDL_strcmp() in tests. 2013-07-20 21:39:54 +02:00
Philipp Wiesemann
e96e39d53b Removed not needed variable and work in standard library.
Found by Cppcheck (that variable's value was never used).
2013-07-20 21:35:26 +02:00
Ryan C. Gordon
d92ced54a0 Workaround crash bug in libXi <= 1.4.1 (thanks, Steve!).
Fixes Bugzilla #1812.
2013-07-20 13:11:40 -04:00