Commit Graph

2641 Commits

Author SHA1 Message Date
Vittorio Romeo
0e419543f2 Make 'Color' constants 'constexpr' and add tests 2022-02-08 23:32:12 +00:00
Chris Thrasher
28f273b9c9 Add sf::Angle
Similar to sf::Time, sf::Angle provides a typesafe API for working
with angles and provides named functions for converting to and from
degrees and radians.
2022-02-08 22:52:37 +00:00
Lukas Dürrenberger
ef8d6ee7f7 Remove VS 2017 as GitHub Actions compiler
VS 2017 doesn't fully support C++17
2022-02-05 19:11:15 +01:00
Chris Thrasher
0c8c35fa0c Fix findIntersection documentation 2022-02-04 09:35:34 +01:00
Chris Thrasher
8f1955af17 Don't add SFML:: namespace to external targets
The SFML target export set includes a number of external targets
which are not owned by the project itself. This includes targets
like Freetype and OpenGL. By specifying a namespace for the export
set, a SFML:: namespace was prepended to all targets. This is not
a problem when using shared libraries but when building and using
static libraries caused a problem where CMake was attempting and
failing to find targets with names like SFML::Freetype or
SFML::OpenGL which did not exist.

Luckily CMake allows you put namespaces in the EXPORT_NAME target
property so now we can just add the SFML:: namespace in the macro
which creates SFML targets and remove the `NAMESPACE SFML::` line
which was adding namespaces to all targets.
2022-01-28 08:11:53 +01:00
Chris Thrasher
7c80f302e4 Use std::optional to remove extra sf::Rect::intersects overload 2022-01-27 02:55:11 +00:00
Chris Thrasher
0ad6d1815c Remove unnecessary CMake version requirement
This is left over from 0f83e3d but we forgot to remove it. Nothing
about this file requires an elevated minimum CMake version now that
the FetchContent usage is gone.
2022-01-22 15:51:27 +01:00
kimci86
ad21794f39 Fix runtests target for multi-configuration generators 2022-01-21 21:19:32 +01:00
Chris Thrasher
052e624ddf Remove GCC 4 workaround 2022-01-21 21:19:05 +01:00
Chris Thrasher
a322d18e63 Use built-in CMake project version functionality 2022-01-21 21:09:20 +01:00
Lukas Dürrenberger
60deef9997 Add support for VS 2022 to the GitHub Actions workflow 2022-01-20 10:53:52 +01:00
Chris Thrasher
7cdb728e52 Add tests for sf::BlendMode 2022-01-20 07:39:19 +01:00
Chris Thrasher
871c021a75 Add tests for sf::ContextSettings 2022-01-13 23:49:37 +01:00
Vittorio Romeo
a880122836 Reintroduce 'SleepImpl' sleep implementation 2022-01-12 00:01:35 +00:00
Chris Thrasher
da6a226941 Add tests for sf::Clock 2022-01-11 22:49:00 +00:00
Chris Thrasher
4586db91a9 Add SFML:: namespace to targets
This removes the sfml- prefixed targets from the export set. The sfml-
prefixed targets are still available within the build tree but not to
downstream users thus making this an API breaking change when compared
to the 2.x releases. To keep things consistent, usage of the sfml-
targets were replaced with their namespaced counterparts.

This has a number of benefits:

  1. It's more idiomatic. Modern CMake libraries are expected to
     have namespaced targets.

  2. Namespaced targets are less likely to collide with user-defined
     targets. No one will accidentally define a SFML:: target.

  3. If a namespaced target is not found by CMake, configuration
     will immediately stop.
2022-01-11 22:27:39 +01:00
Vittorio Romeo
d5604b91c6 Add '.gitignore' file 2022-01-10 10:34:55 +01:00
Chris Thrasher
70e0ad28d4 Only build Cocoa example when using Xcode 2022-01-08 19:46:19 +01:00
Chris Thrasher
b717a68fba Add tests for sf::Transform 2022-01-08 15:06:12 +01:00
Lukas Dürrenberger
c36a7821ee
Merge pull request #1961 from SFML/feature/back_merge
Back-merge changes from 2.6.x to master
2022-01-08 13:04:53 +01:00
Lukas Dürrenberger
3a402f241a Merge branch '2.6.x' into feature/back_merge 2022-01-08 12:28:34 +01:00
Chris Thrasher
3d01efb80a Use operator<< for printing during test failure 2022-01-07 20:04:54 +01:00
Chris Thrasher
cd84b19669 Define fixed-width integer type aliases in terms of standard fixed-width types 2022-01-06 21:02:14 +01:00
Chris Thrasher
79c2aadbcc Remove redundant 4-param sf::Rect<T> constructor 2022-01-06 20:04:03 +01:00
Chris Thrasher
6c816aba44 Add tests for sf::Vertex 2022-01-06 20:02:09 +01:00
Chris Thrasher
7d47e740bb Only build Cocoa example when using Xcode 2022-01-04 23:05:23 +01:00
Jan Haller
2ea46c8702 Fix WindowImplX11 initialization 2022-01-04 19:21:32 +01:00
Chris Thrasher
3197dc8029 Remove redundant formatters 2022-01-03 08:27:43 +01:00
Vittorio Romeo
3dc8fc0923 Add 'NetworkUtil' for network module tests 2022-01-03 01:00:55 +01:00
Chris Thrasher
ff4fc05b18 Stop configuration when GCC is detected on macOS 2022-01-02 23:15:05 +01:00
Jan Haller
3b06972602 Update year to 2022 2022-01-02 23:06:31 +01:00
Vittorio Romeo
5ba6580568 Make 'Time' a 'constexpr' class 2021-12-28 16:52:52 +01:00
Chris Thrasher
dafdacfa20 Let tests and examples inherit language requirement from upstream targets
It's not necessary to re-specify cxx_std_17 since any example or test
which depends on a core target (which should be all of them) will pick
up this language requirement that should be a public property of those
targets. If that changes, these examples and tests will possibly fail
to compile and correctly catch the bug that was introduced in the core
library targets.
2021-12-28 15:53:08 +01:00
Chris Thrasher
f5541d22e5 Add tests for sf::VideoMode 2021-12-27 19:09:35 +01:00
Vittorio Romeo
50d28e3879 Add tests for 'sf::Color' 2021-12-27 17:35:06 +01:00
Chris Thrasher
14fff20eb8 Remove redundant API taking x,y pair instead of sf::Vector 2021-12-26 17:13:18 +01:00
Vittorio Romeo
29983aa8d4 Replace Catch with Doctest 2021-12-24 15:06:32 +01:00
Chris Thrasher
ade9843dd8 Collapse test/src directory 2021-12-24 11:56:58 +01:00
Chris Thrasher
54b8a691d1 Add unit tests for sf::Time 2021-12-23 20:34:33 +01:00
kimci86
53594dfbe7 Fix null pointer dereference in Font 2021-12-23 17:03:16 +01:00
Vittorio Romeo
46639ed277 Manipulate library names on Windows + Clang 2021-12-22 08:53:03 +01:00
kimci86
d0c63f46fc Use a smart pointer to manage std::FILE pointer in FileInputStream 2021-12-22 02:35:45 +01:00
Chris Thrasher
cd1cc62f6d Fix issue with MinGW not handling large files 2021-12-21 23:11:15 +01:00
Chris Thrasher
0f83e3d266 Use FetchContent to grab latest Catch2 release
The key benefit here is that now we're linking against their CMake
target which makes it easy to change how we depend on Catch2. We
can switch from FetchContent to FindPackage to a git submodule and
never have to change our code because we're depending on Catch2 in
the most flexible way possible.
2021-12-21 23:11:15 +01:00
Vittorio Romeo
7364d5b578 Fix broken OpenGL example 2021-12-21 20:41:44 +01:00
Vittorio Romeo
f6de7eca40 Use smart pointers to manage memory 2021-12-21 19:54:25 +01:00
Vittorio Romeo
257c78f07a Don't use 'sf::err' in public example code 2021-12-20 15:06:27 +01:00
Lukas Dürrenberger
e982d08f37
Merge pull request #1920 from SFML/feature/backmerge
Back-merge changes from 2.6.x to master
2021-12-20 14:22:56 +01:00
Lukas Dürrenberger
3cd45a283b Merge branch '2.6.x' into feature/backmerge 2021-12-20 13:44:56 +01:00
Chris Thrasher
14bbb0d1cc Unify toLower implementations 2021-12-20 08:29:05 +01:00