diff options
author | makamys <makamys@outlook.com> | 2023-05-17 00:00:54 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2023-05-17 00:12:52 +0200 |
commit | e09b4eae63b8793fcf1530d5babea7764a0dae8f (patch) | |
tree | d258d7a0116fd03ae494b3fed7b77919d98b0990 /src/main/java | |
parent | 0745276eb2f2eaae80ce8ff7aeb93f6801e71adf (diff) | |
download | Neodymium-e09b4eae63b8793fcf1530d5babea7764a0dae8f.tar.gz Neodymium-e09b4eae63b8793fcf1530d5babea7764a0dae8f.tar.bz2 Neodymium-e09b4eae63b8793fcf1530d5babea7764a0dae8f.zip |
Move GL33 compat check to pre-init time (Fixes #21)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/makamys/neodymium/Compat.java | 8 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/Neodymium.java | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/makamys/neodymium/Compat.java b/src/main/java/makamys/neodymium/Compat.java index b8aa0b1..47a3dfb 100644 --- a/src/main/java/makamys/neodymium/Compat.java +++ b/src/main/java/makamys/neodymium/Compat.java @@ -20,11 +20,15 @@ import net.minecraft.client.settings.GameSettings; public class Compat { + private static boolean isGL33Supported; + private static boolean wasAdvancedOpenGLEnabled; private static int notEnoughVRAMAmountMB = -1; - public static void applyCompatibilityTweaks() { + public static void init() { + isGL33Supported = GLContext.getCapabilities().OpenGL33; + if (Loader.isModLoaded("triangulator")) { disableTriangulator(); } @@ -54,7 +58,7 @@ public class Compat { } - if(!GLContext.getCapabilities().OpenGL33) { + if(!isGL33Supported) { criticalWarns.add(new Warning("OpenGL 3.3 is not supported.")); } if(detectedNotEnoughVRAM()) { diff --git a/src/main/java/makamys/neodymium/Neodymium.java b/src/main/java/makamys/neodymium/Neodymium.java index 4adab56..3750ddd 100644 --- a/src/main/java/makamys/neodymium/Neodymium.java +++ b/src/main/java/makamys/neodymium/Neodymium.java @@ -55,7 +55,7 @@ public class Neodymium @EventHandler public void preInit(FMLConstructionEvent event) { MCLib.init(); - Compat.applyCompatibilityTweaks(); + Compat.init(); } @EventHandler |