PDA

View Full Version : Multiple glWidgets with Lists and Textures.



Gadaviel
26th April 2010, 09:29
Hello,

I need to make a program with 4 different QGLWidget().
There isn't any problem as long as I don't use glNewList() or glGenTexture()... but when I try to use one of these functions (my model contain more than 10^6 triangles and I must display the texture, so I don't have the choice) all gone wrong... the glwidgets stop displaying anything.
I think the problem comes from the function makecurrent() but if I don't do the makecurrent I can't create the new lists.


So I want to know if anybody had met the same problem, and how to fix it. :)


You can find my code and more informations (in French) there (http://forum.qtfr.org/viewtopic.php?id=11021).


Thank you for everything.

Wali
12th May 2010, 19:23
You need to share a gl context with each of your gl widgets.
i.e.



void CreateGLWidgets(QWidget *parent_widget)
{
QGLContext * my_context new QGLContext;
QGLWidget * widget_1 = new QGLWidget( parent_widget,my_context);
QGLWidget * widget_2 = new QGLWidget( parent_widget,my_context);
QGLWidget * widget_3 = new QGLWidget( parent_widget,my_context);
QGLWidget * widget_4 = new QGLWidget( parent_widget,my_context);
}