From 7c3aa758300b6dbcdbb7f287e70b071d90620baa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 24 May 2021 18:45:36 -0400 Subject: Add fancy constructor for C++ events and wrap puglSendEvent() --- examples/pugl_cpp_demo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/pugl_cpp_demo.cpp b/examples/pugl_cpp_demo.cpp index e49c416..552094f 100644 --- a/examples/pugl_cpp_demo.cpp +++ b/examples/pugl_cpp_demo.cpp @@ -66,7 +66,12 @@ CubeView::onEvent(const pugl::ConfigureEvent& event) noexcept pugl::Status CubeView::onEvent(const pugl::UpdateEvent&) noexcept { - return postRedisplay(); + // Normally, we would post a redisplay: + // return postRedisplay(); + + // But for testing, use sendEvent() instead: + return sendEvent( + pugl::ExposeEvent{0u, 0.0, 0.0, frame().width, frame().height}); } pugl::Status -- cgit v1.2.1