Skip to content

Commit

Permalink
Move GL33 compat check to pre-init time (Fixes #21)
Browse files Browse the repository at this point in the history
  • Loading branch information
makamys committed May 16, 2023
1 parent 0745276 commit e09b4ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/main/java/makamys/neodymium/Compat.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@

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();
}
Expand Down Expand Up @@ -54,7 +58,7 @@ public static void getCompatibilityWarnings(List<Warning> warns, List<Warning> c

}

if(!GLContext.getCapabilities().OpenGL33) {
if(!isGL33Supported) {
criticalWarns.add(new Warning("OpenGL 3.3 is not supported."));
}
if(detectedNotEnoughVRAM()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/makamys/neodymium/Neodymium.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Neodymium
@EventHandler
public void preInit(FMLConstructionEvent event) {
MCLib.init();
Compat.applyCompatibilityTweaks();
Compat.init();
}

@EventHandler
Expand Down

0 comments on commit e09b4ea

Please sign in to comment.