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).
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.
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.
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.
- 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
- 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
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
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.
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.