Renamed AbstractShaderProgram::maxSupportedVertexAttributeCount() to
maxVertexAttributes(), the old function is now an alias to retain
source compatibility, will be removed in future release.
Also printing the values in magnum-info.
In 1.8.5 it is now possible to reference directly to enum member.
Hooray! Also added explicit @ref here and there, fixing some referencing
bugs along the way.
Passing pointer as function parameter will now mean that it is possible
to pass `nullptr`. Some code examples now look like the parameter is
copied instead of referenced, which is misleading. Updated the
documentation to reflect that more clearly.
Makes some cases less consistent (and some convenience shortcuts
impossible), but goes well with the attitude "don't use pointer when it
can't be null".
Inspired in STL, base templated class is renamed to BasicColor{3,4} and
typedef'd with Float type to Color{3, 4}. It is much nicer to write
this:
Color3(1.0f)
Color3::fromHSV(25.0_degf, 0.5f, 0.9f);
instead of this:
Color3<>(1.0f);
Color3<>::fromHSV(25.0_degf, 0.5f, 0.9f);
Removed unneeded member variables, removed wrong assertions and wrong
documentation (most of the state they were fobidding is actually valid).
Retrieving shader log with full length, properly printing non-error
messages to debug output.
Each shader must now be compiled explicitly using compile(), which is
slightly better for the user as it is possible to check compile status
instead of having it weirdly hidden inside attachShader(). link() now
also returns linking status.
The methods return reference instead of pointer, as the class is
commonly created on the stack. Removed static functions
Shader::fromFile() and Shader::fromData(), as they are not needed now.
Also asserting that the file exists and is readable in addFile().
The original workaround for enums didn't work (all enums were treated as
UnsignedInt even though they had Int as underlying type), moreover the
solution didn't scale for other possible types with implicit
conversions. Now explicitly listing all scalar types and templated
vectors/matrices, it should work for most cases.
OpenGL includes are ~35k lines together and it is a waste of
compilation time to include them even if they are not needed at all
(e.g. whole SceneGraph and Physics libraries). Saves ~10s of compilation
time (6:46 before, now 6:35).
It seems like a bad idea, but it will:
* Improve portability, as `Int` will be always 32bit.
* Improve readability, as `std::int32_t` is just plain ugly and too
complicated to write.
* Improve consistency and reduce confusion, as it's not good to mix
`int`, `std::int32_t`, `GLint`, `khronos_int_t` and whatnot in one
codebase.
* Possibly reduce compilation time, because including all ~35k lines
worth of GL headers just for one GLfloat typedef is even worse than
now forbidden #include <iostream> in headers.
Remaining unspecified components are set to 0, 0, 1, according to spec.
Also cleaned up and simplified the internals, added debug output
operators for attribute component count and types and tested the whole
thing.
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.