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

Method onWindowResize

Source/Falcor/Utils/UI/Gui.cpp:1343–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341}
1342
1343void Gui::onWindowResize(uint32_t width, uint32_t height)
1344{
1345 ImGui::SetCurrentContext(mpWrapper->mpContext);
1346 ImGuiIO& io = ImGui::GetIO();
1347 io.DisplaySize.x = (float)width;
1348 io.DisplaySize.y = (float)height;
1349 auto var = mpWrapper->mpProgramVars->getRootVar()["PerFrameCB"];
1350#ifdef FALCOR_FLIP_Y
1351 var["scale"] = 2.0f / float2(io.DisplaySize.x, io.DisplaySize.y);
1352 var["offset"] = float2(-1.0f);
1353#else
1354 var["scale"] = 2.0f / float2(io.DisplaySize.x, -io.DisplaySize.y);
1355 var["offset"] = float2(-1.0f, 1.0f);
1356#endif
1357}
1358
1359bool Gui::onMouseEvent(const MouseEvent& event)
1360{

Callers 2

resizeTargetFBOMethod · 0.80
resizeTargetFBOMethod · 0.80

Calls 1

getRootVarMethod · 0.80

Tested by 1

resizeTargetFBOMethod · 0.64