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.
GLEW defines some extensions on its own and is making mistakes, which
aren't later resolved by including the official header, because the
extension is already defined in glew.h.
Hopefully these are the first and last errors found.
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
They can be used for both floating-point (normalized) and integral
(denormalized) representation and support conversion between them.
HSV conversion is done always using floating-point types.
Getters for RGB(A) were removed from Vector3 and Vector4, they are now
part of Color3 and Color4. Because of this, Framebuffer now accepts
Color instead of Vector.
Functions for setting 2D subimage of 3D texture / 1D subimage of 2D
texture introduced in 728ddb19a3 weren't
probably tested at all, as they are ambiguous overloads.
Now using std::enable_if, which works.
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.
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.
Long-standing TODO. It is better to have size first, because it is more
significant than type (e.g. because there are Vector4<T> specializations
and not VectorT<4> specializations). It is also IMHO easier for user to
distinguish/read the type than before:
Vector<float, 4> -> Vector4<float> // before
Vector<4, float> -> Vector4<float> // now
Texture now doesn't have it's own redundant copy of target, but uses the
one from AbstractTexture. Subsequently, all DataHelper functions now
accept "untyped" GLenum as target for better flexibility.
CubeMapTexture is not based on Texture2D anymore, all references to cube
map textures were removed from Target enums, so it's now not possible to
create cube map texture other way than using CubeMapTexture class, which
is how it should be done in first place. The wrapping mode fix is thus
now trivial.
The requirements are cross-referenced to dedicated page, similarly to
TODO and bug lists.
Also updated / improved documentation for some texture / image formats.