forked from StarOpenSource/Engine
Move graphics initialization code around in method
This commit is contained in:
parent
f5af9b34a0
commit
24e26e6a82
1 changed files with 16 additions and 15 deletions
|
@ -217,10 +217,15 @@ public final class GraphicsSubsystem implements SubsystemMainClass {
|
|||
} else
|
||||
logger.diag(apiName + " is incompatible with this system");
|
||||
|
||||
logger.diag("Compatible is/are " + ListFormatter.formatList(compatibleApis));
|
||||
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.
|
||||
if (!compatibleApis.isEmpty()) {
|
||||
api = registeredApis.get(compatibleApis.getLast());
|
||||
try {
|
||||
logger.diag("Initializing Graphics API");
|
||||
|
@ -231,10 +236,6 @@ public final class GraphicsSubsystem implements SubsystemMainClass {
|
|||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
logger.error("No compatible Graphics API was found");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue