diff --git a/src/python/magnum/platform/application.h b/src/python/magnum/platform/application.h index 55a8a80..2a9f386 100644 --- a/src/python/magnum/platform/application.h +++ b/src/python/magnum/platform/application.h @@ -38,7 +38,19 @@ namespace magnum { namespace platform { template void configuration(py::class_& c) { c - .def(py::init()) + .def(py::init([](const std::string& title, const Vector2i& size, typename T::WindowFlag windowFlags) { + return T{} + .setTitle(title) + .setSize(size) + .setWindowFlags(windowFlags); + }), "Constructor", + #if PYBIND11_VERSION_MAJOR*100 + PYBIND11_VERSION_MINOR >= 206 + py::kw_only{}, /* new in pybind11 2.6 */ + #endif + /** @todo drop std::string in favor of our own string caster */ + py::arg("title") = std::string{T{}.title()}, + py::arg("size") = T{}.size(), + py::arg("window_flags") = typename T::WindowFlag(typename std::underlying_type::type(T{}.windowFlags()))) .def_property("title", /** @todo drop std::string in favor of our own string caster */ [](T& self) -> std::string { @@ -64,7 +76,7 @@ template void configuration(py::class_& c) { template void application(py::class_& c) { py::class_ glConfiguration{c, "GLConfiguration", "OpenGL context configuration"}; glConfiguration - .def(py::init()); + .def(py::init(), "Constructor"); /** @todo others */ c