From 30df3e578cef533cacedf737449bbd35d4ea5d11 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Fri, 15 Apr 2022 18:20:30 +0900 Subject: fix shadow and add nanovg support --- .../io/polyfrost/oneconfig/test/TestNanoVGGui.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java (limited to 'src/main/java/io/polyfrost/oneconfig/test') diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java new file mode 100644 index 0000000..74d6a1e --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java @@ -0,0 +1,19 @@ +package io.polyfrost.oneconfig.test; + +import io.polyfrost.oneconfig.lwjgl.NanoVGUtils; +import net.minecraft.client.gui.GuiScreen; + +import java.awt.*; + +public class TestNanoVGGui extends GuiScreen { + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + NanoVGUtils.setupAndDraw((vg) -> { + NanoVGUtils.drawRect(vg, 0, 0, 300, 300, Color.BLUE.getRGB()); + NanoVGUtils.drawRoundedRect(vg, 305, 305, 100, 100, Color.BLACK.getRGB(), 8); + NanoVGUtils.drawString(vg, "Hello!", 500, 500, Color.BLACK.getRGB(), 50); + }); + } +} -- cgit From fff43b4d2a89ae50aa1d315fc4dad65055e654be Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 16 Apr 2022 01:55:58 +0900 Subject: misc things --- src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/polyfrost/oneconfig/test') diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java index 74d6a1e..67e0a68 100644 --- a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java +++ b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java @@ -10,10 +10,11 @@ public class TestNanoVGGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); + drawRect(0, 0, width, height, Color.BLACK.getRGB()); NanoVGUtils.setupAndDraw((vg) -> { NanoVGUtils.drawRect(vg, 0, 0, 300, 300, Color.BLUE.getRGB()); - NanoVGUtils.drawRoundedRect(vg, 305, 305, 100, 100, Color.BLACK.getRGB(), 8); - NanoVGUtils.drawString(vg, "Hello!", 500, 500, Color.BLACK.getRGB(), 50); + NanoVGUtils.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8); + NanoVGUtils.drawString(vg, "Hello!", 500, 500, Color.WHITE.getRGB(), 50); }); } } -- cgit From f10f1165a7c2ea88ce7bb265d51b52eeaa64d8f8 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 16 Apr 2022 12:33:00 +0900 Subject: nanovg optimizations + image renderer --- src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/io/polyfrost/oneconfig/test') diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java index 67e0a68..3f2fa27 100644 --- a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java +++ b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java @@ -15,6 +15,7 @@ public class TestNanoVGGui extends GuiScreen { NanoVGUtils.drawRect(vg, 0, 0, 300, 300, Color.BLUE.getRGB()); NanoVGUtils.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8); NanoVGUtils.drawString(vg, "Hello!", 500, 500, Color.WHITE.getRGB(), 50); + NanoVGUtils.drawImage(vg, "/assets/oneconfig/textures/hudsettings.png", 10, 10, 400, 400); }); } } -- cgit From cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 16 Apr 2022 14:51:58 +0900 Subject: merge rendering files + remove themes --- src/main/java/io/polyfrost/oneconfig/test/TestHud.java | 4 ++-- .../java/io/polyfrost/oneconfig/test/TestNanoVGGui.java | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/main/java/io/polyfrost/oneconfig/test') diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestHud.java b/src/main/java/io/polyfrost/oneconfig/test/TestHud.java index 67f0610..9008e3d 100644 --- a/src/main/java/io/polyfrost/oneconfig/test/TestHud.java +++ b/src/main/java/io/polyfrost/oneconfig/test/TestHud.java @@ -1,7 +1,7 @@ package io.polyfrost.oneconfig.test; import io.polyfrost.oneconfig.hud.interfaces.BasicHud; -import io.polyfrost.oneconfig.renderer.Renderer; +import io.polyfrost.oneconfig.lwjgl.RenderManager; import net.minecraft.client.Minecraft; public class TestHud extends BasicHud { @@ -18,6 +18,6 @@ public class TestHud extends BasicHud { @Override public void draw(int x, int y, float scale) { - Renderer.drawScaledString("FPS: " + Minecraft.getDebugFPS(), x, y, 0xffffff, false, scale); + RenderManager.drawScaledString("FPS: " + Minecraft.getDebugFPS(), x, y, 0xffffff, false, scale); } } diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java index 3f2fa27..c1badc2 100644 --- a/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java +++ b/src/main/java/io/polyfrost/oneconfig/test/TestNanoVGGui.java @@ -1,6 +1,6 @@ package io.polyfrost.oneconfig.test; -import io.polyfrost.oneconfig.lwjgl.NanoVGUtils; +import io.polyfrost.oneconfig.lwjgl.RenderManager; import net.minecraft.client.gui.GuiScreen; import java.awt.*; @@ -11,11 +11,14 @@ public class TestNanoVGGui extends GuiScreen { public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); drawRect(0, 0, width, height, Color.BLACK.getRGB()); - NanoVGUtils.setupAndDraw((vg) -> { - NanoVGUtils.drawRect(vg, 0, 0, 300, 300, Color.BLUE.getRGB()); - NanoVGUtils.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8); - NanoVGUtils.drawString(vg, "Hello!", 500, 500, Color.WHITE.getRGB(), 50); - NanoVGUtils.drawImage(vg, "/assets/oneconfig/textures/hudsettings.png", 10, 10, 400, 400); + RenderManager.setupAndDraw((vg) -> { + RenderManager.drawRect(vg, 0, 0, 100, 100, Color.BLUE.getRGB()); + RenderManager.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8); + RenderManager.drawString(vg, "Hello!", 80, 20, Color.WHITE.getRGB(), 50, "mc-regular"); + RenderManager.drawString(vg, "Hello!", 100, 100, Color.WHITE.getRGB(), 50, "inter-bold"); + RenderManager.drawImage(vg, "/assets/oneconfig/textures/hudsettings.png", 10, 10, 400, 400); + RenderManager.drawLine(vg, 0, 0, 100, 100, 7, Color.PINK.getRGB()); }); + drawString(fontRendererObj, "Hello!", 0, 0, -1); } } -- cgit