From 311de39899300dc23d76981a509638a5b5e96bf0 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 21 Jul 2024 16:44:18 +0200 Subject: [PATCH] Remove createWindow and add mustRunOnMainThread --- .../graphics/opengl/OpenGlManagement.java | 8 ++------ .../graphics/classes/ApiManagementClass.java | 14 ++++---------- .../de/staropensource/sosengine/testapp/Main.java | 1 - 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlManagement.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlManagement.java index d657d8ab..3a0714cc 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlManagement.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlManagement.java @@ -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; } } diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/ApiManagementClass.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/ApiManagementClass.java index bd5719cf..3194b096 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/ApiManagementClass.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/ApiManagementClass.java @@ -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(); } diff --git a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java index 4ac355ad..6f31bd13 100644 --- a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java +++ b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java @@ -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);