summaryrefslogtreecommitdiffstats
path: root/src/Rml.cpp
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-07-04 12:05:00 +0200
committerLaG1924 <lag1924@gmail.com>2021-07-04 12:05:00 +0200
commit2d2fc243662fe5a24b4e3e388d3a3525a0bd48f1 (patch)
treeb3baecdd94f46ca121e9da6f1c93954874a1c191 /src/Rml.cpp
parentAdded Respawn screen (diff)
downloadAltCraft-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/Rml.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Rml.cpp b/src/Rml.cpp
index 6ed83c1..179d4b9 100644
--- a/src/Rml.cpp
+++ b/src/Rml.cpp
@@ -117,11 +117,15 @@ void RmlRenderInterface::RenderGeometry(Rml::Vertex* vertices, int num_vertices,
}
void RmlRenderInterface::EnableScissorRegion(bool enable) {
-
+ if (enable)
+ glEnable(GL_SCISSOR_TEST);
+ else
+ glDisable(GL_SCISSOR_TEST);
}
void RmlRenderInterface::SetScissorRegion(int x, int y, int width, int height) {
-
+ glScissor(x, vpHeight - (y + height), width, height);
+ glCheckError();
}
bool RmlRenderInterface::LoadTexture(Rml::TextureHandle& texture_handle, Rml::Vector2i& texture_dimensions, const Rml::String& source) {
@@ -161,6 +165,8 @@ void RmlRenderInterface::Update(unsigned int windowWidth, unsigned int windowHei
AssetManager::GetAsset<AssetShader>("/altcraft/shaders/rmltex")->shader->SetUniform("viewportSize", windowWidth, windowHeight);
AssetManager::GetAsset<AssetShader>("/altcraft/shaders/rmltex")->shader->SetUniform("fontTexture", 0);
glCheckError();
+ vpWidth = windowWidth;
+ vpHeight = windowHeight;
}
Rml::FileHandle RmlFileInterface::Open(const Rml::String& path) {