diff options
author | LaG1924 <lag1924@gmail.com> | 2021-07-04 12:05:00 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-07-04 12:05:00 +0200 |
commit | 2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1 (patch) | |
tree | b3baecdd94f46ca121e9da6f1c93954874a1c191 /src/Render.cpp | |
parent | Added Respawn screen (diff) | |
download | AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar.gz AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar.bz2 AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar.lz AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar.xz AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.tar.zst AltCraft-2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Render.cpp | 18 |
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"; } |