Commit Graph

3492 Commits

Author SHA1 Message Date
Corentin Schreiber
ebf485737f Add texture coordinate type to sf::RenderStates 2024-01-25 23:45:00 -07:00
Chris Thrasher
b234ede61e Use struct for data type with exclusively public contents 2024-01-24 21:59:00 -07:00
Chris Thrasher
5dfa3f7858 Modernize management of X11 resources
This approach uses RAII to manage resources rather than relying on
correctly calling cleanup functions at all places where scope exits.

This also has the benefit of removing a mutex and no longer having
to lock that mutex so many times.
2024-01-24 20:12:10 -07:00
Bruno Van de Velde
5a74cf33e9 Replaced deprecated exec_program function in CMake scripts with execute_process, as this was causing iOS build to fail with CMake 3.28 2024-01-23 13:09:04 -07:00
Bruno Van de Velde
67feaa0bd3 Update location of sdkmanager in Android CI jobs 2024-01-23 11:05:54 -07:00
Chris Thrasher
7d095c8b6e Clarify instructions for how to use SFML_ROOT
SFML_ROOT can simply point to the directory in which SFML was installed.
This is verified by our install interface tests which do exactly that,
even when SFML is built as a framework. CMake can figure out where
to find the config module if you give it this much information.
2024-01-20 18:48:53 -07:00
Chris Thrasher
ef5ee38576 Refactor ternary into early-returning conditionals
A complex ternary expression here doesn't buy us anything. This
refactor more clearly expresses what is going on in this function.
2024-01-17 19:14:27 -07:00
Chris Thrasher
30a986e632
Use CMake-standard <PackageName>_ROOT variable to locating config module
https://cmake.org/cmake/help/v3.22/command/find_package.html
https://cmake.org/cmake/help/v3.22/variable/PackageName_ROOT.html#variable:%3CPackageName%3E_ROOT

SFML_DIR predates the existence of <PackageName>_ROOT which is now
the preferred way to specify where to find a given package's config
module. User reports have shown that SFML_DIR may be broken at least
in certain circumstances so lets stop mentioning it.
2024-01-16 13:10:58 -07:00
Chris Thrasher
a2c003b2b7 Add sf::State for specifying fullscreen or floating windows 2024-01-15 23:08:33 -07:00
Chris Thrasher
ddb906a0ab Fix file extension typo in .gitattributes 2024-01-15 16:47:09 -07:00
Chris Thrasher
3c4c1d3266 Add missing std:: namespace 2024-01-14 21:56:13 -07:00
Chris Thrasher
a7aa231274 Enable clang-tidy Objective-C checks 2024-01-14 19:20:02 -07:00
Chris Thrasher
43dc13c3de Fix typo in sf::Vector3<T> type trait tests 2024-01-14 19:19:37 -07:00
Chris Thrasher
c919ad533d Remove unnecessary return statements
A new check in clang-tidy-18 catches this. I built it from source
and ran it locally to find this.
2024-01-14 17:00:35 -07:00
Bruno Van de Velde
9cd703aa10 Update location of sdkmanager for Android builds 2024-01-14 15:34:14 -07:00
Chris Thrasher
0d49fab1a6 Remove unnecessary private operators
Equality operations are not automatically generated by the compiler
so we can omit this.
2024-01-09 22:17:55 -07:00
binary1248
ed4dd9fd01 Fixed F13-F24 and consumer key names not being returned on Windows. 2024-01-08 16:18:43 -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
a9d9ef6d83 Deduplicate Window{Base}::create implementations
Co-authored-by: binary1248 <binary1248@hotmail.com>
2024-01-01 12:57:57 -07:00
Lukas Dürrenberger
f46c888e9b Fix shader loading check for empty streams 2023-12-31 16:53:19 -07:00
Chris Thrasher
be5c52a1fc Use std:: namespace 2023-12-31 16:17:29 -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
Chris Thrasher
2fe58c66a7 Delete unnecessary destructor 2023-12-26 22:14:57 -06:00
Chris Thrasher
cf3f4e8d89 Use sf::Vector2s for expressing sizes and positions 2023-12-24 01:45:35 -06:00
Chris Thrasher
8509f0fddd Use struct for type with exclusively public contents 2023-12-23 18:36:41 -06:00
Chris Thrasher
36e7a18881 Fix clang-tidy errors 2023-12-23 10:41:02 -06:00
Chris Thrasher
a1c3aa14cb Remove redundant link libraries
This is the warning I got when building this locally

ld: warning: ignoring duplicate libraries: 'lib/libsfml-graphics-s-d.a', 'lib/libsfml-system-s-d.a', 'lib/libsfml-window-s-d.a'
2023-12-22 23:16:45 -06:00
Chris Thrasher
f5497b2db6 Use more in-class member initializers 2023-12-22 21:55:51 -06:00
Chris Thrasher
3d4ea00135 Use sf::Vector2<T> conversion constructor 2023-12-22 20:32:08 -06:00
Chris Thrasher
ffe9cc0671 Fix incorrect assertion comment 2023-12-22 16:00:39 -06:00
kimci86
39da2b829c Make Keyboard::Key a scoped enumeration 2023-12-22 10:47:30 -06:00
kimci86
82ee0f79ac Remove Key::Last and Scan::Last enumerators
The purpose of those was to make it obvious that an action is needed to
update KeyCount or ScancodeCount when adding more enumerators, but we
rarely touch those enumerations so it is not worth adding those
technical names to the public API.
2023-12-19 22:37:13 +01:00
Chris Thrasher
b13b488f9f Remove unused function 2023-12-17 22:53:35 -07:00
Chris Thrasher
22b518af1f Remove unused function 2023-12-17 20:59:59 -07:00
Chris Thrasher
d1eb21e04f Remove reference to SFML 2 2023-12-17 20:28:11 -07:00
Chris Thrasher
674d68faa6 Remove unhelpful return values 2023-12-17 17:48:11 -07:00
Chris Thrasher
2bc4e15043 Fix typos 2023-12-17 15:48:19 -07:00
kimci86
d2f4452fc8 Use EnumArray for Key or Scancode-indexed arrays 2023-12-17 15:47:47 -07:00
kimci86
faaceb5b5b Define KeyCount and ScancodeCount out of enums
Those values are not valid Key or Scancode values, so it doesn't make
sense for them to have Key or Scancode type.
Moving them out of their enum makes it possible to write exhaustive
switch case statement without having to write a case for those values.
Making them unsigned int allows to use them as array size without having
to do a static_cast.
2023-12-17 15:47:47 -07:00
Chris Thrasher
329e40019a Print out new video mode when current mode is rejected 2023-12-17 12:59:47 -07:00
kimci86
a474654ea7
Add EnumArray to implement enum-indexed arrays 2023-12-16 18:31:25 -07:00
Chris Thrasher
92826e1c1f Remove static_casts 2023-12-16 18:28:05 -07:00
kimci86
b20376813c Rename XButton1 and XButton2 into Extra1 and Extra2
This is to avoid repeating Button when using those values now that the
sf::Mouse::Button enumeration is a scoped enumeration.
2023-12-16 12:14:43 -07:00
kimci86
eab8f426e7 Make Sensor::Type a scoped enumeration 2023-12-15 15:18:25 -07:00
kimci86
3fb0ffce51 Make Mouse::Button and Mouse::Wheel scoped enumerations 2023-12-15 15:18:25 -07: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
5e18e5403b Fix Nix pkg-config support
CMAKE_INSTALL_LIBDIR is an absolute path on Nix (which is a valid
thing to do). In such a case two absolute paths would get appended
resulting in a nonsense path that broke pkg-config support.
2023-12-15 09:42:56 -07:00
Chris Thrasher
9cea872dbc Update changelog for #2821 2023-12-15 09:42:56 -07:00