Commit graph

9717 commits

Author SHA1 Message Date
Ryan C. Gordon
dadc72f8c3 cmake: whoops, Sam and I both fixed this bug at the same time. :) 2017-08-09 22:34:45 -04:00
Sam Lantinga
dd61565e37 Fixed bug 3651 - CMake build does not install CMake package configuration
tschwinger@elitemail.org

Most ironically, although autoconf/automake-based builds install (pretty half-assed) CMake package configuration files, they're missing in installations resulting from CMake-based builds entirely.

A proper configuration file typically also loads target exports (implemented in patch 3572, also fixing this issue - see my comment on that issue for details).

I believe it would be best to let the dinosaurs go extinct and redirect all build efforts to the CMake end for two reasons:

1. It potentially provides the best user experience, but you'd have to give it some love and ship with less quirky buildfiles.

2. It would force distros to build SDL via CMake and thus would ensure target exports are actually available everywhere.

Various CMake patches I submitted today in summary (directly converted from the HG commits and `am`d onto a fork of a git mirror that happened to be on `tip`).

    https://github.com/tschw/SDL/commits/patched

Fixing #2576 #3572, #3613, and this fresh ticket, which is almost entirely advertisement ;).

These already do to make SDL much less of a quirky fella to have in your dependency tree...
2017-08-09 19:03:10 -07:00
Sam Lantinga
1a36d8a9a8 Fixed bug 3590 - CMAKE: typos in CheckMir
Martin Gerhardy

-            list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CLFAGS} ${XKB_CLFLAGS})
+            list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})

CFLAGS is spelled wrong in two different ways for EGL and XKB

And while you are on it...

sdl needs mir >= 0.24 afaik - it fails on travis-ci (ubuntu 14.04 LTS with 0.18 installed and in other environments, too (e.g. https://github.com/urho3d/Urho3D/issues/1685)

To fix this one should add a min version check to pkg_check_modules like this

-        pkg_check_modules(MIR_TOOLKIT mirclient mircommon)
+        pkg_check_modules(MIR_TOOLKIT mirclient>=0.24 mircommon)
2017-08-09 18:47:33 -07:00
Ryan C. Gordon
d1a6464741 cmake: Don't link directly against a libpthread on Android (thanks, Anthony!).
Android has pthreads, but it's just part of their C runtime instead of a
separate library like the usual Linux platforms.

Fixes Bugzilla #3675.

--HG--
extra : rebase_source : 5d08d93237484694560279ab925eeafdce55e68f
2017-08-09 19:50:18 -04:00
Olli Kallioinen
7034592ed9 Android build fixes
-Enabling checking for GCC_ATOMICS also on clang by default. This way all Android ABIs build successfully
 -Android cmake: Threading was not enabled correctly
 -Android cmake: Timers and dynamic lib loading were not included in the sources
2017-06-08 22:07:55 +03:00
Sam Lantinga
de8a709d9a Fixed bug 3733 - Makefile sleeps for 3 seconds if configure is out of date 2017-08-09 16:20:04 -07:00
Ryan C. Gordon
156d7fc580 haiku: non-x86 spins use a normal libstdc++ filename. Handle the differences.
Fixes Bugzilla #3730.

--HG--
extra : rebase_source : e89755d5a83bb4c0a8c1456e3c58390d358742f9
2017-08-09 18:41:59 -04:00
Ryan C. Gordon
693c9d586f haiku: Fixed compiler warning.
--HG--
extra : rebase_source : a6cc1677a4ce007410572abe1be2e5e99de29621
2017-08-09 18:30:48 -04:00
Sam Lantinga
3c8dc5ab15 Added a private hint for Steam to bypass the controller filtering for the Steam virtual gamepad 2017-08-09 12:38:20 -07:00
Sam Lantinga
a0941b37eb Fixed Linux build 2017-08-09 12:11:59 -07:00
Sam Lantinga
b044a3bba8 Added SDL hints to filter the set of game controllers reported by SDL 2017-08-09 11:59:29 -07:00
Sam Lantinga
5c88b8141c Added an API SDL_LoadFile_RW() to load all the data from an SDL data stream, and a convenience macro SDL_LoadFile() to load all the data from a file. 2017-08-09 11:58:38 -07:00
Ryan C. Gordon
dbc08babc8 haiku: Patched SDL_bopengl.cc to compile on x86-64 Haiku.
Fixes Bugzilla #3729.
2017-08-09 01:01:41 -04:00
Ryan C. Gordon
3fee4ae999 Fixed up some compile warnings and errors on x86-64 Haiku. 2017-08-09 00:56:05 -04:00
Ryan C. Gordon
9a1eaedb59 Added a FIXME for 2.1 about an API change. 2017-08-09 00:55:27 -04:00
Sam Lantinga
673e94c9c0 Re-added missing entry for the Steam Virtual Gamepad (was Valve Streaming Gamepad) 2017-08-08 20:38:23 -07:00
Sam Lantinga
41065dbd28 Fixed building on various versions of GCC - YUV MMX code is disabled for now 2017-08-07 10:28:59 -07:00
Ryan C. Gordon
56c21e656b README-linux.md: added libsndio-dev to the package list. 2017-08-07 00:36:45 -04:00
Ryan C. Gordon
187fea6b1b sndio: Fix for some platforms (Linux, for example) that don't define INFTIM.
Fixes Bugzilla #3712.

--HG--
extra : histedit_source : af73344d6ccf91bdbe8413d017899fdd91c8e84f
2017-08-07 00:25:18 -04:00
Philipp Wiesemann
429808fe36 emscripten: Fixed compiler warnings about integer to pointer conversions.
Found by buildbot.
2017-08-05 22:10:55 +02:00
Philipp Wiesemann
0d165785e8 emscripten: Fixed compiling without OpenGL support. 2017-08-05 22:10:48 +02:00
Philipp Wiesemann
43c717afea kmsdrm: Fixed crashes if allocating memory failed. 2017-08-05 22:10:36 +02:00
Philipp Wiesemann
b444e5785d nacl: Fixed freeing static memory on video quit. 2017-08-05 22:10:25 +02:00
Philipp Wiesemann
3066aea0db mir: Removed unnecessary function declaration. 2017-08-05 22:10:15 +02:00
Philipp Wiesemann
c10c85a21d Updated generated configure script. 2017-08-04 23:01:01 +02:00
Philipp Wiesemann
fa1b1b92a0 kmsdrm: Fixed compiling without OpenGL support. 2017-08-04 23:00:47 +02:00
Philipp Wiesemann
ac6afcf3ca Fixed compiler warnings about type conversions.
Found by buildbot.
2017-08-04 23:00:30 +02:00
Ryan C. Gordon
350d9a1b0a psp: Force audio channels to stereo if > 2 channels requested (thanks, Solra!).
Fixes Bugzilla #3726.
2017-08-04 16:18:34 -04:00
Sam Lantinga
7fa2e3e6cb Temporary hack to fix bug 3725 - Call made to glGetString before context creation
This breaks bugs 2570, 3145
2017-08-04 13:06:56 -07:00
Sam Lantinga
ce95a81949 Added a hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether touch events generate synthetic mouse events. 2017-08-03 09:48:44 -07:00
Brandon Schaefer
116acfc15a kmsdrm: Fix tearing in neverputt/ball
https://gfycat.com/FatalFarawayHeron
2017-08-02 17:45:15 -07:00
Patrice Mandin
550cd3b5b4 Add support for Saitek P990 Dual Analog Pad 2017-08-02 23:42:08 +02:00
Brandon Schaefer
13f724bb38 kmsdrm: Fix leaking SDL_VideoDevice* 2017-08-02 13:51:14 -07:00
Sam Lantinga
071ebfc1d7 Fixed bug 3311 - Broken touch positions with SDL_RenderSetLogicalSize & HIGHDPI on iOS
Eric wing

Hi, I think I found a bug when using SDL_WINDOW_ALLOW_HIGHDPI with SDL_RenderSetLogicalSize on iOS. I use SDL_RenderSetLogicalSize for all my stuff. I just tried turning on SDL_WINDOW_ALLOW_HIGHDPI on iOS and suddenly all my touch/mouse positions are really broken/far-off-the-mark.

I actually don't have a real retina device (still) so I'm seeing this using the iOS simulator with a 6plus template.

Attached is a simple test program that can reproduce the problem. It uses RenderSetLogicalSize and draws some moving happy faces (to show the boundaries/space of the LogicalSize and that it is working correctly for that part).

When you click/touch, it will draw one more happy face where your button point is.

If you comment out SDL_WINDOW_ALLOW_HIGHDPI, everything works as expected. But if you compile with it in, the mouse coordinates seem really far off the mark. (Face appears far up and to the left.)


Alex Szpakowski on the mailing list suggests the problem is
"I believe this is a bug in SDL_Render’s platform-agnostic mouse coordinate scaling code. It assumes the units of the mouse coordinates are always in pixels, which isn’t the case where high-DPI is involved (regardless of whether iOS is used) – they’re actually in “DPI independent” coordinates (which matches the window size, but not the renderer output size)."

Additionally, if this is correct, the Mac under Retina is also probably affected too and "as well as any other platform SDL adds high-dpi support for in the future".
2017-08-02 13:38:46 -07:00
Sam Lantinga
6459ca6cc0 Fixed bug 3722 - Fall back to xinerama/xvidmode if xrandr modes initialization fails
Levi Bard

In some environments, xrandr modes initialization can fail even though xrandr support is present and of a sufficient version.
(The one I encountered was an AWS instance running a virtual display)

The attached patch allows SDL to keep trying other methods if xrandr modes initialization fails (still subject to SDL_VIDEO_X11_REQUIRE_XRANDR).
2017-08-02 10:28:13 -07:00
Sam Lantinga
583a4f42cf Fixed potential free of uninitialized memory (thanks Simon!) 2017-08-02 10:24:47 -07:00
Sam Lantinga
9afeb8f34f Fixed bug 3690 - SDL2 KMS/DRM render context support
Manuel

The attached patch adds support for KMS/DRM context graphics.

It builds with no problem on X86_64 GNU/Linux systems, provided the needed libraries are present, and on ARM GNU/Linux systems that have KMS/DRM support and a GLES2 implementation.
Tested on Raspberry Pi: KMS/DRM is what the Raspberry Pi will use as default in the near future, once the propietary DispmanX API by Broadcom is overtaken by open graphics stack, it's possible to boot current Raspbian system in KMS mode by adding "dtoverlay=vc4-kms-v3d" to config.txt on Raspbian's boot partition.
X86 systems use KMS right away in every current GNU/Linux system.

Simple build instructions:

$./autogen.sh
$./configure --enable-video-kmsdrm
$make
2017-08-02 10:22:48 -07:00
Ryan C. Gordon
6ea5de0896 x11: Make a separate unmapped window to own clipboard selections.
Now the clipboard isn't lost if you destroy a specific SDL_Window, as it
works on other platforms. You will still lose the clipboard data on
SDL_Quit() or process termination, but that's X11 for you; run a
Clipboard Manager daemon.

Fixes Bugzilla #3222.
Fixes Bugzilla #3718.
2017-07-31 13:49:22 -04:00
Sam Lantinga
cd0346c192 Fixed bug 3697 - Main thread gets stuck on left mouse down
Eric Wasylishen

I think I found a better fix.

The problem with https://hg.libsdl.org/SDL/rev/81e6d0f852fc is setting the styleMask to 0 clears the NSWindowStyleMaskFullScreen bit, which then confuses Cocoa later when you try to leave fullscreen. Instead I'm just clearing the NSWindowStyleMaskResizable bit, although SetWindowStyle(window, NSWindowStyleMaskFullScreen); seems to also work.
2017-08-01 20:16:10 -07:00
Sam Lantinga
988ff2fc2f Backed out changeset 81e6d0f852fc for bug 3697
Eric Wasylishen

Unfortunately this commit seems to have broken exiting desktop-fullscreen.
- Launch testgl2.
- Press alt+enter to go fullscreen-desktop
- Press alt+enter again. The spinning cube will freeze, and the window stays fullscreen desktop.
2017-08-01 20:09:23 -07:00
Sam Lantinga
8d2f4c623e Fixed bug 3720 - SDL_GL_GetAttribute doesn't check for initialized video driver
Simon Hug

SDL_GL_GetAttribute doesn't check if a video driver has been initialized and will access the SDL_VideoDevice pointer, which is NULL at that point.

I think all of the attributes require an initialized driver, so a simple NULL check should fix it. Patch is attached.
2017-07-31 12:57:15 -07:00
Ryan C. Gordon
59c39daef9 Disable static builds for static analysis.
There's really no sense in analyzing everything twice, and this makes the
job finish significantly faster.
2017-07-30 14:36:01 -04:00
Ryan C. Gordon
3fc1531a34 windows-buildbot-zipper.bat: Check the correct path. 2017-07-30 14:09:18 -04:00
Ryan C. Gordon
9f32a9b1b1 Buildbot should zip up Visual Studio Win64 binaries, too.
--HG--
extra : rebase_source : ae16b5a86fb9903dd6a72b90c1a34164f4342105
2017-07-30 10:09:34 -04:00
Philipp Wiesemann
3c44f8114f Fixed typos in shape header. 2017-07-29 23:00:54 +02:00
Philipp Wiesemann
78636e9f5e qnx: Fixed error message. 2017-07-29 23:00:45 +02:00
Philipp Wiesemann
06d0fac495 aix: Removed unused local variable.
Found by Cppcheck.
2017-07-29 23:00:34 +02:00
Philipp Wiesemann
b06a75d176 haiku: Changed header paths to be more compatible. 2017-07-29 23:00:14 +02:00
Brandon Schaefer
3d389a8ab4 evdev: Fix 'Syscall param ioctl(TIOCLINUX) points to uninitialised byte'
https://pastebin.com/raw/tQjG0kG0
2017-07-28 12:00:10 -07:00
Sam Lantinga
3ed584e7f4 Fixed crash if the WASAPI audio device couldn't be recovered 2017-07-27 22:55:18 -07:00