Use shared font atlas and fix crash when opening overlay in some games.

This commit is contained in:
Mr_Goldberg 2022-08-21 03:45:11 -04:00
parent de6805dd8b
commit c9a102ee30
No known key found for this signature in database
GPG key ID: 8597D87419DEF278
9 changed files with 25 additions and 20 deletions

View file

@ -39,7 +39,8 @@ class Renderer_Hook
public:
Renderer_Hook():
OverlayProc(&DefaultOverlayProc),
OverlayHookReady(&DefaultOverlayHookReady)
OverlayHookReady(&DefaultOverlayHookReady),
ImGuiFontAtlas(nullptr)
{}
static void DefaultOverlayProc() {}
@ -47,6 +48,7 @@ public:
std::function<void()> OverlayProc;
std::function<void(bool)> OverlayHookReady;
void *ImGuiFontAtlas;
virtual bool StartHook(std::function<bool(bool)> key_combination_callback, std::set<ToggleKey> toggle_keys) = 0;
virtual bool IsStarted() = 0;
// Returns a Handle to the renderer image ressource or nullptr if it failed to create the resource, the handle can be used in ImGui's Image calls, image_buffer must be RGBA ordered