View Full Version : [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL
didier
4th August 2011, 22:50
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.:)
Dong Back Kim
5th August 2011, 01:03
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?
didier
5th August 2011, 11:11
Are you using overpainting with the QGLWidget?
A this time, no. I have just written this piece of code.
class GLWidget :public QGLWidget
{
Q_OBJECT
public:
GLWidget(QWidget* argParent = 0,
const QGLWidget* argShareWidget = 0,
Qt::WindowFlags argFlags = 0 );
signals:
void sizeChanges(QSize const&);
void doubleClick(QPoint const&);
void click(QPoint const&);
protected:
void initializeGL();
void resizeGL(int argWidth, int argHeight);
void mouseDoubleClickEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void paintGL();
};
#include "../include/GLWidget.h"
GLWidget::GLWidget(QWidget* argParent,
const QGLWidget* argShareWidget,
Qt::WindowFlags argFlags)
:QGLWidget(argParent,
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());
}
void GLWidget::mouseReleaseEvent(QMouseEvent* event)
{
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.
Dong Back Kim
5th August 2011, 23:33
A this time, no. I have just written this piece of code.
class GLWidget :public QGLWidget
{
Q_OBJECT
public:
GLWidget(QWidget* argParent = 0,
const QGLWidget* argShareWidget = 0,
Qt::WindowFlags argFlags = 0 );
signals:
void sizeChanges(QSize const&);
void doubleClick(QPoint const&);
void click(QPoint const&);
protected:
void initializeGL();
void resizeGL(int argWidth, int argHeight);
void mouseDoubleClickEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void paintGL();
};
#include "../include/GLWidget.h"
GLWidget::GLWidget(QWidget* argParent,
const QGLWidget* argShareWidget,
Qt::WindowFlags argFlags)
:QGLWidget(argParent,
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());
}
void GLWidget::mouseReleaseEvent(QMouseEvent* event)
{
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.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.