Chris Thrasher
76223b07a1
Implement sf::IpAddress
with std::optional
2022-06-23 20:22:13 +02:00
Chris Thrasher
e4e9b290b1
Add tests for sf::IpAddress
2022-06-23 18:47:23 +02:00
Chris Thrasher
ce9577bbff
Upgrade to Doctest v2.4.9
...
Fixes some linker errors and a compiler error described here:
https://github.com/doctest/doctest/issues/636
2022-06-23 18:47:23 +02:00
Vittorio Romeo
e4c5af63b7
Replace 'TcpSocket::send' local buffer with data member
2022-06-23 18:37:01 +02:00
kimci86
95201a3950
Update Image code example with Vector2u parameters
2022-06-23 18:03:54 +02:00
kimci86
c4790bcb14
Clarify Image::copy implementation
2022-06-23 18:03:54 +02:00
Vittorio Romeo
6cd07a043f
'sf::Image::copy' returns a 'bool' to signal success/failure
2022-06-21 16:40:22 +02:00
Bambo-Borris
91c4a451ef
Fix out of bounds read for sf::Image::copy()
with bad sourceRect
2022-06-21 15:14:27 +02:00
Bambo-Borris
8b3723a52b
Add tests for sf::Image
2022-06-21 15:14:27 +02:00
Chris Thrasher
757cb36d30
Use <random>
header
2022-06-16 23:56:39 +02:00
Chris Thrasher
65fef85b30
Simplify how examples are built
...
CMake doesn't require absolute paths so we can safely remove
SRCROOT and let implicit relative pathing achieve the same result
with less work on our part.
2022-06-16 23:56:39 +02:00
Chris Thrasher
539483d329
Use std::array
2022-06-16 23:56:39 +02:00
Chris Thrasher
27a7774786
Use = default for trivial virtual destructors
2022-06-13 12:01:37 +02:00
Chris Thrasher
e61a8c5c1b
Remove empty non-virtual destructors
...
While this practice didn't matter too much in C++03, it becomes a
pessimization with the introduction of C++11 move semantics. When
a destructor is defined, no matter how trivial it is, it implicitly
disables move semantics. Because the compiler can sometimes move
objects without the programmer asking, the inability to make these
moves can unnecessarily slow down SFML programs. Removing these
trivial destructors is an easy way to enable move semantics for
more SFML types and quietly speed up everyone's code.
2022-06-13 12:01:37 +02:00
Bård Sigurd Møller
709530d062
SFML/Graphics/Text.cpp: Compare utf32-characters to utf32 character literals consistently
2022-06-10 14:15:13 +02:00
Chris Thrasher
9e23fb0899
Clarify sf::ConvexShape
docs
...
Co-authored-by: Jan Haller <bromeon@gmail.com>
2022-06-09 10:05:29 +02:00
Chris Thrasher
6a59ab0051
Add tests for sf::ConvexShape
2022-06-09 10:05:29 +02:00
Vittorio Romeo
fd1435d1c0
Prevent more conflicts between the 'None' Xlib macro and 'WindowStyle::None'
2022-06-08 13:44:16 +02:00
Chris Thrasher
dbac180db5
Limit the scope of event object
2022-06-08 13:16:40 +02:00
Chris Thrasher
745bcb82ef
Remove implicitly defined special member functions
2022-06-07 23:19:30 +02:00
Chris Thrasher
3203c3927f
Add tests for sf::RenderStates
2022-06-07 08:25:52 +02:00
Lukas Dürrenberger
864f0feedd
Merge pull request #2112 from SFML/2.6.x
...
Merge 2.6.x to master
2022-06-03 17:59:50 +02:00
Vittorio Romeo
29f364eafa
Include '<utility>' for 'std::exchange'
2022-06-03 17:57:42 +02:00
Lukas Dürrenberger
417f003224
Merge branch '2.6.x'
2022-06-03 17:08:06 +02:00
DanielRabl
97a1bf2f5d
Use wide-string character consistently
...
Comparing '\r' against 8bit character instead of 16bit wide character.
2022-06-02 16:09:33 +02:00
Chris Thrasher
e1f36e66a5
Reduce casts to (void)
2022-06-01 08:19:40 +02:00
Chris Thrasher
b71ff372c7
Use ()
for functions with no parameters
2022-06-01 08:19:40 +02:00
Chris Thrasher
e0c4d14541
Use [[maybe_unused]]
for parameters that are sometimes not used
...
Depending on preprocessor settings, certain parameters may or may
not be used. Instead of casing to (void) when not used, it's easier
to use C++17's [[maybe_unused]] attribute to express this.
2022-06-01 08:19:40 +02:00
Chris Thrasher
58e93ddd19
Add tests for sf::View
2022-06-01 08:09:29 +02:00
Chris Thrasher
60131b19ef
Add tests for sf::Glyph
2022-06-01 08:09:29 +02:00
Andrew King
3e424550d8
Added comment for GCC 12.1 false-positive (issue #2100 )
2022-05-26 00:03:07 +02:00
Andrew King
6ff85eebe5
bugfix for #2100 : null-dereference in GCC 12.1.0
2022-05-26 00:03:07 +02:00
Chris Thrasher
7dd001e5c0
Simplify approximate comparisons of SFML types
...
Co-authored-by: kimci86 <kimci86@hotmail.fr>
2022-05-25 13:36:12 +02:00
Chris Thrasher
5fde1ca613
Hide symbols in cross platform manner
2022-05-21 21:35:35 +02:00
Chris Thrasher
62d1abe491
Stop setting CMake policy 0068
...
https://cmake.org/cmake/help/latest/policy/CMP0068.html
No longer necessary since CMake 3.9
2022-05-21 21:35:35 +02:00
Chris Thrasher
89a0489a44
Stop setting CMake policy 0042
...
https://cmake.org/cmake/help/latest/policy/CMP0042.html
No longer necessary since CMake 3.0
2022-05-21 21:35:35 +02:00
Chris Thrasher
1e6dc82304
Add tests for sf::CircleShape
2022-05-17 20:30:17 +02:00
Chris Thrasher
049e3ce8f2
Increase precision of operator<<(Vector2<T>)
2022-05-17 20:30:17 +02:00
Chris Thrasher
88515b2fca
Add polar coordinates constructor for sf::Vector2<T>
2022-05-17 20:30:02 +02:00
Chris Thrasher
0785093ebc
Use sf::Vector2<T>
for numeric parameter pairs
2022-05-17 08:33:11 +02:00
Chris Thrasher
488b139ea7
Fix conversion warning
2022-05-16 19:05:35 +02:00
Bambo-Borris
b2ab6d6ab3
Add extension methods to Vector3<T>
...
Includes relevant tests and updates TestUtilities to feature ApproxVec2 & ApproxVec3
2022-05-16 08:59:42 +02:00
Lukas Dürrenberger
65e357e901
Merge pull request #2099 from SFML/2.6.x
...
Backmerge 2.6.x to master
2022-05-10 23:39:34 +02:00
Chris Thrasher
3301c47755
Remove CompileOptionsOverride
...
These overrides existed to prevent MSVC errors related to duplicate
compiler warnings. Because we required a version of CMake older
3.15, CMake would add /W3 as a default compiler flag when using
MSVC. We then add /W4 in addition to that. Modern CMake versions
seem to deduplicate these warnings but older versions did not.
The easist fix is to raise the minimum CMake version to 3.15 which
changes the default behavior to no longer add /W3 without being
explicitly specified. See the below link for more information about
this behavior change.
https://cmake.org/cmake/help/latest/policy/CMP0092.html
2022-05-09 15:38:39 +02:00
Chris Thrasher
829cf3b502
Apply compiler warnings to test utilities
2022-05-09 15:38:24 +02:00
kimci86
9842c8fdf8
Fix incorrect cast when loading 16-bit samples from WAV file
2022-05-06 21:07:42 +02:00
Coder-Rahul-Y
9d401398e7
replacing NULL with nullptr in src/window file
2022-05-05 00:03:00 +02:00
CosminPerRam
6b4c287c20
Fixed unnecessary instantiation
...
Co-authored-by: kimci86 <kimci86@hotmail.fr>
2022-05-05 00:00:35 +02:00
CosminPerRam
27a82e733b
try_emplace in Font::loadPage
2022-05-05 00:00:35 +02:00
Chris Thrasher
c0a6cf1f0c
Remove unnecessary lossy conversions in test utilities
...
Both ApproxVec and ApproxDeg accept a double then convert that to
a float just to then convert it back to a double. We can save an
extra lossy conversion by just accepting a float instead of a double
in the first place.
2022-05-04 09:03:04 +02:00