MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / imgui_owned_font_copy

Function imgui_owned_font_copy

src/host/ui_fonts.cpp:44–49  ·  view source on GitHub ↗

ImGui frees atlas-owned font data with IM_FREE, so the mutable copy the API wants must come from ImGui's own allocator; this replaces passing the embedded const arrays through const_cast with ownership disabled.

Source from the content-addressed store, hash-verified

42// API wants must come from ImGui's own allocator; this replaces passing
43// the embedded const arrays through const_cast with ownership disabled.
44void* imgui_owned_font_copy(const unsigned char* data, const std::size_t size) {
45 void* copy = ImGui::MemAlloc(size);
46 IM_ASSERT(copy != nullptr);
47 std::memcpy(copy, data, size);
48 return copy;
49}
50
51} // namespace
52

Callers 1

setup_ui_fontsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected