[Qt-interest] Strange GL profile behaviour
Yves Bailly
yves.bailly at sescoi.fr
Tue Apr 19 08:31:27 CEST 2011
Hello all,
While trying to do some core profile (3.2) OpenGL, I see something a bit strange.
All of this on Windows 7 64bits, same result using Visual C++ or MinGW, video
driver up-to-date.
Here's the beginning of my code, error checking removed:
QApplication app;
QGLFormat default_format(/*..some bits..*/);
default_formatsetProfile(QGLFormat::CoreProfile);
QGLFormat::setDefaultFormat(default_format);
// the following just to get some infos
QGLPixelBuffer pbuff(100, 100);
pbuff.makeCurrent();
glewInit();
// now showing infos
GLint gl_major = -1;
GLint gl_minor = -1;
glGetIntegerv(GL_MAJOR_VERSION, &gl_major);
glGetIntegerv(GL_MINOR_VERSION, &gl_minor);
qDebug() << "GL_MAJOR_VERSION =" << gl_major;
qDebug() << "GL_MINOR_VERSION =" << gl_minor;
qDebug() << "GL_VERSION =" << (const char*)(glGetString(GL_VERSION));
qDebug() << "GL_VENDOR =" << (const char*)(glGetString(GL_VENDOR));
qDebug() << "GL_RENDERER =" << (const char*)(glGetString(GL_RENDERER));
qDebug() << "GL_SHADING_LANGUAGE_VERSION" << (const char*)(glGetString(GL_SHADING_LANGUAGE_VERSION));
When run, I get expected values:
GL_MAJOR_VERSION = 3
GL_MINOR_VERSION = 3
GL_VERSION = 3.3.0
GL_VENDOR = NVIDIA Corporation
GL_RENDERER = Quadro FX 3800/PCI/SSE2
GL_SHADING_LANGUAGE_VERSION 3.30 NVIDIA via Cg compiler
...but when I ask for these very same informations inside a QGLWidget,
either in initializeGL() or paintGL(), I receive other values:
GL_MAJOR_VERSION = -1
GL_MINOR_VERSION = -1
GL_VERSION = 2.1.2
GL_VENDOR = NVIDIA Corporation
GL_RENDERER = Quadro FX 3800/PCI/SSE2
GL_SHADING_LANGUAGE_VERSION 1.20 NVIDIA via Cg compiler
Am I missing something? any hint appreciated :-)
Have all a nice day.
--
/- Yves Bailly - Software developper -\
\- Sescoi R&D - http://www.sescoi.fr -/
"The possible is done. The impossible is being done. For miracles,
thanks to allow a little delay."
More information about the Qt-interest-old
mailing list