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.
It only caused another maintenance burden and was confusing to users.
Now when scene graph is in SceneGraph namespace there is no need for
another grouping. Namespaces are (and should be) sufficient.
This reverts commit 79945ab6fc.
Conflicts:
src/BufferedImage.h
src/BufferedTexture.h
src/Framebuffer.h
src/Query.h
src/SceneGraph/Scene.h
Desktop OpenGL and OpenGL ES 2 support can be switched using CMake
TARGET_GLES option. All functionality not supported in ES is marked in
documentation.
If targetting OpenGL ES, GLES2/gl2.h is included instead of GLEW.
Mesh class now uses VAOs only in desktop OpenGL, in ES the buffers are
bound on each draw call.
According to OpenGL specification the sampler uniform takes only texture
layer and not any particular texture. In OpenGL 4.2 it is possible to
explicitly specify desired texture layer in the uniform, so I suppose
it's desired to have shader with fixed texture layers and on the other
hand be able to bind texture to any layer, not only one -- the exact
opposite of how it was in Magnum before.
The shader should now specify in its public API which texture is on
which layer and explicitly set the layer uniforms upon construction. All
setUniform() functions taking textures as argument were thus removed, as
they confuse things a lot.
The textures now have bind() function which takes layer as argument, so
it's now sufficient to only bind the texture before drawing the mesh
without messing with sampler uniform.
While namespaces act for hierarchy, modules are something like "tags" -
usable when you want to check related classes of e.g. CubeMapTexture.
Not sure how to name module for Math and Physics namespaces and
Contexts/Trade, though.
Preferred workflow is to specify attribute location explicitly in the
shader. The functions remains here as some old Intel systems don't
support the required extension ARB_explicit_attrib_location (and it's
not in GL 3.0 either). Also updated and fixed the documentation.
Function bindAttribute() was renamed to bindAttributeLocation() to be
consistent with bindFragmentDataLocation().
PhongShader now uses explicit attribute location.
Fixed a few typos in extension names, fixed BPTC texture compression
typos. Removed redundant EXT_framebuffer_object from functions as the
Framebuffer class itself has it.
For classes which already have pure virtual functions instantiation is
not allowed, but for other there needs to be at least one pure virtual
method: the destructor.
Pure virtual functions actually can have implementations, but they must
be called explicitly. Destructors are called explicitly, so for them it
works.
The class is now created always on the stack, so the user doesn't have
to delete it explicitly. It's now possible to write less verbose
shader code, instead of three lines before:
Shader* s = Shader::fromFile(Shader::Fragment, "Shader.frag");
attachShader(s);
// ...
delete s;
It's now only one:
attachShader(Shader::fromFile(Shader::Fragment, "Shader.frag"));
The requirements are cross-referenced to dedicated page, similarly to
TODO and bug lists.
Also updated / improved documentation for some texture / image formats.
Removed another old overdone code, the attributes are now bound
directly, without saving the data to some temporary location and then
binding everything at once in link().
All HTML code and Doxygen shortcuts such as @c, @b and @em are now
rewritten using Markdown syntax, which makes it more readable.
Also updated Doxyfile. Doxygen 1.8 at least is required to generate
the documentation now.
Now the data type is part of attribute definition, so user doesn't have
to guess / look up what data should be there when binding with
Mesh::bindAttribute().
According to my observations (and crazy bugfixing madness) ATI cards
don't support anything else than attributes numbered from 0 with
successive numbers.
Also fixed (pedantic) comma at the end of enum.
Not using macro this time, as some classes could want only to disable
either copy or move and with macros this would become unintuitive and
error-prone.