Commit Graph

3641 Commits

Author SHA1 Message Date
Lukas Dürrenberger
ec42987cdf Update copyright year to 2025 2025-01-14 11:57:01 +00:00
Lukas Dürrenberger
4764c5104a Add a C++ language version check 2025-01-09 17:28:35 -07:00
Chris Thrasher
dfc9b83fe4 Suggest fix when incorrect library type is found by find_package
This is what it currently looks like when find_package(SFML) fails
due to locating the incorrect library type:

    CMake Error at <path>/<to>/lib/cmake/SFML/SFMLConfig.cmake:182 (message):
      Requested SFML configuration (Shared) was not found
    Call Stack (most recent call first):
      CMakeLists.txt:7 (find_package)

    CMake Error at CMakeLists.txt:7 (find_package):
      Found package configuration file:

        <path>/<to>/lib/cmake/SFML/SFMLConfig.cmake

      but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
      FOUND.

After this change the "Requested SFML configuration" line is followed by either

    Set SFML_STATIC_LIBRARIES to ON for static libraries

or

    Set SFML_STATIC_LIBRARIES to OFF for shared libraries

depending on the value of SFML_STATIC_LIBRARIES. This should help clear up a
common source of confusion when users build SFML from source. The library
follows CMake convention of building static libraries by default but our
config module assumes shared libraries by default so those who build SFML
from source are prone to run into this error.
2025-01-09 21:57:10 +00:00
Lukas Dürrenberger
b56604c940 Use approximation when comparing floats in tests 2025-01-08 11:33:40 +00:00
Jonny Paton
722ab54f84 Use correct type for accessing array 2025-01-07 20:00:01 +00:00
Jonny Paton
8316c9e8d5 Make keyboard key/scancode count variables inline 2025-01-07 11:36:17 +00:00
Mark Jansen
bc268fbaea Remove unused RESOURCES_DIR cmake option 2025-01-04 18:08:47 -07:00
Jonny Paton
d4ff27caad Make pi/tau variables inline 2025-01-04 16:07:41 -07:00
Mark Jansen
74a460206c Remove unused prototype
The rest of the code was deleted in b39be46db0
2025-01-04 16:07:16 -07:00
Chris Thrasher
7ea7622ae3 Fix grammar in docs 2025-01-04 16:07:00 -07:00
Chris Thrasher
796592edae Add non-const overload of sf::Event::getIf 2024-12-29 20:50:38 -06:00
Chris Thrasher
3c084bf661 Reduce pointer usage 2024-12-26 17:11:02 -06:00
Vittorio Romeo
dab1800f61
Hide <filesystem> dependency in [E]GLCheck .cpp 2024-12-25 07:41:56 -06:00
Bambo-Borris
2c7c3dd056 Make glCheckError take a std::string_view rather than constructing a std::filesystem::path on error checks 2024-12-24 13:11:23 -06:00
Lukas Dürrenberger
0d34974a5e Remove irrelevant change from SFML 3 changelog 2024-12-23 18:22:22 -06:00
Lukas Dürrenberger
ad2188e4a1 Mention libxi-dev as dependency 2024-12-23 18:22:22 -06:00
Chris Thrasher
cc78fd04f3 Update state of development
Now that SFML 3 is released, there is little reason to mention
the SFML 2 branch. Users can simply focus on version 3.
2024-12-22 11:17:05 -06:00
Lukas Dürrenberger
328f38553e Update SFML version to 3.1.0 2024-12-21 11:28:47 -06:00
Lukas Dürrenberger
7f1162dfea Mark code as official release 2024-12-20 23:55:10 +00:00
Bruno Van de Velde
6b9f3e36c2 Use a relative install path for pkgconfig files
This allows the pkgconfig install path to still be correct when changing the CMAKE_INSTALL_PREFIX after the first cmake run.
2024-12-20 21:27:13 +00:00
Lukas Dürrenberger
6f8655590e Add limitation info regarding setMouseCursorVisible 2024-12-19 19:44:28 -06:00
Lukas Dürrenberger
c4d4e8f62a Fix Channel Map size in documentation 2024-12-19 19:44:28 -06:00
Lukas Dürrenberger
03812a545d Add additional documentation regarding channel maps 2024-12-14 16:33:30 -07:00
Lukas Dürrenberger
f734dec6fb Add migration guide note regarding channel maps 2024-12-14 15:55:04 -07:00
Lukas Dürrenberger
2e8dc0f94f Patch out include and pkgconfig files for external libraries 2024-12-14 21:59:28 +01:00
Chris Thrasher
cb38877a8c Ensure current desktop mode is also a fullscreen mode
Port of PR #3331
2024-12-13 14:22:47 -07:00
Lukas Dürrenberger
71a8ac7e70 Fix naming of PDB files for sfml-main 2024-12-13 20:35:19 +01:00
Lukas Dürrenberger
e103eb1272 Use new HTML Help flag for the install target 2024-12-11 17:22:53 +01:00
James Cowgill
ccda2659d4 Store IpAddress::m_address in host byte order
This changes the ordering of `IpAddress` objects to be lexographical
which is more intuitive, and it fixes unit test failures on big-endian
systems.
2024-12-08 23:20:43 +01:00
James Cowgill
34ec2795a1 Fix Ogg ov_read call on big-endian systems
In the `ov_read` API, the fouth parameter says what endianness the
samples should be returned in - `0` for little-endian, and `1` for
big-endian. SFML wants samples in the host endian, so we need to set
this parameter to 1 on big-endian systems.

Fixes a unit test failure on big-endian systems.
2024-12-08 15:08:13 -07:00
Lukas Dürrenberger
f930cbc562 Remove additional, obsolete extlibs 2024-12-06 13:02:30 +01:00
James Cowgill
e1bb69b3b5 Fix segfault if XOpenIM fails
If `XOpenIM` fails we will store a `nullptr` into `sharedXIM`. When
the shared `XIM` is destroyed we call the deleter `XCloseIM` on the
`nullptr` which segfaults.

Fix this by adding a new `closeIM` helper function which checks for
null first.
2024-12-05 08:48:44 +01:00
James Cowgill
ad70442246 Do not cache atom name if XInternAtom fails
If `XInternAtom` is called with `onlyIfExists` set, then it can
legitimately return `None`. We should not cache this value because it
might change in the future.

This bug can sometimes be triggered because we use
`getAtom("UTF8_STRING", true)` and `getAtom("UTF8_STRING")`. If the
first call caches `None` because the atom didn't exist, then the
second call could return `None` instead of creating a new atom like it
should.
2024-12-05 08:48:44 +01:00
Chris Thrasher
f88b768ba6 Ensure a C compiler is found during configuration
In 248fd6d we added a lot of 3rd party C source files. That means
building SFML has the additional requirement of needing a C compiler.
I would expect that all of this would be properly handled by those
upstream projects properly telling CMake to find a C compiler but
apparently that is not the case.

By removing `LANGUAGES CXX` we are telling CMake to fall back to its
default behavior to find a C and C++ compiler.
2024-12-05 08:46:09 +01:00
Lukas Dürrenberger
0d05ed739c Add comment regarding input monitoring access on macOS 2024-12-05 08:38:16 +01:00
binary1248
248fd6dda8 Build dependency libraries instead of bundling pre-built binaries. 2024-12-04 23:52:24 +01:00
Chris Thrasher
ae87def93e Use char32_t for UTF-32 characters
This is probably an oversight from https://github.com/SFML/SFML/pull/2480
2024-11-30 18:28:34 -05:00
Chris Thrasher
51e38f51d4 Add tests for sf::Utf 2024-11-28 17:57:05 -05:00
Chris Thrasher
574d8295dd Fix bug in sf::Utf32::count 2024-11-27 08:39:39 -07:00
Chris Thrasher
1a2f566f12 Update migration guide 2024-11-25 15:02:11 -07:00
Chris Thrasher
97541c6244 Add more tests for sf::SoundStream 2024-11-25 11:50:43 -07:00
Chris Thrasher
eec0ece713 Add missing sf::SoundSource tests 2024-11-24 15:21:33 -07:00
kimci86
d78cec0236 Add keyboard example program 2024-11-24 09:58:05 -07:00
kimci86
ffaf37ef1f Fix typo in asset licenses table 2024-11-24 09:58:05 -07:00
Chris Thrasher
832c608a5b Provide minimum compiler versions to compile SFML 3
These are estimates. We don't necessarily have access to all prior
compiler releases and don't continuously test with these old
compilers so it's possible that we accidentally drop support in a
future v3 release  even without raising the minimum C++ requirement.
2024-11-20 16:32:11 -07:00
Lukas Dürrenberger
4d09b8fd61 Revert "Stop uploading code coverage from non-pull request CI runs"
This reverts commit 46a1b568a9 as it seems
to cause wrong reporting on pull request coverage info, likely due to
missing baselines from the master branch "push".
2024-11-19 18:42:33 -07:00
Chris Thrasher
6ece7bdc9b Mention the removal of sf::SoundStream::setProcessingInterval 2024-11-19 17:12:37 -07:00
Lukas Dürrenberger
cbc43da1d7
Merge branch '2.6.x' into master 2024-11-19 22:10:15 +00:00
Chris Thrasher
f648ae8f35
Merge branch '2.6.x' into feature/backmerge 2024-11-19 13:02:44 -07:00
Andrew Mickelson
55ecc6498a Fix DRM mode setting to use SFML window dimensions
- Actually use the dimensions of the SFML window as the DRM mode
      dimensions when setting a DRM mode.
    - If SFML window dimensions don't match a valid DRM mode, show
      the window contents on screen in the current mode instead of
      simply failing to show anything.
    - With these change the SFML examples are now working for me
2024-11-19 11:05:47 -07:00