The stride was computed always for resulting GLSL type (e.g. vec4) even
if the data were of anoother type (e.g. std::uint8_t[4]). The code is
exceptionally ugly now, time to wrap it with unit tests.
It prevents unwanted implicit conversions from e.g. nullptr to Camera,
Vector2 to Physics::Point etc. By making all the constructors explicit
it is easier to routinely add the keyword to all new classes instead of
thinking about cases when to add and when not to.
Some target platforms supply their own OpenGL headers, thus we cannot
use our own from ES 3.0 and compilation fails.
On the other hand, this will be better for users as usage of unsupported
features will be catched right during compilation and not at runtime.
* Normalization of e.g. color components passed as unsigned byte to
float values is possible.
* BGRA vector component ordering is possible.
* Proper type checking, allowing only GLSL-equivalent types to be used
as attributes.
* Reverted back to typedef'ing shader attributes, as type conversion
can now be specified in constructor.
* #version directive doesn't belong to shader sources, since it is
specified in Shader constructor.
* It's not needed to call use() before setUniform() anymore.
* Instead of "binding attributes" the user now "adds vertex buffer". It
corresponds better with what OpenGL itself does.
* Vertex buffers now must be managed by the user.
* Shader attributes are now static const members instead of typedefs to
allow more convenient add*VertexBuffer*() calls.
Also explicitly calling use() on default (non-DSA) setUniform()
implementation. Because of that, it is now possible to conveniently call
use() at the end, instead of at the beginning of uniform setting chain,
for example:
// before
shader->use();
shader->setTransformation(transformation)
->setProjection(projection)
->setColor(color);
// now
shader->setTransformation(transformation)
->setProjection(projection)
->setColor(color)
->use();
Note that you still have to explicitly call use(), because if DSA is
available, no use() is called explicitly on any setUniform(). If DSA is
not available, use() is called on first setUniform() and subsequent
calls have no negative performance impacts.
* Grouping lengthy documentation into "Feature overview" page.
* Link only to example index, where all the disclaimers are.
* Also minor documentation updates.
Vector4 doesn't set W component to one by default anymore, this is now
handled by Point*D itself. This finally allows creating of 2D primitives
and 2D position vectors without messing explicitly with Z = 1.
All classes which should use Point instead of Vector were updated to use
Point instead.
Now the #version string is added from Shader class itself, making it
possible to do workarounds for older versions more conveniently. As a
consequence, #version must not be part of shader source anymore.
Magnum.h now doesn't include anything except OpenGL headers, thus
changes in Math library don't trigger recompilation of everything, but
only of things really depending on it.
Math constants moved to separate file for similar reasons, de-inlined
some functions to remove the need for some #includes.