Skip to content

Commit

Permalink
Update PreLaunchChecks.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbianxiao authored Sep 17, 2024
1 parent 425c148 commit 6e7775e
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.jellysquid.mods.sodium.client.compatibility.checks;

import me.jellysquid.mods.sodium.client.SodiumClientMod;
import me.jellysquid.mods.sodium.client.compatibility.environment.probe.GraphicsAdapterProbe;
import me.jellysquid.mods.sodium.client.compatibility.environment.probe.GraphicsAdapterVendor;
import me.jellysquid.mods.sodium.client.compatibility.workarounds.nvidia.NvidiaDriverVersion;
Expand Down Expand Up @@ -29,6 +30,37 @@ public class PreLaunchChecks {

private static final String prismMessage = "It appears you are using Prism Launcher to start the game. You can likely fix this problem by opening your instance settings and navigating to the Version section in the sidebar.";

public static void onContextInitialized() {
checkContextImplementation();

if ((!SodiumClientMod.options().pojav.noLongerWarnPojavLauncher) && isUsingPojavLauncher()) {
Console.instance().logMessage(MessageLevel.WARN, Text.translatable("sodium.console.pojav_launcher"), 30.0);
LOGGER.info("modified version of Sodium is running on PojavLauncher, if you run into any problems please report the problem to ConfectionaryQwQ and not to the Sodium team");
}
}

private static void checkContextImplementation() {
GLContextInfo driver = GLContextInfo.create();

if (driver == null) {
LOGGER.warn("Could not retrieve identifying strings for OpenGL implementation");
return;
}

LOGGER.info("OpenGL Vendor: {}", driver.vendor());
LOGGER.info("OpenGL Renderer: {}", driver.renderer());
LOGGER.info("OpenGL Version: {}", driver.version());

if (!isSupportedNvidiaDriver(driver)) {
Console.instance()
.logMessage(MessageLevel.SEVERE, Text.translatable("sodium.console.broken_nvidia_driver"), 30.0);

LOGGER.error("The NVIDIA graphics driver appears to be out of date. This will likely cause severe " +
"performance issues and crashes when used with Sodium. The graphics driver should be updated to " +
"the latest version (version 536.23 or newer).");
}
}

public static void beforeLWJGLInit() {
if (BugChecks.ISSUE_2561) {
if (!Version.getVersion().startsWith(REQUIRED_LWJGL_VERSION)) {
Expand Down

0 comments on commit 6e7775e

Please sign in to comment.