Commit Graph

3468 Commits

Author SHA1 Message Date
Chris Thrasher
d7fb1bf0f6 Upgrade Catch2 2024-03-04 14:51:00 -07:00
Chris Thrasher
4967a4c28f Add tests for sf::Texture::loadFromImage 2024-02-27 09:44:05 -07:00
Chris Thrasher
aa3d0b7ba5 Use std::{min|max}
A new clang-tidy-18 check led me to this. These files already use
<algorithm> so we might as well use these functions where appropriate.
2024-02-26 16:06:51 -07:00
Chris Thrasher
2a48b34386 Upgrade CI actions to fix deprecation warnings 2024-02-20 14:28:18 -07:00
Chris Thrasher
3d4815ef65 Enable bugprone-suspicious-include 2024-02-20 13:52:24 -07:00
vittorioromeo
23c26f9b70 Turn 'sf::Vertex' into an aggregate 'struct' 2024-02-19 16:44:06 +00:00
Shane Whitmire
691292b23a Fix assert not firing when only x index is out of bounds
Original protection to UB here was to simply check if the produced index
is out of bounds, but that isn't entirely correct imo. What is correct
is to fire if either the x or the y go out of bounds.

This shouldn't cause the UB problem to reappear, and be a little more
"correct" from the user's perspective. I believe that the most correct
way would be to use a boolean return in the setPixel(), and a
std::optional and return None on a failed fetch for the getPixel()
function. I don't know if ya'll are willing to do this, but this seems
sufficient too. Atleast there is a clear place where the programs fails
to work.
2024-02-19 05:08:29 +00:00
Lukas Dürrenberger
e50f7b9759 Add a macOS arm64 build to CI pipeline 2024-02-17 01:38:33 +00:00
Chris Thrasher
32a5440bb8 Fix CI deprecation warnings 2024-02-16 02:08:34 +00:00
Chris Thrasher
1e6eaa5d91 Disable display tests in OpenGL ES CI jobs 2024-02-15 23:40:46 +00:00
Elijah Hopp
f2b7364611 Reflect account name change in asset_licenses.md. 2024-02-13 23:31:47 +00:00
vittorioromeo
7402e969c9 Replace unused '<cstring>' with '<cstdint>' 2024-02-09 16:45:24 +01:00
vittorioromeo
f3d5762a17 Add static PCH CI jobs for Windows/Linux 2024-02-09 12:52:37 +01:00
vittorioromeo
b552148e26 Header cleanup guided by IWYU 2024-02-09 12:52:23 +01:00
vittorioromeo
72d30e7beb Update Catch2 to v3.5.2 2024-02-05 19:58:44 +01:00
vittorioromeo
ee13dfbd3b 'SoundFileFactory' implementation overhaul 2024-02-05 17:11:23 +01:00
vittorioromeo
4ff70c87d3 Self-contained '.inl' headers + minor refactoring 2024-02-05 13:45:01 +01:00
Vittorio Romeo
76295f2624 Improve SocketSelector in-documentation example 2024-02-04 20:41:52 +01:00
vittorioromeo
368ff9dace Header include clean-up and minor refactoring 2024-02-03 23:58:44 +01:00
Kipernal
eb07e1e6c5 Added support for stencil testing.
Co-authored-by: binary1248 <binary1248@hotmail.com>
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
2024-01-29 08:13:14 -07:00
Chris Thrasher
9022d9564d Define character traits for std::uint8_t
Character traits are only standardized for character types of which
std::uint8_t is not. All major C++ implementations happen to define
this specialization but because it is not standard C++ they are
allowed to remove it as LLVM has done by deprecating this specialization
in LLVM 18. It is slated for removal in LLVM 19. To avoid compilation
errors and to get ahead of any deprecation warnings when LLVM 18 ships
we need to define our own std::uint8_t character traits.

SFML 4 will have access to C++20's std::u8string which should let us
remove this code.
2024-01-28 10:24:02 -07:00
kimci86
a7f054712a Update PrimitiveType values occurrences in documentation
because PrimitiveType is a scoped enumeration.
2024-01-27 15:31:30 -07:00
kimci86
0d3c7f1c32 Make VertexBuffer::Usage a scoped enumeration 2024-01-27 15:31:30 -07:00
kimci86
a019b5167b Make Shader::Type a scoped enumeration 2024-01-27 15:31:30 -07:00
kimci86
b496877c90 Make BlendMode::Factor and BlendMode::Equation scoped enumerations 2024-01-27 15:31:30 -07:00
Miron Alexandru
3ca42c9a45 Update copyright year 2024-01-26 12:00:22 -07:00
Corentin Schreiber
ebf485737f Add texture coordinate type to sf::RenderStates 2024-01-25 23:45:00 -07:00
Chris Thrasher
b234ede61e Use struct for data type with exclusively public contents 2024-01-24 21:59:00 -07:00
Chris Thrasher
5dfa3f7858 Modernize management of X11 resources
This approach uses RAII to manage resources rather than relying on
correctly calling cleanup functions at all places where scope exits.

This also has the benefit of removing a mutex and no longer having
to lock that mutex so many times.
2024-01-24 20:12:10 -07:00
Bruno Van de Velde
5a74cf33e9 Replaced deprecated exec_program function in CMake scripts with execute_process, as this was causing iOS build to fail with CMake 3.28 2024-01-23 13:09:04 -07:00
Bruno Van de Velde
67feaa0bd3 Update location of sdkmanager in Android CI jobs 2024-01-23 11:05:54 -07:00
Chris Thrasher
7d095c8b6e Clarify instructions for how to use SFML_ROOT
SFML_ROOT can simply point to the directory in which SFML was installed.
This is verified by our install interface tests which do exactly that,
even when SFML is built as a framework. CMake can figure out where
to find the config module if you give it this much information.
2024-01-20 18:48:53 -07:00
Chris Thrasher
ef5ee38576 Refactor ternary into early-returning conditionals
A complex ternary expression here doesn't buy us anything. This
refactor more clearly expresses what is going on in this function.
2024-01-17 19:14:27 -07:00
Chris Thrasher
30a986e632
Use CMake-standard <PackageName>_ROOT variable to locating config module
https://cmake.org/cmake/help/v3.22/command/find_package.html
https://cmake.org/cmake/help/v3.22/variable/PackageName_ROOT.html#variable:%3CPackageName%3E_ROOT

SFML_DIR predates the existence of <PackageName>_ROOT which is now
the preferred way to specify where to find a given package's config
module. User reports have shown that SFML_DIR may be broken at least
in certain circumstances so lets stop mentioning it.
2024-01-16 13:10:58 -07:00
Chris Thrasher
a2c003b2b7 Add sf::State for specifying fullscreen or floating windows 2024-01-15 23:08:33 -07:00
Chris Thrasher
ddb906a0ab Fix file extension typo in .gitattributes 2024-01-15 16:47:09 -07:00
Chris Thrasher
3c4c1d3266 Add missing std:: namespace 2024-01-14 21:56:13 -07:00
Chris Thrasher
a7aa231274 Enable clang-tidy Objective-C checks 2024-01-14 19:20:02 -07:00
Chris Thrasher
43dc13c3de Fix typo in sf::Vector3<T> type trait tests 2024-01-14 19:19:37 -07:00
Chris Thrasher
c919ad533d Remove unnecessary return statements
A new check in clang-tidy-18 catches this. I built it from source
and ran it locally to find this.
2024-01-14 17:00:35 -07:00
Bruno Van de Velde
9cd703aa10 Update location of sdkmanager for Android builds 2024-01-14 15:34:14 -07:00
Chris Thrasher
0d49fab1a6 Remove unnecessary private operators
Equality operations are not automatically generated by the compiler
so we can omit this.
2024-01-09 22:17:55 -07:00
binary1248
ed4dd9fd01 Fixed F13-F24 and consumer key names not being returned on Windows. 2024-01-08 16:18:43 -07:00
Chris Thrasher
4346b9a8bc Remove unnecessary default destructor
sf::RenderWindow still inherits a virtual destructor from a base
class so there's no need to explicitly declare a virtual destructor.
I added a test to ensure this property was not broken.
2024-01-08 12:26:28 -07:00
Chris Thrasher
a9d9ef6d83 Deduplicate Window{Base}::create implementations
Co-authored-by: binary1248 <binary1248@hotmail.com>
2024-01-01 12:57:57 -07:00
Lukas Dürrenberger
f46c888e9b Fix shader loading check for empty streams 2023-12-31 16:53:19 -07:00
Chris Thrasher
be5c52a1fc Use std:: namespace 2023-12-31 16:17:29 -07:00
Chris Thrasher
115344ecc3 Improve sf::Packet test coverage 2023-12-31 14:17:55 -07:00
Chris Thrasher
f9a343290d Add tests for sf::Ftp 2023-12-31 10:05:54 -07:00
Chris Thrasher
2fe58c66a7 Delete unnecessary destructor 2023-12-26 22:14:57 -06:00