Browse Source

Platform: add tests for setMin/MaxWindowSize().

DPI scaling is not respected and viewport event is not fired on SDL.
Ugh.
pull/397/head
Vladimír Vondruš 7 years ago
parent
commit
3e4646f4be
  1. 9
      src/Magnum/Platform/Test/GlfwApplicationTest.cpp
  2. 9
      src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp

9
src/Magnum/Platform/Test/GlfwApplicationTest.cpp

@ -61,7 +61,14 @@ struct GlfwApplicationTest: Platform::Application {
} else if(event.key() == KeyEvent::Key::T) {
Debug{} << "setting window title";
setWindowTitle("This is a UTF-8 Window Title™!");
} else if(event.key() == KeyEvent::Key::H) {
}
#if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302
else if(event.key() == KeyEvent::Key::W) {
Debug{} << "setting max window size, which should trigger a viewport event if the size changes";
setMaxWindowSize(Vector2i{700, 500});
}
#endif
else if(event.key() == KeyEvent::Key::H) {
Debug{} << "toggling hand cursor";
setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow);
} else if(event.key() == KeyEvent::Key::L) {

9
src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp

@ -86,7 +86,14 @@ struct Sdl2ApplicationTest: Platform::Application {
} else if(event.key() == KeyEvent::Key::T) {
Debug{} << "setting window title";
setWindowTitle("This is a UTF-8 Window Title™!");
} else if(event.key() == KeyEvent::Key::H) {
}
#ifndef CORRADE_TARGET_EMSCRIPTEN
else if(event.key() == KeyEvent::Key::W) {
Debug{} << "setting max window size, which should trigger a viewport event";
setMaxWindowSize(Vector2i{700, 500});
}
#endif
else if(event.key() == KeyEvent::Key::H) {
Debug{} << "toggling hand cursor";
setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow);
}

Loading…
Cancel
Save