在将 debian 从 stretch 升级到 buster 并GLEW
从更新2.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 本身?