Vladimír Vondruš
8af1f6a91e
Platform: delay GLFW event callback setup to first main loop iteration.
...
A more robust fix for the Windows-specific issue, and fixing a similar
macOS issue as well.
6 years ago
Vladimír Vondruš
ce0efd1aeb
Platform: move a window creation asset to a better place in GlfwApp.
...
So this gets checked even when the user is calling mainLoopIteration()
directly.
6 years ago
Vladimír Vondruš
c17f5a0340
Platform: avoid GlfwApplication::viewportEvent() being fired too soon.
...
Fixed sad an nasty crashes with GLFW-based apps on Windows.
6 years ago
Vladimír Vondruš
65743b5647
Platform: make it possible to override DPI scaling from the app.
...
This was sadly broken since probably ever. Since it was hard to wrap my
head around this, added also some code to test this.
6 years ago
Vladimír Vondruš
444b925b2a
Platform: implement virtual DPI scaling in GlfwApp on Windows.
...
Until now, both physical and virtual returned the physical DPI scaling.
6 years ago
Vladimír Vondruš
750544e2c2
Platform: update copyright in headers.
6 years ago
Vladimír Vondruš
7d37647897
Platform: print the "HiDPI not enabled" warning at most once on macOS.
...
If the application is constructed with delayed window creation, the
warning would be printed on each context creation attempt / call to
dpiScaling(const Configuration&), which is silly.
6 years ago
Vladimír Vondruš
bbc6102320
Platform: hide internal {Glfw,Sdl2}Application flags from the header.
...
Because things are going to get messy soon (well, in case of SDL2 they
already are).
6 years ago
Vladimír Vondruš
31a7c4f66e
Platform: check for presence of GLFW cursor defines instead of a version.
...
Makes this work on older Git clones which have version set as 3.4 but
don't contain those defines yet.
6 years ago
Marco Melorio
1b1c12a56f
GlfwApplication: added new GLFW 3.4 resizing cursors.
6 years ago
Vladimír Vondruš
e67526abf0
Platform: ability to set window size in Sdl2 and GlfwApplication.
...
It had the min/max size setters added in 2019.10 but this was missing.
6 years ago
Konstantinos Chatzilygeroudis
5e5c5f7945
GlfwApplication: fix for empty env XDG_SESSION_TYPE
7 years ago
Vladimír Vondruš
090c6bb4a7
Platform: window icon management in Glfw and Sdl2Application.
7 years ago
Vladimír Vondruš
51e65aaae0
Platform: respect DPI in setMin/MaxWindowSize().
...
I hope this doesn't break someone's use case.
7 years ago
Konstantinos Chatzilygeroudis
c8d2c33ac6
Fix for Glfw and Wayland crashing when showing the window after being hidden
7 years ago
Konstantinos Chatzilygeroudis
411e349358
GlfwApplication: Workaround for DPI scaling when monitor size is equal to zero
7 years ago
Konstantinos Chatzilygeroudis
756c1242ad
GlfwApplication: add mainLoopIteration similar to Sdl2Application
7 years ago
Vladimír Vondruš
8d9d247573
Platform: deprecate badly designed & useless GlfwApp setCursorMode().
...
I'm not sure who thought making this settable only during app startup
(and never after) is a good idea. Let's use the new setCursor() APIs
instead.
7 years ago
Vladimír Vondruš
a1bca4d8f4
Platform: minor cleanup, doc++, make cursor LUTs file-local.
7 years ago
Marco Melorio
40bfa7ae91
Plaftorm: Add cursor management support
7 years ago
Vladimír Vondruš
305454453d
Platform: fix GLFW context creation on GL-less builds.
7 years ago
Vladimír Vondruš
a61e258d88
Platform: fix {Sdl2,Glfw}Application startup on GL-less builds.
7 years ago
Vladimír Vondruš
89d4a754d5
Platform: add MouseMoveEvent::relativePosition() to Glfw and Emscripten.
...
These toolkits don't support it, but I got really annoyed and so the
apps are emulating it.
7 years ago
Vladimír Vondruš
ad22f463fb
Platform: add {Sdl2,Glfw,Emscripten}Application::setWindowTitle().
...
On Emscripten as well, however I'm keeping the Configuration::setTitle()
a no-op because the title is usually set by the HTML markup already and
so dynamic code implicitly changing it to something else doesn't make
much sense.
7 years ago
Vladimír Vondruš
df6582d948
Platform: ask for debug context if --magnum-gpu-validation is enabled.
...
Also mention the option more prominently in related docs.
7 years ago
Vladimír Vondruš
50902e72d7
Platform: check for non-null GL_VENDOR before comparing it.
...
Otherwise, when context creation fails *really bad*, this crashes
somewhere deep in __strncmp_sse42 or so.
7 years ago
Vladimír Vondruš
f383959fb0
Platform: fix SDL2/GLFW viewportEvent() on Retina-aware {i,mac}OS apps.
7 years ago
Guillaume Jacquemin
b4dac78ef3
Platform: improve {Glfw,Sdl2}Application.
...
Two new methods, setMinWindowSize() and setMaxWindowSize(), were added.
They use the underlying library's API to achieve their purpose.
7 years ago
Guillaume Jacquemin
f4b6130ab0
Platform: improve {Glfw,Sdl2}Application::exit().
...
Now, it's possible to specify a custom exit code.
7 years ago
Vladimír Vondruš
64bc7f9c8e
Math: moved configuration value parsers to a dedicated header.
...
There's a lot of string operations and that's nothing good to have
included everywhere. Should speed up the compilation quite a bit.
7 years ago
Vladimír Vondruš
930a323c05
GL: removed deprecated aliases to GL functionality in the root namespace.
...
Deprecated for 2018.04, it's been almost a year since. Whoever is using
Magnum regularly updated already, and who not can always upgrade
gradually (2018.02, 2018.04, 2018.10, 2019.01 etc.).
7 years ago
Vladimír Vondruš
b168433c4e
Platform: minor cleanup.
7 years ago
Vladimír Vondruš
2253987531
Platform: HiDPI support for SDL2 and GLFW on Windows.
...
Co-authored-by: Guillaume Jacquemin <williamjcm@users.noreply.github.com>
7 years ago
Vladimír Vondruš
d98efb241d
Platform: deduplicate DPI handling code.
...
And compilation of it. It should be enough to have just an OBJECT
library added to each, instead of including a header which includes the
world.
7 years ago
Vladimír Vondruš
053f406b7d
Platform: make SDL2 and GLFW apps buildable without TARGET_GL again.
...
I'm pretty sure this worked correctly in 2018.04.
7 years ago
Thibault Jochem
28e300da02
zero-initialize utf8 buffer.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
3ca13dbc1b
Platform: implement {Glfw,Sdl2}Application::exitEvent().
...
SDL has to be special and behave weirdly, of course, as always.
7 years ago
Vladimír Vondruš
877557fff0
Platform: minor event cleanup in GlfwApplication.
7 years ago
Vladimír Vondruš
1e0d3d3727
Platform: proper feature parity for GlfwApplication::ViewportEvent.
...
Not sure why I omitted this in dba35bac7a .
7 years ago
Vladimír Vondruš
8f55880b6b
Platform: remove deprecated wheel-reported-as-button events.
...
Deprecated in 2a77856df2 (June 2016). Use
the dedicated mouseScrollEvent() API instead.
8 years ago
Vladimír Vondruš
c579060922
Platform: ability to override GL forward compatibility in SDL and GLFW.
...
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.
8 years ago
Vladimír Vondruš
e1e4dbd4c4
Platform: properly fall back to physical DPI scaling.
...
Not sure why I did it this way. For sure wasn't like that in the initial
implementation.
8 years ago
Vladimír Vondruš
5319e6bb1c
Platform: properly initialize a value.
8 years ago
Vladimír Vondruš
674a740da5
Renamed various sRGB-related GL APIs for consistency with naming in Math.
...
As usual, the old names are deprecated aliases to the new things.
8 years ago
Vladimír Vondruš
dba35bac7a
Platform: initial HiDPI support in GlfwApplication.
...
Not basing this off GLFW 3.3 as it's far from being released yet, just a
copy of what's done for SDL2 already.
8 years ago
Vladimír Vondruš
d21c05f6f3
Platform: disallow calling framebufferSize() / windowSize() w/o a window.
8 years ago
Squareys
f832c8df51
Platform: gracefully fail GlfwApplication::exec() if no window was opened
...
Signed-off-by: Squareys <squareys@googlemail.com>
8 years ago
Vladimír Vondruš
47ade4ef53
Platform: make it possible to get scroll position in Glfw and Sdl2App.
8 years ago
Vladimír Vondruš
ed0a719da2
Platform: pass a class to viewportEvent().
...
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.
8 years ago