Fix render progress framebuffer never being deleted

This commit is contained in:
Jonas Herzig
2022-04-10 17:07:08 +02:00
parent 01d37ab2cb
commit fb36fc2ba8
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package com.replaymod.render.gui.progress;
import com.replaymod.render.mixin.MainWindowAccessor;
import de.johni0702.minecraft.gui.function.Closeable;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.Framebuffer;
import net.minecraft.client.util.Window;
@@ -9,7 +10,7 @@ import net.minecraft.client.util.Window;
//$$ import net.minecraft.client.gl.WindowFramebuffer;
//#endif
public class VirtualWindow {
public class VirtualWindow implements Closeable {
private final MinecraftClient mc;
private final Window window;
private final MainWindowAccessor acc;
@@ -40,6 +41,11 @@ public class VirtualWindow {
//#endif
}
@Override
public void close() {
guiFramebuffer.delete();
}
public void bind() {
gameWidth = acc.getFramebufferWidth();
gameHeight = acc.getFramebufferHeight();

View File

@@ -363,6 +363,8 @@ public class VideoRenderer implements RenderInfo {
// Tear down of the timeline player might only happen the next tick after it was cancelled
timelinePlayer.onTick();
guiWindow.close();
// FBOs are always used in 1.14+
//#if MC<11400
//$$ if (!OpenGlHelper.isFramebufferEnabled()) {