In testing I tried passing `nullptr` to this function which caused
a segfault on Linux. If we know that's an invalid input then lets
assert against it.
sf::JoystickManager is a private type but the sf::Joystick API calls
into it so those asserts are still prone to fail due to incorrect
user input.
Yay for catching more UB :)
https://github.com/actions/runner-images/issues/8343#issuecomment-1727810519
Ninja's presence in the Windows images was due to it being a
transitive dependency of another packages. It was never guaranteed
to be present. The actions/runner-images devs do not plan on adding
it so we're forced to install it ourselves.
This takes a 4 second configuration time for the entire project with
examples and tests and turns that into 3! Whopping 25% reduction in
configuration time. This effect is likely to be even larger on machines
without exceptionally good internet connections.
Before:
$ hyperfine 'rm -rf build && cmake --preset dev'
Benchmark 1: rm -rf build && cmake --preset dev
Time (mean ± σ): 4.076 s ± 0.130 s [User: 2.148 s, System: 1.376 s]
Range (min … max): 3.963 s … 4.321 s 10 runs
After:
$ hyperfine 'rm -rf build && cmake --preset dev'
Benchmark 1: rm -rf build && cmake --preset dev
Time (mean ± σ): 3.007 s ± 0.313 s [User: 1.061 s, System: 1.160 s]
Range (min … max): 2.783 s … 3.805 s 10 runs
Co-authored-by: binary1248 <binary1248@hotmail.com>
Out of bounds array access is undefined behavior so let's be sure
to catch potential UB in debug builds. It's too easy to accidentally
provide an invalid index to one of these public APIs.
A fun thing about runDisplayTests() is that it means that the tests
won't get run in CI on the DRM code. Technically you can run the
display tests locally when buidling with DRM so these tests will
still fail under those circumstances. Regardless I think this is a
net positive to run the tests in CI.
This is not the best default value because it imposes additional
requirements on user builds that are not strictly necessary. This
has caused many complaints in the past as people encounter build
failures that are merely due to warnings and not hard compiler
errors.
Changing this default value emakes it more likely that someone trying
to use SFML can use it without issue.
The name of the find module was changed to match the name used by
the reference implementation of Vorbis. Likely the target names were
taken from what the reference implementation names those targets.
This is a lighitly modified copy of CMake 3.27.4's FindOpenAL.cmake
module. This gives us access to the OpenAL::OpenAL target which was
not added until CMake 3.25.
https://github.com/github/gitignore/blob/main/C%2B%2B.gitignore
Our .gitignore file originated from this .gitignore template. This
template is made to be general-purpose and thus includes many things
we don't care about. We know that the SFML build won't produce files
with any of these patterns outside of the binary dir.
I alphabetized the list while I was at it.
This class hides a lot of its logic in the private section of the
classes and uses friends to access them so there is little accessible
in the public interface for testing.