1 | #ifdef NANOGUI_PYTHON |
2 | |
3 | #include "python.h" |
4 | |
5 | class PyGLCanvas : public GLCanvas { |
6 | public: |
7 | using GLCanvas::GLCanvas; |
8 | NANOGUI_WIDGET_OVERLOADS(GLCanvas); |
9 | |
10 | void drawGL() { |
11 | PYBIND11_OVERLOAD(void, GLCanvas, drawGL); |
12 | } |
13 | }; |
14 | |
15 | void register_glcanvas(py::module &m) { |
16 | py::class_<GLCanvas, Widget, ref<GLCanvas>, PyGLCanvas> glcanvas(m, "GLCanvas" , D(GLCanvas)); |
17 | glcanvas |
18 | .def(py::init<Widget *>(), py::arg("parent" ), D(GLCanvas, GLCanvas)) |
19 | .def("backgroundColor" , &GLCanvas::backgroundColor, D(GLCanvas, backgroundColor)) |
20 | .def("setBackgroundColor" , &GLCanvas::setBackgroundColor, D(GLCanvas, setBackgroundColor)) |
21 | .def("drawBorder" , &GLCanvas::drawBorder, D(GLCanvas, drawBorder)) |
22 | .def("setDrawBorder" , &GLCanvas::setDrawBorder, D(GLCanvas, setDrawBorder)) |
23 | .def("drawGL" , &GLCanvas::drawGL, D(GLCanvas, drawGL)); |
24 | } |
25 | |
26 | #endif |
27 | |