From 5daa6c567bf439ed2bed64ff16dc53ae7a320d34 Mon Sep 17 00:00:00 2001 From: makamys Date: Tue, 7 Jun 2022 22:43:26 +0200 Subject: Make GPU debugger a bit prettier --- src/main/java/makamys/lodmod/util/GuiHelper.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/main/java/makamys/lodmod/util') diff --git a/src/main/java/makamys/lodmod/util/GuiHelper.java b/src/main/java/makamys/lodmod/util/GuiHelper.java index 0f0f80e..3054237 100644 --- a/src/main/java/makamys/lodmod/util/GuiHelper.java +++ b/src/main/java/makamys/lodmod/util/GuiHelper.java @@ -26,7 +26,6 @@ public class GuiHelper { public static void drawRectangle(int x, int y, int w, int h, int color) { Tessellator tessellator = Tessellator.instance; - //GL11.glEnable(GL11.GL_BLEND); tessellator.startDrawingQuads(); tessellator.setColorOpaque_I(color); tessellator.addVertex(x, y, 0); @@ -37,6 +36,22 @@ public class GuiHelper { tessellator.draw(); } + public static void drawRectangle(int x, int y, int w, int h, int color, int opacity) { + GL11.glEnable(GL11.GL_BLEND); + + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(color, opacity); + tessellator.addVertex(x, y, 0); + tessellator.addVertex(x, y+h, 0); + tessellator.addVertex(x+w, y+h, 0); + tessellator.addVertex(x+w, y, 0); + + tessellator.draw(); + + GL11.glDisable(GL11.GL_BLEND); + } + public static void end() { //GL11.glDisable(GL11.GL_BLEND); -- cgit