Renamed FontAtlas to Fonts. Further cleanup/comments.

This commit is contained in:
ocornut
2015-01-18 10:46:49 +00:00
parent 1f8d209202
commit 1916a0c78c
6 changed files with 103 additions and 111 deletions

View File

@ -235,15 +235,15 @@ void InitGL()
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void LoadFontTexture()
void LoadFontsTexture()
{
ImGuiIO& io = ImGui::GetIO();
//ImFont* my_font = io.FontAtlas->AddFontDefault();
//ImFont* my_font2 = io.FontAtlas->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 20.0f, ImFontAtlas::GetGlyphRangesJapanese());
//ImFont* my_font = io.Fonts->AddFontDefault();
//ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 20.0f, io.Fonts->GetGlyphRangesJapanese());
unsigned char* pixels;
int width, height;
io.FontAtlas->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits for OpenGL3 demo because it is more likely to be compatible with user's existing shader.
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits for OpenGL3 demo because it is more likely to be compatible with user's existing shader.
GLuint tex_id;
glGenTextures(1, &tex_id);
@ -253,7 +253,7 @@ void LoadFontTexture()
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// Store our identifier
io.FontAtlas->TexID = (void *)(intptr_t)tex_id;
io.Fonts->TexID = (void *)(intptr_t)tex_id;
}
void InitImGui()
@ -282,7 +282,7 @@ void InitImGui()
io.SetClipboardTextFn = ImImpl_SetClipboardTextFn;
io.GetClipboardTextFn = ImImpl_GetClipboardTextFn;
LoadFontTexture();
LoadFontsTexture();
}
void UpdateImGui()