diff --git a/doc/python/pages/changelog.rst b/doc/python/pages/changelog.rst index a43c71e..93ac88a 100644 --- a/doc/python/pages/changelog.rst +++ b/doc/python/pages/changelog.rst @@ -80,6 +80,8 @@ Changelog to make the window resizable on startup - Exposed :ref:`platform.sdl2.Application.exit_event` and :ref:`platform.glfw.Application.exit_event` +- Exposed :ref:`platform.glfw.Application.swap_interval` and + :ref:`platform.glfw.Application.main_loop_iteration` - Exposed :ref:`Color3.red()` and other convenience constructors (see :gh:`mosra/magnum-bindings#12`) - Fixed issues with an in-source build (see :gh:`mosra/magnum-bindings#13`) diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index 4a5324b..3bba190 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -188,7 +188,12 @@ void glfw(py::module_& m) { }; py::class_> glfwApplication{m, "Application", "GLFW application"}; - /** @todo def_property_writeonly for swap_interval */ + glfwApplication + .def_property("swap_interval", nullptr, + [](PublicizedApplication& self, Int interval) { + self.setSwapInterval(interval); + }, "Swap interval") + .def("main_loop_iteration", &PyApplication::mainLoopIteration, "Run one iteration of application main loop"); PyNonDestructibleClass exitEvent_{glfwApplication, "ExitEvent", "Exit event"}; PyNonDestructibleClass viewportEvent_{glfwApplication, "ViewportEvent", "Viewport event"};