在Ubuntu (12.10)上的OpenGL应用程序中,我在创建窗口时发出了以下GLFW窗口提示:
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_VISIBLE, GL_TRUE);
glfwWindowHint(GLFW_SAMPLES, 0);
glfwWindowHint(GLFW_RED_BITS, 24);
glfwWindowHint(GLFW_GREEN_BITS, 24);
glfwWindowHint(GLFW_BLUE_BITS, 24);
glfwWindowHint(GLFW_ALPHA_BITS, 8);
// Create Opengl Window
window = glfwCreateWindow(width, height, windowTitle.c_str(), NULL, NULL);
centerWindow();
glfwMakeContextCurrent(window);但这会导致使用像素颜色位深度为R-G-B-A = 8-8-8-8的关联窗口创建OpenGL上下文。为了检查这一点,我在创建GLFW窗口后使用了以下代码:
int count;
const GLFWvidmode * mode = glfwGetVideoMode(monitor);
cout << "Current video mode: " <<
mode->redBits << "-" <<
mode->greenBits << "-" <<
mode->blueBits << endl;
cout << "All possible video modes: " << endl;
mode = glfwGetVideoModes(monitor, &count);
for(int i = 0; i < count; i++) {
cout << mode->redBits << "-" <<
mode->greenBits << "-" <<
mode->blueBits << endl;
}令人惊讶的是,我当前的视频模式和所有可能的视频模式都得到了8-8-8-8。我确信情况不会是这样,因为我的显示器(三星S23B550)可以显示单色渐变而没有任何马赫条带问题,这意味着它应该至少是每个颜色通道的16-24位深度。我还使用了现代显卡(Nvidia GT650M),它应该有一个帧缓冲器,每个通道支持24-32位。
唯一奇怪的是,我的显卡使用Nvidia Optimus技术,这意味着如果我想在Linux上使用我的专用显卡,我必须使用optirun (Bumblee)进行显卡切换(集成到专用),这是我在运行OpenGL应用程序时所做的。
发布于 2013-10-26 03:24:08
OpenGL表示,要在Nvidia中使用10位颜色,您必须使用shell out for a Quadro。
不是那个AMD is any better in that regard。
https://stackoverflow.com/questions/19596916
复制相似问题