Fix render progress framebuffer never being deleted
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user