Commit Graph

5767 Commits

Author SHA1 Message Date
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
Sam Lantinga
bdbf90e3fc on-screen keyboard newline is reported as an Enter key 2022-07-01 09:17:30 -07:00
Sam Lantinga
7ac5d616f3 Fixed backspace being delivered after committed text on Android 12
Testing:
Enter "hello ", followed by "?" - the events generated are:
: commitText hello
: Key pressed :  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key released:  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key pressed :  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key released:  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key released:  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key pressed :  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: Key released:  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: INPUT Text (\x68\x65\x6c\x6c\x6f\x20): "hello "
: finishComposingText
: deleteSurroundingText 1 / 0
: Key pressed :  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: Key released:  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: commitText ?
: Key pressed :  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: LSHIFT
: Key pressed :  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: (none)
: INPUT Text (\x3f): "?"
: setComposingText , at 1
: EDIT Text (): ""

Previously, the backspace would be delivered after the "?"
2022-07-01 08:58:08 -07:00
Cameron Cawley
78089e6598 Remove unused internal header SDL_sysevents.h 2022-07-01 07:39:48 -07:00
Cameron Gutman
3e114872e8 joystick: Fix redetection of HIDAPI joysticks after reinitializing
The HIDAPI joystick driver doesn't properly reset the change counter
it uses to track if re-enumeration is needed when the joystick
subsystem is quit and then reinitialized.

The first SDL_Init(SDL_INIT_JOYSTICK) will result in the expected
HIDAPI joysticks appearing, but subsequent calls will result in no
joysticks being enumerated until another HIDAPI joystick is added
or removed from the system.
2022-06-30 20:43:14 -07:00
chalonverse
4f73219794 Fixed D3D12 renderer not working with batching, and got rid of the vertex buffer size limit 2022-06-30 03:41:17 -07:00
Sam Lantinga
0ad65277ce Refactored code to send scancodes for an ASCII on-screen keyboard key 2022-06-29 17:26:09 -07:00
Francisco Javier Trujillo Mata
a054a5f7f2 Improve SDL2 main, adding memory card and usb drivers 2022-06-29 03:15:00 +03:00
Jade Macho
6a2e6c82a0 Add SDL_HINT_DIRECTINPUT_ENABLED (on by default) 2022-06-28 15:59:05 -07:00
Sam Lantinga
1d1fb95a61 Removed double va_end() 2022-06-28 06:21:45 -07:00
Sylvain
f815580dde
Fix SIGSEV in SDL_error. Re-apply same pattern on this uncompiled code (see #5795) 2022-06-28 13:09:38 +02:00
Sylvain
d4e6047e3c
Fix SIGSEV in SDL_error (After removing the limit on the size of the SDL error message) (see #5795) 2022-06-28 09:46:12 +02:00
Sourcery AI
cddf095a16 'Refactored by Sourcery' 2022-06-27 17:55:47 -07:00
Sam Lantinga
b6f1c91862 Fixed Watcom C build 2022-06-27 17:44:55 -07:00
Sam Lantinga
cbd0187475 Removed the limit on the size of the SDL error message
Also added SDL_GetOriginalMemoryFunctions()

Fixes https://github.com/libsdl-org/SDL/issues/5795
2022-06-27 16:59:50 -07:00
Pierre Wendling
f25b4b2774 Style: Flip if statement. 2022-06-27 15:19:40 -07:00
Pierre Wendling
6c536afdb7 Fix C89 declaration for macOS modules.
Since Clang 14, `-Wdeclaration-after-statement` is enforced on every
standard.
2022-06-27 15:19:40 -07:00
Francisco Javier Trujillo Mata
e4a8087551 Initial Audio driver 2022-06-27 15:18:48 -07:00
Brad Smith
9723917637 Use proper header for OpenBSD PPC CPU detection 2022-06-27 11:01:34 -07:00
chalonverse
3b191580c3
Windows GDK Support (#5830)
* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Sylvain
314bb5a1ed
Fixed bug #5850: Android EGL_BAD_ACCESS because of viewport command while turning the screen off/on. 2022-06-27 14:45:14 +02:00
Francisco Javier Trujillo Mata
7fd46ec581 Initial PS2_Joystick implementation 2022-06-27 00:32:43 -07:00
Francisco Javier Trujillo Mata
84d69da4e1 Initial SDL_ps2_main implementation 2022-06-27 00:32:43 -07:00
Ivan Epifanov
b2f07d94d2 Vita: create rendertarget color surface with same format as texture. Fixes #5844 2022-06-26 15:41:14 -07:00
unknown
ebe4f47f2b Fixed __VA_ARGS__ in gcc when no args 2022-06-26 15:35:18 -07:00
unknown
51c6488f97 Add support for SDL_render_d3d12.c to compile in C++ mode 2022-06-26 15:35:18 -07:00
Francisco Javier Trujillo Mata
2b41f497db Improve Joystick removing semaphores 2022-06-22 15:08:41 +02:00
Francisco Javier Trujillo Mata
c3a5e4aa7b Adding GetGamepadMapping to Vita Joystick driver 2022-06-22 02:23:00 +03:00
Ozkan Sezer
7adb08a79a fixed SDL_BlitMap typedef redefinition errors 2022-06-22 01:37:00 +03:00
Ryan C. Gordon
12b371ee0f
x11: Don't send diplay-add events for displays connected at init time.
Reference Issue #4977.
2022-06-21 14:49:21 -04:00
Frank Praznik
c11bdeeb69 wayland: Round fractional backbuffer sizes halfway away from zero
Use SDL_lroundf() to round fractional backbuffer sizes halfway away from zero, as this is the rounding method recommended by the forthcoming Wayland fractional scaling protocol.
2022-06-21 14:01:29 -04:00
Pieter-Jan Briers
9914e87faa Also send DPI change when expected resize. 2022-06-20 06:54:40 -07:00
Pieter-Jan Briers
af733c7a32 Fix DPI-raised SDL_WINDOWEVENT_SIZE_CHANGED with event callback.
Move the sending of this event down so stuff like calling SDL_GL_GetDrawableSize() from a callback reports the new size instead of the old one.
2022-06-20 06:54:40 -07:00
Ozkan Sezer
2316e5682e SDL_windows.h: match WINVER value to _WIN32_WINNT. 2022-06-19 08:33:28 -07:00
Ozkan Sezer
22a29321e9 tweak _WIN32_WINNT value for shellscalingapi.h present but no d3d12 2022-06-19 08:33:28 -07:00
Sam Lantinga
abe38bca3e Support SDL_AUDIODRIVER set to "dsound", which was used by SDL 1.2
Fixes https://github.com/libsdl-org/SDL/issues/5818
2022-06-18 13:08:58 -07:00
Ozkan Sezer
a8d41b3b45 check for shellscalingapi.h presence instead of WINVER >= 0x0603 2022-06-18 13:00:44 -07:00
Sam Lantinga
5f6d0abebe SDL_SendEditingText() has int parameters, so use that type for parameter calculation
We might want to use ssize_t as @Guldoman suggested, but that's a larger internal API change, and still requires casting of the SDL_utf8strnlen() result.

Fixes https://github.com/libsdl-org/SDL/pull/5821
2022-06-18 12:59:28 -07:00
Mathieu Eyraud
00b95e989b Fix read of uninitialised variable
If the condition (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) is false, subtext is not initialised.
2022-06-18 18:23:50 +03:00
Sam Lantinga
12f14bdbeb Fixed digit count in sscanf, e.g. "%1x" 2022-06-18 07:02:38 -07:00
Sam Lantinga
53e307050b List the available tests if the filter didn't match 2022-06-18 06:52:16 -07:00
Sam Lantinga
eb7e29a8b2 Fixed crash when the joystick product name isn't available 2022-06-17 17:43:14 -07:00
Sam Lantinga
adc6875870 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
2022-06-17 10:22:28 -07:00