From 033e0c17bc62e5f7b571ec323153d443b5a6c997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 15 Sep 2019 11:25:07 +0200 Subject: [PATCH] python: minor code cleanup. Or also making the code coverage happier, since that damn thing reports uncovered lines when the chained function call is wrapped on multiple lines. FFS. --- src/python/magnum/gl.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 506f938..ad14eff 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -244,6 +244,7 @@ void gl(py::module& m) { GL object labels limit queries + wrap/release of underlying GL object IDs */ m.doc() = "OpenGL wrapping layer"; @@ -467,14 +468,10 @@ void gl(py::module& m) { attribute .def(py::init(), "Constructor", py::arg("kind"), py::arg("location"), py::arg("components"), py::arg("data_type")) - .def_property_readonly("kind", &GL::DynamicAttribute::kind, - "Attribute kind") - .def_property_readonly("location", &GL::DynamicAttribute::location, - "Attribute location") - .def_property_readonly("components", &GL::DynamicAttribute::components, - "Component count") - .def_property_readonly("data_type", &GL::DynamicAttribute::dataType, - "Type of passed data"); + .def_property_readonly("kind", &GL::DynamicAttribute::kind, "Attribute kind") + .def_property_readonly("location", &GL::DynamicAttribute::location, "Attribute location") + .def_property_readonly("components", &GL::DynamicAttribute::components, "Component count") + .def_property_readonly("data_type", &GL::DynamicAttribute::dataType, "Type of passed data"); /* Buffer */ py::enum_{m, "BufferUsage", "Buffer usage"} @@ -529,7 +526,6 @@ void gl(py::module& m) { buffer /** @todo limit queries */ - .def(py::init(), "Constructor", py::arg("target_hint") = GL::Buffer::TargetHint::Array) .def_property_readonly("id", &GL::Buffer::id, "OpenGL buffer ID") .def_property("target_hint", &GL::Buffer::targetHint, &GL::Buffer::setTargetHint, "Target hint") @@ -657,16 +653,13 @@ void gl(py::module& m) { abstractFramebuffer /** @todo limit queries */ - .def("bind", &GL::AbstractFramebuffer::bind, - "Bind framebuffer for drawing") - .def_property("viewport", &GL::AbstractFramebuffer::viewport, &GL::AbstractFramebuffer::setViewport, - "Viewport") + .def("bind", &GL::AbstractFramebuffer::bind, "Bind framebuffer for drawing") + .def_property("viewport", &GL::AbstractFramebuffer::viewport, &GL::AbstractFramebuffer::setViewport, "Viewport") /* Using lambdas to avoid method chaining getting into signatures */ .def("clear", [](GL::AbstractFramebuffer& self, GL::FramebufferClear mask) { self.clear(mask); }, "Clear specified buffers in the framebuffer") - .def("read", static_cast(&GL::AbstractFramebuffer::read), - "Read block of pixels from the framebuffer to an image view") + .def("read", static_cast(&GL::AbstractFramebuffer::read), "Read block of pixels from the framebuffer to an image view") /** @todo more */; py::class_> defaultFramebuffer{m,