Commit Graph

605 Commits (2cd583ee13ec4660d7fbe6e6d8293744d3343071)

Author SHA1 Message Date
Sam Lantinga a31dc6dfcb Switched SDL_TouchID and SDL_FingerID to be Uint64 with 0 being an invalid value 2024-01-18 10:55:24 -08:00
Edoardo Lolletti b384973936 Remove no longer needed hint 2024-01-18 10:19:18 -08:00
Sam Lantinga cda2bffeee Re-add SDL_HAPTIC_SQUARE for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/8753
Closes https://github.com/libsdl-org/SDL/pull/8831
Closes https://github.com/libsdl-org/SDL/pull/8783
2024-01-18 09:24:03 -08:00
Sam Lantinga df4b855af5 Updated SDL_TLSID to use the same type as other IDs in SDL 2024-01-18 08:18:37 -08:00
Sam Lantinga fc0c774976 Renamed SDL_ThreadID() to SDL_GetCurrentThreadID()
Also renamed SDL_threadID to SDL_ThreadID and made it Uint64 for consistency with other ID types
2024-01-18 08:18:37 -08:00
Sam Lantinga d6a41f8f31 Updated SDL_TimerID to use the same type as other IDs in SDL 2024-01-18 07:08:15 -08:00
SDL Wiki Bot bc3a71d400 Sync SDL3 wiki -> header 2024-01-18 15:01:21 +00:00
Sam Lantinga 464f4d19fe Removed obsolete XInput mapping hint 2024-01-18 07:00:21 -08:00
Sam Lantinga f8dfee01bb Made SDL_ReadSurfacePixel a public function
Fixes https://github.com/libsdl-org/SDL/issues/8320
2024-01-18 07:00:10 -08:00
Sam Lantinga c540c77756 Removed SDL_INIT_EVERYTHING
Fixes https://github.com/libsdl-org/SDL/issues/8709
2024-01-18 06:17:58 -08:00
Sam Lantinga 26996e2c02 We've decided to keep separate functions for creating a thread with and without stack size specified.
Fixes https://github.com/libsdl-org/SDL/issues/6652
2024-01-18 06:11:55 -08:00
Sam Lantinga a2665f54c8 Updated the atomic API for SDL 3.0 naming conventions
Fixes https://github.com/libsdl-org/SDL/issues/7388
2024-01-18 04:41:34 -08:00
SDL Wiki Bot 4e60fc9b2b Sync SDL3 wiki -> header 2024-01-18 12:07:19 +00:00
Sam Lantinga fb898d6df0 Clarify that desktop mode is the non-exclusive borderless fullscreen mode
Fixes https://github.com/libsdl-org/SDL/issues/8413
2024-01-18 04:06:32 -08:00
SDL Wiki Bot b5bcf45a65 Sync SDL3 wiki -> header 2024-01-18 12:02:08 +00:00
Sam Lantinga 4fee6cb274 Added documentation for custom event cleanup in SDL_FlushEvent() 2024-01-18 04:00:48 -08:00
SDL Wiki Bot 20e8411b12 Sync SDL3 wiki -> header 2024-01-18 11:27:24 +00:00
Sam Lantinga f224af5ac5 Updated Haptic API for SDL 3.0 conventions
Also removed the XInput haptic support since using the haptic API for rumble is no longer supported.
2024-01-18 03:26:11 -08:00
SDL Wiki Bot 3ca8cee874 Sync SDL3 wiki -> header 2024-01-16 20:27:25 +00:00
Ryan C. Gordon 8bf74280e0
docs: Note SDL_UpdateWindowSurfaceRects can update beyond specified areas.
Reference Issue #8825.
2024-01-16 15:26:13 -05:00
SDL Wiki Bot 464a41411e Sync SDL3 wiki -> header 2024-01-15 18:55:24 +00:00
Frank Praznik 4f3d4bd110 wayland: Add the ability to import and wrap external surfaces
Add the ability to import and wrap external surfaces from external toolkits such as Qt and GTK.

Wayland surfaces and windows are more intrinsically tied to the client library than other windowing systems, so it is necessary to provide a way to initialize SDL with an existing wl_display object, which needs to be set prior to video system initialization, or export the internal SDL wl_display object for use by external applications or toolkits. For this, the global property SDL_PROPERTY_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER is used.

A Wayland example was added to testnative, and a basic example of Qt 6 interoperation is provided in the Wayland readme to demonstrate the use of external windows with both SDL owning the wl_display, and an external toolkit owning it.
2024-01-15 13:54:35 -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
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
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
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
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 5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sam Lantinga 2faae8457d The C standard defines a boolean expression as a signed integer value.
Microsoft came to the same conclusion:
https://devblogs.microsoft.com/oldnewthing/20110328-00/?p=11113

Fixes https://github.com/libsdl-org/SDL/issues/8761
2023-12-30 11:44:40 -08:00
Sam Lantinga e3d50619f8 Fixed fatal error: SDL_pen.h: No such file or directory 2023-12-29 20:04:40 -08:00
Sam Lantinga 7681695875 Revert "Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions"
This reverts commit 61db102da9.

This causes the build to fail:
SDL_waylandwindow.c:1876:45: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            wind->fullscreen_was_positioned = SDL_TRUE;
2023-12-29 17:14:05 -08:00
Sam Lantinga ebd7f9adbd Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch in SDL_video.c 2023-12-29 10:37:28 -08:00
Sam Lantinga 61db102da9 Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions 2023-12-29 09:23:47 -08:00
Sam Lantinga d71454da17 Store the surface properties in the reserved pointer of a surface
This prevents us from exposing the properties publicly and allows us to repurpose the pointer later if necessary.

Fixes https://github.com/libsdl-org/SDL/issues/8758
2023-12-29 08:17:06 -08:00