Commit Graph

5909 Commits

Author SHA1 Message Date
Anonymous Maarten
36dfbe5d66 stdlib: exclude mslibc functions using SDL_STATIC_LIB macro 2022-07-29 15:05:19 +02:00
Sam Lantinga
f3c1194c0f Removed obsolete comment 2022-07-28 21:50:41 -07:00
Sam Lantinga
aee179e46f Removed debug output 2022-07-28 21:50:20 -07:00
Sam Lantinga
d8fd78736b Added entry for the Nintendo Switch Joy-Con controller pair 2022-07-28 21:44:23 -07:00
Sam Lantinga
875b737c64 Added support for the Nintendo Online NES Controllers to the HIDAPI driver 2022-07-28 21:40:01 -07:00
Sam Lantinga
ab967475c6 Greatly improved Nintendo Joy-Con support using the HIDAPI driver
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:38:38 -07:00
Sam Lantinga
dfed862a66 Fixed variable shadow warning 2022-07-28 19:35:46 -07:00
Sam Lantinga
2fa2f9ff77 Greatly improved Nintendo Joy-Con support using the HIDAPI driver
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:22:27 -07:00
Sam Lantinga
def60ce6fe Fixed the name of the HIDAPI Joy-Con controller for consistency with other drivers 2022-07-27 19:20:42 -07:00
Sam Lantinga
0f1be9401f Updated mapping for Joy-Con controllers using hid-nintendo
This matches the mapping on iOS 16 and will match the HIDAPI
implementation.
2022-07-27 17:32:51 -07:00
Sam Lantinga
756978a236 Left and right single Joy-Con controllers are mapped as individual mini controllers 2022-07-27 16:17:32 -07:00
Sam Lantinga
4990bd0517 Added debug code to show available inputs on iOS/tvOS controllers 2022-07-27 16:17:32 -07:00
Sam Lantinga
dbf7940541 Enable capturing raw Xinput2 touch events and use to flag global mouse state as dirty
- Touch events may be translated to mouse movement events without the normal Xinput2 raw motion events
  being sent. Not all touch events will necessarily move the mouse but this ensures we update the global
  mouse state just in case.

- Fix up some formatting

CR: saml
2022-07-27 10:31:24 -07:00
Ryan C. Gordon
42165fe8d1
kmsdrm: slightly better device index hint parsing. 2022-07-27 12:12:36 -04:00
Anonymous Maarten
5da85376b9 stdlib: move all mslibc functions to SDL_mslibc.c
This allows disabling LTO on them by only specifying a single file.
2022-07-27 09:07:56 -07:00
Sam Lantinga
a169259f62 Actually we don't need to unlock to send k_eSwitchProprietaryCommandIDs_ForceUSB since we don't wait for reply 2022-07-27 09:05:02 -07:00
Sam Lantinga
c51464d9d8 Put the Nintendo Switch Pro controller back into enhanced mode as needed
Fixes https://github.com/libsdl-org/SDL/issues/3450
2022-07-27 09:00:39 -07:00
Sam Lantinga
613ce7850e Fixed interpreting SDL_KMSDRM_DEVICE_INDEX="" as index 0 2022-07-26 13:34:27 -07:00
Ryan C. Gordon
cc982ea7a7 kmsdrm: let device indexes be > 2 digits. 2022-07-26 15:43:34 -04:00
diddily
1f276a5148 Fix Main Thread Checker warning on macOS
Cache off NSWindow's windowNumber in SDL_WindowData on setup and use that in `Cocoa_SendWakeupEvent` to prevent accessing windowNumber off the main  thread.
2022-07-26 15:17:44 -04:00
Ryan C. Gordon
542a4da3d6
kmsdrm: check SDL_HINT_KMSDRM_DEVICE_INDEX hint in dri_getindex().
Otherwise, it would work for Init but not Available.
2022-07-26 15:11:19 -04:00
Ryan C. Gordon
218c3dbb34
cocoa: Don't crash if moving a message box created before SDL_Init.
Fixes #5928.
2022-07-26 14:45:26 -04:00
Ryan C. Gordon
8ff738f234
audio: Report SDL_AUDIODEVICEREMOVED for unopened devices.
Unopened devices, if removed, now send SDL_AUDIODEVICEREMOVED events with
a `which` field set to zero. Apps can use this to decide if they need to
refresh a list of devices being shown in an options menu, etc.

It's safe to call SDL_CloseAudioDevice(0), so even if they try to clean
up this bogus id, it should be safe.

Fixes #5199.
2022-07-26 12:40:47 -04:00
Ryan C. Gordon
5d85c7d300
kmsdrm: Added a hint to specify device index.
Fixes #2811.
2022-07-26 00:19:54 -04:00
Ryan C. Gordon
20a76b0e3e
video: removed unused devindex argument from bootstrap's create method. 2022-07-26 00:19:52 -04:00
pionere
12211df669 hide SDL_GenerateAssertionReport in case SDL_ASSERT_LEVEL is 0
otherwise SDL_PromptAssertion (and SDL_GenerateAssertionReport) can not be eliminated
2022-07-25 14:26:46 -07:00
Sam Lantinga
a423848ea0 Allow floating point values for SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED
This allows setting the brightness of the home LED on Nintendo Switch Pro controllers, in the range 0.0 - 1.0.

This can be updated at runtime by setting the hint dynamically.

Fixes https://github.com/libsdl-org/SDL/issues/3787
2022-07-25 11:26:18 -07:00
diddily
1e492b2f6d Improve behavior of SDL_events_need_periodic_poll() and SDL_events_need_polling()
SDL_events_need_periodic_poll() and SDL_events_need_polling() are intended to allow the event loop to update joysticks and/or sensors if needed, however those systems only update when the SDL_update_joysticks and/or SDL_update_sensors variables are true. This change brings the behavior of these functions in line with if work will actually need to be performed.

This change allows the hints for AUTO_UPDATE to influence the polling behavior of the event loop such that an app can choose to update joysticks/sensors itself and avoid the expense of constantly sleeping and waking the event loop. Additionally in makes these functions marginally faster in some situations by not searching the active events.
2022-07-25 09:00:31 -07:00
diddily
d9bda89fce Fix updating SDL_update_joysticks and SDL_update_sensors in response to hint changes
Hint callbacks are called before the actual value in the hint is changed, so the functions SDL_AutoUpdateJoysticksChanged and SDL_AutoUpdateSensorsChanged were not actually properly updating their respective variables in repsonse to their auto update hint changing.

Instead, we pull the new hint value out of the value passed into the callback and use that to update the variables. Assume true on a null value as that was the previous behavior and it matches with the default values of SDL_update_joysticks/SDL_update_sensors.
2022-07-25 09:00:31 -07:00
diddily
0ec5bb4e6d Add missing controller events to SDL_GameControllerEventState()
Events to handle controller touchpads and sensors were added to the library but not added in `SDL_GameControllerEventState()`. This change adds the missing events.
2022-07-25 08:55:17 -07:00
Sam Lantinga
4d66501736 Fixed building with 10.9 SDK
Fixes https://github.com/libsdl-org/SDL/issues/5954
2022-07-24 18:04:26 -07:00
Cameron Gutman
3ab1e303ec joystick: Refactor and fix a few bugs in Shield HIDAPI driver
- CMD_CHARGE_STATE was checking the seqnum instead of the payload
- Off-by-one error in size validation for command payload
- Unused payload space was left uninitialized in output report
2022-07-24 15:36:30 -05:00
Sam Lantinga
4d8bb89c46 Fixed mouse clip rect bounds on Windows
Fixes https://github.com/libsdl-org/SDL/issues/5946
2022-07-24 11:50:14 -07:00
Dean Herbert
6bcde52d88 Further adjust implementation of Cocoa_GetWindowDisplayIndex
As discussed in PR review, there may be an off-chance that the index
returned doesn't match up with SDL's display indexing.

This change ensures that the indices match and adds a safety check for
off-screen windows.
2022-07-24 09:25:16 -07:00
Dean Herbert
ce8aae1419 Fix Cocoa_GetWindowDisplayIndex failing and causing a catastrophic crash
With the introduction of this function, it is possible that for certain
monitor and window configurations, creating an SDL window will cause a
native crash.

```
Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000050
Exception Codes:       0x0000000000000001, 0x0000000000000050
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [56627]

VM Region Info: 0x50 is not in any region.  Bytes before following region: 140737486737328
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      VM_ALLOCATE              7fffffe75000-7fffffe76000 [    4K] r-x/r-x SM=ALI

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libSDL2.dylib                            0x10247f665 SDL_UpdateFullscreenMode + 357
1   libSDL2.dylib                            0x10247ec70 SDL_CreateWindow_REAL + 1504
2   ???                                      0x111262de8 ???
3   ???                                      0x110c39fff ???
4   libcoreclr.dylib                         0x101fdf2a9 CallDescrWorkerInternal + 124
```

Tracking thread from our end: https://github.com/ppy/osu-framework/issues/5190
Regressed with: https://github.com/libsdl-org/SDL/pull/5573

In testing, the window would not find a valid screen if created
"hanging" off a primary display with a secondary display below it. In
checking why this was the case, the `display_centre` was being
calculated with a negative y origin, causing a final negative value
falling outside all display bounds:

```
SDL error log [debug]: display_centre.y = -1296 + 1296 / 2

SDL error log [debug]: Display rect 0: 0 0 2560 1440
SDL error log [debug]: Display rect 1: 2560 -625 1080 2560
SDL error log [debug]: Display rect 2: 0 1440 1728 1296
```

The method that was being used to find the current window using the frame
origin/size seems unreliable, so I have opted to replace it with with a
tried method (https://stackoverflow.com/a/40891902).

Initial testing shows that this works with non-standard DPI screens, but
further testing would be appreciated (cc @sezero / @misl6 from the
original PR thread).
2022-07-24 09:25:16 -07:00
Sebastian Krzyszkowiak
041666e6c3 video: wayland: Don't switch to libdecor path for borderless windows
We actually request CSD mode with xdg-decoration for borderless
windows, so we get what we wanted there and there's no point in going
into fallback paths.
2022-07-24 10:59:42 -04:00
Sebastian Krzyszkowiak
405d1f6598 video: wayland: Roundtrip after falling back to libdecor in xdg-decoration handler
Otherwise libdecor doesn't have a chance to acquire xdg-toplevel after
libdecor_new before we attempt to use it in Wayland_ShowWindow.

Fixes #5952
2022-07-24 10:57:51 -04:00
Ozkan Sezer
8c51cae784 audio/aaudio, audio/openslES: fix -Wdeclaration-after-statement errors
Fixes https://github.com/libsdl-org/SDL/issues/5950
2022-07-23 14:56:04 +03:00
slime
65647b3417 SDL_Render: use high precision texcoords in ES2 shaders, when possible
Fixes #5884
2022-07-22 19:03:53 -07:00
Sam Lantinga
f9beef760a Added support for the Nintendo Switch Joy-Con Controllers on iOS and tvOS 16 2022-07-22 18:58:29 -07:00
Sam Lantinga
aad7ef6eaf Added support for the Nintendo Switch Pro Controller on iOS and tvOS 16 2022-07-22 10:58:34 -07:00
Sam Lantinga
20f51b1fd7 Fixed crash if debug text wasn't drawn during a session 2022-07-22 10:58:29 -07:00
Ethan Lee
f3008e4aab
audio: 3- and 5-channel formats are now supported 2022-07-20 19:08:31 -04:00
Ryan C. Gordon
45c3b59d4b audio: Turn off DEBUG_CONFIG logging again. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
bec721f08a audio: Fixed dst pointer on channel conversions that grow in-place. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
9f56c7cf02 audio: Remove 5.1->X SIMD converters, add SSE mono->stereo.
The 5.1 versions didn't use the new algorithm, and making that new
algorithm work took so many permutes that it was significantly slower
than just using the scalar versions.

However, mono-to-stereo is an extremely common conversion, and it's
trivial to accelerate it with plain SSE, so that was added!
2022-07-20 18:41:53 -04:00
Ryan C. Gordon
b83ae9f24c audio: Replaced some debug-printfs with debug-SDL_Logs. :) 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
49ec8db5f8 audio: Generate the channel converter code from a program. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
f06cc3e945 audio: "SL" means "surround left" not "side left", etc. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
5a0c819863 audio: Add channel convert filter _after_ choosing an SIMD version. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
fe16084075 audio: LOG_DEBUG_CONVERT should use SDL_Log, not fprintf(stderr). 2022-07-20 18:41:53 -04:00
Ryan C. Gordon
257277903e audio: first attempt at rewriting the channel converters.
This is not ready for production use!
2022-07-20 18:41:53 -04:00
Sam Lantinga
be3a945a8b Added support for the 8BitDo Ultimate Wired Controller for Xbox 2022-07-20 11:05:55 -07:00
Ozkan Sezer
b700a32630 audio, pipewire: fix signatures of pw_get_library_version and pw_init.
Reference issue: https://github.com/libsdl-org/SDL/issues/5938
2022-07-20 07:01:10 +03:00
Ozkan Sezer
6e210d3797 audio, pipewire: pipewire_version_xx globals out of dynamic loading
Fixes build with --disable-pipewire-shared
Reference issue: https://github.com/libsdl-org/SDL/issues/5938
2022-07-20 07:01:10 +03:00
David Gow
78bad66773 video: wayland: Resize the window before sending the SDL_RESIZE event
Currently, the SDL_WINDOWEVENT_RESIZED event is sent before the actual
window is resized (and various internal state, such as the desired
GL/Vulkan backbuffer size, are updated). This makes sense, as SDL will
discard a no-op resize, which would be the case if we had resized before
sending the event (indeed, there are existing hacks to prevent this).

However, this means that SDL_{GL,Vulkan}_GetDrawableSize() will still
use the old size in the SDL_WINDOWEVENT_RESIZED handler. In the case of
SDL_Renderer, this means the drawable size it uses will be wrong, and
the viewport will get "updated" to the old value.

This then results in bug #5899.
2022-07-18 09:21:15 -07:00
Sam Lantinga
53e685168d Fixed declaration-after-statement warning 2022-07-18 07:31:23 -07:00
Sam Lantinga
6ad7fdecce Fixed infinite loop for values bigger than 0x40000000
Fixes https://github.com/libsdl-org/SDL/issues/5930
2022-07-18 07:26:29 -07:00
Sam Lantinga
2be9301410 Fixed comment (thanks @pionere!) 2022-07-18 07:18:56 -07:00
Sam Lantinga
cef1514b01 Fixed some Xcode warnings 2022-07-17 09:07:04 -07:00
Sam Lantinga
b299cb3d3c Added a utility function to calculate the next power of 2 for a value 2022-07-17 08:31:16 -07:00
Ethan Lee
90b86b132a audio: Handle non-power-of-two spec.samples when unsupported
Fixes #3685
2022-07-17 10:36:15 -04:00
Ethan Lee
a09d62e4d8
directsound: Remove redundant SubFormat copy 2022-07-15 23:45:56 -04:00
Ethan Lee
c5e408ae98 directsound: For channel counts > 2, generate a dwChannelMask for CreateSoundBuffer 2022-07-15 13:59:46 -04:00
Ethan Lee
fff34f6304 windows: SDL_IMMDevice needed more deinit code from the Win32 path.
Fixes #5919
2022-07-15 09:49:29 -04:00
Frank Praznik
37aecda2c1 pipewire: Use PW_KEY_TARGET_OBJECT to specify stream connection nodes
Pipewire 0.3.44 introduced PW_KEY_TARGET_OBJECT, which is to be used to specify target connection nodes for streams.  This parameter takes either a node path (PW_KEY_NODE_NAME) or serial number (PW_KEY_OBJECT_SERIAL) to specify a target node.  The former is used in this case since the path is already being retrieved and stored for other purposes.

The target_id parameter in pw_stream_connect() is now deprecated and should always be PW_ID_ANY when PW_KEY_TARGET_OBJECT is used.
2022-07-14 12:23:50 -04:00
Ozkan Sezer
2201d80255 avoid -Werror=declaration-after-statement after last commit. 2022-07-14 02:40:00 +03:00
freebsd
24b3efd08d (OpenBSD) Exe Path: Use PWD instead of CWD and use CWD as fallback 2022-07-13 16:24:20 -07:00
Sam Lantinga
883409ea07 Added support for the misc1 button on the Nintendo Switch Pro Controller
when using hid_nintendo kernel driver
2022-07-13 11:26:42 -07:00
SuperSamus
9a4f200d44 gamecontrollerdb: Linux, add mappings for hid-nintendo driver and more
Taken from https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
2022-07-13 11:23:15 -07:00
Sam Lantinga
06c7d22653 Added mappings for the HORI Fighting Stick mini 4 on Linux and macOS 2022-07-12 18:53:53 -07:00
Sam Lantinga
e24b971a34 Added support for the NVIDIA Shield controller guide button 2022-07-12 17:53:03 -07:00
Cameron Gutman
b321eae51a joystick: Fix spurious battery empty events when opening a Shield controller 2022-07-11 19:43:25 -05:00
Cameron Gutman
a0d8848baa joystick: Plumb SDL_JoystickSendEffect() for the Shield HIDAPI driver
The effect data format consists of one command byte followed by zero or more
payload bytes.
2022-07-11 19:38:26 -05:00
Frank Praznik
36d8460c9e pipewire: Dynamically allocate the buffer for node strings
Calculate and allocate the buffer for the IO node name and path strings dynamically instead of using arbitrary sized static buffers.
2022-07-11 18:03:56 -04:00
Frank Praznik
996cea31ee pipewire: Update default audio devices during runtime
Make the default device metadata node persist for the lifetime of the hotplug loop so the default source/sink devices will be updated if they change during runtime.
2022-07-11 18:03:56 -04:00
Frank Praznik
60da11f0e2 pipewire: Remove deprecated configuration key
With Pipewire now requiring a minimum version 0.3.24, the PW_KEY_CONTEXT_PROFILE_MODULES value is no longer required for legacy compatability and can be safely removed.
2022-07-11 18:03:56 -04:00
Ozkan Sezer
4fa2653394 SDL_GetJoystickGUIDInfo: byte-swap vendor, product and version values.
Reference issue: https://github.com/libsdl-org/SDL/issues/5907
2022-07-12 00:55:00 +03:00
Ethan Lee
ecfbdce64b pipewire: Require version 0.3.24 or newer at runtime 2022-07-11 13:34:35 -04:00
Ethan Lee
2f0816adb7 Add SDL_GetDefaultAudioInfo.
This API is supported on pipewire, pulseaudio, wasapi, and directsound.

Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
2022-07-11 13:34:35 -04:00
Ethan Lee
15d0618083 SDL_IMMDevice: Fix a WASAPI-specific leak, clean up Add() 2022-07-11 12:54:34 -04:00
Ethan Lee
ae105ae1c7 windows: Move IMMDevice work to common file, implement DirectSound enumeration support 2022-07-11 12:54:34 -04:00
Sam Lantinga
2373da5d94 Exposed SDL_ResetKeyboard() as a public function
This will be used by Source 2 titles to reset keyboard state before showing assertion dialogs
2022-07-11 09:49:00 -07:00
Cameron Gutman
6e712d2440 joystick: Add HIDAPI driver for NVIDIA SHIELD 2017 controller
Basic input already works using the OS HID driver, but this enables
force feedback and battery state reporting.
2022-07-10 10:53:26 -07:00
Cameron Gutman
3242265ff1 joystick: Fix endianness issues in Xbox HIDAPI drivers 2022-07-10 10:49:38 -07:00
Ozkan Sezer
2f21648528 SDL_os2video.c: silenced -Wempty-body warning, along with minor tidy-up. 2022-07-08 20:56:40 +03:00
285424336
4aad594a8b Update SDL_qsa_audio.c
Fix qnx platform compile error, change SDL_Bool to SDL_bool.
2022-07-08 12:15:00 +03:00
Eric Curtin
c0eada2019
Fix assumption that DRI_DEVNAME begins at 0 (#5865)
* Fix assumption that DRI_DEVNAME begins at 0

The existing logic of the code was to count every possible entry in
KMSDRM_DRI_PATH. After this a for loop would start trying to open
filename0, filename1, filename2, etc. In recent Linux kernels (say
5.18) with simpledrm, the lowest KMSDRM_DRI_DEVNAME is often
/dev/dri/card1, rather than /dev/dri/card0, causing the code to fail
once /dev/dri/card0 has failed to open. Running:

modprobe foodrm && modprobe bardrm && rmmod foodrm

before you try to run an application with SDL KMSDRM would have also
made this fail.

* Various changes from review

- Removed newline and period from SDL error
- Explicitely compare memcmp to zero (also changed to SDL_memcmp)
- Changed memcpy to strncpy
- Less aggressive line wrapping

* Various changes from review

- strncpy to SDL_strlcpy
- removed size hardcodings for KMSDRM_DRI_PATHSIZE and
  KMSDRM_DRI_DEVNAMESIZE
- made all KMSDRM_DRI defines, run-time variables to reduce bugs caused
  by these defines being more build-time on Linux and more run-rime on
  OpenBSD
- renamed openbsd69orgreater variable to moderndri
- altered comment from "if on OpenBSD" to add difference in 6.9

* Various changes from review

- Use max size of destination, rather than max size of source
- Less hardcodings
2022-07-06 09:00:16 -07:00
Sam Lantinga
adf3ce7c01 Don't drop mouse focus on WM_MOUSELEAVE if the mouse is in relative mode; mouse-level is not meaningful for that case.
Do drop mouse focus when keyboard focus is lost if the mouse is in relative mode.
2022-07-05 21:42:24 -07:00
Sam Lantinga
0253a45029 Fix format specifiers for WPARAM/LPARAM values, they are UINT_PTR. 2022-07-05 21:42:20 -07:00
Eddy Jansson
ad0b91302d android: Add missing entries to SDL_category_prefixes table.
Add static assert so this shouldn't happen in the future.

Fixes #5883
2022-07-05 17:50:19 -07:00
Chris Mumford
98411c0d33 Added include: libkern/OSAtomic.h
When building on macOS without gcc (e.g. clang) where HAVE_GCC_ATOMICS
is not defined, `SDL_AtomicTryLock` will call
`OSAtomicCompareAndSwap32Barrier` which is not yet declared.
Including OSAtomic.h on OSX resolves this error/warning:

    SDL_spinlock.c:125:12: error: implicit declaration of function
      'OSAtomicCompareAndSwap32Barrier' is invalid in
      C99 [-Werror,-Wimplicit-function-declaration]
        return OSAtomicCompareAndSwap32Barrier(0, 1, lock);

This was reported in issue #3885 but marked Invalid and closed - possibly
because the default CMake build uses gcc instead of clang.
2022-07-05 07:50:57 -07:00
Ryan C. Gordon
fdb86b8266
x11: Don't try to use XInput2 multitouch if not supported.
Fixes #5889.
2022-07-04 12:48:32 -04:00
rohlem
b085c18251 make SDL_SetTextInputRect take a pointer to const
The documentation doesn't state that the argument is ever modified,
and no implementation does so currently.
This is a non-breaking change to guarantee as much to callers.
2022-07-04 09:38:01 -07:00
Dav999-v
51f75b8b30 Fix fallback implementations of SDL_strchr and SDL_strrchr for '\0'
strchr and strrchr return a pointer to the first/last occurrence of a
character in a string, or NULL if the character is not found. According
to the C standard, the final null terminator is part of the string, and
it should thus be possible to get a pointer to the final null with
these functions. The fallback implementations of SDL_strchr and
SDL_strrchr would always return NULL if trying to find '\0', and this
commit fixes that.
2022-07-04 11:10:26 -04:00
chalonverse
85bbf8eec9 Fixed coment after #endif 2022-07-03 15:22:30 -04:00
Francisco Javier Trujillo Mata
7d7c5b803c Improving mkdir creating parents folder 2022-07-03 09:23:34 -07:00
chalonverse
f317d619cc
Xbox GDKX support (#5869)
* Xbox GDK support (14 squashed commits)

* Added basic keyboard testing

* Update readme

* Code review fixes

* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
2022-07-01 13:59:14 -07:00
Sam Lantinga
89624485cc Updated the test bitmap font to cover the Latin-1 character set
Based on Marcel Sondaar's font8_8.asm, in the public domain
2022-07-01 13:32:56 -07:00
Sam Lantinga
e9d5060c4c checkkeys will now render text that is input
Also added test functions for multi-line debug text display

Currently this only supports ASCII, as the font doesn't have the correct Latin-1 characters
2022-07-01 12:56:47 -07:00