MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / registerScriptBindings

Method registerScriptBindings

Source/Falcor/Core/SampleApp.cpp:624–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622}
623
624void 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

Callers 1

startScriptingMethod · 0.95

Calls 5

shutdownMethod · 0.95
renderFrameMethod · 0.95
getWindowFunction · 0.85
setWindowPosMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected