avis_phoenix
6th July 2014, 02:48
Hi!
I'm learning to use OpenGL 3.2 in Qt5, I understand that you want to use version 3.2 must use QSurfaceFormat follows:
QSurfaceFormat format;
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CompatibilityPro file);
But if I set a version 3.0 and up, when I use QPainter to draw information in the screen, crash my program, with this error message:
QOpenGLShader::compile(Vertex): Vertex shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 1 compilation errors. No code generated
Obviously this is because GLSL 1.10 is only supports by OpenGL 2.0, and I need use GLSL 1.50 for OpenGL 3.2, and for OpenGL 4 GLSL 4, but I don't know how to specify this, because is an internal code for QPainter.
Anyone can help me?
I use:
Qt 5.2.1 and Qt 5.3.0
Windows 8.1 64 bits and Linux 64 bits(Ubuntu 14.04, with online installation, not from repositories)
AMD Radeon HD 7700 Series
Version of Catalyst 14.4
I'm learning to use OpenGL 3.2 in Qt5, I understand that you want to use version 3.2 must use QSurfaceFormat follows:
QSurfaceFormat format;
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CompatibilityPro file);
But if I set a version 3.0 and up, when I use QPainter to draw information in the screen, crash my program, with this error message:
QOpenGLShader::compile(Vertex): Vertex shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 1 compilation errors. No code generated
Obviously this is because GLSL 1.10 is only supports by OpenGL 2.0, and I need use GLSL 1.50 for OpenGL 3.2, and for OpenGL 4 GLSL 4, but I don't know how to specify this, because is an internal code for QPainter.
Anyone can help me?
I use:
Qt 5.2.1 and Qt 5.3.0
Windows 8.1 64 bits and Linux 64 bits(Ubuntu 14.04, with online installation, not from repositories)
AMD Radeon HD 7700 Series
Version of Catalyst 14.4