diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java index 3f1dfe54..0e172f5d 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java @@ -217,24 +217,25 @@ public final class GraphicsSubsystem implements SubsystemMainClass { } else logger.diag(apiName + " is incompatible with this system"); - logger.diag("Compatible is/are " + ListFormatter.formatList(compatibleApis)); - - // Choose last item in list. - if (!compatibleApis.isEmpty()) { - api = registeredApis.get(compatibleApis.getLast()); - try { - logger.diag("Initializing Graphics API"); - logger.diag("Initialized Graphics API in " + Miscellaneous.measureExecutionTime(() -> api.initializeApi()) + "ms"); - } catch (Throwable throwable) { - logger.crash("Graphics API failed to initialize", throwable, true); - throw throwable; - } - - return true; - } else { + if (compatibleApis.isEmpty()) { logger.error("No compatible Graphics API was found"); return false; + } else if (compatibleApis.size() == 1) + logger.diag("Compatible is " + compatibleApis.getFirst()); + else + logger.diag("Compatible are " + ListFormatter.formatList(compatibleApis)); + + // Choose last item in list. + api = registeredApis.get(compatibleApis.getLast()); + try { + logger.diag("Initializing Graphics API"); + logger.diag("Initialized Graphics API in " + Miscellaneous.measureExecutionTime(() -> api.initializeApi()) + "ms"); + } catch (Throwable throwable) { + logger.crash("Graphics API failed to initialize", throwable, true); + throw throwable; } + + return true; } /**