Skip to content

Commit

Permalink
Add hardware acceleration setting (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofferHolmesland authored Nov 10, 2023
2 parents dc7c3d5 + df039cf commit dc94197
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/java/minicraft/core/Initializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static void parseArgs(String[] args) {
// Parses command line arguments
@Nullable
String saveDir = null;
boolean enableHardwareAcceleration = true;
for (int i = 0; i < args.length; i++) {
if (args[i].equalsIgnoreCase("--savedir") && i + 1 < args.length) {
i++;
Expand All @@ -56,9 +57,13 @@ static void parseArgs(String[] args) {
Localization.isDebugLocaleEnabled = true;
} else if (args[i].equalsIgnoreCase("--debug-unloc-tracing")) {
Localization.unlocalizedStringTracing = true;
} else if (args[i].equalsIgnoreCase("--no-hardware-acceleration")) {
enableHardwareAcceleration = false;
}
}
((TinylogLoggingProvider) ProviderRegistry.getLoggingProvider()).init();
// Reference: https://stackoverflow.com/a/13832805
if (enableHardwareAcceleration) System.setProperty("sun.java2d.opengl", "true");

FileHandler.determineGameDir(saveDir);
}
Expand Down

0 comments on commit dc94197

Please sign in to comment.