2010 Commits

Author SHA1 Message Date
kimci86
7862385ba3 Bevel shape outline corners beyond threshold 2024-12-26 19:37:03 +01:00
kimci86
ff774057c7 Fix shape outline normal computation
The previous implementation could fail to determine if normals had to be
flipped or not: it assumed the first vertex position was strictly inside
the shape. This position being set to the bounding box's center, it is
possible for it be on an edge of the shape (consider a right triangle).
2024-12-26 19:35:45 +01:00
Vittorio Romeo
dab1800f61
Hide <filesystem> dependency in [E]GLCheck .cpp 2024-12-25 07:41:56 -06:00
Bambo-Borris
2c7c3dd056 Make glCheckError take a std::string_view rather than constructing a std::filesystem::path on error checks 2024-12-24 13:11:23 -06:00
Lukas Dürrenberger
2e8dc0f94f Patch out include and pkgconfig files for external libraries 2024-12-14 21:59:28 +01:00
Chris Thrasher
cb38877a8c Ensure current desktop mode is also a fullscreen mode
Port of PR #3331
2024-12-13 14:22:47 -07:00
James Cowgill
ccda2659d4 Store IpAddress::m_address in host byte order
This changes the ordering of `IpAddress` objects to be lexographical
which is more intuitive, and it fixes unit test failures on big-endian
systems.
2024-12-08 23:20:43 +01:00
James Cowgill
34ec2795a1 Fix Ogg ov_read call on big-endian systems
In the `ov_read` API, the fouth parameter says what endianness the
samples should be returned in - `0` for little-endian, and `1` for
big-endian. SFML wants samples in the host endian, so we need to set
this parameter to 1 on big-endian systems.

Fixes a unit test failure on big-endian systems.
2024-12-08 15:08:13 -07:00
James Cowgill
e1bb69b3b5 Fix segfault if XOpenIM fails
If `XOpenIM` fails we will store a `nullptr` into `sharedXIM`. When
the shared `XIM` is destroyed we call the deleter `XCloseIM` on the
`nullptr` which segfaults.

Fix this by adding a new `closeIM` helper function which checks for
null first.
2024-12-05 08:48:44 +01:00
James Cowgill
ad70442246 Do not cache atom name if XInternAtom fails
If `XInternAtom` is called with `onlyIfExists` set, then it can
legitimately return `None`. We should not cache this value because it
might change in the future.

This bug can sometimes be triggered because we use
`getAtom("UTF8_STRING", true)` and `getAtom("UTF8_STRING")`. If the
first call caches `None` because the atom didn't exist, then the
second call could return `None` instead of creating a new atom like it
should.
2024-12-05 08:48:44 +01:00
binary1248
248fd6dda8 Build dependency libraries instead of bundling pre-built binaries. 2024-12-04 23:52:24 +01:00
Chris Thrasher
ae87def93e Use char32_t for UTF-32 characters
This is probably an oversight from https://github.com/SFML/SFML/pull/2480
2024-11-30 18:28:34 -05:00
Chris Thrasher
f648ae8f35
Merge branch '2.6.x' into feature/backmerge 2024-11-19 13:02:44 -07:00
Andrew Mickelson
55ecc6498a Fix DRM mode setting to use SFML window dimensions
- Actually use the dimensions of the SFML window as the DRM mode
      dimensions when setting a DRM mode.
    - If SFML window dimensions don't match a valid DRM mode, show
      the window contents on screen in the current mode instead of
      simply failing to show anything.
    - With these change the SFML examples are now working for me
2024-11-19 11:05:47 -07:00
Lukas Dürrenberger
58085efb29 Close the open window first
This prevents race conditions where for a brief moment two different
window implementations can exist and cause uniqueness issues
2024-11-09 16:40:12 +00:00
acsbendi
15e001608a Fixed wrong fullscreen resolution 2024-11-09 16:04:54 +00:00
Andrew Mickelson
34b6bda233 [drm] Fix DRM mode setting to use SFML window dimensions
- actually use the dimensions of the SFML window as the DRM mode
      dimensions when setting a DRM mode.
    - If SFML window dimensions don't match a valid DRM mode, show
      the window contents on screen in the current mode instead of
      simply failing to show anything.
    - With these change the SFML examples are now working for me
2024-11-09 15:57:06 +00:00
Chris Thrasher
fa28722ff7 Improve const correctness 2024-10-30 16:21:40 -06:00
Chris Thrasher
18eb48b13e Disallow C-style arrays 2024-10-17 21:40:41 -06:00
Chris Thrasher
c38b98c653 Upgrade to clang-format-17 2024-10-16 16:41:15 -06:00
Chris Thrasher
cabc36b8a4 Reduce the scope of variables 2024-10-14 12:13:07 +02:00
Chris Thrasher
56f9ee2b40 Remove unnecessary static_casts 2024-10-14 12:10:43 +02:00
Chris Thrasher
bf3fb0bc3e Prefer standard fixed width integers to Miniaudio's integer aliases 2024-10-10 16:26:01 -06:00
ZXShady
04b1808522 Use eglCheck macro as an expression instead of a statement
Applies missed changes in pr #3239
2024-10-09 11:46:53 +02:00
ZXShady
f8d77ea822 Make true and false keywords lowercase and monospaced in docs
Continues the work of pr #3213
2024-10-08 10:26:22 +02:00
ZXShady
e8f59f9d4c Remove empty lamdba parenthesis 2024-10-07 21:01:24 -06:00
ZXShady
26eb6348e5 Remove unneeded function prefix in implementation files
I used nested namespaces from C++17 instead, of having to specify the namespace for the function implementation.
2024-10-06 12:57:47 -06:00
ZXShady
5ed16195b3 Use correct iterator comparison
Switching the iterator comparison used lowers the requirement for
iterators from *RandomAccessIterators* to *ForwardIterators*, which is a
benefit. It is also more accurate; instead of saying "if `begin` is less
than the end, stop." it states "if `begin` is not equal to end, stop."

Additionally, the old '<' did not protect us from undefined behavior because it is
undefined to compare two iterators relationally that are not:

1. past the end
2. within the array
2024-10-06 11:36:00 -06:00
ZXShady
d4ee28c441 Use initializer list instead of assigning in body 2024-10-05 11:31:21 -06:00
ZXShady
72207a63ef Use inherited constructors instead of constructor delegation
sf::Exception can use the inheriting constructors functionality instead of a constructor delegating to the parent constructor.

I removed Exception.cpp as it is not needed anymore.
2024-10-05 10:22:49 -06:00
ZXShady
9169e11195 Remove unneeded class prefixes 2024-10-05 09:41:45 -06:00
ZXShady
8fd67a0d99 Remove wrong comment
There is no explicit scope made specifically for an RAII variable, so I removed the comment
2024-10-05 13:37:06 +01:00
ZXShady
cfc43f50a7 Use sf::VertexArray.clear instead of .resize(0) 2024-10-04 10:43:35 -06:00
Lukas Dürrenberger
ecb945b341 Use explicit constructors when implicit construction isn't wanted 2024-10-03 22:43:57 -06:00
vittorioromeo
37de949d87 Actually, don't define 2024-09-30 23:15:18 -06:00
Chris Thrasher
ea08388e7a Remove unnecessary ternaries
It's simpler to let the boolean get promoted to an integer
2024-09-29 23:34:27 -06:00
Lukas Dürrenberger
053ef0b483 Prefer try_emplace over emplace for maps 2024-09-27 10:10:23 -06:00
vittorioromeo
eb4a2dbe0f Drain errors in [E]GLCheck via loop 2024-09-27 10:09:07 -06:00
vittorioromeo
7cec342b2b DRY shader creation via helper lambda 2024-09-26 16:33:05 -06:00
Chris Thrasher
d2ca038e2a Actually let's not 2024-09-25 20:37:43 -06:00
Chris Thrasher
9d1e5d9acf Prevent reading from an uninitialized character buffer
If `GLEXT_glGetInfoLog` fails then `log` is left unchanged which
can lead to a reading from an uninitialized buffer on the following
line. Initializing the buffer ensures this never happens. While I
was touching this code I elected to switch to `std::array` as well
since SFML has made previous efforts to stop using C-style arrays
and I wanted to continue that effort.
2024-09-25 19:34:16 -06:00
Zombieschannel
40fc524b8d InputImpl.hpp now has Android implementation 2024-09-25 17:15:16 -06:00
ZXShady
0d33ddeccf Change glCheck macro to be usable as an expression 2024-09-25 09:47:36 -06:00
Chris Thrasher
c8cf84511d Fix clang-tidy-19 errors 2024-09-24 18:42:31 -06:00
Vittorio Romeo
1f11e91bed Avoid unnecessary assignment in Text::findCharacterPos 2024-09-22 14:20:25 +02:00
Lorenzooone
5545df7290 Use lazy loading for keyboard scancodes on macos (backport) 2024-09-16 17:41:41 -04:00
Lorenzooone
6bcc3414fc Use lazy loading for keyboard scancodes on macos 2024-09-16 16:35:12 -04:00
Vittorio Romeo
20b048fb08 Replace swap with move where appropriate 2024-09-16 13:29:52 -04:00
Lukas Dürrenberger
6591c59504 Add window create functions without style specifier
This brings the create() functions inline with the constructor overloads
for WindowBase, Window, and RenderWindow
2024-09-16 12:05:59 -04:00
Vittorio Romeo
e2ea1d8a7c Simplify and extend [E]GLCheck implementation 2024-09-16 12:02:54 -04:00