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

Method loadImage

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

Source from the content-addressed store, hash-verified

850}
851
852const Texture* GuiImpl::loadImage(const std::filesystem::path& path)
853{
854 auto it = mLoadedImages.find(path);
855 if (it != mLoadedImages.end())
856 return it->second.get();
857
858 ref<Texture> pTex = Texture::createFromFile(mpDevice, path, false, true);
859 if (!pTex)
860 FALCOR_THROW("Failed to load GUI image from '{}'.", path);
861 return mLoadedImages.emplace(path, pTex).first->second.get();
862}
863
864void GuiImpl::addImage(const char label[], const Texture* pTex, float2 size, bool maintainRatio, bool sameLine)
865{

Callers 1

renderUIMethod · 0.45

Calls 2

endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected