mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-31 16:31:30 -06:00
* 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.
23 lines
631 B
C++
23 lines
631 B
C++
#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;
|
|
}
|