293 Commits

Author SHA1 Message Date
Anonymous Maarten
8a5d1fc196 cmake: add swift test 2024-07-27 08:39:55 +02:00
Anonymous Maarten
37881b3150 cmake: use genex to link with Apple Frameworks 2024-07-27 08:37:21 +02:00
Anonymous Maarten
2aad26abb0 cmake: gate all preseeding behind SDL_PRESEED option 2024-07-25 16:42:11 +00:00
Ryan C. Gordon
546cd3ac83 cmake: Preseed CMake cache for Emscripten builds.
Makes a from-scratch build on this laptop go from 2 minutes 42 seconds to
28 seconds!
2024-07-25 16:42:11 +00:00
Anonymous Maarten
cc47969a79 cmake: actually check ARM64EC 2024-07-19 22:24:44 +02:00
Anonymous Maarten
2d1d3d9fb2 cmake: fix building UWP with non-MSVC generator 2024-07-19 10:21:34 +00:00
Anonymous Maarten
c59771d7fc cmake: detect ARM64EC 2024-07-19 10:21:34 +00:00
huanhuan-jiang
723c1cc5b3 Print message in summary when a X11 or wayland video driver is not found 2024-07-16 11:02:57 -07:00
Bruce Mitchener
e38f971f46 Fix typos in cmake 2024-07-15 15:24:00 -07:00
Anonymous Maarten
7277d69c0e cmake: verify no undefined versioned symbols exist 2024-07-12 18:45:38 +02:00
Sam Lantinga
2ba76dbe80 Simplified SDL_Surface
SDL_Surface has been simplified and internal details are no longer in the public structure.

The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect().

SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types.

SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value.

SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups.
2024-07-10 00:48:18 -07:00
Isaac Aronson
0f351cd6af Remove ARM32 assembly/pixman blitters 2024-07-08 10:53:46 -07:00
Anonymous Maarten
d52ea20916 cmake: check for valid isinf/isinff/isnan/isnanf macros 2024-06-24 22:00:53 +02:00
Frank Praznik
974bbea20b x11: Add keymap support
XkbKeycodeToKeySym is replaced with XkbLookupKeySym, which can take the modifier states. The associated cmake check has been renamed for consistency.

Only the XKB path is currently handled. The deprecated XKeycodeToKeysym path is TODO.
2024-06-23 15:40:55 -04:00
Emmanuele Bassi
61dafb3b2f Add XSETTINGS support to x11 driver
Import the XSettingsClient implementation to handle the settings
selection.

Currently, we only care about the Gdk/WindowScalingFactor value used by
the windowing system to notify us of display-wide changes in the scaling
factor.
2024-06-14 08:54:17 -07:00
Anonymous Maarten
dd0bb25f66 cmake: remove SDL_STATIC_PIC cmake option.
Use CMAKE_POSITION_INDEPENDENT_CODE instead
2024-06-10 18:04:18 +02:00
Anonymous Maarten
a919774fe4
Build with -Wfloat-conversion + fix all warnings 2024-06-03 21:33:29 +00:00
Anonymous Maarten
4b0f52b04e cmake: fall back to per-cpu test when all-in-one test fails
The 'all-in-one' test fails for Emscripten because try_compile does not copy back the actual binary:
the wasm file contains the machine parseable strings, not the html or js file(s).
2024-05-31 18:53:21 +02:00
Anonymous Maarten
bba76859f5 cmake: detect CPU architecture in 1 compilation 2024-05-26 23:52:48 +02:00
Anonymous Maarten
86b2f441c0 release: create arm64 Visual Studio binaries
[skip ci]
2024-05-23 00:13:10 +02:00
Anonymous Maarten
3c00af1ac6 cmake: preseed CMake cache on MSVC to speed up configuration 2024-05-22 21:03:12 +02:00
Anonymous Maarten
e10207e831 cmake: disallow '#include "SDL.h"' 2024-05-22 20:17:13 +02:00
Wim Taymans
a340748c06 camera: add PipeWire camera support
The PipeWire camera will enumerate the pipewire Video/Source nodes with
their formats.

When capturing is started, a stream to the node will be created and
frames will be captured.
2024-05-09 13:19:27 -07:00
Frank Praznik
fb4c15319e pipewire: Raise minimum build version to 0.3.44 2024-04-19 12:34:22 -04:00
Anonymous Maarten
9f83647aec cmake: switch iOS and watchOS 2024-04-08 19:25:38 +02:00
Ravbug
2d640d0b59
ci: Add iOS and tvOS CMake GitHub Actions checks (#9465)
- Also add watchos support to CMake (SDL does not support this platform yet)

Co-authored-by: Ravbug <ravbug@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-04-08 19:18:28 +02:00
Robert Edmonds
e3395a7585 cmake: Fix ALSA "Unable to find..." warning
If cmake is invoked with -DSDL_ALSA=OFF, the misleading warning
message "Unable to find the alsa development library" is printed.
It's misleading because no attempt was actually made to find the ALSA
development library. It's always printed by the CheckALSA macro if
SDL_ALSA is false.

This commit moves this warning message in the CheckALSA macro to being
printed if ALSA_FOUND is false. However, I don't see an explicit warning
message like this for the other macros that search for development
libraries, so I wonder if the message shouldn't just be removed
entirely. It seems redundant with the "Could NOT find ALSA ..." message
generated by cmake.

Before this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    CMake Warning at cmake/sdlchecks.cmake:125 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

After this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    CMake Warning at cmake/sdlchecks.cmake:123 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

All of the cmake invocations above were without the libasound2-dev
package installed.
2024-04-06 12:19:55 -04:00
Anonymous Maarten
2f26c58504 cmake: fix typo in cmake/sdlplatform.cmake 2024-04-02 23:44:15 +02:00
Anonymous Maarten
63cb541797 cmake: set SYSTEM property in SDL3Config.cmake for compatibility with older CMake versions 2024-04-01 20:09:51 +02:00
Anonymous Maarten
75a71bde4b cmake: build tests against installed SDL prefix 2024-03-23 21:41:20 +01:00
Anonymous Maarten
f59dbf6a12 cmake: add -Wimplicit-fallthrough warning 2024-03-18 20:34:50 +01:00
Anonymous Maarten
b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Anonymous Maarten
7341d5f361 cmake: allow hidapi to use libusb on Windows
When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
2024-03-10 09:07:33 -07:00
Anonymous Maarten
0e6fcf947a cmake: find libusb through LibUSB cmake module 2024-03-10 09:07:33 -07:00
Anonymous Maarten
3cc4705dd2 cmake: build OBJC sources with warning & error flags, ignoring deprecated declarations 2024-03-07 01:58:28 +01:00
Anonymous Maarten
1f536a1e77 cmake: fix SDL_RENDER_VULKAN reporting
Also fix an error when configuring with `-DSDL_VULKAN=ON
-DSDL_RENDER_VULKAN=FALSE`: the vulkan renderer is now correctly
disabled.
2024-02-26 20:37:10 +01:00
Dan Ginsburg
cab20117e6
Vulkan Renderer (#9114)
This pull request adds an implementation of a Vulkan Render backend to SDL.  I have so far tested this primarily on Windows, but also smoke tested on Linux and macOS (MoltenVK).  I have not tried it yet on Android, but it should be usable there as well (sans any bugs I missed).  This began as a port of the SDL Direct3D12 Renderer, which is the closest thing to Vulkan as existed in the SDL codebase. The shaders are more or less identical (with the only differences being in descriptor bindings vs root descriptors).  The shaders are built using the HLSL frontend of glslang.

Everything in the code is pure Vulkan 1.0 (no extensions), with the exception of HDR support which requires the Vulkan instance extension `VK_EXT_swapchain_colorspace`.  The code could have been simplified considerably if I used dynamic rendering, push descriptors, extended dynamic state, and other modern Vulkan-isms, but I felt it was more important to make the code as vanilla Vulkan as possible so that it would run on any Vulkan implementation.

The main differences with the Direct3D12 renderer are:
* Having to manage renderpasses for performing clears.  There is likely some optimization that would still remain for more efficient use of TBDR hardware where there might be some unnecessary load/stores, but it does attempt to do clears using renderpasses.
* Constant buffer data couldn't be directly updated in the command buffer since I didn't want to rely on push descriptors, so there is a persistently mapped buffer with increasing offset per swapchain image where CB data gets written.
* Many more resources are dependent on the swapchain resizing due to i.e. Vulkan requiring the VkFramebuffer to reference the VkImageView of the swapchain, so there is a bit more code around handling that than was necessary in D3D12.
* For NV12/NV21 textures, rather than there being plane data in the texture itself, the UV data is placed in a separate `VkImage`/`VkImageView`.

I've verified that `testcolorspace` works with both sRGB and HDR linear.  I've tested `testoverlay` works with the various YUV/NV12/NV21 formats.  I've tested `testsprite`.  I've checked that window resizing and swapchain out-of-date handling when minimizing are working.  I've run through `testautomation` with the render tests.  I also have run several of the tests with Vulkan validation and synchronization validation.  Surely I will have missed some things, but I think it's in a good state to be merged and build out from here.
2024-02-22 14:58:11 -08:00
Frank Praznik
8b6eae2d4f cmake: Split and store the libdecor version as individual parts
It is becoming necessary to enable additional features as libdecor continues to evolve, and checking against a single base version will no longer be adequate. Libdecor doesn't provide versioning defines in its headers, so split the version string into parts to allow for discrete version detection and feature enablement at build time.
2024-02-20 11:28:02 -05:00
Simon McVittie
a06ee5b98d Don't try to use SDL platform macros in configure-time checks
At the point that we run this, nothing SDL-specific is set up yet.
__APPLE__ is a compiler predefined macro that forms part of the API on
Apple platforms, so it's fine to rely on it.

This partially reverts commit 31d133db.

Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-24 14:12:50 +03:00
Anonymous Maarten
31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones (#8875) 2024-01-24 01:40:51 +00:00
Sam Lantinga
5db543a66a Just use the khronos headers for the checks that need them 2024-01-19 23:55:05 -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
ac367be171 Updated CMakeLists.txt now that timers and threads can't be disabled 2024-01-17 09:24:04 -08:00
Anonymous Maarten
dd5b8db3a6 SDL_hidapi requires libusb >= 1.0.16
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:31:59 +01:00
Anonymous Maarten
a45b371de0 cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
Sylvain
d8600f717e Pointer as bool (libsdl-org#7214) 2023-11-09 14:18:36 -08:00
Anonymous Maarten
391a3d23d0 cmake: the compile-time pdb does not have a suffix, if set 2023-11-09 03:28:20 +01:00
Anonymous Maarten
a6541166bc cmake: also install pdb files of static libraries 2023-11-09 02:17:07 +01:00
Wohlstand
0a1b6b270f sdlchecks.cmake: Clarified the reason why shared X11 mode doesn't work
#6778
2023-11-08 02:57:28 -08:00
Frank Praznik
1a57f6bb29 wayland: Remove QtWayland extensions
These were added a very long time ago and seem to serve no purpose now, as the functionality they provided is now in core Wayland protocols, current information on their usage and status is nonexistent, no modern compositor seems to support them, and the code paths are untested and subject to bit-rot at this point. It also causes duplicate symbol issues when statically linking an application to both Qt and SDL.
2023-11-07 11:00:32 -05:00