* Moved the enum and setter function to Camera, made it static, because
it doesn't depend on any particular scene and is camera (rendering)
related.
* Function features() didn't actually work, because setFeature() didn't
update private variable at all. Removed it altogether, because the
values are not stored anywhere, the enum now holds right values
(GL_*), which makes setFeature() function so much simpler.
* Scene class now doesn't have any non-inline functions, removed *.cpp.
* The light didn't catch camera transformation changes, so it was
returning wrong position for most of the time.
* The multiplication was in wrong order, it should be multiplied with
camera matrix from the left.
I need to find an solution for this, because now it is one redundant
matrix*vector multiplication per object per frame again.
This reverts commit 0443bbe286.
Conflicts:
src/Light.cpp
src/Test/LightTest.cpp
It shouldn't be implicit, because then it will be possible to
autoconvert Vector4 from Vector2, which shouldn't be possible at all.
But it shouldn't be explicit either, because this will not be possible
then:
Vector2 vec2;
Vector3 vec3 = {vec2, 1.0};
Vector4 constructor from Vector3 stays the same, because the conversion
is fairly common, nearly always with W set to 1.
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"));
Each function which returned e.g. Vector<size, T> was in subclasses
overloaded with function returning e.g. Vector3<T>, so the user is able
to use subclass-specific functions. It was nightmare to maintain and it
cluttered the documentation a lot.
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.
It's slight copypaste, because operator| doesn't accept typedefs and
extracting the algorithm from Renderbuffer would cause the code to be
overcomplicated and not prepared for more buffer texture/renderbuffer
format additions.
The requirements are cross-referenced to dedicated page, similarly to
TODO and bug lists.
Also updated / improved documentation for some texture / image formats.
* Added asserts for unsupported mipmap and wrapping modes instead of
previous blind behavior, moved more-than-one-liner functions into
*.cpp
* Updated documentation to reflect the rectangle texture inabilities to
user, changed "unusable" to "incomplete" to be consistent with OpenGL
terminology.
* Removed some unneeded rows in documentation.
Object::setClean() now computes absolute transformation while traversing
through object parents and passes it as parameter to clean(), which is
now virtual a meant to be reimplemented instead of setClean().
Updated and greatly improved unit test.