Windows! Not really working!

This commit is contained in:
JeremyStar™ 2024-06-16 15:53:07 +02:00
parent 9828409bb7
commit 62b4718ef4
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -22,8 +22,11 @@ package de.staropensource.sosengine.graphics.opengl.classes;
import de.staropensource.sosengine.base.classes.Vec2i;
import de.staropensource.sosengine.base.logging.LoggerInstance;
import de.staropensource.sosengine.base.types.LogIssuer;
import de.staropensource.sosengine.graphics.events.GraphicsApiErrorEvent;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.opengl.GL;
import org.lwjgl.system.MemoryUtil;
import java.util.HashSet;
import java.util.Set;
@ -100,6 +103,14 @@ public class Window implements de.staropensource.sosengine.graphics.classes.Wind
windowName = title;
windowSize = size;
glfwCreateWindow(windowSize.getX(), windowSize.getY(), windowName, NULL, NULL);
long windowId = glfwCreateWindow(windowSize.getX(), windowSize.getY(), windowName, NULL, NULL);
if (windowId == NULL)
new GraphicsApiErrorEvent().callEvent("Unable to create window: ID is null");
glfwMakeContextCurrent(windowId);
glfwShowWindow(windowId);
GL.createCapabilities();
glfwSwapBuffers(windowId);
glfwPollEvents();
}
}