Commit Graph

288 Commits

Author SHA1 Message Date
Chris Thrasher
53ade4baf1 Remove default empty state of sf::Cursor 2024-05-21 01:09:09 -06:00
Chris Thrasher
7234fc149b Remove default empty state of sf::Shader 2024-05-19 20:58:58 -06:00
Chris Thrasher
504b850f03 Remove default empty state of sf::Font 2024-05-19 14:01:54 -06:00
Chris Thrasher
0ac278b2d6 Remove default empty state of sf::Image 2024-05-19 13:25:34 -06:00
Chris Thrasher
add6422e6b Remove default empty state of sf::SoundBuffer 2024-05-19 13:09:38 -06:00
Lukas Dürrenberger
6766268f36 Use the SoundSource derived type specific status 2024-05-16 13:41:05 -06:00
Chris Thrasher
9722fb3724 Add tests for Audio module types 2024-05-16 12:06:21 -06:00
vittorioromeo
884206ce0c Store angles internally as radians 2024-05-14 13:07:40 -06:00
Chris Thrasher
593c4fe173 Replace C arrays with std::array 2024-05-14 12:47:19 -05:00
Chris Thrasher
0777ce5ead Update to Catch2 v3.6.0 2024-05-07 17:02:47 +00:00
binary1248
2386653bd3 Add GitHub actions support for running x86, x86_64 and arm64-v8a Android tests using an Android emulator. 2024-05-04 17:22:12 +00:00
trustytrojan
ca0a231b35 Add operator bool() to sf::Event for checking if the event type is not Empty 2024-05-03 22:50:59 +00:00
Chris Thrasher
59447dd8e5 Rewrite sf::Event API to improve type safety
This new API is built on top of std::variant. This allows us to
store many different event types in a space-efficient way and access
the active event type in a type-safe manner that eliminates the
categories of UB that are possible with unions.

Co-authored-by: kimci86 <kimci86@hotmail.fr>
2024-05-01 18:00:58 +00:00
Chris Thrasher
249caa2fb2 Require that variables are initialized 2024-04-27 19:20:52 +00:00
binary1248
34fde883b9 Replaced OpenAL with miniaudio.
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
Co-authored-by: kimci86 <kimci86@hotmail.fr>
Co-authored-by: vittorioromeo <mail@vittorioromeo.com>
2024-04-25 10:24:11 +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
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
efcfaf06fb Improve test coverage 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
Chris Thrasher
49cf5058e5 Add more sf::Context tests 2024-04-02 20:10:24 -05: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
vittorioromeo
23c26f9b70 Turn 'sf::Vertex' into an aggregate 'struct' 2024-02-19 16:44:06 +00: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
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
0d3c7f1c32 Make VertexBuffer::Usage 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
Corentin Schreiber
ebf485737f Add texture coordinate type to sf::RenderStates 2024-01-25 23:45:00 -07:00
Chris Thrasher
a2c003b2b7 Add sf::State for specifying fullscreen or floating windows 2024-01-15 23:08:33 -07:00
Chris Thrasher
43dc13c3de Fix typo in sf::Vector3<T> type trait tests 2024-01-14 19:19:37 -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
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
kimci86
39da2b829c Make Keyboard::Key a scoped enumeration 2023-12-22 10:47:30 -06:00
kimci86
ebf190b660 Make Joystick::Axis a scoped enumeration 2023-12-15 15:18:25 -07:00
kimci86
df2f56fe83 Make Cursor::Type a scoped enumeration 2023-12-15 15:18:25 -07:00
Chris Thrasher
ea42079da9 Update Catch2
https://github.com/catchorg/Catch2/releases/tag/v3.5.0
2023-12-10 19:40:28 -07:00
Chris Thrasher
7f5d87dcd5 Add move semantics to sf::Context 2023-12-09 10:27:57 -07:00