Set current texture. This is mostly called from AddTexture() + to handle a failed resize.
| 4019 | |
| 4020 | // Set current texture. This is mostly called from AddTexture() + to handle a failed resize. |
| 4021 | static 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 |
| 4032 | ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h) |
no test coverage detected