Skip to content

Commit

Permalink
UGraphics: Fix regression in configureTexture
Browse files Browse the repository at this point in the history
The `GlStateManager.bindTexture` calls were erroneously changed to
`UGraphics.bindTexture` in 13c00ee, 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`.

GitHub: #82
  • Loading branch information
Johni0702 authored Aug 14, 2024
1 parent 0bc0590 commit e7a43ed
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/gg/essential/universal/UGraphics.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e7a43ed

Please sign in to comment.