Examples: Not clearing input data/tex data in atlas (will be required for dynamic atlas anyway). Effectively fix resizing in DX examples.

+ Standardized comments.
This commit is contained in:
ocornut
2015-11-29 14:54:05 +00:00
parent 6269859315
commit 6cee2fca94
9 changed files with 39 additions and 58 deletions

View File

@ -230,14 +230,13 @@ void ImGui_ImplDX9_Shutdown()
static bool ImGui_ImplDX9_CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
// Build
unsigned char* pixels;
int width, height, bytes_per_pixel;
io.Fonts->GetTexDataAsAlpha8(&pixels, &width, &height, &bytes_per_pixel);
// Create DX9 texture
// Upload texture to graphics system
g_FontTexture = NULL;
if (D3DXCreateTexture(g_pd3dDevice, width, height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8, D3DPOOL_DEFAULT, &g_FontTexture) < 0)
return false;
@ -251,9 +250,6 @@ static bool ImGui_ImplDX9_CreateFontsTexture()
// Store our identifier
io.Fonts->TexID = (void *)g_FontTexture;
// Cleanup (don't clear the input data if you want to append new fonts later)
io.Fonts->ClearInputData();
io.Fonts->ClearTexData();
return true;
}