Remove createWindow and add mustRunOnMainThread

This commit is contained in:
JeremyStar™ 2024-07-21 16:44:18 +02:00
parent 56743e9bf0
commit 311de39899
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
3 changed files with 6 additions and 17 deletions

View file

@ -19,10 +19,7 @@
package de.staropensource.sosengine.graphics.opengl;
import de.staropensource.sosengine.base.types.vectors.Vec2i;
import de.staropensource.sosengine.graphics.classes.ApiManagementClass;
import de.staropensource.sosengine.graphics.opengl.classes.Window;
import org.jetbrains.annotations.NotNull;
/**
* The OpenGL API management class.
@ -37,9 +34,8 @@ public final class OpenGlManagement implements ApiManagementClass {
public OpenGlManagement() {}
/** {@inheritDoc} */
@NotNull
@Override
public Window createWindow(String title, Vec2i size) {
return new Window(title, size);
public boolean mustRunOnMainThread() {
return true;
}
}

View file

@ -19,9 +19,6 @@
package de.staropensource.sosengine.graphics.classes;
import de.staropensource.sosengine.base.types.vectors.Vec2i;
import org.jetbrains.annotations.NotNull;
/**
* The interface for Graphics API management classes.
*
@ -30,13 +27,10 @@ import org.jetbrains.annotations.NotNull;
@SuppressWarnings({ "unused" })
public interface ApiManagementClass {
/**
* Creates a new {@link Window}.
* Returns if this Graphics API must be interacted with on the main thread.
*
* @param title initial window title
* @param size initial window size
* @return new window
* @since v1-alpha0
* @return {@code true} if Graphics API must be interacted with on the main thread, {@code false} otherwise
* @since v1-alpha2
*/
@NotNull
Window createWindow(String title, Vec2i size);
boolean mustRunOnMainThread();
}

View file

@ -111,7 +111,6 @@ public class Main {
ApiManagementClass management = api.getManagement();
// Create window
management.createWindow("Test", new Vec2i(960, 540));
// Sleep for five seconds
Thread.sleep(5000);