forked from StarOpenSource/Engine
Require OpenGL version during window creation
This commit is contained in:
parent
80478e6a69
commit
8b09290c81
1 changed files with 6 additions and 0 deletions
|
@ -68,12 +68,18 @@ public class Window extends de.staropensource.sosengine.graphics.classes.Window
|
||||||
if (!Miscellaneous.onMainThread())
|
if (!Miscellaneous.onMainThread())
|
||||||
throw new NotOnMainThreadException();
|
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);
|
long identifier = glfwCreateWindow(getSize().getX(), getSize().getY(), getTitle(), MemoryUtil.NULL, MemoryUtil.NULL);
|
||||||
if (identifier == MemoryUtil.NULL) {
|
if (identifier == MemoryUtil.NULL) {
|
||||||
new GraphicsApiErrorEvent().callEvent("Unable to create window: Identifier is null");
|
new GraphicsApiErrorEvent().callEvent("Unable to create window: Identifier is null");
|
||||||
throw new de.staropensource.sosengine.graphics.opengl.exceptions.WindowCreationFailureException();
|
throw new de.staropensource.sosengine.graphics.opengl.exceptions.WindowCreationFailureException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set identifier
|
||||||
setIdentifier(String.valueOf(identifier));
|
setIdentifier(String.valueOf(identifier));
|
||||||
|
|
||||||
ownContext(identifier); // Own context
|
ownContext(identifier); // Own context
|
||||||
|
|
Loading…
Reference in a new issue