Commit Graph

8312 Commits (b649314d627a77f25315e49cd29e43ec6fe12e63)

Author SHA1 Message Date
Ryan C. Gordon d78cb9e903 testtimer: added SDL_GetTicks64() calls. 2021-11-01 14:28:00 -04:00
Ryan C. Gordon 228219dcd4 include: Improved SDL_GetTicks*() documentation a little. 2021-11-01 14:28:00 -04:00
Ryan C. Gordon cca79d32a2 android: Patched SDL_GetTicks64() to compile. 2021-11-01 14:28:00 -04:00
Ryan C. Gordon affb183ea4 unix: Fixed SDL_GetTicks64 function signature. 2021-11-01 14:28:00 -04:00
Ryan C. Gordon 99c9727dc0 timer: Added SDL_GetTicks64(), for a timer that doesn't wrap every ~49 days.
Note that this removes the timeGetTime() fallback on Windows; it is a
32-bit counter and SDL2 should never choose to use it, as it only is needed
if QueryPerformanceCounter() isn't available, and QPC is _always_ available
on Windows XP and later.

OS/2 has a similar situation, but since it isn't clear to me that similar
promises can be made about DosTmrQueryTime() even in modern times, I decided
to leave the fallback in, with some heroic measures added to try to provide a
true 64-bit tick counter despite the 49-day wraparound. That approach can
migrate to Windows too, if we discover some truly broken install that doesn't
have QPC and still depends on timeGetTime().

Fixes #4870.
2021-11-01 14:28:00 -04:00
Cameron Gutman 0d631c741f CI: Build tests for Windows, macOS, and Linux 2021-10-31 17:57:40 -07:00
Cameron Gutman 210713a600 cmake: Work around bug in opengl32.lib detection on MSVC ARM64 2021-10-31 17:57:40 -07:00
Cameron Gutman 77141e84e0 cmake: Fix test linking with MinGW 2021-10-31 17:57:40 -07:00
Cameron Gutman 618b0d414f cmake: Remove SDL2_test_resources dummy hack
It doesn't work properly on MSVC because the dummy target fails to link
2021-10-31 17:57:40 -07:00
Cameron Gutman 16845eef29 cmake: Add SDL include path when building tests
The tests can't find any of the SDL includes otherwise
2021-10-31 17:57:40 -07:00
Cameron Gutman 7e8469d196 cmake: Fix MinGW build break in WGI joystick driver
Just look for windows.gaming.input.h rather than assuming its presence
or absence based on other CMake variables.

Fixes MinGW builds in CI
2021-10-31 09:34:34 -05:00
Northfear fba82ad1cb Remove sceGxmFinish from RenderPresent on Vita. Make sure that rendering is finished on render texture during locking 2021-10-31 09:17:13 -04:00
Ozkan Sezer f3640e26a4 tests: minor update to acinclude.m4::pkg.m4 2021-10-31 08:47:00 +03:00
Ozkan Sezer cc3fe1a182 tests: don't fail configury if libunwind is not available. 2021-10-31 08:25:24 +03:00
Ozkan Sezer c401627793 testsurround.c: remove unnecessary libc includes and stdint.h types 2021-10-31 08:14:50 +03:00
Ozkan Sezer e28e399338 testsurround.c: add missing newline at end of file. 2021-10-31 08:00:20 +03:00
Sam Lantinga a01aaf053c Fixed compiler warning 2021-10-30 21:42:07 -07:00
Cameron Gutman cd66c050fe testsurround: Add surround sound channel tester 2021-10-30 21:26:03 -07:00
Cameron Cawley 27369b3e40 docs: Add README-riscos.md 2021-10-30 21:25:01 -07:00
Cameron Cawley ce09389167 Add RISC OS builds to GitHub Actions 2021-10-30 21:25:01 -07:00
Cameron Cawley 4d3da5b75b riscos: Disable the mouse pointer for now 2021-10-30 21:25:01 -07:00
Cameron Cawley 1c256b892e riscos: Fix enumerating screen modes 2021-10-30 21:25:01 -07:00
Cameron Cawley 5a3c97f3a3 riscos: Fix detection of the current mode 2021-10-30 21:25:01 -07:00
Cameron Cawley 53b3db0c5d Handle the KMOD_SCROLL modifier on RISC OS 2021-10-30 21:25:01 -07:00
Cameron Cawley 1268984edc Implement mouse input on RISC OS 2021-10-30 21:25:01 -07:00
Cameron Cawley f7f54f0d04 Implement keyboard input on RISC OS
Partially based on a patch from http://www.riscos.info/websvn/listing.php?repname=gccsdk&path=%2Ftrunk%2Fautobuilder%2Flibraries%2Fsdl%2Flibsdl2%2F&rev=7174#a6401c766f408f1ea356e6977894cc6a5
Currently lacks support for mapping scancodes to keycodes.
2021-10-30 21:25:01 -07:00
Cameron Cawley f8a8ca3e1f Support proper mode switching on RISC OS 2021-10-30 21:25:01 -07:00
Cameron Cawley fe9bb74764 riscos: Refactor framebuffer code 2021-10-30 21:25:01 -07:00
Cameron Cawley 25c71748ad Add a barebones RISC OS video driver 2021-10-30 21:25:01 -07:00
Cameron Gutman a559864968 x11/wayland: Fix signal handling while blocking in WaitEventTimeout()
Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the
flag in WaitEventTimeout() to ensure that a SIGINT will wake up
SDL_WaitEvent() without another event coming in.
2021-10-30 21:23:45 -07:00
Cameron Gutman c97c46877f core: Convert SDL_IOReady()'s 2nd parameter to flags 2021-10-30 21:23:45 -07:00
Ybalrid (Arthur Brainville) 81fe2ccb9c cmake: Add missing SDL_JOYSTICK_WGI in config step
SDL_config.h *can* define SDL_JOYSTICK_WGI. On builds with the Windows
10 SDK available, this allow implementing trigger rumbling on Xbox One
controllers. The files included in the Visual Studio Solution in
VisualC\SDL.sln *do* have this define set.

fix #4859
2021-10-30 21:21:54 -07:00
Ryan C. Gordon 8a4a282aaa
alsa: Make hotplug thread optional.
Even without the thread, it'll do an initial hardware detection at startup,
but there won't be any further hotplug events after that. But for many cases,
that is likely complete sufficient.

In either case, this cleaned up the code to no longer need a semaphore at
startup.

Fixes #4862.
2021-10-30 16:02:12 -04:00
Sam Lantinga 26706319d7 Ignore the ASRock LED controller, it's not a joystick 2021-10-30 05:53:12 -07:00
Cameron Gutman ac54d57aa5 event: Check subsystem initialization before events or devices
SDL_WasInit() is cheaper SDL_NumJoysticks()/SDL_NumSensors().
2021-10-27 22:35:56 -05:00
Cameron Gutman 1bc6dc3ea0 event: Cap maximum wait time if sensor or joystick subsystems are active
Joystick and sensor subsystems require periodic polling to detect new devices.
2021-10-27 22:35:56 -05:00
Cameron Gutman 2bf36bfac4 wayland: Implement WaitEventTimeout() and SendWakeupEvent()
We can have spurious wakeups in WaitEventTimeout() due to Wayland events
that don't end up causing us to generate an SDL event. Fortunately for us,
SDL_WaitEventTimeout_Device() handles this situation properly by calling
WaitEventTimeout() again with an adjusted timeout.
2021-10-27 19:16:53 -05:00
Joel Winarske 378c5d7ffe make aclocal install relative 2021-10-26 22:37:53 -04:00
SDL Wiki Bot c7dafb1556 Sync wiki -> header 2021-10-27 01:36:05 +00:00
Cameron Gutman 6b8e880a10 checkkeysthreads: Create a renderer for window display on Wayland
Applies checkkeys patch from 105f1206 to checkkeysthreads.
2021-10-26 20:27:34 -05:00
Ryan C. Gordon 179a04f85a
fnsince.pl: Don't print out the version numbers if updating the wiki. 2021-10-26 21:01:05 -04:00
Ryan C. Gordon 85edbc92ac
fnsince.pl: Added a way to sync this information to the wiki.
This will let us automate this so it's managed for us, and as things go
from development to official releases, the documentation will automatically
update!
2021-10-26 19:00:06 -04:00
Ryan C. Gordon f5de45aecc
fnsince.pl: Found a few more incorrect versions. 2021-10-26 18:59:21 -04:00
Ryan C. Gordon e8fbcf893a
fnsince.pl: a script to list version when all public APIs were added. 2021-10-26 12:13:41 -04:00
SDL Wiki Bot 1c6414603c Sync wiki -> header 2021-10-26 15:30:06 +00:00
Ivan Epifanov 9c799802c9 Vita: fix IME input languages 2021-10-26 08:29:56 -07:00
Ozkan Sezer 7ac0c73af2 regenerated test/configure 2021-10-25 21:40:04 +03:00
David Gow c57bcb47b1 test: Fix building with libunwind under autotools
There are two issues which are stopping the SDL tests from building on
my machine:
- libunwind is not being linked
- Even if it is, it is missing several symbols.

The first is fixed by having the test programs link against libunwind if
available. Technically, SDL2_test should be linking against it, as it's
used in SDL_test_memory.c, but as SDL2_test is a static library, it
can't itself import libunwind. We just assume that if it's present on
the system, we should link it directly to the test programs. This should
strictly be an improvement, as the only case where this'd fail is if
SDL2 was compiled when libunwind was present, but the tests are being
compiled without it, and that'd fail anyway.

The second is fixed by #define-ing UNW_LOCAL_ONLY before including
libunwind.h: this is required to make libunwind link to predicatable
symbols, in what can only be described as a bit of a farce. There are a
few more details in the libunwind man page, but the gist of it is that
it disables support for "remote unwinding": unwinding stack frames in a
different process (and possibly from a different architecture?):
http://www.nongnu.org/libunwind/man/libunwind(3).html

Note that I haven't tried this with CMake: I suspect that it'll work,
though, as the CMakeLists.txt seems to have SDL2 link against libunwind if
it's present. This adds an ugly extra dependency to SDL2, but does mean
that issue 1 isn't present. The UNW_LOCAL_ONLY change shouldn't be
build-system-specific.
2021-10-25 11:28:20 -07:00
Joel Winarske fdb27e0b08
cmake: Use host wayland-scanner only (#4873) 2021-10-25 12:04:07 -04:00
Cameron Gutman 408a93a1ec wayland: Use multi-thread event reading APIs
Wayland provides the prepare_read()/read_events() family of APIs for
reading from the display fd in a deadlock-free manner across multiple
threads in a multi-threaded application. Let's use those instead of
trying to roll our own solution using a mutex.

This fixes an issue where a call to SDL_GL_SwapWindow() doesn't swap
buffers if it happens to collide with SDL_PumpEvents() in the main
thread. It also allows coexistence with other code or toolkits in
our process that may want read and dispatch events themselves.
2021-10-25 12:00:35 -04:00