MCPcopy Create free account
hub / github.com/cinder/Cinder / ImFontAtlasBuildSetTexture

Function ImFontAtlasBuildSetTexture

src/imgui/imgui_draw.cpp:3932–3940  ·  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

3930
3931// Set current texture. This is mostly called from AddTexture() + to handle a failed resize.
3932static void ImFontAtlasBuildSetTexture(ImFontAtlas* atlas, ImTextureData* tex)
3933{
3934 ImTextureRef old_tex_ref = atlas->TexRef;
3935 atlas->TexData = tex;
3936 atlas->TexUvScale = ImVec2(1.0f / tex->Width, 1.0f / tex->Height);
3937 atlas->TexRef._TexData = tex;
3938 //atlas->TexRef._TexID = tex->TexID; // <-- We intentionally don't do that. It would be misleading and betray promise that both fields aren't set.
3939 ImFontAtlasUpdateDrawListsTextures(atlas, old_tex_ref, atlas->TexRef);
3940}
3941
3942// Create a new texture, discard previous one
3943ImTextureData* 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