Commit Graph

861 Commits

Author SHA1 Message Date
Chris Thrasher
b583eaf160 Replace const char* with std::string_view 2024-05-24 12:01:27 +02:00
Chris Thrasher
cc87ef7a3c Use std::string_view to construct sf::Shaders without allocations 2024-05-23 19:26:13 -06:00
Chris Thrasher
fdcd899d2b Remove default empty state of sf::RenderTexture 2024-05-22 23:37:42 -06:00
Chris Thrasher
e6d4ee7ad1 Fix sound file docs 2024-05-22 18:32:55 -06:00
vittorioromeo
8b36da3625 Use '{}' for default parameter initialization 2024-05-22 11:54:49 -06:00
Chris Thrasher
e9fadbbcb3 Remove default empty state of sf::InputSoundFile and sf::OutputSoundFile 2024-05-22 09:46:37 -06:00
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
binary1248
002b8953fa Added support for user defined sound effect implementations. 2024-05-16 21:52:16 -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
207b54e445
Merge branch '2.6.x' into feature/backmerge 2024-05-13 21:07:03 -06:00
Chris Thrasher
3acc332de0 Use American spellings 2024-05-13 00:44:27 -05:00
Chris Thrasher
8c9fa1087e Remove misplaced comma 2024-05-13 00:44:27 -05:00
Chris Thrasher
742dffa0de Remove reference to old API
0785093 changed the API to use a vector instead of two scalar values
2024-05-13 00:44:27 -05:00
Chris Thrasher
b9b8366a45 Fix run-on sentences 2024-05-13 00:44:27 -05:00
Lukas Dürrenberger
1a4003fcc0 Add clarification about the RenderTexture state after creation 2024-05-12 19:35:14 -05:00
vittorioromeo
ae269e1149 Make 'Event.inl' self-contained 2024-05-06 04:44:28 +00:00
binary1248
4daeac6459 Fall back to stdio when performing file input on Android without an activity. 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
Andrei
9534c000f6 Added missing \param field from sf::Keyboard::getDescription(Scancode code) in docs 2024-05-03 07:25:50 +00:00
Chris Thrasher
b7c526efc2 Fix API documentation bugs 2024-05-03 01:36:55 +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
73126c93a3 Use std::optional to express functions that may not return a value 2024-04-29 19:09:39 +00:00
kimci86
71395e746e Define SoundStream::NoLoop as constexpr instead of enum 2024-04-28 16:36:57 +00:00
kimci86
bdd348c142 Make Sound::Status a scoped enumeration 2024-04-28 16:36:57 +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
a05daa62b7 Use more C++17 inline variables 2024-04-23 09:35:46 -06: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
6eaf300918 constexpr-fy sf::priv::Vector4 2024-04-11 09:05:28 -06: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
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
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
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