Unlike Matrix3/Matrix4 these don't have any transformation-related
functions. Deprecated the old Matrix2 typedef, which is now replaced
with Matrix2x2 and will be removed in future release.
They were already in Magnum namespace for floats and doubles, now they
can be used also for generic type (e.g. use `Math::Matrix2x3<T>` instead
of overly verbose `Math::RectangularMatrix<2, 3, T>`). GCC 4.7+ only.
All the functionality is moved to Math::swizzle() and the result is
casted to given type only if its header is included. Thus it is possible
to remove include dependency on Color. The original swizzle() is now
just an alias marked as deprecated and will be removed in future
release.
In addition to 37e4f9d6f7 which did the
change for Sdl2Application (because Emscripten required it), making sure
that everything (except GLUT, which does it by default) behaves the
same.
Moreover, some applications don't expect viewport size changes at all
(e.g. the app can't change size of immutable texture used for rendering)
and thus the original way to defer the initialization until
viewportEvent() is called would be overly complicated.
Also, since framebuffer classes store viewport size in them, there is no
need to call viewportEvent() on initialization. The current ways to do
the initial call in Sdl2Application, *XApplication and NaClApplication
were nothing more than ugly workarounds for mimicking GLUT behavior,
which is bad.
Lastly, to be sure that nothing breaks in user apps, I did this change
in magnum-bootstrap long ago and all bootstrap application behave the
right way.
Consider this craziness when setting up projection or something similar:
Vector2i framebufferSize;
Float aspectRatio = Float(framebufferSize.x())/framebufferSize.y();
And now, behold, the convenience:
Float aspectRatio = Vector2(framebufferSize).aspectRatio();
The event is called only if any button is pressed, added Button::Left
which is always present. This is just for source compatibility with
other Application implementations.
Doing it the same way as in Sdl2Application, as this doesn't have any
performance impact (just alias for already present variable).
The other way around, i.e. combining mouse buttons and keyboard
modifiers in Sdl2Application, would have unnecessary performance
penalty, as keyboard modifiers must be queried with separate function,
even if they won't probably be used at all.
Qt employs similar approach.
The old way is preserved for backwards compatibility, but marked as
deprecated and will be removed in future releases.
Emscripten supports some hybrid between SDL1 and SDL2. I don't want to
add Sdl1Application just for that and create more portability issues, so
I just changed some things in Sdl2Application to be compatible with what
Emscripten wants. Full SDL2 support is awaited in Emscripten, thus this
is future-proof (rather than having SDL1 support, which would be
deprecated later).
Added documentation about Emscripten usage and template HTML markup to
Sdl2Application docs, will move it somewhere else in the future when
more than one Application will be supported (e.g. GLUT).