From 7e137112b7004874c741eb843a12dcd386eb7ad6 Mon Sep 17 00:00:00 2001 From: Smyler Date: Mon, 17 Jun 2024 23:34:13 +0200 Subject: [PATCH] Implement Gl transformations in 1.20.1 --- .../net/smyler/smylib/gui/Lwjgl3GlState.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/smylib/fabric/src/main/java/net/smyler/smylib/gui/Lwjgl3GlState.java b/smylib/fabric/src/main/java/net/smyler/smylib/gui/Lwjgl3GlState.java index ada2ac8e..be66c964 100644 --- a/smylib/fabric/src/main/java/net/smyler/smylib/gui/Lwjgl3GlState.java +++ b/smylib/fabric/src/main/java/net/smyler/smylib/gui/Lwjgl3GlState.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.smyler.smylib.Color; + public class Lwjgl3GlState implements GlState { @Override public void enableAlpha() { @@ -34,4 +35,29 @@ public void disableColorLogic() { RenderSystem.disableColorLogicOp(); } + @Override + public void pushViewMatrix() { + RenderSystem.getModelViewStack().pushPose(); + } + + @Override + public void rotate(double angle) { + RenderSystem.getModelViewMatrix().rotate((float)(angle), 0f, 0f, 1f); + } + + @Override + public void translate(double x, double y) { + RenderSystem.getModelViewMatrix().translate((float)x, (float)y, 0); + } + + @Override + public void scale(double x, double y) { + RenderSystem.getModelViewMatrix().scale((float)x, (float)y, 1); + } + + @Override + public void popViewMatrix() { + RenderSystem.getModelViewStack().popPose(); + } + }