summaryrefslogtreecommitdiffstats
path: root/src/Render.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Render.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Render.cpp b/src/Render.cpp
index 6aecd88..a76bba7 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -4,6 +4,7 @@
#include <optick.h>
#include <RmlUi/Core.h>
#include <RmlUi/Lua.h>
+#include <RmlUi/Debugger.h>
#include "Shader.hpp"
#include "AssetManager.hpp"
@@ -293,6 +294,15 @@ void Render::HandleEvents() {
break;
}
+ case SDL_SCANCODE_F8:
+ Rml::Debugger::SetVisible(!Rml::Debugger::IsVisible());
+ break;
+
+ case SDL_SCANCODE_F7: {
+ SetMouseCapture(!isMouseCaptured);
+ break;
+ }
+
default:
break;
}
@@ -358,6 +368,11 @@ void Render::HandleEvents() {
break;
}
+ case SDL_MOUSEWHEEL: {
+ rmlContext->ProcessMouseWheel(-event.wheel.y, rmlKeymods);
+ break;
+ }
+
case SDL_TEXTINPUT: {
rmlContext->ProcessTextInput(Rml::String(event.text.text));
break;
@@ -567,4 +582,7 @@ void Render::InitRml() {
Rml::Lua::Initialise(PluginSystem::GetLuaState());
rmlContext = Rml::CreateContext("default", Rml::Vector2i(renderState.WindowWidth, renderState.WindowHeight));
+
+ if (!Rml::Debugger::Initialise(rmlContext))
+ LOG(WARNING) << "Rml debugger not initialized";
}