FIX: init_font crash

Change-Id: I2d2fd9f297e2980e789b124d3e026d0db1fa1602
This commit is contained in:
liz.li authored and Lane.Wei committed 2022-12-15 04:38:15 -05:00
1 parent dfde6e518f
commit 1f0ce4ac47
5 files changed
+36 -10

No files matched your search

+1
View File
@@ -1979,6 +1979,7 @@ void ImGuiWrapper::init_font(bool compress)
unsigned char* pixels;
int width, height;
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.
BOOST_LOG_TRIVIAL(trace) << "Build texture done. width: " << width << ", height: " << height;
// Fill rectangles from the SVG-icons
for (auto icon : font_icons) {