From 42228354c9ee112e295916848354c79282117137 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 14 Aug 2024 08:39:08 +0200 Subject: [PATCH] UGraphics: Fix regression in configureTexture The `GlStateManager.bindTexture` calls were erroneously changed to `UGraphics.bindTexture` in 13c00ee9, however that method on 1.17+ does not actually bind the texture on the OpenGL level anymore, it only sets MC's global field which is insufficient for `configureTexture`. --- src/main/java/gg/essential/universal/UGraphics.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/gg/essential/universal/UGraphics.java b/src/main/java/gg/essential/universal/UGraphics.java index cef41da..53558a5 100644 --- a/src/main/java/gg/essential/universal/UGraphics.java +++ b/src/main/java/gg/essential/universal/UGraphics.java @@ -387,11 +387,19 @@ public static void enableAlpha() { public static void configureTexture(int glTextureId, Runnable block) { int prevTextureBinding = GL11.glGetInteger(GL_TEXTURE_BINDING_2D); - bindTexture(glTextureId); + //#if STANDALONE + //$$ glBindTexture(GL_TEXTURE_2D, glTextureId); + //#else + GlStateManager.bindTexture(glTextureId); + //#endif block.run(); - bindTexture(prevTextureBinding); + //#if STANDALONE + //$$ glBindTexture(GL_TEXTURE_2D, prevTextureBinding); + //#else + GlStateManager.bindTexture(prevTextureBinding); + //#endif } public static void configureTextureUnit(int index, Runnable block) {