fix test mod and add warning comment to framebuffer (#6698)

This commit is contained in:
ichttt authored and GitHub committed 2020-05-15 20:25:57 +02:00
1 parent 68cf703435
commit 8d3685439e
2 files changed
+5 -3

No files matched your search

@@ -15,7 +15,7 @@
}
this.func_147611_b();
@@ -254,4 +260,28 @@
@@ -254,4 +260,29 @@
GlStateManager.func_227658_a_(i, p_216493_1_);
this.func_147609_e();
}
@@ -23,9 +23,10 @@
+ /*================================ FORGE START ================================================*/
+ private boolean stencilEnabled = false;
+ /**
+ * Attempts to enabled 8 bits of stencil buffer on this FrameBuffer.
+ * Attempts to enable 8 bits of stencil buffer on this FrameBuffer.
+ * Modders must call this directly to set things up.
+ * This is to prevent the default cause where graphics cards do not support stencil bits.
+ * <b>Make sure to call this on the main render thread!</b>
+ */
+ public void enableStencil()
+ {
@@ -2,6 +2,7 @@ package net.minecraftforge.debug.client.rendering;
import net.minecraft.client.Minecraft;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@@ -13,6 +14,6 @@ public class StencilEnableTest {
}
private void clientSetup(FMLClientSetupEvent event) {
Minecraft.getInstance().getFramebuffer().enableStencil();
DeferredWorkQueue.runLater(() -> Minecraft.getInstance().getFramebuffer().enableStencil());
}
}