[Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL
Hi,
I'm encountering a problem with integrating a QGLWidget.
The message "Unrecognized OpenGL" appears on console.
And glGetString always returns NULL.
My graphic driver is up-to-date.
I success in compiling and running a trivial openGL program and glGetStrings works well.
Someone can tell me what to do ?
Thanks a lot.:)
Re: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL
Quote:
Originally Posted by
didier
Hi,
I'm encountering a problem with integrating a QGLWidget.
The message "Unrecognized OpenGL" appears on console.
And glGetString always returns NULL.
My graphic driver is up-to-date.
I success in compiling and running a trivial openGL program and glGetStrings works well.
Someone can tell me what to do ?
Thanks a lot.:)
Are you using overpainting with the QGLWidget?
Re: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL
Quote:
Originally Posted by
Dong Back Kim
Are you using overpainting with the QGLWidget?
A this time, no. I have just written this piece of code.
Code:
{
Q_OBJECT
public:
Qt::WindowFlags argFlags = 0 );
signals:
void sizeChanges
(QSize const
&);
void doubleClick
(QPoint const
&);
protected:
void initializeGL();
void resizeGL(int argWidth, int argHeight);
void paintGL();
};
Code:
#include "../include/GLWidget.h"
GLWidget
::GLWidget(QWidget* argParent,
Qt::WindowFlags argFlags)
argShareWidget,
argFlags)
{
}
void GLWidget::initializeGL()
{
}
void GLWidget::resizeGL(int argWidth, int argHeight)
{
emit sizeChanges
(QSize(argWidth, argHeight
));
}
void GLWidget::paintGL()
{
}
void GLWidget
::mouseDoubleClickEvent(QMouseEvent* event
) {
emit doubleClick(event->pos());
}
{
emit click(event->pos());
}
I've believed, an instant, it's because my OpenGL implementation is 4.1 and Qt 4.6.3 wouldn't recognize OpenGL 4.1 because of enum QGLFormat::OpenGLVersionFlag's definition.
About glGetString(). The problem is over. I've discovered glContext is inititialized in after QGLWidget() constructor. In paintGL(), it works well.
Re: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL
Quote:
Originally Posted by
didier
A this time, no. I have just written this piece of code.
Code:
{
Q_OBJECT
public:
Qt::WindowFlags argFlags = 0 );
signals:
void sizeChanges
(QSize const
&);
void doubleClick
(QPoint const
&);
protected:
void initializeGL();
void resizeGL(int argWidth, int argHeight);
void paintGL();
};
Code:
#include "../include/GLWidget.h"
GLWidget
::GLWidget(QWidget* argParent,
Qt::WindowFlags argFlags)
argShareWidget,
argFlags)
{
}
void GLWidget::initializeGL()
{
}
void GLWidget::resizeGL(int argWidth, int argHeight)
{
emit sizeChanges
(QSize(argWidth, argHeight
));
}
void GLWidget::paintGL()
{
}
void GLWidget
::mouseDoubleClickEvent(QMouseEvent* event
) {
emit doubleClick(event->pos());
}
{
emit click(event->pos());
}
I've believed, an instant, it's because my OpenGL implementation is 4.1 and Qt 4.6.3 wouldn't recognize OpenGL 4.1 because of enum QGLFormat::OpenGLVersionFlag's definition.
About glGetString(). The problem is over. I've discovered glContext is inititialized in after QGLWidget() constructor. In paintGL(), it works well.
Good to know about QGLFormat::OpenGLVersionFlag.