Partially needed to avoid build breakages because Corrade itself
switched as well, partially because a cleanup is always good. Done
except for (STL-heavy) code that's deprecated or SceneGraph-related APIs
that are still quite full of STL as well.
While branching on a compiler is rather common, checking a particular
compiler version should be needed only rarely. Thus minimize use of such
macros to make them easier to grep for.
Because the cost of hundreds of tiny allocations when filling a
std::unordered_map (and then the cache unfriendliness of the whole
thing) definitely overweights the potential speedup by searching in O(1)
instead of O(log n). Same approach is chosen in the upcoming Vulkan
wrapper, I just backported it here.
This strips about 8 kB off the Emscripten build.
Same as in Corrade. Because BUILD_STATIC is independent between Corrade
and Magnum this option is also independent -- the corner cases and bad
interactions would be otherwise too complex to handle (e.g., in case of
a dynamic Corrade and static Magnum it would be impossible to enable
this option for Magnum etc etc).
Bloaty says it saved 10 kB in Debug build of MagnumGL:
VM SIZE FILE SIZE
-------------- --------------
[ = ] 0 .debug_info +1.59Ki +0.0%
+0.4% +1.50Ki .text +1.50Ki +0.4%
[ = ] 0 .debug_str +409 +0.0%
[ = ] 0 .debug_line +276 +0.1%
[ = ] 0 .debug_abbrev +20 +0.0%
-28.6% -2 [LOAD [RX]] -2 -28.6%
[ = ] 0 [Unmapped] -4.28Ki -41.0%
-22.7% -9.23Ki .rodata -9.23Ki -22.7%
-0.8% -7.73Ki TOTAL -9.73Ki -0.1%
And 4 kB in Release:
VM SIZE FILE SIZE
-------------- --------------
+1.1% +3.44Ki .text +3.44Ki +1.1%
+1.7% +1.39Ki .eh_frame +1.39Ki +1.7%
[ = ] 0 [Unmapped] +656 +51%
-25.5% -9.47Ki .rodata -9.47Ki -25.5%
-0.7% -4.64Ki TOTAL -4.00Ki -0.4%
That's not negative, so I guess that's good. This change is of course
more significant in the context of a minimal WebGL build, where the exe
can be as little as 50 kB -- there 4 kB is almost 10% of the size.
The Audio::Extension::extensions() and GL::Extension::extensions()
functions now return an ArrayView instead of a reference to std::vector.
Having a function-local static std::vector is the worst thing ever. Ugh.
Emscripten AL does not support specifying attributes and does not set a
ALC error when alcCreateContext fails.
Signed-off-by: Squareys <squareys@googlemail.com>
Since `ALC_HRTF_SOFT` is a ALC extension, we need to use `alcGetIntegerv()`
instead of `alGetIntegerv()` which requires access to the OpenAL device
stored in `Audio::Context` and therefore the aforementioned methods have
been moved there.
Signed-off-by: Squareys <Squareys@googlemail.com>
Polished some minor stuff in the code, reordered Renderer getter-only
functions to be at the top, fixed \al_extension and \alc_extension
Doxygen commands to link to proper place and some other minor
Doxygen-related stuff.
Add `HrtfStatus` and queries in `Audio::Renderer`, `ALC::SOFT::HRTF` and
`@requires_alc_extension` notes for relevant methods in `Configuration`.
Signed-off-by: Squareys <Squareys@googlemail.com>