MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImFontAtlasBuildSetTexture

Function ImFontAtlasBuildSetTexture

imgui_tiny_app/imgui/imgui_draw.cpp:4021–4029  ·  view source on GitHub ↗

Set current texture. This is mostly called from AddTexture() + to handle a failed resize.

Source from the content-addressed store, hash-verified

4019
4020// Set current texture. This is mostly called from AddTexture() + to handle a failed resize.
4021static void ImFontAtlasBuildSetTexture(ImFontAtlas* atlas, ImTextureData* tex)
4022{
4023 ImTextureRef old_tex_ref = atlas->TexRef;
4024 atlas->TexData = tex;
4025 atlas->TexUvScale = ImVec2(1.0f / tex->Width, 1.0f / tex->Height);
4026 atlas->TexRef._TexData = tex;
4027 //atlas->TexRef._TexID = tex->TexID; // <-- We intentionally don't do that. It would be misleading and betray promise that both fields aren't set.
4028 ImFontAtlasUpdateDrawListsTextures(atlas, old_tex_ref, atlas->TexRef);
4029}
4030
4031// Create a new texture, discard previous one
4032ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h)

Callers 2

ImFontAtlasTextureAddFunction · 0.85
ImFontAtlasTextureRepackFunction · 0.85

Calls 2

ImVec2Function · 0.85

Tested by

no test coverage detected