Skip to content

Commit d2005a4

Browse files
committed
Fix leaking framebuffer
1 parent 0ea76c9 commit d2005a4

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

src/client/java/net/irisshaders/imgui/ImGuiMC.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,15 @@ public void draw() {
141141
drawing = false;
142142

143143
glAccessor.renderDrawData(ImGui.getDrawData());
144+
GlStateManager._glBindFramebuffer(GlConst.GL_FRAMEBUFFER, 0);
144145

145146
ImGui.updatePlatformWindows();
146147
ImGui.renderPlatformWindowsDefault();
147148
//? if >1.21.8 {
148-
/*GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().handle());
149-
*///?} else {
150-
GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().getWindow());
151-
//?}
149+
GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().handle());
150+
//?} else {
151+
/*GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().getWindow());
152+
*///?}
152153
}
153154

154155
private static boolean isGone;

src/client/java/net/irisshaders/imgui/mixin/DrawMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class DrawMixin {
2020
boolean bl, CallbackInfo ci
2121
) {
2222
//? if >1.21.8 {
23-
/*ImGuiMC.getInstance().afterPollEvents(this.window.handle());
24-
*///?} else {
25-
ImGuiMC.getInstance().afterPollEvents(this.window.getWindow());
26-
//?}
23+
ImGuiMC.getInstance().afterPollEvents(this.window.handle());
24+
//?} else {
25+
/*ImGuiMC.getInstance().afterPollEvents(this.window.getWindow());
26+
*///?}
2727
}
2828

2929
@Inject(method = "runTick", at = @At(value = "INVOKE", target = /*? if >= 1.21.5 {*/"Lcom/mojang/blaze3d/platform/Window;isMinimized()Z"/*?} else {*//*"Lcom/mojang/blaze3d/pipeline/RenderTarget;unbindWrite()V"*//*?}*/))

src/client/java/net/irisshaders/imgui/mixin/KeyboardHandlingMixin.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import net.irisshaders.imgui.ImGuiMC;
44
import net.minecraft.client.KeyboardHandler;
55
//? if >1.21.8 {
6-
/*import net.minecraft.client.input.CharacterEvent;
6+
import net.minecraft.client.input.CharacterEvent;
77
import net.minecraft.client.input.KeyEvent;
8-
*///?}
8+
//?}
99
import org.spongepowered.asm.mixin.Mixin;
1010
import org.spongepowered.asm.mixin.injection.At;
1111
import org.spongepowered.asm.mixin.injection.Inject;
@@ -14,7 +14,7 @@
1414
@Mixin(KeyboardHandler.class)
1515
public class KeyboardHandlingMixin {
1616
//? if >1.21.8 {
17-
/*@Inject(method = "keyPress", at = @At("HEAD"))
17+
@Inject(method = "keyPress", at = @At("HEAD"))
1818
private void imgui$keyPress(long window, int action, KeyEvent keyEvent, CallbackInfo ci) {
1919
ImGuiMC.getInstance().onKeyPress(window, keyEvent.key(), keyEvent.scancode(), action, keyEvent.modifiers());
2020
}
@@ -23,8 +23,8 @@ public class KeyboardHandlingMixin {
2323
private void imgui$charTyped(long l, CharacterEvent characterEvent, CallbackInfo ci) {
2424
ImGuiMC.getInstance().onCharTyped(l, characterEvent.codepoint(), characterEvent.modifiers());
2525
}
26-
*///?} else {
27-
@Inject(method = "keyPress", at = @At("HEAD"))
26+
//?} else {
27+
/*@Inject(method = "keyPress", at = @At("HEAD"))
2828
private void imgui$keyPress(long l, int i, int j, int k, int m, CallbackInfo ci) {
2929
ImGuiMC.getInstance().onKeyPress(l, i, j, k, m);
3030
}
@@ -33,5 +33,5 @@ public class KeyboardHandlingMixin {
3333
private void imgui$charTyped(long l, int i, int j, CallbackInfo ci) {
3434
ImGuiMC.getInstance().onCharTyped(l, i, j);
3535
}
36-
//?}
36+
*///?}
3737
}

src/client/java/net/irisshaders/imgui/mixin/MouseHandlingMixin.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import net.irisshaders.imgui.ImGuiMC;
44
import net.minecraft.client.MouseHandler;
55
//? if >1.21.8 {
6-
/*import net.minecraft.client.input.MouseButtonInfo;
7-
*///?}
6+
import net.minecraft.client.input.MouseButtonInfo;
7+
//?}
88
import org.spongepowered.asm.mixin.Mixin;
99
import org.spongepowered.asm.mixin.injection.At;
1010
import org.spongepowered.asm.mixin.injection.Inject;
@@ -23,14 +23,14 @@ public class MouseHandlingMixin {
2323
}
2424

2525
//? if >1.21.8 {
26-
/*@Inject(method = "onButton", at = @At("HEAD"))
26+
@Inject(method = "onButton", at = @At("HEAD"))
2727
private void imgui$onScroll(long window, MouseButtonInfo button, int action, CallbackInfo ci) {
2828
ImGuiMC.getInstance().onMouseButton(window, button.button(), action, button.modifiers());
2929
}
30-
*///?} else {
31-
@Inject(method = "onPress", at = @At("HEAD"))
30+
//?} else {
31+
/*@Inject(method = "onPress", at = @At("HEAD"))
3232
private void imgui$onScroll(long window, int button, int action, int mods, CallbackInfo ci) {
3333
ImGuiMC.getInstance().onMouseButton(window, button, action, mods);
3434
}
35-
//?}
35+
*///?}
3636
}

stonecutter.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
//id("dev.kikugie.j52j") version "1.0.2" apply false // Enables asset processing by writing json5 files
55
//id("me.modmuss50.mod-publish-plugin") version "0.7.+" apply false // Publishes builds to hosting websites
66
}
7-
stonecutter active "1.21.5" /* [SC] DO NOT EDIT */
7+
stonecutter active "1.21.10" /* [SC] DO NOT EDIT */
88

99

1010
/*

0 commit comments

Comments
 (0)