It's enabled by default, but it's possible to explicitly remove the flag
to allow for using features that are not enabled otherwise (such as wide
lines). To make the flag handling easier, there's now also new
addFlags() and clearFlags() methods.
With HiDPI support it's no longer just about window size changing -- if
the framebuffer size is different than window size, on resize both are
changed to new (different) values. Other than that, for example, when
moving a window from one display to another with a different DPI,
all three of window size, framebuffer size and DPI scaling can change as
well. This should be all reflected in the event.
This change is done in all Application classes, but the full
implementation is only in the SDL2 implementation at the moment, as the
others don't have full HiDPI support implemented yet. The old
viewportEvent(const Vector2i&) is deprecated and for backwards
compatibility called with either framebufferSize() or windowSize()
(depending on level of HiDPI support) from the new event. Overriding the
old one will still work as expected (in case you build with
MAGNUM_BUILD_DEPRECATED enabled and use the `override` keyword -- which
you should); overriding the new one will cause the compat implementation
to not be called anymore.
In order to make it possible to preserve backwards compatibility, the
viewportEvent() is no longer pure virtual in Screen. That's also
consistent with all Application implementations.
Removes all needless private static class members and fixes a bug
introduced when getting rid of the global window pointer -- the user
window pointer was set only in the case of having a GL context, not in
the contextless case. Boom. (This bug happened after 2018.04, so I'm not
putting that in the changelog.)
The Platform::*Application::Configuration class was split into
Configuration and GLConfiguration, the latter containing only
GL-specific configuration. Moreover, createContext() and
tryCreateContext() were renamed to create() / tryCreate().
There's now a constructor and a create() / tryCreate() overload taking
GLConfiguration and this will be later extended with VkConfiguration,
for example. GL-specific getters/setters from Configuration are now
marked as deprecated and merged into GLConfiguration during context
creation.
Everything has still hard dependency on GL, that will be done in the
next commits.
The move away from `nullptr` to NoCreate for constructing an application
without creating OpenGL context was done quite some time ago for
windowless application, but for some weird reason it was never done for
windowed apps. Now made this consistent.
The old `nullptr`-based constructor is still present, but marked as
deprecated and due to be removed in some future release.
It was Resizeable on GLFW and Resizable on SDL2. As both APIs use
"resizable" as the flag name, I'm keeping it. The old enum value is now
an alias to the new one, is marked as deprecated and will be removed in
a future release.
The SDL2 variant works better than expected, however the GLFW variant
underdelivers -- no key names for modifier keys, the accent keys are not
UTF-8... I don't care ATM, will solve it once someone actually
complains.
The original implementation tried to mimic the behavior of GLUT, which
treats mouse wheel as a button. SDL2, GLFW and NaCl all treat scroll
event separately, so it was quite nastily hacked in, with horizontal
scrolling ignored and scrolling offset treated as cursor position.
Moreover, wheel up/down buttons were confused with extra mouse buttons
in SDL2.
Now there is a dedicated MouseScrollEvent, which has just the offset and
modifiers, no cursor position. The original way with WheelUp/WheelDown
buttons in mouse press event is still preserved, though it is marked as
deprecated and will be removed in future release. Sdl2Application had
WheelUp/WheelDown buttons also for mouse move event, which was
completely useless (try moving a mouse while the wheel is rotating, ha),
so it's removed.
Scroll event offset is now also consistently Vector2 across all toolkits
-- it was integer in SDL2, float in NaCl and double in GLFW.
The X1 and X2 buttons in Sdl2Application are not confused with wheel
up/down anymore and are a new Mouse*Event::Button::X1 and
Mouse*Event::Button::X2 enums -- on my mouse they are actually wheel
left and wheel right (though wheel left and wheel right is not treated
as horizontal scrolling, weird).