diff --git a/src/python/corrade/containers.cpp b/src/python/corrade/containers.cpp index b207f3f..102e0dc 100644 --- a/src/python/corrade/containers.cpp +++ b/src/python/corrade/containers.cpp @@ -402,6 +402,8 @@ template void mutableStridedArrayView3D(py::class_> arrayView_{m, "ArrayView", "Array view", py::buffer_protocol{}}; arrayView(arrayView_); @@ -446,6 +448,5 @@ void containers(py::module& m) { }} PYBIND11_MODULE(containers, m) { - m.doc() = "Corrade containers module"; corrade::containers(m); } diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 264b391..e8c2640 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -42,6 +42,8 @@ namespace magnum { namespace { void gl(py::module& m) { + m.doc() = "OpenGL wrapping layer"; + py::module::import("corrade.containers"); /* Abstract shader program */ @@ -303,7 +305,5 @@ void gl(py::module& m) { }} PYBIND11_MODULE(gl, m) { - m.doc() = "OpenGL wrapping layer"; - magnum::gl(m); } diff --git a/src/python/magnum/meshtools.cpp b/src/python/magnum/meshtools.cpp index e63dd4e..1a9ffdf 100644 --- a/src/python/magnum/meshtools.cpp +++ b/src/python/magnum/meshtools.cpp @@ -35,6 +35,8 @@ namespace magnum { namespace { void meshtools(py::module& m) { + m.doc() = "Mesh tools"; + py::module::import("magnum.gl"); py::module::import("magnum.trade"); @@ -50,7 +52,5 @@ void meshtools(py::module& m) { }} PYBIND11_MODULE(meshtools, m) { - m.doc() = "Mesh tools"; - magnum::meshtools(m); } diff --git a/src/python/magnum/platform/egl.cpp b/src/python/magnum/platform/egl.cpp index c1b291d..d59c10f 100644 --- a/src/python/magnum/platform/egl.cpp +++ b/src/python/magnum/platform/egl.cpp @@ -34,6 +34,8 @@ namespace magnum { namespace platform { namespace { int argc = 0; void egl(py::module& m) { + m.doc() = "EGL-based platform integration"; + struct PyWindowlessApplication: Platform::WindowlessApplication { explicit PyWindowlessApplication(const Configuration& configuration = Configuration{}): Platform::WindowlessApplication{Arguments{argc, nullptr}, configuration} {} @@ -54,7 +56,5 @@ void egl(py::module& m) { }}} PYBIND11_MODULE(egl, m) { - m.doc() = "EGL-based platform integration"; - magnum::platform::egl(m); } diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index cda5611..2a38fc6 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -34,6 +34,8 @@ namespace magnum { namespace platform { namespace { int argc = 0; void glfw(py::module& m) { + m.doc() = "GLFW-based platform integration"; + struct PublicizedApplication: Platform::Application { explicit PublicizedApplication(const Configuration& configuration, const GLConfiguration& glConfiguration): Platform::Application{Arguments{argc, nullptr}, configuration, glConfiguration} {} @@ -106,7 +108,5 @@ void glfw(py::module& m) { }}} PYBIND11_MODULE(glfw, m) { - m.doc() = "GLFW-based platform integration"; - magnum::platform::glfw(m); } diff --git a/src/python/magnum/platform/glx.cpp b/src/python/magnum/platform/glx.cpp index 21631e6..48c1ab1 100644 --- a/src/python/magnum/platform/glx.cpp +++ b/src/python/magnum/platform/glx.cpp @@ -34,6 +34,8 @@ namespace magnum { namespace platform { namespace { int argc = 0; void glx(py::module& m) { + m.doc() = "GLX-based platform integration"; + struct PyWindowlessApplication: Platform::WindowlessApplication { explicit PyWindowlessApplication(const Configuration& configuration = Configuration{}): Platform::WindowlessApplication{Arguments{argc, nullptr}, configuration} {} @@ -54,7 +56,5 @@ void glx(py::module& m) { }}} PYBIND11_MODULE(glx, m) { - m.doc() = "GLX-based platform integration"; - magnum::platform::glx(m); } diff --git a/src/python/magnum/platform/sdl2.cpp b/src/python/magnum/platform/sdl2.cpp index 26d83dd..5e94c8d 100644 --- a/src/python/magnum/platform/sdl2.cpp +++ b/src/python/magnum/platform/sdl2.cpp @@ -34,6 +34,8 @@ namespace magnum { namespace platform { namespace { int argc = 0; void sdl2(py::module& m) { + m.doc() = "SDL2-based platform integration"; + struct PublicizedApplication: Platform::Application { explicit PublicizedApplication(const Configuration& configuration, const GLConfiguration& glConfiguration): Platform::Application{Arguments{argc, nullptr}, configuration, glConfiguration} {} @@ -114,7 +116,5 @@ void sdl2(py::module& m) { }}} PYBIND11_MODULE(sdl2, m) { - m.doc() = "SDL2-based platform integration"; - magnum::platform::sdl2(m); } diff --git a/src/python/magnum/primitives.cpp b/src/python/magnum/primitives.cpp index 79edce6..d16252f 100644 --- a/src/python/magnum/primitives.cpp +++ b/src/python/magnum/primitives.cpp @@ -34,6 +34,8 @@ namespace magnum { namespace { void primitives(py::module& m) { + m.doc() = "Primitive library"; + py::module::import("magnum.trade"); py::enum_{m, "SquareTextureCoords", "Whether to generate square texture coordinates"} @@ -52,7 +54,5 @@ void primitives(py::module& m) { }} PYBIND11_MODULE(primitives, m) { - m.doc() = "Primitive library"; - magnum::primitives(m); } diff --git a/src/python/magnum/scenegraph.cpp b/src/python/magnum/scenegraph.cpp index e609f04..e744db4 100644 --- a/src/python/magnum/scenegraph.cpp +++ b/src/python/magnum/scenegraph.cpp @@ -121,6 +121,8 @@ template void camera(py::class_ void vertexColor(NonDestructibleBase void meshData(py::class_& c) { } void trade(py::module& m) { + m.doc() = "Data format exchange"; + py::class_ meshData2D{m, "MeshData2D", "Two-dimensional mesh data"}; py::class_ meshData3D{m, "MeshData3D", "Three-dimensional mesh data"}; meshData(meshData2D); @@ -47,7 +49,5 @@ void trade(py::module& m) { }} PYBIND11_MODULE(trade, m) { - m.doc() = "Data format exchange"; - magnum::trade(m); }