Browse Source

Platform: do at least something in the test draw event.

To indicate the event handler was triggered.
pull/434/head
Vladimír Vondruš 6 years ago
parent
commit
b04aa48c03
  1. 5
      src/Magnum/Platform/Test/GlfwApplicationTest.cpp
  2. 6
      src/Magnum/Platform/Test/GlxApplicationTest.cpp
  3. 7
      src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp
  4. 6
      src/Magnum/Platform/Test/XEglApplicationTest.cpp

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

@ -54,7 +54,10 @@ struct GlfwApplicationTest: Platform::Application {
event.setAccepted(); /* Comment-out to test app exit suppression */
}
void drawEvent() override {}
void drawEvent() override {
Debug{} << "draw event";
swapBuffers();
}
void keyPressEvent(KeyEvent& event) override {
#if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302

6
src/Magnum/Platform/Test/GlxApplicationTest.cpp

@ -29,7 +29,11 @@ namespace Magnum { namespace Platform { namespace Test { namespace {
struct GlxApplicationTest: Platform::Application {
explicit GlxApplicationTest(const Arguments& arguments): Platform::Application{arguments} {}
void drawEvent() override {}
void drawEvent() override {
Debug{} << "draw event";
swapBuffers();
}
};
}}}}

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

@ -57,8 +57,6 @@ struct Sdl2ApplicationTest: Platform::Application {
event.setAccepted(); /* Comment-out to test app exit suppression */
}
void drawEvent() override {}
/* For testing HiDPI resize events */
void viewportEvent(ViewportEvent& event) override {
Debug{} << "viewport event" << event.windowSize()
@ -68,6 +66,11 @@ struct Sdl2ApplicationTest: Platform::Application {
<< event.dpiScaling();
}
void drawEvent() override {
Debug{} << "draw event";
swapBuffers();
}
/* For testing event coordinates */
void mousePressEvent(MouseEvent& event) override {
Debug{} << "mouse press event:" << event.position() << Int(event.button());

6
src/Magnum/Platform/Test/XEglApplicationTest.cpp

@ -29,7 +29,11 @@ namespace Magnum { namespace Platform { namespace Test { namespace {
struct XEglApplicationTest: Platform::Application {
explicit XEglApplicationTest(const Arguments& arguments): Platform::Application{arguments} {}
void drawEvent() override {}
void drawEvent() override {
Debug{} << "draw event";
swapBuffers();
}
};
}}}}

Loading…
Cancel
Save