This commit is contained in:
ocornut
2015-09-09 14:15:17 +01:00
parent cafe8b0cd7
commit 1793c1a991
4 changed files with 36 additions and 28 deletions

View File

@ -147,10 +147,12 @@ void ImGui_ImplGlfwGL3_CreateFontsTexture()
{
ImGuiIO& io = ImGui::GetIO();
// Build texture atlas
unsigned char* pixels;
int width, height;
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.
// Create OpenGL texture
glGenTextures(1, &g_FontTexture);
glBindTexture(GL_TEXTURE_2D, g_FontTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);