From def9a3996819d55db065264b86e9b8687e76c4df Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Sat, 6 Jan 2024 13:02:58 -0500 Subject: [PATCH] Fix cursors being created before SDL2 initialization --- src/ui/ui_renderer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index ecfa78c..3fc2ee6 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -628,7 +628,7 @@ struct { Rml::ElementDocument* current_document; Rml::Element* prev_focused; public: - SystemInterface_SDL system_interface; + std::unique_ptr system_interface; std::unique_ptr render_interface; Rml::Context* context; recomp::UiEventListenerInstancer event_listener_instancer; @@ -747,11 +747,12 @@ void init_hook(RT64::RenderInterface* interface, RT64::RenderDevice* device) { UIContext.render.device = device; // Setup RML - UIContext.rml.system_interface.SetWindow(window); + UIContext.rml.system_interface = std::make_unique(); + UIContext.rml.system_interface->SetWindow(window); UIContext.rml.render_interface = std::make_unique(&UIContext.render); UIContext.rml.make_event_listeners(); - Rml::SetSystemInterface(&UIContext.rml.system_interface); + Rml::SetSystemInterface(UIContext.rml.system_interface.get()); Rml::SetRenderInterface(UIContext.rml.render_interface.get()); Rml::Factory::RegisterEventListenerInstancer(&UIContext.rml.event_listener_instancer);