Sort methods in OpenGlSubsystem

This commit is contained in:
JeremyStar™ 2024-07-21 16:44:57 +02:00
parent 311de39899
commit 7962a15c12
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -139,6 +139,32 @@ public final class OpenGlSubsystem implements ApiMainClass {
logger.info("Initialized Graphics API in " + initTime + "ms");
}
/**
* Shuts the graphics subsystem down.
*
* @since v1-alpha0
*/
public static void shutdownApi() {
LoggerInstance logger = instance.logger;
logger.verb("Shutting down");
@SuppressWarnings("resource")
long shutdownTime = Miscellaneous.measureExecutionTime(() -> {
glfwTerminate();
//noinspection DataFlowIssue
glfwSetErrorCallback(null).free();
});
logger.info("Shut down in " + shutdownTime + "ms");
}
/** {@inheritDoc} */
@NotNull
@Override
public DependencyVector getDependencyVector() {
return new DependencyVector("opengl", StarOpenSourceVersioningSystem.class, EngineInformation.getVersioningString());
}
/** {@inheritDoc} */
@Override
public String getApiName() {
@ -183,30 +209,4 @@ public final class OpenGlSubsystem implements ApiMainClass {
public static void onGraphicsApiError(String error) {
instance.logger.error("Graphics API returned an error: " + error);
}
/**
* Shuts the graphics subsystem down.
*
* @since v1-alpha0
*/
public static void shutdownApi() {
LoggerInstance logger = instance.logger;
logger.verb("Shutting down");
@SuppressWarnings("resource")
long shutdownTime = Miscellaneous.measureExecutionTime(() -> {
glfwTerminate();
//noinspection DataFlowIssue
glfwSetErrorCallback(null).free();
});
logger.info("Shut down in " + shutdownTime + "ms");
}
/** {@inheritDoc} */
@NotNull
@Override
public DependencyVector getDependencyVector() {
return new DependencyVector("opengl", StarOpenSourceVersioningSystem.class, EngineInformation.getVersioningString());
}
}