diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2021-07-04 14:47:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 14:47:44 +0200 |
commit | 8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a (patch) | |
tree | 1e9510a1c2ff7f6c0eaaba211c38e0a855b36ca9 /src/Rml.cpp | |
parent | Merge pull request #64 from LaG1924/ftr/render-optimization (diff) | |
parent | Added screenshot-mode (diff) | |
download | AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.gz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.bz2 AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.lz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.xz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.zst AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.zip |
Diffstat (limited to 'src/Rml.cpp')
-rw-r--r-- | src/Rml.cpp | 10 |
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) { |