首页 > 解决方案 > LWJGL3 游戏在 MacO 上崩溃

问题描述

我目前正在使用 LWJGL 3 for Java 11 创建游戏。每次尝试在 MacO 上启动它时,它都会崩溃。我推断该错误是由 GLFW 引起的,并且与这些代码行有关:

glfwDefaultWindowHints(); // optional, the current window hints are already the default
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

我已经尝试过该解决方案,但它也不起作用。

glfwDefaultWindowHints(); // optional, the current window hints are already the default
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);

那是错误日志

我不知道如何避免游戏崩溃。我已经在 StackOverflow 上搜索了其他答案,但找不到任何有用的东西。 链接到存储库

标签: javamacosopengllwjglglfw

解决方案


推荐阅读