Examples: OpenGL2: Uploading font texture as RGBA32 to increase compatibility with users shaders for beginners (#824)

This commit is contained in:
ocornut
2016-09-10 17:43:07 +02:00
parent 012223114d
commit 02399852fe
2 changed files with 3 additions and 3 deletions

View File

@ -178,7 +178,7 @@ bool ImGui_ImplGlfwGL3_CreateFontsTexture()
ImGuiIO& io = ImGui::GetIO();
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.
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.
// Upload texture to graphics system
GLint last_texture;