[Qt-interest] When OpenGL Initialization happens? (QGraphicsScene - OpenGL glBegin/glEnd)

Samuel Rødal sroedal at trolltech.com
Wed Apr 15 09:45:29 CEST 2009


fungos wrote:
> I was doing some tests with opengl in both Qt and Win32 and then I
> found my problem. The problem is that opengl context is not
> initialized when I try to use it inside Qt (by initializing my
> library).
> 
> My question now is, when opengl initialization will happen in Qt? Just
> when I try to use my opengk QGraphicsScene inside a QGraphicsView? Is
> there a way to initialize opengl context with QApplication
> initialization?
> 
> Attached are two samples using opengl, TestGL is the Qt test (using
> QtCreator) and TestGL2 is the Win32 test (using Code::Blocks).
> 
> Thank you

As soon as you create a QGLWidget you can call makeCurrent() on that 
widget and you will then have a valid OpenGL context for issuing OpenGL 
commands.

--
Samuel



More information about the Qt-interest-old mailing list