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.
ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
intKeyMap[ImGuiKey_COUNT];// <unset> // Map of indices into the KeysDown[512] entries array
void*UserData;// = NULL // Store your own data for retrieval by callbacks.
ImFontAtlas*FontAtlas;// <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
ImFontAtlas*Fonts;// <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
floatFontGlobalScale;// = 1.0f // Global scale all fonts
boolFontAllowUserScaling;// = false // Allow user scaling text of individual window with CTRL+Wheel.
@ -748,43 +748,39 @@ struct ImDrawList
};
// Load and rasterize multiple TTF fonts into a same texture.
// We also add custom graphic data into the texture that serves for ImGui.
// Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering.
// The simple use case, if you don't intent to load custom or multiple fonts, is:
// 1. GetTexDataAsRGBA32() or GetTexDataAsAlpha8() // to obtain pixels
// 2. <upload the texture to graphics memory>
// 3. SetTexID(my_engine_id); // use the pointer/id to your texture in your engine format
// 4. ClearPixelsData() // to save memory
// We also add custom graphic data into the texture that serves for ImGui.
// 1. (Optional) Call AddFont*** functions. If you don't call any, the default font will be loaded for you.
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
// 3. Upload the pixels data into a texture within your graphics system.
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
// 5. Call ClearPixelsData() to free textures memory on the heap.