Window all blacked in OpenGL 3.1
-
I'm using QOpenGLWidget and when i set QSurfaceFormat to version 3.1 the screen goes all black, not even clearing the color that it supposed to be.
I have an Intel HD Graphics 3000 which supports up to OpenGL 3.1 (https://www.intel.la/content/www/xl/es/support/articles/000005524/graphics-drivers.html) and my drivers are up to date.
This code is in my main.cppQApplication a(argc, argv); a.setAttribute(Qt::AA_UseDesktopOpenGL); QSurfaceFormat fmt; fmt.setRenderableType(QSurfaceFormat::OpenGL); fmt.setProfile(QSurfaceFormat::NoProfile); fmt.setVersion(3, 1); QSurfaceFormat::setDefaultFormat(fmt); MainWindow w; w.show();
i have set the UseDesktopOpenGL attribute to force the program to use desktop opengl because normally the opengl version it is set to Opengl ES even if my rendering type is set to OpenGL i dont know why.
In previous version of OpenGL the windows work fine and also i tested changing the QSurfaceFormat
-
I'm using QOpenGLWidget and when i set QSurfaceFormat to version 3.1 the screen goes all black, not even clearing the color that it supposed to be.
I have an Intel HD Graphics 3000 which supports up to OpenGL 3.1 (https://www.intel.la/content/www/xl/es/support/articles/000005524/graphics-drivers.html) and my drivers are up to date.
This code is in my main.cppQApplication a(argc, argv); a.setAttribute(Qt::AA_UseDesktopOpenGL); QSurfaceFormat fmt; fmt.setRenderableType(QSurfaceFormat::OpenGL); fmt.setProfile(QSurfaceFormat::NoProfile); fmt.setVersion(3, 1); QSurfaceFormat::setDefaultFormat(fmt); MainWindow w; w.show();
i have set the UseDesktopOpenGL attribute to force the program to use desktop opengl because normally the opengl version it is set to Opengl ES even if my rendering type is set to OpenGL i dont know why.
In previous version of OpenGL the windows work fine and also i tested changing the QSurfaceFormat
@Mario1159 said in Window all blacked in OpenGL 3.1:
QSurfaceFormat fmt;
fmt.setRenderableType(QSurfaceFormat::OpenGL); fmt.setProfile(QSurfaceFormat::NoProfile); fmt.setVersion(3, 1); QSurfaceFormat::setDefaultFormat(fmt);
why do you need to force those?
-
@raven-worx because if i comment
a.setAttribute(Qt::AA_UseDesktopOpenGL);
and put thisqDebug() << reinterpret_cast<const char*>(glGetString(GL_VERSION));
in initializeGL in my QOpenGLWidget , i get OpenGL ES 3.0 (ANGLE 2.1.0.unknown hash) instead of desktop opengl 3.1