mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-05-24 15:21:16 -04:00
Implement SDF fonts. (#24)
* Initial SDF font generation work. * Text now correctly displaying with proper spacing. * Fix untextured draws, implement custom rectangles. * Fix regular image display. * Slightly refactor ImGui rendering. * Implement outlines. * Implement bevel. * Create host device after loading the module if the installer wasn't run. * Move ImGui files to its own folder. * Fix outline sizes. * Fix default ImGui font and font scales. * Update font atlas files.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include "imgui_common.h"
|
||||
|
||||
static std::vector<std::unique_ptr<ImGuiCallbackData>> g_callbackData;
|
||||
static uint32_t g_callbackDataIndex = 0;
|
||||
|
||||
ImGuiCallbackData* AddImGuiCallback(ImGuiCallback callback)
|
||||
{
|
||||
if (g_callbackDataIndex >= g_callbackData.size())
|
||||
g_callbackData.emplace_back(std::make_unique<ImGuiCallbackData>());
|
||||
|
||||
auto& callbackData = g_callbackData[g_callbackDataIndex];
|
||||
++g_callbackDataIndex;
|
||||
|
||||
ImGui::GetForegroundDrawList()->AddCallback(reinterpret_cast<ImDrawCallback>(callback), callbackData.get());
|
||||
|
||||
return callbackData.get();
|
||||
}
|
||||
|
||||
void ResetImGuiCallbacks()
|
||||
{
|
||||
g_callbackDataIndex = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user