Exception at creation of QOpenGLFramebufferObject
-
Hello. Very possible my question is unique.
Consider the simplest program, writteln with Qt5.1 and MSVC 2012
@
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include <QOpenGLFramebufferObject>
#include <QtWidgets/QApplication>
void foo()
{
QOpenGLFramebufferObject fbo(512,512);// exception here
}int main(int argc, char *argv[])
{
QApplication a(argc, argv);
foo();
FastGL w;//GastGL is a simply widget, generated automatically, void
w.show();
return a.exec();
}@Actually, firstly I got the example from "here":http://dangelog.wordpress.com/2013/02/10/using-fbos-instead-of-pbuffers-in-qt-5-2/ but then simplify it. I have exception while creating QOpenGLFramebufferObject object:
bq. Unhandled exception at 0x0F551DFA (Qt5Guid.dll) in FastGL.exe: 0xC0000005: Access violation reading location 0x00000004.
I also tried to pass format to constructor, chage the size, but without an effect.
When working in MSVC2010 with Qt 4.8.4 but using QGLFramebufferObject it still doesn't work.
The code:
@DoubleBuff::DoubleBuff(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)//DoubleBuff is a widget being created in main
{
ui.setupUi(this);
m_painter=new QPainter(this);
m_fbo=new QGLFramebufferObject(1024,1024);
}@
Exception in qscopedpointer.h, line 110,
@ inline T *operator->() const
{
Q_ASSERT(d);
return d;
}@Any thinks?
Actually, my task is to draw sequence of rectangles having different colors on form as soon as possible, about 60 frames/sec. Can you give me an advice how to do this?