0
我是新来的游戏制作和LWJGL,我想创建一个基本窗口。这里是我的代码:LWJGL:无法使用glfwCreateWindow创建窗口
if (!glfwInit()) {
System.out.println("Failed to initialize GLFW");
System.exit(1);
}
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
window = glfwCreateWindow(this.SCREEN_WIDTH, this.SCREEN_HEIGHT,
"Hello World", MemoryUtil.NULL, MemoryUtil.NULL);
if (window == MemoryUtil.NULL) {
System.out.println("Failed to create window");
System.exit(1);
}
glfwMakeContextCurrent(window);
GL.createCapabilities();
glfwSwapInterval(1);
但是,当我执行的代码,我不断收到:
Failed to create window
Process finished with exit code 1
我下面这个教程GitHub上:
可有人告诉我是什么导致了这种情况发生。任何帮助,将不胜感激!