OpenGL and Specific Version Support
-
wrote on 28 Nov 2017, 11:15 last edited by
I have an application which makes use of the
QOpenGLWidget
.I've had reports back from customers that although the software runs (icon in the task bar) there is no display - the window is almost transparent. I've since narrowed this down to the version of OpenGL supported by the end users system but I would like to know:
- Is there any way of specifying a version of OpenGL to use in the application. For example, my development is running version 4.4 whereas one of the customers with this issue is only running 3.1. Obviously there are some OpenGL features not supported on the customers system.
- How can I determine which features are preventing correct operation of the application? Is it down to a single function call which may not be supported in earlier versions of OpenGL?
Thanks in advance for any advice.
-
wrote on 28 Nov 2017, 20:18 last edited by
Hi!
#include "mainwindow.h" #include <QApplication> #include <QSurfaceFormat> #include <QOpenGLContext> void setSurfaceFormat() { QSurfaceFormat format; #ifdef QT_OPENGL_ES_2 format.setRenderableType(QSurfaceFormat::OpenGLES); #else if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { format.setVersion(4, 3); // <-- the minimum version needed goes here format.setProfile(QSurfaceFormat::CoreProfile); } #endif format.setDepthBufferSize(24); format.setSamples(4); format.setStencilBufferSize(8); QSurfaceFormat::setDefaultFormat(format); } int main(int argc, char *argv[]) { QApplication a(argc, argv); setSurfaceFormat(); MainWindow w; w.show(); return a.exec(); }
-
wrote on 29 Nov 2017, 07:51 last edited by
@Wieland thanks for your solution. I will give your code a try now.
-
wrote on 6 Dec 2017, 08:12 last edited by
@Wieland Unfortunately this method doesn't seem to work. I used your code, changing the
setVersion
parameters to3, 0
however the customer is still having issues with no OpenGL display.I've also tried a
setVersion(2, 0)
which doesn't work,setVersion(1,0)
which also doesn't work either. On my local development machine with 4.4, all of the above work fine. -
Hi,
Did you gather the specifics of your customer work station ?
You might be hitting a driver issue.