Commit graph

15569 commits

Author SHA1 Message Date
Amun
4a759b340f Fixes in SDL_ColorSpace (SDL_pixels.h) 2024-01-30 11:16:53 -08:00
Frank Praznik
9462eec57b pipewire: Don't assert if the default capture device is a sink or vice versa
When no source devices are connected, the default source string can contain a sink name. If the default source and sink match, it will be caught as a sink device first and handled correctly, but if the default sink/source don't match, which happens when the sink is an HDMI output and the source is still an onboard audio chipset output name, an assert can result since the requested source device won't be flagged as a capture device. Rather than asserting, simply don't assign default devices that don't match the correct capabilities, as it's not an uncommon scenario and can be handled gracefully.

Additionally, if asserting is a no-op in release mode, sinks can be returned as sources and vice versa, which is incorrect.
2024-01-30 13:32:22 -05:00
SDL Wiki Bot
d15fb9e063 Sync SDL3 wiki -> header 2024-01-30 17:49:26 +00:00
Sam Lantinga
f257eb4481 Added the concept of colorspace to the SDL renderer
This allows color operations to happen in linear space between sRGB input and sRGB output. This is currently supported on the direct3d11, direct3d12 and opengl renderers.

This is a good resource on blending in linear space vs sRGB space:
https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

Also added testcolorspace to verify colorspace changes
2024-01-30 09:48:02 -08:00
Sam Lantinga
554f0625d3 Renderer colors now have floating point precision 2024-01-30 09:48:02 -08:00
Francisco Javier Trujillo Mata
da8fc70a83 Fixing viewport 2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
851c1a5e9c Fix scissor usage 2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
dc35ee9d54 Fix color 2024-01-29 20:41:25 -08:00
Sam Lantinga
61a3a163db Fixed typo (thanks @Akaricchi!) 2024-01-29 18:48:41 -08:00
SDL Wiki Bot
7fbd85ad5c Sync SDL3 wiki -> header 2024-01-29 02:25:21 +00:00
Sam Lantinga
61b5c38e6e Added the initial concept of colorspace to SDL 2024-01-28 18:24:39 -08:00
Xander
a3bfd5329c Fix broken mingw i686 buildscript 2024-01-28 17:29:33 -08:00
Xander
59d7dd3615 Fix broken mingw x86_64 buildscript 2024-01-28 17:29:33 -08:00
Frank Praznik
fbf10afb31 wayland: Consolidate window creation logic
The fractional scale manager and viewport are both created for a surface under the same circumstances, so consolidate the logic.
2024-01-28 18:15:39 -05:00
Frank Praznik
2e96307b27 wayland: Always create a viewport for the surface, if possible
Toggling viewports on and off can cause visual anomalies such as flicker when moving windows between displays on a mixed-DPI configuration or toggling the scaled fullscreen modes. If the viewport protocol is avilable, always create a viewport for the surface, unless it is an unscaled external surface, in which case the surface should be left untouched as an application may wish to attach its own viewport or use integer scaling.

This allows for the removal of several helper functions as well.
2024-01-28 17:52:35 -05:00
Frank Praznik
94240c197d docs: Hint envvars needs to use the hint string, not the macro name 2024-01-28 15:12:03 -05:00
SDL Wiki Bot
00a8ca403e Sync SDL3 wiki -> header 2024-01-28 18:32:23 +00:00
Frank Praznik
fbebbab90d wayland: Only set the explicit logical window size when using display scaling
Otherwise, the standard width/height is already in points/screen units.
2024-01-28 13:31:42 -05:00
Frank Praznik
879ba46ade wayland: Make sure the logical window size can't go to zero.
libdecor can send a size of zero as a valid value, the use of which will close the window. Make sure the minimum width/height are clamped to a minimum of 1.
2024-01-28 13:31:42 -05:00
Frank Praznik
b97cda226f wayland: Refactor internal variable names for better readability
Add descriptions in the internal window struct as well.
2024-01-28 13:31:42 -05:00
Frank Praznik
344ec60f8f tests: Fix window centering test with Wayland display scaling mode
The usable fullscreen bounds need to be queried after window creation, as Wayland can send different usable bounds depending on the focused window's scaling mode.
2024-01-28 13:31:42 -05:00
Frank Praznik
5b8ca05f1a wayland: Add a forced screen space scaling mode
Add a mode that forces Wayland windows to output with scaling that forces 1:1 pixel mapping.

This is intended to allow legacy applications to be displayed without desktop scaling being applied, and may have issues with some display configurations, as this forces the window to behave in a way that Wayland desktops were not designed to accommodate (rounding errors can result from certain combinations of window/scale values, the window may be unusably small, jump in size at times, or appear to be larger than the desktop space, and cursor precision may be reduced).

Windows flagged as DPI-aware are not affected by this.

The automated video test suite passes with the hint turned on.
2024-01-28 13:31:42 -05:00
Sam Lantinga
9f7eb6c4c1 Fixed testautomation log callback calling convention 2024-01-27 22:44:13 -08:00
Sam Lantinga
12bdb2b4d0 Added the environment variable SDL_LOGGING to control default log output 2024-01-27 19:30:22 -08:00
Ryan C. Gordon
dcd26a80e5 windows: Minor tweaks that makes Windows XP vidmodes work again.
(thanks @madebr!)

Fixes #8328.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
6ca596cfc1 windows: Manage MapVirtualKey vs Windows XP.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
1c5bc53738 windows: Manage WideCharToMultiByte vs Windows XP.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
2144c2ac71 windows: Added WIN_IsWindowsXP, for extreme runtime compatibility checks.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
56fa22c63b windows: OS version checks now cache results.
So these only have to talk to the Win32 API once per check, per process.
2024-01-27 20:15:08 -05:00
Sam Lantinga
4fba663368 Simplified the default log category logic
Now it's much clearer and easier to tweak the defaults
2024-01-27 15:45:38 -08:00
Sam Lantinga
a7a98d8bbb Document that the default log priority is error, not critical 2024-01-27 15:45:38 -08:00
SDL Wiki Bot
fd14a20a4b Sync SDL3 wiki -> header 2024-01-27 23:26:26 +00:00
Sam Lantinga
17768c51fc Revert "Sync SDL3 wiki -> header"
This reverts commit 5e96e410d6.
2024-01-27 15:25:29 -08:00
Ozkan Sezer
2a4db8c415 SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG
(cherry picked from commit fcd1c155cc)
2024-01-28 02:22:00 +03:00
Charlie Volow
5ae2ffc127 document that text input is on by default
See:
https://discourse.libsdl.org/t/text-input-is-active-by-default-hampering-frame-rate/24396
https://discourse.libsdl.org/t/restoring-text-input-to-the-default-state/42690
2024-01-27 15:18:05 -08:00
SDL Wiki Bot
5e96e410d6 Sync SDL3 wiki -> header 2024-01-27 23:12:19 +00:00
Sam Lantinga
f66fe7e221 Replaced SDL_GetJoystickCaps() with joystick properties
Fixes https://github.com/libsdl-org/SDL/issues/8927
2024-01-27 15:11:52 -08:00
Ozkan Sezer
019dc53764 SDL_RWFromFile, stdio: reject if the file is not a regular file.
Fixes https://github.com/libsdl-org/SDL/issues/8935
(cherry picked from commit 230ae797a7)
2024-01-28 01:44:50 +03:00
SDL Wiki Bot
aba3038353 Sync SDL3 wiki -> header 2024-01-27 21:01:19 +00:00
Sam Lantinga
3b55c7d1f4 Shortened SDL property names 2024-01-27 13:00:50 -08:00
SDL Wiki Bot
1885e6b2e0 Sync SDL3 wiki -> header 2024-01-27 20:47:21 +00:00
Sam Lantinga
8a4284b7df Clarified the use of SDL_RENDERER_SOFTWARE when creating a renderer
Fixes https://github.com/libsdl-org/sdlwiki/issues/458
2024-01-27 12:46:41 -08:00
Sam Lantinga
2d94b4f490 Make sure we set datasize on error in SDL_LoadFile_RW() 2024-01-27 12:19:59 -08:00
Sam Lantinga
dff76bf295 Enable text input on video initialization without popping up an on-screen keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8561

(cherry picked from commit 4ff3b28273)
2024-01-27 12:00:39 -08:00
Sam Lantinga
b9ea2dde44 Added VisionOS as a supported target to the Xcode project
Also added SDL_PLATFORM_VISIONOS to the platform definitions and generally switched from TARGET_OS_* macros to SDL_PLATFORM_* macros.
2024-01-27 11:07:21 -08:00
Ryan C. Gordon
7a7875c904
wasapi: A few tweaks to buffer management.
These were previously applied, in a different form, in SDL2.

Reference Issue #8924.
2024-01-27 14:05:09 -05:00
Frank Praznik
e71e16950a wayland: Use the preferred order of displays exposed by KDE
KDE provides the kde_output_order_v1 protocol, which tells clients the preferred order of all connected displays. Sort SDL displays according to the provided list at init time.
2024-01-27 02:10:49 -05:00
Sam Lantinga
e0c2cca629 Fixed fullscreen windows having rounded corners and 1px transparent borders on Windows 11.
When an app makes a fullscreen window on Windows, the window is really just resized to the monitor dimensions and positioned at 0, 0 and positioned on top of everything, including the taskbar. Added disabling rounded corners and some new DWM controlled border color (which seems to be defaulted to 1px transparent, but can be set to the theme color by users). Previous settings are restored when exiting fullscreen mode.
2024-01-26 23:05:31 -08:00
Sam Lantinga
a1a4948fda Fixed the size and position of minimized windows on Windows 2024-01-26 22:36:32 -08:00
Caiyi Hsu
5ba839e83b fix XRandR refresh rate calculation 2024-01-26 20:44:23 -08:00