Pablo Escobar
1fd365773a
Platform: update {Emscripten,Sdl2}App cursor using Module['canvas'].
6 years ago
Vladimír Vondruš
832f0ae3fc
Platform: don't hardcode ID in {Emscripten,Sdl}App::setContainerCssClass().
...
Instead look for a closest parent element of our <canvas> having the
.mn-container class. This should thus work for more than one canvas on a
page.
6 years ago
Vladimír Vondruš
cd48c59cab
Remove remaining APIs deprecated in 2018.10.
6 years ago
Vladimír Vondruš
19e0e96d74
Updated copyright year.
6 years ago
Vladimír Vondruš
e7838a8b9e
Platform: check before calling SDL_DestroyWindow().
...
Can cause a crash when exiting from constructor on Windows (but not on
Linux). To be safe do the same for all others.
6 years ago
Vladimír Vondruš
68559411fc
Platform: drop the forward compatible flag for fallback GLX 2.1 context.
...
Same is already done in the GLFW and SDL2 app. Also updated the comments
to clarify why is it done (instead of an "I have no idea" TODO).
6 years ago
Vladimír Vondruš
65a2ced2a7
Make this compile and test cleanly with CORRADE_NO_ASSERT defined.
6 years ago
Vladimír Vondruš
d3f2235759
Adapted to Corrade changes.
6 years ago
Vladimír Vondruš
e6dc5be1af
Platform: default to 32-bit RGBA framebuffer instead of 24-bit RGB.
...
macOS and Android is known to degrade 24-bit to 16-bit colors, this
prevents them from doing that.
6 years ago
Vladimír Vondruš
2149e78f82
Platform: make *Application::exit() exit right after constructor ends.
...
Instead of first entering the main loop, processing events etc. This
also makes it finally possible to exit the application cleanly, with all
non-global destructors executed as well.
6 years ago
Vladimír Vondruš
ad9b9f5a3d
Platform: ensure Sdl2Application has a window opened in the main loop.
...
Same is done in GlfwApplication, and not doing so makes no sense.
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š
c3878c9bf1
Platform: implement physical DPI scaling in Sdl2App on Windows.
...
Yes, because it's exactly the other way for SDL. You know, consistency
and all. FFS.
6 years ago
Vladimír Vondruš
5cbd6bdf85
Platform: use an Optional for lazy-loaded event properties in Sdl2App.
...
It was done like this in GlfwApp and elsewhere, this is probably a
remmant from earlier pre-Optional times.
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š
9d5064c857
Platform: fix Sdl2Application::setSwapInterval(0) + setMinLoopPeriod().
...
It thought VSync was enabled even when it was set to 0. Also clarified
the docs a bit.
6 years ago
Vladimír Vondruš
d64a67ab63
Platform: this error message was beyond useless.
6 years ago
Vladimír Vondruš
32eb99890e
Platform: silence clang-cl warnings from internal SDL headers.
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
Vladimír Vondruš
86c7486402
Platform: fix non-deprecated build.
...
Breakage introduced by the recent window icon addition.
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
Vladimír Vondruš
322a57e88c
Platform: properly fire Sdl2Application::viewportEvent() in all cases.
...
The event wasn't fired when the window size got changed through an API
call. Unfortunately after this change the event gets fired any time
I call setMaxWindowSize(), not just when the size changes.
7 years ago
Vladimír Vondruš
c4e3e3c045
Platform: deprecate Sdl2Application::setMouseLocked().
...
Now also handled by the new setCursor() APIs.
7 years ago
Vladimír Vondruš
04827d3743
Platform: Emscripten support for cursors in Sdl2Application.
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š
35bf229ed5
Platform: add Sdl2Application::Configuration::WindowFlag::{OpenGL,Vulkan}.
7 years ago
Vladimír Vondruš
82f53862e1
Platform: Sdl2Application::mainLoopIteration() now returns a bool.
...
To indicate when the app desires to exit.
7 years ago
Vladimír Vondruš
6ba9bf529a
Platform: doc++
7 years ago
Vladimír Vondruš
64ad4a566a
Platform: fix Sdl2Application on Emscripten with TARGET_GL disabled.
...
An old TODO.
7 years ago
Vladimír Vondruš
a61e258d88
Platform: fix {Sdl2,Glfw}Application startup on GL-less builds.
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š
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š
39678dac09
Platforms: update Emscripten markup for 1.38.27 and up.
...
This took me a while -- the old behavior for all emscripten_*()
functions was to take a DOM element ID as an argument, with nullptr
acting as a "the element that makes most sense for given operation". The
new behavior when -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 is
enabled is to take a CSS selector instead. Presence of this option is
not detectable at compile time, so there was no easy way of knowing
what's the expected value, whether `"module"` or `"#module"`.
After a few failed attempts, I discoverd that using `"#canvas"` would
work for both the old and the new version -- in the new version it would
be selecting an element with id="canvas", while in the old version it
was a special value denoting Module['canvas']. Problem was, however,
that the markup was historically using id="module" and not id="canvas",
so this had to be changed.
This is a breaking change affecting everyone who targets Emscripten. You
need to update the HTML markup and, in case you maintain copies or forks
of the CSS and JS files, these as well. Details in the changelog.
7 years ago
Vladimír Vondruš
80f37d5262
Platforms: Pointer_stringify() is no more.
7 years ago
Vladimír Vondruš
9005b3c9aa
Platform: expose also window events via Sdl2Application::anyEvent().
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
Vladimír Vondruš
d7d65db884
Platform: hint SDL what GLES library we want to use.
7 years ago
Vladimír Vondruš
20a55b16aa
Platform: implement Sdl2Application::anyEvent(), expose SDL_Event.
7 years ago