Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.6.3
-
None
Description
I have tested with QOpenGLWindow and QOpenGLWidget. The result is the same. I have attached both examples.
To reproduce the problem:
- Download an attached archive
- Run the project. A triangle will not be drawn
- The debug console shows that you use OpenGL 3.3 Core:
Requesting 3.3 core context
OpenGL version: 3.3.0 NVIDIA 391.35
GLSL version: 3.30 NVIDIA via Cg compiler
Vendor: NVIDIA Corporation
- Comment the following code in the main.cpp that sets OpenGL 3.3 Core profile:
// // Request OpenGL 3.3 core or OpenGL ES 3.0. // if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { // qDebug("Requesting 3.3 core context"); // fmt.setVersion(3, 3); // fmt.setProfile(QSurfaceFormat::CoreProfile); // } else { // qDebug("Requesting 3.0 context"); // fmt.setVersion(3, 0); // }
- Run the project to see that it shows a triangle
- See that the debug console show OpenGL 4.6 version:
OpenGL version: 4.6.0 NVIDIA 391.35
GLSL version: 4.60 NVIDIA
Vendor: NVIDIA Corporation
- So it works for OpenGL 4.6 but doesn't work for OpenGL 3.3 Core
P.S. The next code is needed in the main.cpp to activate the discrete GeForce video card on my laptop Asus K53S:
#ifdef _WIN32 #include <windows.h> extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; #endif
Topic: https://forum.qt.io/topic/157179/qt-s-opengl-vertex-binding-funcs-problem