Browse Source

Platform: notify about hardcoded WebGL canvas size in verbose output.

Very useful for debugging, because doing that is usually wrong.
pull/491/head
Vladimír Vondruš 5 years ago
parent
commit
4547f0a4aa
  1. 6
      doc/changelog.dox
  2. 3
      src/Magnum/Platform/EmscriptenApplication.cpp
  3. 6
      src/Magnum/Platform/Sdl2Application.cpp

6
doc/changelog.dox

@ -185,6 +185,12 @@ See also:
allocation function, which changed signature in 2.0.5 and caused runtime
failures when `-s ASSERTIONS` was enabled. A public stable API is now used
instead, see [mosra/magnum#483](https://github.com/mosra/magnum/pull/483).
- Because hardcoding canvas size using
@ref Platform::EmscriptenApplication::Configuration::setSize() "Platform::Application::Configuration::setSize()"
on WebGL is usually a wrong thing to do, both
@ref Platform::EmscriptenApplication and @ref Platform::Sdl2Application now
notify about that in the verbose output (enabled with `?magnum-log=verbose`),
previously only autodetected canvas size got printed
@subsubsection changelog-latest-changes-shaders Shaders library

3
src/Magnum/Platform/EmscriptenApplication.cpp

@ -404,6 +404,9 @@ bool EmscriptenApplication::tryCreate(const Configuration& configuration, const
Vector2i canvasSize;
if(!configuration.size().isZero()) {
canvasSize = configuration.size();
/* Because hardcoding canvas size for WebGL is usually a wrong thing to
do, notify about that in the verbose output */
Debug{verbose} << "Platform::EmscriptenApplication::tryCreate(): hardcoded canvas size" << canvasSize;
} else {
canvasSize = _lastKnownCanvasSize;
Debug{verbose} << "Platform::EmscriptenApplication::tryCreate(): autodetected canvas size" << canvasSize;

6
src/Magnum/Platform/Sdl2Application.cpp

@ -408,6 +408,9 @@ bool Sdl2Application::tryCreate(const Configuration& configuration) {
Vector2i windowSize;
if(!configuration.size().isZero()) {
windowSize = configuration.size();
/* Because hardcoding canvas size for WebGL is usually a wrong thing to
do, notify about that in the verbose output */
Debug{_verboseLog ? Debug::output() : nullptr} << "Platform::Sdl2Application::tryCreate(): hardcoded canvas size" << windowSize;
} else {
windowSize = _lastKnownCanvasSize;
Debug{_verboseLog ? Debug::output() : nullptr} << "Platform::Sdl2Application::tryCreate(): autodetected canvas size" << windowSize;
@ -636,6 +639,9 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf
Vector2i windowSize;
if(!configuration.size().isZero()) {
windowSize = configuration.size();
/* Because hardcoding canvas size for WebGL is usually a wrong thing to
do, notify about that in the verbose output */
Debug{_verboseLog ? Debug::output() : nullptr} << "Platform::Sdl2Application::tryCreate(): hardcoded canvas size" << windowSize;
} else {
windowSize = _lastKnownCanvasSize;
Debug{_verboseLog ? Debug::output() : nullptr} << "Platform::Sdl2Application::tryCreate(): autodetected canvas size" << windowSize;

Loading…
Cancel
Save