Browse Source

Merge branch 'master' of https://github.com/mosra/magnum-bindings into pyArrayHolderMissingMove

pull/17/head
Aaron Gokaslan 4 years ago
parent
commit
0f062d0d1d
  1. 1
      doc/python/conf.py
  2. 3
      doc/python/pages/changelog.rst
  3. 9
      doc/python/pages/developers.rst
  4. 10
      src/python/magnum/gl.cpp
  5. 2
      src/python/magnum/platform/cgl.cpp
  6. 2
      src/python/magnum/platform/egl.cpp
  7. 2
      src/python/magnum/platform/glfw.cpp
  8. 2
      src/python/magnum/platform/glx.cpp
  9. 2
      src/python/magnum/platform/sdl2.cpp
  10. 2
      src/python/magnum/platform/wgl.cpp

1
doc/python/conf.py

@ -164,6 +164,7 @@ INPUT_PAGES = [
'pages/api-conventions.rst', 'pages/api-conventions.rst',
'pages/changelog.rst', 'pages/changelog.rst',
'pages/credits.rst', 'pages/credits.rst',
'pages/developers.rst',
'../../../magnum-examples/doc/python/examples.rst' '../../../magnum-examples/doc/python/examples.rst'
] ]

3
doc/python/pages/changelog.rst

@ -67,7 +67,8 @@ Changelog
issues with shitty IDE indexers such as Eclipse, confusing these with issues with shitty IDE indexers such as Eclipse, confusing these with
Python's ``<Python.h>`` Python's ``<Python.h>``
- Minor performance fixes (see :gh:`mosra/magnum-bindings#10`, - Minor performance fixes (see :gh:`mosra/magnum-bindings#10`,
:gh:`mosra/magnum-bindings#15`) :gh:`mosra/magnum-bindings#15`,
:gh:`mosra/magnum-bindings#16`)
Travis banned everyone from using their CI and so all Linux and macOS Travis banned everyone from using their CI and so all Linux and macOS
builds were migrated from Travis to Circle CI. See also builds were migrated from Travis to Circle CI. See also
:gh:`mosra/magnum#350` and :gh:`mosra/magnum#523`. :gh:`mosra/magnum#350` and :gh:`mosra/magnum#523`.

9
doc/python/pages/developers.rst

@ -30,7 +30,14 @@ Developers Guide
corrade corrade
magnum magnum
:summary: Checklists for developing new things in Magnum Python bindings :summary: Checklists for developing new things in Magnum Python bindings
themselves themselves.
.. role:: cmake(code)
:language: cmake
.. role:: cpp(code)
:language: c++
.. role:: py(code)
:language: py
`Checklist for adding / removing bindings for a library`_ `Checklist for adding / removing bindings for a library`_
========================================================= =========================================================

10
src/python/magnum/gl.cpp

@ -364,10 +364,10 @@ void gl(py::module_& m) {
corrade::enumOperators(contextDetectedDriver); corrade::enumOperators(contextDetectedDriver);
context context
.def_property_readonly_static("has_current", [](py::object) { .def_property_readonly_static("has_current", [](const py::object&) {
return GL::Context::hasCurrent(); return GL::Context::hasCurrent();
}, "Whether there is any current context") }, "Whether there is any current context")
.def_property_readonly_static("current", [](py::object) { .def_property_readonly_static("current", [](const py::object&) {
if(!GL::Context::hasCurrent()) { if(!GL::Context::hasCurrent()) {
PyErr_SetString(PyExc_RuntimeError, "no current context"); PyErr_SetString(PyExc_RuntimeError, "no current context");
throw py::error_already_set{}; throw py::error_already_set{};
@ -901,7 +901,7 @@ void gl(py::module_& m) {
.def(py::init<MeshPrimitive>(), "Constructor", py::arg("primitive")) .def(py::init<MeshPrimitive>(), "Constructor", py::arg("primitive"))
.def_property_readonly("id", &GL::Mesh::id, "OpenGL vertex array ID") .def_property_readonly("id", &GL::Mesh::id, "OpenGL vertex array ID")
.def_property("primitive", &GL::Mesh::primitive, .def_property("primitive", &GL::Mesh::primitive,
[](GL::Mesh& self, py::object primitive) { [](GL::Mesh& self, const py::object &primitive) {
if(py::isinstance<MeshPrimitive>(primitive)) if(py::isinstance<MeshPrimitive>(primitive))
self.setPrimitive(py::cast<MeshPrimitive>(primitive)); self.setPrimitive(py::cast<MeshPrimitive>(primitive));
else if(py::isinstance<GL::MeshPrimitive>(primitive)) else if(py::isinstance<GL::MeshPrimitive>(primitive))
@ -1100,10 +1100,10 @@ void gl(py::module_& m) {
#endif #endif
/** @todo FFS why do I have to pass the class as first argument?! */ /** @todo FFS why do I have to pass the class as first argument?! */
.def_property_static("clear_color", nullptr, [](py::object, const Color4& color) { .def_property_static("clear_color", nullptr, [](const py::object&, const Color4& color) {
GL::Renderer::setClearColor(color); GL::Renderer::setClearColor(color);
}, "Set clear color") }, "Set clear color")
.def_property_readonly_static("error", [](py::object) { .def_property_readonly_static("error", [](const py::object&) {
return GL::Renderer::error(); return GL::Renderer::error();
}, "Error status"); }, "Error status");
} }

2
src/python/magnum/platform/cgl.cpp

@ -63,7 +63,7 @@ void cgl(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {} virtual ~PyWindowlessApplication() = default;
}; };
py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless CGL application"}; py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless CGL application"};

2
src/python/magnum/platform/egl.cpp

@ -63,7 +63,7 @@ void egl(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {} virtual ~PyWindowlessApplication() = default;
}; };
py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"}; py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"};

2
src/python/magnum/platform/glfw.cpp

@ -64,7 +64,7 @@ void glfw(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PublicizedApplication() {} virtual ~PublicizedApplication() = default;
}; };
struct PyApplication: PublicizedApplication { struct PyApplication: PublicizedApplication {

2
src/python/magnum/platform/glx.cpp

@ -63,7 +63,7 @@ void glx(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {} virtual ~PyWindowlessApplication() = default;
}; };
py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"}; py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"};

2
src/python/magnum/platform/sdl2.cpp

@ -64,7 +64,7 @@ void sdl2(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PublicizedApplication() {} virtual ~PublicizedApplication() = default;
}; };
struct PyApplication: PublicizedApplication { struct PyApplication: PublicizedApplication {

2
src/python/magnum/platform/wgl.cpp

@ -63,7 +63,7 @@ void wgl(py::module_& m) {
/* The base doesn't have a virtual destructor because in C++ it's never /* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */ deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {} virtual ~PyWindowlessApplication() = default;
}; };
py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessWglApplication{m, "WindowlessApplication", "Windowless WGL application"}; py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessWglApplication{m, "WindowlessApplication", "Windowless WGL application"};

Loading…
Cancel
Save