Commit Graph

3393 Commits

Author SHA1 Message Date
Chris Thrasher
f5a9def56e Silence new clang-tidy-18 checks 2024-04-23 09:49:36 +02:00
Chris Thrasher
4315c3d290 Revert change to Drawable::draw function signature
This change was made in 359fe90 due to recommendations from tooling.
On its face this change makes sense since it removes a copy that
isn't always necessary. In practice it caused ergonomic issues due
to now being forced to make a copy of the render states when needed.

The performance gains of eliding this copy are unsubstantiated. We
have not done any profiling to measure its impact. For lack of such
measurements I'd rather err on the side of improved user experience.
If future benchmarks prove this copy is rather expensive then we
can reconsider removing it with that evidence in mind.
2024-04-18 13:18:49 +02:00
Chris Thrasher
d6e1961112 Ensure struct data members are given an initial value
While I don't suspect there are any uninitialize variable bugs
present, it's still good to err on the side of safety and provide
an initial value nonetheless.
2024-04-16 19:14:38 -06:00
Chris Thrasher
95a23c2d05 Add type trait tests for sf::SoundFileWriter
Other Audio module types get this same treatment so we ought to
also have a .test.cpp for this header.
2024-04-16 17:05:42 -06:00
Chris Thrasher
cb651c063c Add tests for sf::SoundFileReader 2024-04-16 17:05:42 -06:00
Chris Thrasher
7bb97a85b1 Compile unit tests for iOS and Android
While you can't easily run these unit tests, it's easy enough to
still compile them so we don't need to go out of way to prohibit
this. CMake has some support for running tests on the target OS
so perhaps in the future we find a compelling way to run the test
suite on a mobile OS.
2024-04-13 11:49:45 -06:00
Chris Thrasher
30fcb3523c Use loadIntoMemory 2024-04-12 11:49:11 -06:00
Lukas Dürrenberger
8ccf534993 Revert disabling brew update 2024-04-12 10:25:35 -06:00
binary1248
7e1765717a Fixed coverage data not being collected for MinGW builds because OpenCPPCoverage relies on pdb data being available. 2024-04-11 17:32:24 -06:00
Chris Thrasher
b17150d3c0 Disable code coverage upload in forks 2024-04-11 16:08:32 -06:00
Chris Thrasher
efcfaf06fb Improve test coverage 2024-04-11 12:59:06 -06:00
Chris Thrasher
d31dad8300 Define sf::Shader move operations for OpenGL ES backend 2024-04-11 12:59:06 -06:00
binary1248
90fb07066b Replaced Codecov with Coveralls. 2024-04-11 10:46:27 -06:00
Chris Thrasher
6eaf300918 constexpr-fy sf::priv::Vector4 2024-04-11 09:05:28 -06:00
Chris Thrasher
f1bdacb57f Add tests for sf::Glsl types 2024-04-10 20:39:20 -06:00
Lukas Dürrenberger
e3b7d87373 Update Catch2 to v3.5.4 2024-04-10 19:17:11 -06:00
Lukas Dürrenberger
a742b2158f Allow failure of coverage uploads due to rate limits 2024-04-10 23:40:32 +02:00
Lukas Dürrenberger
2b6194a632 Switch back to Codecov GitHub Action with our own token 2024-04-10 23:40:32 +02:00
Chris Thrasher
b0e25088a2 Initialize all sf::Glyph members
This silences an MSVC warning about lsbDelta and rsbDelta not being
initialized. Whether or not this fixes any bugs, it provides a
better user experience if nobody sees those warnings.
2024-04-07 12:34:37 -06:00
Chris Thrasher
3ea228434b Build Cocoa example even when not using Xcode 2024-04-06 00:18:34 +02:00
Chris Thrasher
d00ab43ea6 Return nullptr when sf::Context::getFunction is called on Windows without an active context
This converts termination in Debug and a SEGFAULT in Release builds
into defined behavior.
2024-04-02 21:40:09 -05:00
Chris Thrasher
49cf5058e5 Add more sf::Context tests 2024-04-02 20:10:24 -05:00
Chris Thrasher
544a9a8a79 Remove redundant line 2024-03-29 09:58:44 -05:00
binary1248
88e9d4c0b3 Fixed CMAKE_CXX_FLAGS being treated as a list when SFML_ENABLE_SANITIZERS is enabled. 2024-03-28 18:30:33 -06:00
Chris Thrasher
7ec3760fe8 Mention CMake template in README 2024-03-12 09:44:55 -06:00
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