diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java index fbe8f393..35a7826a 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java @@ -68,12 +68,18 @@ public class Window extends de.staropensource.sosengine.graphics.classes.Window if (!Miscellaneous.onMainThread()) throw new NotOnMainThreadException(); + // Set required version and profile + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); + + // Create window long identifier = glfwCreateWindow(getSize().getX(), getSize().getY(), getTitle(), MemoryUtil.NULL, MemoryUtil.NULL); if (identifier == MemoryUtil.NULL) { new GraphicsApiErrorEvent().callEvent("Unable to create window: Identifier is null"); throw new de.staropensource.sosengine.graphics.opengl.exceptions.WindowCreationFailureException(); } + // Set identifier setIdentifier(String.valueOf(identifier)); ownContext(identifier); // Own context