Fix GL leaks (#35)

This commit is contained in:
Algent authored and GitHub committed 2026-07-27 12:34:09 +07:00
1 parent b03be8e3a7
commit 5c78cd6e54
2 files changed
+8 -8

No files matched your search

@@ -49,13 +49,14 @@ public class ParticlePosition extends EntityReddustFX {
float rotationYZ, float rotationXY, float rotationXZ) {
tessellator.draw();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glDisable(GL11.GL_DEPTH_TEST);
tessellator.startDrawingQuads();
super.renderParticle(tessellator, partialTickTime, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
tessellator.draw();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopAttrib();
tessellator.startDrawingQuads();
}
@@ -54,7 +54,11 @@ public class SlotHighlighter implements IContainerDrawHandler {
@Override
public void renderSlotUnderlay(GuiContainer gui, Slot slot) {
if (this.gui == gui && this.slots.contains(slot)) {
GL11.glPushMatrix();
GL11.glPushAttrib(
GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT
| GL11.GL_CURRENT_BIT
| GL11.GL_LIGHTING_BIT
| GL11.GL_TEXTURE_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -71,12 +75,7 @@ public class SlotHighlighter implements IContainerDrawHandler {
highlightSlot(tessellator, slot.xDisplayPosition, slot.yDisplayPosition);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
}