Commit Graph

322 Commits (70ccf3458701d8563f4b213b1713eafcc052e34e)

Author SHA1 Message Date
SDL Wiki Bot a3e0cd5208 Sync SDL3 wiki -> header 2023-06-22 13:45:16 +00:00
Sylvain 627165a2b2 Fix comments 2023-06-22 15:44:48 +02:00
Sam Lantinga 4c9fb3e169 Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE
This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.
2023-06-21 13:59:53 -07:00
Sam Lantinga 4e81b4e8de Added SDL_HINT_VIDEO_X11_SCALING_FACTOR to allow overriding the content scale on X11 (thanks Andres!) 2023-06-18 12:19:43 -07:00
Sam Lantinga 9fe384b696 Fixed display orientation function names for SDL 3.0 convention 2023-06-17 09:28:27 -07:00
Sam Lantinga d91e96e7f5 Use SDL_HINT_GAMECONTROLLER_SENSOR_FUSION as a list of controllers to enable sensor fusion
There are too many wraparound style controllers out there to enumerate them all, so instead make this a user option in applications that support it.
2023-06-17 08:59:52 -07:00
Sam Lantinga e6d1ba2a17 Added the concept of display natural orientation
Also renamed SDL_GetDisplayOrientation() SDL_GetDisplayCurrentOrientation()

The natural orientation of the primary display is the frame of reference for accelerometer and gyro sensor readings.
2023-06-17 07:42:16 -07:00
Sam Lantinga 8de6ce7e92 Rotate the sensor axes to match gamepad orientation when using the device sensors for game controllers 2023-06-16 17:48:34 -07:00
Sam Lantinga 42e4639a5e For gamepads that don't have their own sensors, try to use the system sensors.
This allows using the gyro and accelerometer in handheld devices in conjunction with built-in or wraparound controllers.
2023-06-16 14:44:59 -07:00
Sam Lantinga 2e465ae31b Revert "Added SDL_nextafter() and SDL_nextafterf()"
This reverts commit bc5d074818.

It's not clear that we need these yet, so I'm going to remove them for now.
2023-06-14 11:05:10 -07:00
Sam Lantinga bc5d074818 Added SDL_nextafter() and SDL_nextafterf() 2023-06-13 10:32:21 -07:00
SDL Wiki Bot 7f86415146 Sync SDL3 wiki -> header 2023-06-10 15:42:15 +00:00
Sam Lantinga 281018f169 Make it clear that you can't mix 2D rendering and the window surface API
Also added functions to query and destroy the window surface so you can switch between modes if you want.

See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:39:20 -07:00
Alibek Omarov 56520372ca hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
(cherry picked from commit c39524042520d6962434228ab8af9ba7e0542308)
2023-06-02 07:42:06 -07:00
Nikita Krapivin c886e80675 gdk: Virtual keyboard and text input backend 2023-05-31 13:11:39 -07:00
Frank Praznik adad6514d4 wayland: Add aspect-correct output for scaled modes
Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none).

The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions.

The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.
2023-05-31 13:41:49 -04:00
Frank Praznik 2f75596d5a Consolidate the X11 WM_CLASS and Wayland app ID envvars
Consolidate the X11_WMCLASS and WAYLAND_WMCLASS envvars into one SDL_HINT_APP_ID hint. This hint serves the same purpose on both windowing systems to allow desktop compositors to identify and group windows together, as well as associate applications with their desktop settings and icons.

The common code for retrieving the value is now consolidated under core/unix/SDL_appid.c as it's common to *nix platforms, and the value is now retrieved at window creation time instead of being cached by the video driver at startup so that changes to the hint after video initialization and before window creation will be seen, as well as to accommodate cases where applications want to use different values for different windows.
2023-05-28 19:15:36 -04:00
SDL Wiki Bot 4d6ed7173e Sync SDL3 wiki -> header 2023-05-27 17:52:16 +00:00
Sam Lantinga 0ffeca8a1c Added SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS to control whether SDL_hid_enumerate() enumerates all HID devices or only controllers.
By default SDL will only enumerate controllers, to reduce risk of hanging or crashing on devices with bad drivers and avoiding macOS keyboard capture permission prompts.
2023-05-27 10:51:52 -07:00
Nikita Krapivin 97a927b44e gdk: Fix the project 2023-05-26 14:53:17 -07:00
Ozkan Sezer a8a72de6fb fix mingw build failures in CI with clang-tidy. 2023-05-26 23:55:04 +03:00
Sam Lantinga cb73bed6eb SDL API renaming: SDL TLS functions
Fixes https://github.com/libsdl-org/SDL/issues/7743
2023-05-26 08:33:15 -07:00
SDL Wiki Bot 2a271aeaf1 Sync SDL3 wiki -> header 2023-05-26 15:20:16 +00:00
Sam Lantinga af45ae7296 Update the SDL HIDAPI API to match upstream hidapi 0.14.0 2023-05-26 08:19:04 -07:00
Sam Lantinga c9d8a04945 Added SDL_swprintf() and SDL_vswprintf() 2023-05-26 08:19:04 -07:00
Sam Lantinga 6c28546828 Added SDL_wcstol() 2023-05-26 08:19:04 -07:00
Sam Lantinga 4dd9f61bfd Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)
Fixes https://github.com/libsdl-org/SDL/pull/5127

(cherry picked from commit a2f4783e753e499c7f6660bf34e337618239a72f)
2023-05-22 11:33:47 -07:00
Sam Lantinga a6a222095e Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
Fixes https://github.com/libsdl-org/SDL/issues/7160
2023-05-20 11:14:34 -07:00
Sam Lantinga a66cad79c1 SDL_GetClosestFullscreenDisplayMode() now takes a boolean whether to include high density modes
Also changed the match to prioritize resolution over refresh rate
2023-05-18 12:15:23 -07:00
Sam Lantinga 87186a893c Integrate 8067023 and 8067041 to SDL3:
Change 8067023 by mikela:
	Add SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED to SDL_RaiseWindow

	- When set to false, this allows SDL_RaiseWindow to bring a chosen window to the top of the stack but not force input focus to it

Change 8067041 by mikela:
	Rename SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN to SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN
2023-05-18 09:21:29 -07:00
Sam Lantinga e61b5ceefe The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed SDL_WINDOW_HIGH_PIXEL_DENSITY 2023-05-18 07:34:45 -07:00
SDL Wiki Bot f9ecc841ca Sync SDL3 wiki -> header 2023-05-18 00:55:15 +00:00
Sam Lantinga cc94f600fd Officially added the concept of window pixel density
The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed SDL_WINDOW_HIGH_PIXEL_DENSITY, and added the function SDL_GetWindowPixelDensity()
2023-05-17 17:54:03 -07:00
SDL Wiki Bot 5836e057de Sync SDL3 wiki -> header 2023-05-17 19:59:14 +00:00
Sam Lantinga c699f3d1d8 Updated SDL high DPI support
We have gotten feedback that abstracting the coordinate system based on the display scale is unexpected and it is difficult to adapt existing applications to the proposed API.

The new approach is to provide the coordinate systems that people expect, but provide additional information that will help applications properly handle high DPI situations.

The concepts needed for high DPI support are documented in README-highdpi.md. An example of automatically adapting the content to display scale changes can be found in SDL_test_common.c, where auto_scale_content is checked.

Also, the SDL_WINDOW_ALLOW_HIGHDPI window flag has been replaced by the SDL_HINT_VIDEO_ENABLE_HIGH_PIXEL_DENSITY hint.

Fixes https://github.com/libsdl-org/SDL/issues/7709
2023-05-17 12:58:00 -07:00
SDL Wiki Bot e2b7b9b91c Sync SDL3 wiki -> header 2023-05-15 18:21:14 +00:00
Sam Lantinga 4de7433a9e Use the term "points" instead of "screen coordinates"
It turns out that screen coordinates were confusing people, thinking that meant pixels, when instead they are virtual coordinates; device independent units defined as pixels scaled by the display scale. We'll use the term "points" for this going forward, to reduce confusion.
2023-05-15 11:20:38 -07:00
SDL Wiki Bot 92a59333ba Sync SDL3 wiki -> header 2023-05-12 14:55:13 +00:00
Linus Probert 19adfa3ad9 wayland: Add support for images in clipboard.
Re-writes the clipboard data handling in wayland to an on demand
solution where callbacks are provided to generate/provide the clipboard
data when requested by the OS.
2023-05-12 07:54:56 -07:00
Sylvain dfd80f3d76 Android: control activity re-creation 2023-05-12 07:48:33 -07:00
Sam Lantinga fd42a2f994 Changed all variadic macros into fixed (thanks @Wohlstand!) 2023-05-10 06:27:38 -07:00
SDL Wiki Bot 9786d8ac40 Sync SDL3 wiki -> header 2023-05-09 18:27:15 +00:00
Ryan C. Gordon 2b6cb7bfb2
include: SDL_ConvertAudioSamples docs now warn about converting in chunks.
Fixes #7154.
2023-05-09 14:24:22 -04:00
Semphris 7f2ef4d02f Implement SDL_GetPath stub for all OSes 2023-05-08 09:36:39 -07:00
Semphriss c1dab7745a
Add SDL_GetPath() for default OS folders (#7665) 2023-05-04 11:38:11 -07:00
Brick 079ae065f1 Added SDL prefix AUDIO_* constants 2023-05-02 08:09:06 -07:00
Frank Praznik bee6099372 events: Emit an event when a window is destroyed
As child windows can be recursively destroyed when their parents are destroyed, emit an event to notify the application when a window is being or has been implicitly destroyed so that it can appropriately clean up any associated resources.

If the application has registered an event watch, the destroy message will be received when the window handle is still valid, so the application can retrieve and release any userdata associated with the window. If the message is processed at any time after that, the window handle is already invalid and the ID is only useful for application-side bookkeeping purposes.
2023-04-28 15:09:47 -04:00
SDL Wiki Bot 78cfc23993 Sync SDL3 wiki -> header 2023-04-28 19:09:14 +00:00
Sam Lantinga 87ad71f9b2 Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention 2023-04-28 12:08:33 -07:00
Sam Lantinga 61c0c009ab Rename SDL semaphore and condition variable functions to match SDL 3.0 naming convention
Fixes https://github.com/libsdl-org/SDL/issues/7642
2023-04-28 12:08:33 -07:00