MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImFontAtlasDebugWriteTexToDisk

Function ImFontAtlasDebugWriteTexToDisk

imgui_tiny_app/imgui/imgui_draw.cpp:4072–4078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4070#define STB_IMAGE_WRITE_IMPLEMENTATION
4071#include "../stb/stb_image_write.h"
4072static void ImFontAtlasDebugWriteTexToDisk(ImTextureData* tex, const char* description)
4073{
4074 ImGuiContext& g = *GImGui;
4075 char buf[128];
4076 ImFormatString(buf, IM_COUNTOF(buf), "[%05d] Texture #%03d - %s.png", g.FrameCount, tex->UniqueID, description);
4077 stbi_write_png(buf, tex->Width, tex->Height, tex->BytesPerPixel, tex->Pixels, tex->GetPitch()); // tex->BytesPerPixel is technically not component, but ok for the formats we support.
4078}
4079#endif
4080
4081void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h)

Callers

nothing calls this directly

Calls 2

ImFormatStringFunction · 0.85
GetPitchMethod · 0.80

Tested by

no test coverage detected