Browse Source

by reference

dev
parent
commit
0a2918a01a
  1. 15
      src/python/magnum/scenegraph.cpp

15
src/python/magnum/scenegraph.cpp

@ -39,14 +39,13 @@ template<UnsignedInt dimensions, class T> struct PyDrawable: SceneGraph::PyFeatu
explicit PyDrawable(SceneGraph::AbstractObject<dimensions, T>& object, SceneGraph::DrawableGroup<dimensions, T>* drawables): SceneGraph::PyFeature<SceneGraph::Drawable<dimensions, T>>{object, drawables} {}
void draw(const MatrixTypeFor<dimensions, T>& transformationMatrix, SceneGraph::Camera<dimensions, T>& camera) override {
PYBIND11_OVERLOAD_PURE_NAME(
void,
PyDrawable,
"draw",
draw,
transformationMatrix,
camera
);
py::gil_scoped_acquire gil;
py::function override = py::get_override(static_cast<const PyDrawable*>(this), "draw");
if(!override) {
py::pybind11_fail("Tried to call pure virtual function \"PyDrawable::draw\"");
}
override(transformationMatrix,
py::cast(&camera, py::return_value_policy::reference));
}
};

Loading…
Cancel
Save