From b04aa48c032fd955e8f0067492b28c21202bfa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 9 Apr 2020 16:11:54 +0200 Subject: [PATCH] Platform: do at least something in the test draw event. To indicate the event handler was triggered. --- src/Magnum/Platform/Test/GlfwApplicationTest.cpp | 5 ++++- src/Magnum/Platform/Test/GlxApplicationTest.cpp | 6 +++++- src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp | 7 +++++-- src/Magnum/Platform/Test/XEglApplicationTest.cpp | 6 +++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp index 3ed9913ff..380329f7f 100644 --- a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp +++ b/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 diff --git a/src/Magnum/Platform/Test/GlxApplicationTest.cpp b/src/Magnum/Platform/Test/GlxApplicationTest.cpp index 8e9e345b4..14781d45a 100644 --- a/src/Magnum/Platform/Test/GlxApplicationTest.cpp +++ b/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(); + } }; }}}} diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index a16ad9ddf..54f83f1c0 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/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()); diff --git a/src/Magnum/Platform/Test/XEglApplicationTest.cpp b/src/Magnum/Platform/Test/XEglApplicationTest.cpp index 7823aea1b..b6c2dd33b 100644 --- a/src/Magnum/Platform/Test/XEglApplicationTest.cpp +++ b/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(); + } }; }}}}