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

Method addImageButton

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

Source from the content-addressed store, hash-verified

879}
880
881bool GuiImpl::addImageButton(const char label[], const Texture* pTex, float2 size, bool maintainRatio, bool sameLine)
882{
883 FALCOR_ASSERT(pTex);
884 if (sameLine)
885 ImGui::SameLine();
886 float aspectRatio = maintainRatio ? (static_cast<float>(pTex->getHeight()) / static_cast<float>(pTex->getWidth())) : 1.0f;
887 return ImGui::ImageButton((ImTextureID)(pTex), {size.x, maintainRatio ? size.x * aspectRatio : size.y});
888}
889
890template<typename T>
891bool addScalarVarHelper(

Callers 1

imageButtonMethod · 0.80

Calls 2

getHeightMethod · 0.80
getWidthMethod · 0.80

Tested by

no test coverage detected