MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / getTexture

Function getTexture

TheForceEngine/TFE_Ui/markdown.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 TextureGpu* getTexture(const char* path)
91 {
92 TextureMap::iterator iTexture = s_textures.find(path);
93 if (iTexture != s_textures.end())
94 {
95 return iTexture->second;
96 }
97
98 const SDL_Surface* image = TFE_Image::get(path);
99 if (!image) { return nullptr; }
100
101 TextureGpu* texture = TFE_RenderBackend::createTexture(image->w, image->h, (u32*)image->pixels);
102 if (texture) { s_textures[path] = texture; }
103 return texture;
104 }
105
106 ImGui::MarkdownImageData imageCallback(ImGui::MarkdownLinkCallbackData data)
107 {

Callers 2

imageCallbackFunction · 0.70
bindMethod · 0.50

Calls 3

getFunction · 0.50
createTextureFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected