我制作了一个在光栅模式下工作正常的 Qt/Qml 应用程序。
QApplication::setGraphicsSystem("raster");
但是,一旦我将其更改为 opengl,它就会崩溃并显示以下消息:
hijackWindow() context created for QmlApplicationViewer(0xbfce6e5c) 1
QGLContext::makeCurrent(): Failed.
QGLFramebufferObject: Unable to resolve framebuffer object extensions - make sure there is a current context when creating the framebuffer object.
QGLWindowSurface: Failed to create valid FBO, falling back
QGLPixelBuffer: Unable to find a context/format match - giving up.
QGLWindowSurface: Failed to create valid pixelbuffer, falling back
QGLContext::makeCurrent(): Failed.
QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x932b428)
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader
Vertex shader for simpleShaderProg (MainVertexShader & PositionOnlyVertexShader) failed to compile
QGLShader: could not create shader
Fragment shader for simpleShaderProg (MainFragmentShader & ShockingPinkSrcFragmentShader) failed to compile
QGLShaderProgram: could not create shader program
Errors linking simple shader: ""
QGLShader: could not create shader
Vertex shader for blitShaderProg (MainWithTexCoordsVertexShader & UntransformedPositionVertexShader) failed to compile
QGLShader: could not create shader
Fragment shader for blitShaderProg (MainFragmentShader & ImageSrcFragmentShader) failed to compile
QGLShaderProgram: could not create shader program
Errors linking blit shader: ""
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader
Warning: "" failed to compile!
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader
Warning: "" failed to compile!
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
The program has unexpectedly finished.
平台:Ubuntu 12.04 - 32 位 - Intel i5 - Qt 4.8
编辑 1:
我尝试了一种使用SO 上提到的这种方法的方法。它确实有效,但即使使用如此强大的平台,我的表现也最差!?
有什么我想念的吗?有人可以列出平台上应确保的所有内容,以确保应用程序实际上在 opengl 模式下工作,而不是退回到本机模式。
例如。显卡/驱动程序/opengl 支持等?
编辑 2:
当我尝试运行 glxinfo 命令时,其中一行显示:direct rendering: No
这是我应该担心的事情吗?
编辑 3:
我试图安装一些驱动程序并注意到在我完成后direct rendering: No
更改为 a 。Yes