Commit Graph

3658 Commits

Author SHA1 Message Date
FRex
9132655a3d Use std::fstream to support Unicode filenames in sf::Image #647 2025-01-30 10:16:03 -07:00
FRex
f7e904172f Add tests for Unicode filenames with sf::Image #647 2025-01-30 10:16:03 -07:00
FRex
7c60447a39 Always print filepaths as UTF-8 to a char stream #3406 2025-01-29 12:39:00 -07:00
Lukas Dürrenberger
4378a022e5 Silence C4275 warning for sf::Exception
Warning is not relevant when deriving from standard library types as the
documentation states:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4275
2025-01-28 17:40:16 -07:00
kimci86
4c0b5b3df9 Implement support for references to handlers and function pointers 2025-01-27 12:21:41 -07:00
kimci86
efb207c849 Check that all WindowBase::handleEvents arguments handle some events 2025-01-27 12:21:41 -07:00
kimci86
23afdc2f9e More explicit naming for visit and handleEvents types and fix lint comments 2025-01-27 12:21:41 -07:00
kimci86
37c87ee11e Test Event::visit with move-only visitor 2025-01-25 13:10:56 -07:00
kimci86
c6df55eed8 Revert "Transform Event::visit signature to accept multiple handlers"
This reverts commit d64a222c86.
2025-01-25 13:10:56 -07:00
Pixel-Tony
d64a222c86 Transform Event::visit signature to accept multiple handlers 2025-01-24 09:39:52 -07:00
vittorioromeo
18393ea5cb Add non-const overload of Event::visit 2025-01-22 18:03:00 +01:00
Chris Thrasher
0e37e6dfee Use std::queue to model queues 2025-01-20 18:11:22 -07:00
Chris Thrasher
08bfae34e7 Fix build errors when compiling in C++20 mode
C++20 removes the ability to stream char32_t characters.
This is the error I get when setting CMAKE_CXX_STANDARD
to 20.

    /Users/thrasher/Projects/sfml/test/System/String.test.cpp:32:52: error: overload resolution selected deleted operator '<<'
       32 |     stream << "[\\x" << std::uppercase << std::hex << character << ']';
          |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/ostream:1009:31: note: candidate function [with _Traits = std::char_traits<char>] has been explicitly deleted
     1009 | basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
          |                               ^
2025-01-20 11:27:43 +00:00
Chris Thrasher
97dfa7692d Use macOS 14 in more CI jobs 2025-01-18 19:12:52 -08:00
Chris Thrasher
662830e90a Fix conversion warning
Continuing what was started in #3381
2025-01-18 13:43:12 -08:00
kimci86
62a2a39650 Update copyright year to 2025 (continued) 2025-01-14 19:27:26 +00:00
Lukas Dürrenberger
68ce027b2e Update Catch2 to v3.8.0 2025-01-14 14:34:19 +00:00
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