Because we can't forward-declare class members we would need to include
whole Mesh (along with all OpenGL headers and other stuff) just to use
Primitive enum. The old Mesh::Primitive is now alias to new one, is
marked as deprecated and will be removed in future release.
Don't do anything to respond to viewport size by default, as the window
has fixed size in most cases anyway (always fullscreen, canvas of fixed
size in browser etc.). Makes the initial implementation requirements
much simpler and shorter.
* The default (empty) implementation of virtuals shouldn't be called,
thus this effectively protects the user from doing it.
* Only the application itself knows best when and how to call
rendering-related functions such as swapBuffers() and redraw(), thus
they are protected.
* Functions for setting up fullscreen or hiding the mouse may be called
from user code outside the application, thus they are kept public.
We need to create one instance, send it to subclasses and then check its
state, thus we expect that the user always operatres with the original
instance.
They are something like singletons (or they expect that behavior
internally), moreover some code might hold pointer to them, thus
movement is not desired.
Somebody would just want to defer context creation after parsing
arguments or doing some validations without any particular setup, thus
having to write even the {} is annoying.
Added missing tryCreateContext() implementations. Error messages are
printed only by tryCreateContext(), createContext() is only a thin
wrapper which exits the application if tryCreateContext() fails and
doesn't print any additional information on the output.
Hopefully I didn't break anything :-)
Sdl2Application is now taken as base implementation (it was GLUT
previously) and all others are copying/referencing the documentation
from it. When SDL2 is included in all major distributions (Ubuntu, I'm
looking at you), it will replace GLUT as the default application.
The conversion is done implicitly, thus this seemingly innocent code
would be allowed:
ImageReference2D reference = Image2D(...);
foo(reference.data()); // crash on access, data already deleted
ImageReference is supposed to be wrapper around existing data array of
some type which is passed to Magnum functions. Thus modifying the
original data array (which must be kept somewhere for proper deletion)
is much better option than casting the pointer returned by data() to
some proper type and then operating on that. Hopefully this won't break
any existing code.
The pointer conversion can be done only explicitly, thus the users will
always know what they are doing. With that change, perfectly valid
things like this couldn't be done (the result of a + b is kept until the
semicolon):
Vector3 a, b;
void foo(float* data);
foo((a + b).data());
Moreover this conversion wasn't even properly tested, leading to issues
as in mosra/corrade@781f5df38a7b1b366f3de477dd5fe641eca6ed20.
This reverts commit add989703e.
We should have used == instead of =, the counter is set to that value
later anyway, so this didn't break anything... but the assert was
useless. Hopefully it won't fire each time now :-)