| 622 | } |
| 623 | |
| 624 | void SampleApp::registerScriptBindings(pybind11::module& m) |
| 625 | { |
| 626 | using namespace pybind11::literals; |
| 627 | |
| 628 | auto exit = [this](int32_t errorCode) { this->shutdown(errorCode); }; |
| 629 | m.def("exit", exit, "errorCode"_a = 0); |
| 630 | |
| 631 | auto renderFrame = [this]() |
| 632 | { |
| 633 | mProgressBar.close(); |
| 634 | this->renderFrame(); |
| 635 | }; |
| 636 | m.def("renderFrame", renderFrame); |
| 637 | |
| 638 | auto setWindowPos = [this](int32_t x, int32_t y) |
| 639 | { |
| 640 | if (auto pWindow = getWindow()) |
| 641 | pWindow->setWindowPos(x, y); |
| 642 | }; |
| 643 | m.def("setWindowPos", setWindowPos, "x"_a, "y"_a); |
| 644 | |
| 645 | auto resize = [this](uint32_t width, uint32_t height) { resizeFrameBuffer(width, height); }; |
| 646 | m.def("resizeSwapChain", resize, "width"_a, "height"_a); // PYTHONDEPRECATED |
| 647 | m.def("resizeFrameBuffer", resize, "width"_a, "height"_a); |
| 648 | } |
| 649 | } // namespace Falcor |
no test coverage detected