To be more consistent with GLSL naming. Also, the original naming was
quite misleading, as normalize() is used in GLSL for something
completely different.
If building with deprecated APIs, the Functions.h header includes the
new Packing.h header and the {de,}normalize() functions are defined as
deprecated aliases to the new functions. This will be removed at some
point in the future.
At first I designed a hugely disrupting change that basically deprecated
everything related to 8-bit linear RGB colors, but then I took a step
back and reconsidered 8-bit linear RGB as a valid use case.
The documentation of Color classes, typedefs and literals was clarified
to mention that these classes should always represent linear RGB and
that 8-bit colors are commonly treated as *not* linear and one should be
aware of it.
There is now a new Color3::fromSrgb() and Color3::toSrgb() that converts
from sRGB representation to a linear RGB usable for calculations and
then back. For four-component colors, there is now
Color4::fromSrgbAlpha() and Color4::toSrgbAlpha(). Similarly to what
OpenGL sRGB behavior is regarding to alpha, the alpha channel is kept
linear, that's why I'm also calling it sRGB + alpha instead of sRGBA.
Besides that, there are four new literals _srgb, _srgba, _srgbf and
_srgbaf that have different semantics to support the sRGB workflow. The
8-bit versions are equivalent to _rgb and _rgba, though they don't
return Color3 but a non-color Vector3 to hint that the result is not a
linear RGB color. Main purpose of these is documentation. The float
versions apply an inverse sRGB curve to the input, returning a linear
RGB color.
No need for them to be classes, less indentation, less keywords and
boilerplate, more space for documentation, better `using` usage. Also
revised and fixed various issues in the documentation.
In particular it is now possible to override the MAGNUM_PLUGINS_DIR
variables and even specify them relative, which will make them relative
to executable location.
It's nice when everything clicks together :)
Because the library still links to the old crappy opengl32.dll, we need
to load all symbols above OpenGL 1.1, not just those that are above
OpenGL ES 2.0/3.0.
Added a new enabled-by-default BUILD_AL_TESTS CMake option. The test
cases that actually require OpenAL context were split to new tests with
`*ALTest` suffix so they can be executed selectively.
Emscripten bundles the OpenAL library implicitly, so there's no
OPENAL_LIBRARY needed. Also minor other changes required for extracting
the module out of the official location.
Enabled by default, makes the current Magnum context a thread-local
variable instead of a global one, so it's possible to have multiple
thread-local contexts. Might have some performance implications, that's
why it's possible to disable it (but enabled by default is the safer
option).
GCC 4.7 and Apple platforms don't support thread_local, but __thread
does the job too (though on iOS not until Xcode 7.3). Also had to move
it to file-local because MSVC doesn't like having thread local variables
as part of DLL interface. (And there is *of course* no way to disable
exporting one particular member. F' that.)
Each Windowless*Application has now a companion Windowless*Context that
manages just the GL context creation and nothing else, with the ability
to just create the context and not make it current, so it doesn't affect
current thread state and can be moved to another thread and make current
there.
Other things that were done:
* Using `NoCreateT` instead of `nullptr` for creating the application
without creating GL context.
* Properly handling failed creation of Magnum context instance -- if it
errors out, also the GL context is destroyed to make it possible to
create the context with a different configuration.
* Reworked AMD and NVidia binary driver workaround, where core context
created with specific version doesn't automatically choose the newest
available (creating compatibility context on the other hand causes
the version to get stuck on 2.1 on Mesa and OSX).
* Added the above workaround also for WindowlessWglApplication to avoid
driver issues in the future.
* Reworked WindowlessWglApplication to not be so crazily entangled. It
was a misunderstanding on my side about how WINAPI works. Much
simpler now (and I hope still working :D).
Similarly as it is done in STL for C++14 literals, the user has to
explicitly put them to scope with `using` keyword to avoid accidental
collisions. If MAGNUM_BUILD_DEPRECATED is set, they are still brought to
the root namespace, but that will be removed in a future release.