Commit Graph

82 Commits

Author SHA1 Message Date
Ethan Lee
4b42c05ba1 video: Add SDL_SetWindowMouseRect.
This API and implementation comes from the Unreal Engine branch of SDL, which
originally called this "SDL_ConfineCursor".

Some minor cleanup and changes for consistency with the rest of SDL_video, but
there are two major changes:

1. The coordinate system has been changed so that `rect` is _window_ relative
   and not _screen_ relative, making it easier to implement without having
   global access to the display.
2. The UE version unset all rects when passing `NULL` as a parameter for
   `window`, this has been removed as it was an unused feature anyhow.

Currently this is only implemented for X, but can be supported on Wayland and
Windows at minimum too.
2021-11-08 14:16:54 -08:00
Sam Lantinga
b8327a4a48 Added SDL_HIDAPI_DISABLED so it can be disabled like other SDL subsystems 2021-11-08 07:19:45 -08:00
Ozkan Sezer
802e17aad9 autotools: added windows.gaming.input.h (and SDL_JOYSTICK_WGI) detection 2021-11-03 20:35:20 +03:00
Cameron Cawley
25c71748ad Add a barebones RISC OS video driver 2021-10-30 21:25:01 -07:00
Cameron Cawley
3db898c5b6 riscos: Implement SDL_GetPrefPath() 2021-10-12 13:07:52 -07:00
Ryan C. Gordon
478f9eed28
x11: Don't include X11/extensions/extutil.h
We don't use it, it was a leftover from 1.2, I think, and it doesn't exist
on Solaris, so this should hopefully fix the build there.

This also means we don't need the configure/cmake checks for
SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY, so that was removed also.

Fixes #1666.
2021-09-20 10:22:50 -04:00
Sam Lantinga
6810399352 Enable AAUDIO driver for Android
I thought this was already enabled for 2.0.16, but apparently not.

Fixes https://github.com/libsdl-org/SDL/issues/3710
2021-08-10 14:50:43 -07:00
Ozkan Sezer
77c8d11137 configuration updates for dlopen:
- cmake, configure (CheckDLOPEN): --enable-sdl-dlopen is now history..
  detach the dl api discovery from SDL_LOADSO_DLOPEN functionality.
  define HAVE_DLOPEN. also define DYNAPI_NEEDS_DLOPEN (CheckDLOPEN is
  called only for relevant platforms.)
- update SDL_config.in and SDL_config.cmake accordingly.
- SDL_dynapi.h: set SDL_DYNAMIC_API to 0 if DYNAPI_NEEDS_DLOPEN is
  defined, but HAVE_DLOPEN is not.
- pthread/SDL_systhread.c: conditionalize dl api use to HAVE_DLOPEN
- SDL_x11opengl.c, SDL_DirectFB_opengl.c, SDL_naclopengles.c: rely
  on HAVE_DLOPEN, not SDL_LOADSO_DLOPEN.
- SDL_config_android.h, SDL_config_iphoneos.h, SDL_config_macosx.h,
  SDL_config_pandora.h, and SDL_config_wiz.h: define HAVE_DLOPEN.

Closes: https://github.com/libsdl-org/SDL/pull/4351
2021-08-10 12:07:32 -07:00
Christian Rauch
9e6fcbe72c wayland: client-side decoration 2021-07-25 14:54:12 -07:00
Ozkan Sezer
0a68322170 add missing PIPEWIRE defines to SDL_config.h.in
also specify 'audio' in Pipepire configuration enable messages.
2021-03-01 15:11:50 +03:00
Ozkan Sezer
bb9e049d1d minor updates to libc function checks 2021-02-10 10:22:19 -05:00
Sam Lantinga
2426949a18 Removed support for clock_gettime_nsec_np()
SDL_GetTicks() was broken and it's not adding any real value here.
2021-02-10 10:22:19 -05:00
Sam Lantinga
96cfb81232 Fixed bug 5467 - SDL sys timer Mac OS update proposal
David Carlier

Change of api from 2016 which reduce code complexity a bit.
2021-01-24 00:51:25 -05:00
Ozkan Sezer
2376458841 renamed SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H to SDL_HAVE_MACHINE_JOYSTICK_H 2021-01-24 00:51:25 -05:00
Ozkan Sezer
02e61a88fb added SDL_JOYSTICK_OS2 to SDL_config.h.in and SDL_config.h.cmake 2021-01-24 00:51:25 -05:00
Sam Lantinga
82aafa9aa8 Fixed bug 5461 - Add rewritten WSCONS driver for OpenBSD
wahil1976

This patch adds a written-from-scratch WSCONS driver for OpenBSD. It does not have hardcoded keymaps, and it features mouse support when wsmux is available.

For this to work, it needs access to the /dev/wskbd* devices which are not available to non-root users by default. Access to those can be granted by changing /etc/fbtab to give the logging user the ownership of those devices.
2021-01-14 14:32:11 -08:00
Sam Lantinga
9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Ozkan Sezer
1cdc1d4890 SDL_config.h.cmake, SDL_config.h.in: update for SIZEOF_VOIDP define 2020-12-30 01:00:24 +03:00
Ozkan Sezer
b76b81b0e4 SDL_config.h.cmake, SDL_config.h.in: add os/2 driver defines
in case autofoo or cmake is used for it some day..
2020-12-30 01:00:24 +03:00
Ozkan Sezer
8a32ee24db removed MSVC strtok_s use from SDL_strtokr().
no other ??_s are used elsewhere in SDL_stdinc. besides, C11 has a
strtok_s with a different signature.
2020-12-30 01:00:24 +03:00
Joel Linn
2443e51e0e Add optional suffix _generic to generic SDL_cond impl
Allows for runtime selectable implementation
2020-12-28 11:42:49 -08:00
Sam Lantinga
93ccdee8c1 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf
Cameron Cawley

stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf

The default implementation is based on the one used in the Windows RT video driver.
2020-12-23 13:47:49 -08:00
Sam Lantinga
6bd4c717a1 Fixed bug 5402 - ARM support little update proposal
David Carlier

No fix but mostly an update for ARM architecture.
2020-12-17 21:41:23 -08:00
Ozkan Sezer
b6e63625c8 fix bug #5395: handle old systems where inotify_init1 is not available 2020-12-13 15:32:24 +03:00
Sam Lantinga
46a844786b Added SDL_wcscasecmp() and SDL_wcsncasecmp() 2020-11-24 12:43:01 -08:00
Sam Lantinga
e9869e07bf Fixed bug 5335 - enable joystick/haptic/evdev support by default on FreeBSD
Alex S

Evdev headers aren't actually included in the base system (well, it has a private copy), they are available through the devel/evdev-proto port instead. We also have devel/libinotify and devel/libudev-devd shims, I didn't verify whether they work with SDL.
2020-11-23 21:08:19 -08:00
Ozkan Sezer
4c96faee57 remove non-existing tslib support from autofoo and cmake 2020-11-23 20:37:10 +03:00
Sam Lantinga
fd89446782 Fixed building on Mac OS X on the command line and with an older macOS SDK 2020-11-21 14:13:26 -08:00
Ryan C. Gordon
bee8db3b04 config: Make sure HAVE_TRUNC and HAVE_TRUNCF are defined as appropriate.
The configure/cmake scripts were checking for these functions but we didn't
have the SDL_config.h.* pieces in place. The other config headers are best
guesses.
2020-11-14 02:16:41 -05:00
Sam Lantinga
1822f97e5f Fixed bug 5346 - Add FreeBSD evdev KBIO keyboard input driver
wahil1976

This patch adds the KBIO text input driver for FreeBSD, which allows text input to fully work without text spilling out into the console. It also supports accented input, AltGr keys and Alt Lock combinations.

Tested with US accent keys layout and various AltGr layouts.
2020-11-11 19:37:47 -08:00
Ozkan Sezer
196cda69f2 build: fix / update sensors (windows) configuration
- SDL_config.h.in: add missing defines SDL_SENSOR_COREMOTION
  and SDL_SENSOR_WINDOWS (configure did set SDL_SENSOR_WINDOWS
  but it never went in SDL_config.h or Makefile.)
- SDL_config.h.cmake: remove duplicated SDL_SENSOR_XXX cmake
  defines.
- autofoo, cmake: check for sensorsapi.h header before enabling
  windows sensors.
2020-10-12 01:02:28 +03:00
Sam Lantinga
eadc8693dd Fixed bug 5103 - Port fcitx support to both fcitx 4 & 5
wengxt

Due to the new major fcitx version is coming close, the existing code need to be ported to use new Fcitx dbus interface.

The new dbus interface is supported by both fcitx 4 and 5, and has a good side effect, which is that it will work with flatpak for free. Also the patch remove the dependency on fcitx header. Instead, it just hardcodes a few enum value in the code so need to handle the different header for fcitx4 or 5.
2020-05-11 14:31:04 -07:00
Sam Lantinga
4dea340ca7 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows
Jimb Esser

Add new RawInput controller API, and improved correlation with XInput/WGI

Reorder joystick init so drivers can ask the others if they handle a device reliably
Do not poll disconnected XInput devices (major perf issue)
Fix various cases where incorrect correlation could happen
Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation
Correlate by axis motion as well as button presses
Fix failing to zero other trigger
Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init()
Add missing device to device names
Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices

Updated to SDL 2.0.13 code with the following notes:
New HID driver: xbox360w - no idea what that is, hopefully urelated
SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data.
SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem.
Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason.
Something changed in how devices get names, so getting generic names.
Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
2020-03-16 12:23:38 -07:00
David Ludwig
cc37ee8a0c virtual joysticks: add autotools-build support (Bug 5028)
Autotools support for virtual-joysticks turns it OFF by default.  To turn it
on, pass the following into configure: --enable-joystick-virtual
2020-03-16 00:21:22 -04:00
Sam Lantinga
a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga
650964461e Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp() 2019-11-20 16:42:50 -08:00
Ozkan Sezer
eb8f14bb6a added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.) 2019-11-20 20:40:50 +03:00
Ben Avison
a6bfdd103f ARM: Create configure option --enable-arm-neon to govern assembly optimizations 2019-10-24 21:17:05 -04:00
Ben Avison
6a6a05289e ARM: Create configure option --enable-arm-simd to govern assembly optimizations 2019-10-24 21:12:08 -04:00
Ozkan Sezer
ffc7d09197 endpointvolume.h checks not needed since changeset 13078:8ab094a9df6b . 2019-10-01 14:00:02 +03:00
Alex Szpakowski
aebaa316c7 Add public APIs for creating a Metal view attached to an SDL window. Add SDL_metal.h. 2019-08-05 12:35:32 -03:00
Ethan Lee
f7d82e5616 hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.

Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.
2019-07-31 12:20:55 -04:00
Sam Lantinga
f79190f407 Use _Exit() when available 2019-04-23 07:59:31 -07:00
Sam Lantinga
5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Ryan C. Gordon
bc57ac27f9 mir: Removed mir client support.
Fixes Bugzilla #4288.
2018-11-02 21:34:17 -04:00
Ozkan Sezer
b11c75e9f4 configury, cmake: add check for endpointvolume.h :
add HAVE_ENDPOINTVOLUME_H, HAVE_MMDEVICEAPI_H and HAVE_AUDIOCLIENT_H
in SDL_config.h.in, SDL_config.h.cmake, SDL_config_windows.h, and in
SDL_config_winrt.h.
2018-09-28 13:41:04 +03:00
Sam Lantinga
3e5dbc694a Added a dummy sensor driver 2018-08-21 13:29:21 -07:00
Sam Lantinga
d2042e1ed4 Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Ethan Lee
b4fe7412f9 SDL_exp 2018-08-04 11:52:46 -04:00
Ethan Lee
11c348b4d7 SDL_log10 2018-01-17 11:53:09 -05:00