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