Commit Graph

14813 Commits (ee87132385014449c4cd33236c661d57539071c1)

Author SHA1 Message Date
Frank Praznik ec2159d492 tests: Clean up the window creation properties in the Wayland custom surface example 2024-01-10 11:17:06 -05:00
Sam Lantinga 9a77813df0 WinMain is specified by the Win32 API as having extern "C" linkage
Fixes https://github.com/libsdl-org/SDL/issues/8814
2024-01-10 06:25:49 -08:00
Sam Lantinga 6407e0cc37 Added attribution for GIP protocol handling (thanks @medusalix!) 2024-01-09 11:43:12 -08:00
Frank Praznik 3a219caf3d wayland: Restore accidentally removed line of code 2024-01-08 18:01:06 -05:00
Sam Lantinga ccae9c1ef6 Only initialize audio drivers that have been requested
If testautomation is running with only a specific audio driver enabled, we shouldn't try to open other ones, as they might fail.

Fixes https://github.com/libsdl-org/SDL/issues/8797

(cherry picked from commit 4c11307a4e75fbfde0d8ace6b19d612d2973bf0b)
2024-01-08 14:35:42 -08:00
Sam Lantinga 590d0bec6f Revert "Make sure new windows have mouse and keyboard focus if there's no windowing system"
This reverts commit 5948ea997f.

This isn't needed, the proper focus logic is in SDL_ShowWindow()
2024-01-08 14:32:28 -08:00
Sam Lantinga 5948ea997f Make sure new windows have mouse and keyboard focus if there's no windowing system 2024-01-08 13:54:18 -08:00
SDL Wiki Bot 05d18aab1c Sync SDL3 wiki -> header 2024-01-08 19:55:19 +00:00
Frank Praznik 4b6df89238 wayland: Add a property to allow creation of a wl_egl_window object even if OpenGL is not enabled
Useful if the application handles OpenGL outside of SDL and wants to use the window without having to pull in Wayland as a dependency.
2024-01-08 14:54:47 -05:00
Frank Praznik f7dd0f9491 wayland: Allow the creation of roleless window surfaces for custom application use
Allow for the creation of SDL windows with a roleless surface that applications can use for their own purposes, such as with a windowing protocol other than XDG toplevel.

The property `wayland.surface_role_custom` will create a window with a surface that SDL can render to and handles input for, but is not associated with a toplevel window, so applications can use it for their own, custom purposes (e.g. wlr_layer_shell).

A test/minimal example is included in tests/testwaylandcustom.c
2024-01-08 14:54:47 -05:00
Frank Praznik 4417250d0d wayland: Remove the registry from the window properties
A Wayland registry object can only have one listener attached at a time, so an application attempting to use the backend SDL registry object for its own purposes will just result in an error. Remove this property, as it is of no use to applications and will only result in errors.

If an application needs the registry, it needs to get the wl_display object via `SDL.window.wayland.display` and use wl_display_get_registry() to create a new registry object that it can attach its own listeners to.
2024-01-08 14:54:47 -05:00
Frank Praznik 392796e49c wayland: Eliminate redundant protocol checks
If the xdg_wm_base protocol isn't present, the window won't be assigned a valid surface type at creation time, which makes these checks redundant.

The libdecor path was already cleaned up in this manner some time ago.
2024-01-08 14:54:47 -05:00
Ryan C. Gordon 82f2c4d581
render: Renamed SDL_GetTextureRenderer to SDL_GetRendererFromTexture. 2024-01-08 14:16:16 -05:00
SDL Wiki Bot 95066ce2a0 Sync SDL3 wiki -> header 2024-01-08 19:10:31 +00:00
Ryan C. Gordon df438a3170
opengl: OpenGL renderers need to support texture target in properties.
Otherwise this has to become an awkward heuristic in sdl2-compat.
2024-01-08 14:08:35 -05:00
Simon McVittie 8e7c0b34d7 test: If SDL_CreateRenderer() fails, say why
Helps: https://github.com/libsdl-org/SDL/issues/8799
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 11:02:12 -08:00
Simon McVittie 022ff075b9 test: When listing test-cases, say which ones are disabled
When a test has been disabled because it's known not to work reliably
or it's a test for unimplemented functionality, we probably don't want
to encourage developers and testers to run it and report its failures
as a bug.

Helps: #8798, #8800
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 09:44:09 -08:00
SDL Wiki Bot 44adab7dfd Sync SDL3 wiki -> header 2024-01-08 17:36:24 +00:00
Simon McVittie 059fb560ba gamepad: Clarify range and direction of axes
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.

We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).

Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 09:35:25 -08:00
SDL Wiki Bot 4942027117 Sync SDL3 wiki -> header 2024-01-08 17:34:23 +00:00
Ryan C. Gordon e056f52f7d
include: Remove string literals from properties documentation.
I'm going to let the wiki bridge clean up the word wrapping for me, here. :)
2024-01-08 12:33:29 -05:00
SDL Wiki Bot e8c595af5c Sync SDL3 wiki -> header 2024-01-08 17:16:19 +00:00
Ryan C. Gordon adef35b9ec
include: Attempt to make new properties documentation wiki bridge friendly. 2024-01-08 12:14:08 -05:00
SDL Wiki Bot 4ffec098b7 Sync SDL3 wiki -> header 2024-01-08 15:18:26 +00:00
Ryan C. Gordon 9bc7cfc755
render: Added SDL_GetTextureRenderer(). 2024-01-08 10:17:38 -05:00
Sam Lantinga 7eae08cfc4 Removed SDL_GL_BindTexture() and SDL_GL_UnbindTexture()
Now that we have the OpenGL texture properties, you can directly bind them yourself.

Fixes https://github.com/libsdl-org/SDL/issues/2124
2024-01-07 20:19:19 -08:00
SDL Wiki Bot 4d5bffc323 Sync SDL3 wiki -> header 2024-01-08 01:02:25 +00:00
Sam Lantinga 1a13dae219 Added constant definitions for SDL properties
Fixes https://github.com/libsdl-org/SDL/issues/8622
2024-01-07 16:59:41 -08:00
Sam Lantinga 3deefa6b43 Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT 2024-01-07 14:20:16 -08:00
Semphris 2348e8b6a2 Add hint to make SDL handle dbus_shutdown() 2024-01-07 14:11:33 -08:00
Sam Lantinga d3daba791a Don't try to send the PS third-party feature request to the Logitech G815 keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8373
2024-01-06 08:29:01 -08:00
Sam Lantinga 014a63b4b5 Renamed ShowTextInput/HideTextInput to ShowScreenKeyboard/HideScreenKeyboard on Android
This better reflects the actual implementation and makes SDL_HINT_ENABLE_SCREEN_KEYBOARD work on Android.

Fixes https://github.com/libsdl-org/SDL/issues/8652
2024-01-06 08:11:22 -08:00
Sam Lantinga 3a9a52fe6c updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil.
Fixes https://github.com/libsdl-org/SDL/issues/8200
2024-01-06 07:31:10 -08:00
Sam Lantinga e100992c17 Added mapping for the RX Gamepad, e.g. Pandora Box 7
Fixes https://github.com/libsdl-org/SDL/issues/8217
2024-01-06 06:18:13 -08:00
J. Neuschäfer 139a0931a3 Fix memory barriers on ARMv5
The ARM926EJ-S Technical Reference Manual states:

> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.

Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.
2024-01-05 09:00:47 -08:00
Sam Lantinga 21c80ac843 Added a practical example of confirm/cancel gamepad button handling 2024-01-04 22:51:43 -08:00
Sam Lantinga 787a15f760 Fix Mac child windows that are created hidden showing if their parent window is shown
- Child windows are added and removed dynamically from the window hierarchy when they're shown/hidden. Adding a hidden child window to a visible
  parent is fine, but adding a hidden child window to a hidden parent will cause the child to show when the parent window is shown as it's still a part of
  the window hierarchy.

- For some reason, not adding the child window to the parent entirely causes the child to not focus correctly the first time it's shown. Adding then immediately
  calling orderOut to remove the child window from the hierarchy does work correctly so we do this to work around the weird issue.
2024-01-04 12:44:57 -08:00
Sam Lantinga d6b1fc9576 Add SDL_MAC_REGISTER_ACTIVATION_HANDLERS hint to allow disabling the normal application startup/activation/deactivation handlers 2024-01-04 12:44:54 -08:00
Sam Lantinga 7c5e694022 Ignore a new warning in Visual Studio 2022 2024-01-04 12:44:48 -08:00
Frank Praznik 73d02184d7 docs: Add Wayland to the SysWM migration example
Wayland will be increasingly encountered going forward and needs to be handled by applications requesting window handles to initialize the Vulkan WSI and such, so include it in the migration example to reflect current best practices.
2024-01-04 14:59:14 -05:00
Sam Lantinga c03c01e9b2 Make sure we get mouse events as soon as possible 2024-01-04 09:12:55 -08:00
Anonymous Maarten 5cbdeab799 Rename SDL_mslibc_x64.asm -> SDL_mslibc_x64.masm
The .masm suffix should give meson sufficient info about the file
being MASM instead of NASM/YASM.
2024-01-04 17:46:07 +01:00
Frank Praznik ed62d6e7de cocoa: Set the titled flag on fullscreen space windows
For some reason, fullscreen space windows won't get any mouse button events unless the NSWindowStyleMaskTitled flag is set when entering fullscreen, even though they successfully become key and receive mouse motion events. Make sure the flag is always set when entering fullscreen space state.
2024-01-03 21:12:34 -05:00
Ozkan Sezer b4b5dbd92f testcontroller.c: fixed warnings. 2024-01-03 14:40:20 +03:00
Sam Lantinga 31851a50d2 Fixed dropping raw input because of mixing GetRawInputBuffer() and WM_INPUT handling
It turns out that when you enable raw input and then process Windows messages, you'll get the currently pending input in GetRawInputBuffer(), and you'll get any new input that occurs while processing messages as WM_INPUT.

The fix for this is to create a dedicated thread to handle raw input and only use GetRawInputBuffer() in that thread. A nice side effect of this is that we'll get mouse input at the lowest latency possible, but raw mouse events will now occur on a separate thread, outside of the normal event loop processing.

Improved fix for https://github.com/libsdl-org/SDL/issues/8756
2024-01-03 02:20:23 -08:00
Nour Fouad 987744aae8 Fix Duplicated includes 2024-01-02 16:34:11 -08:00
Sam Lantinga 2b369a14ab Fixed allocation and alignment of raw input buffers 2024-01-02 09:25:28 -08:00
Vicki Pfau bec1b8f849 Add basic rumble support to Steam Deck 2024-01-01 21:46:38 -08:00
Sam Lantinga 8fe4a45edf Use GetRawInputBuffer() instead processing raw input one at a time
This is a huge performance improvement for high polling rate mice, like the Razer Viper 8K mouse.

Fixes https://github.com/libsdl-org/SDL/issues/8756
2024-01-01 20:41:15 -08:00
Sam Lantinga 87b8f09657 Fixed warning: no previous prototype for function 'SDL_PrivateGetGamepadButtonFromString' [-Wmissing-prototypes] 2024-01-01 14:56:55 -08:00