Was Magnum::GL::Extensions::GL before and the redundancy was completely
unnecessary. Potential future extensions coming from GLX, EGL or whatnot
will most probably be in the Platform namespace in a completely separate
file, so this is not a problem.
All code internal to the GL library is affected, not much the outside,
as that is handled by the compatibility alias.
At the moment just the GL library itself w/o the tests, and without
backwards compatibility aliases. The following types were left in the
root namespace, despite being in the GL/ directory, as they will get
moved back soon:
* Image, CompressedImage and their dimensional typedefs
* ImageView, CompressedImageView and their dimensional typedefs
* PixelStorage
Not PixelFormat etc., that one will stay in the GL namespace and a
completely new PixelFormat enum will be provided in the root namespace.
Minimal updates (just the include guards) so Git is hopefully able to
detect the rename and track the history properly.
Everything except Magnum::GL doesn't compile now.
* Half-floats and floats are usable in ES2 / WebGL 1 (they weren't by
mistake) -- just use OES_texture_float or OES_texture_half_float.
* Half-floats are linearly filterable in ES3 / WebGL 2 and
OES_texture_half_float_linear makes it possible in ES2 / WebGL 1.
* Floats are not linearly filterable, not even in ES3 (they were by
mistake) -- one needs OES_texture_float_linear for that.
* Neither floats nor half-floats are renderable in ES < 3.2 -- one
needs EXT_color_buffer_half_float or EXT_color_buffer_float for that.
The former is available for example on iOS, the latter is apparently
only on NV cards. Both are builtin in ES 3.2, EXT_color_buffer_float
depends in ES3, so half-floats are the only possible format to render
to in ES2.
* Rendering to floats in WebGL is slightly more complicated --
unlike with OpenGL ES 2 it's possible to render to floats in WebGL 1
using WEBGL_color_buffer_float. There's another WebGL 1 extension
called EXT_color_buffer_half_float and they are both replaced with
EXT_color_buffer_float in WebGL 2.
And, as a cherry on top, GPH (formerly SGI) has patents on most of
these, which is probably why the support for them is so spotty.
A bunch of extensions formerly in AEP are now part of ES 3.2, which
means they were reordered in the extension lists. While at it, also
added corresponding new GL and WebGL extensions and fixed a few wrongly
categorized extensions in WebGL.
DetectedDriver::AMD is now DetectedDriver::Amd,
DetectedDriver::ProbablyAngle is now just DetectedDriver::Angle. The old
names are still present, but deprecated and will be removed in the
future.
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.)
What this changes:
* Before, a Version::GLES310 shader was created with `#version 450`
directive, which is wrong, because an implementation might support
GLES 3.1 but not GL 4.5 so this was not working and also the syntax
is a bit different so this wasn't helpful at all.
* Similarly, Context::isVersionSupported(Version::GLES310) was checking
for support of OpenGL 4.5. Now it just checks for
`ARB_ES3_1_compatibility` extension.
* Added a small isVersionES() utility that just tells whether given
version is ES or not.
103% of use cases use the returned value directly without checking, so
we might as well do the check ourselves. Added new function hasCurrent()
and added deprecated backward-compatibility conversion and -> operators.
Wow, that creeped to a lot of places.
Last dinosaur from the pointer age.
Added `--magnum-disable-extensions` option next to the already existing
`--magnum-disable-workarounds`. Specified extensions are not used
automatically and also report as disabled and unsupported when asked using
Context::isExtensionSupported() and Context::isExtensionDisabled().
The engine can now list all driver workarounds that were used during the
initialization. Any listed workaround can then be disabled from the
command-line using `--magnum-disable-workarounds` command-line
parameter. The disabling and querying API is private and undocumented,
because the driver workarounds should be disabled only by end-users and
not application developers. The workaround list is now empty, but will
be filled up in the following commits and the workarounds will be
probably documented only privately in Implementation/driverSpecific.hpp,
as it is really something that should be used only to debug driver
problems.
The parameterless Platform::Context::Context() constructor and
Platform::Context::tryCreate() function are deprecated in favor
functions that take argc/argv pair. The Context class now accepts
arguments starting with --magnum-* prefix. Currently there are none
except for the implicit --magnum-help, but that will change with the
following commits.
In some cases the GL context creation might success without error, but
the created version is one that we don't want (e.g. software GDI
rasterizer on Windows). Previously the Context class constructor just
exited the application and it was impossible to react on that from the
application side (for example reducing some context feature
requirements).
Now there is Platform::Context::tryCreate(), which returns either
created instance or `nullptr` if the instance creation failed with some
error. That is now used in all Platform::*Application implementations.