linux - 更新GLEW后,窗口变成黑色

标签 linux opengl debian glew debian-buster

将 Debian 从 Stretch 升级到 Buster 并将 GLEW2.0.0-3 更新到 2.1.0-2 后,我的应用程序停止了在职的。更准确地说,只有黑屏可见。着色器编译成功,但仅此而已。以下是我的程序的代码摘录:

void initGL() {
    std::cout << "Starting GLFW context, OpenGL 3.3" << std::endl;
    // Init GLFW
    if (!glfwInit()) std::cout << "GLFW init failed";
    // Set all the required options for GLFW
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);

    // Create a GLFWwindow object that we can use for GLFW's functions
    window = FULLSCREEN == true ? 
        glfwCreateWindow(WIN_W, WIN_H, "Algine", glfwGetPrimaryMonitor(), nullptr) : 
        glfwCreateWindow(WIN_W, WIN_H, "Algine", nullptr, nullptr);

    glfwMakeContextCurrent(window);

    // Set the required callback functions
    glfwSetKeyCallback(window, key_callback);
    glfwSetWindowSizeCallback(window, window_size_callback);

    // Set this to true so GLEW knows to use a modern approach to retrieving function pointers and extensions
    // glewExperimental = GL_TRUE;
    // Initialize GLEW to setup the OpenGL Function pointers
    if (glewInit() != GLEW_NO_ERROR) std::cout << "GLEW init failed\n";

    glEnable(GL_DEPTH_TEST);
    glDepthMask(true);
    //glCullFace(GL_BACK);
}

渲染:

while (!glfwWindowShouldClose(window)) {
    currentTime = glfwGetTime();
    frameCount++;
    // If a second has passed.
    if (currentTime - previousTime >= 1.0) {
        // Display the frame count here any way you want.
        std::cout << frameCount << " fps\n";
        frameCount = 0;
        previousTime = currentTime;
    }

    // Check if any events have been activiated (key pressed, mouse moved etc.) and call corresponding response functions
    glfwPollEvents();
    display();
    glfwSwapBuffers(window);
}

我正在使用 Debian Buster;我的应用程序中的 GLFW + GLEW

有什么想法可能是什么问题吗?我将非常感谢您的帮助!

更新:将系统回滚到 Debian Stretch。之后,我手动将 glew 更新到版本 2.1.0-2(位于 Buster 上),一切正常。如果问题不在驱动程序中,不在我使用的库中,那么它会出现在 Debian Buster 本身中吗?

最佳答案

问题已解决。事实证明,问题出在新的 glm 中。我手动将 glm 版本从 0.9.9~a2-2(Buster) 回滚到 0.9.8.3-3(Stretch) 以及所有内容开始正常工作。

关于linux - 更新GLEW后,窗口变成黑色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53575203/

相关文章:

使用 gldrawpixels 的 opengl 旋转

linux - 从哪里获取 iostream.h

apache2 - Apache 向 Kerberos 发送错误的服务器主体名称

linux - 如何在创建 screen 后立即执行命令?

linux - 试图删除 sendmail 消息

Ruby - 如何在数据包中做 DSCP 标记?

linux - 如何以定义的延迟复制文件集

linux - 如何在 linux ubuntu 中启动 gui 应用程序

c++ - GLM乘法顺序

Java 在 OpenGL 上下文中使用 Finalize()