Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2006
Re: Multiple GL contexts in Qt 4.2 not working


Message 1 in thread

First of all, thanks to all, who were helping me.

I just solved the problem. It is either a bug or a feature in Qt 4.2 :-) 
Maybe Qt developers can comment on it.

Ok, here is the problem description:
updateGL() calls makeCurrent() internally (you can found the source code for 
this in qgl_win.cpp in the class QGLContext). makeCurrent() internally calls 
GetDC(). So far so good.
Eevery call to GetDC() MUST have a corresponding call to ReleaseDC(). 
ReleaseDC() is usually called in doneCurrent(). doneCurrent() is supposed to 
be called automatically by Qt. However, in our application Qt DID NOT call 
doneCurrent() automatically, but only makeCurrent(), causing many many calls 
of GetDC() without corresponding calls of ReleaseDC(). If the numer of 
GetDC() calls exceeds some limit, a null pointer is returned by Windows.

So the temporary solution in our application is to replace every updateGL() 
call by updateGL() followed by doneCurrent().

Qt developers, is this behaviour intended or is it a bug?
Unfortunately I don't have the 4.1 source available at the moment to debug 
the behaviour, but apparently Qt 4.2 introduced this incorrect behaviour.

Thanks for your considerations!

Cheers,
Marco 


--
 [ signature omitted ] 

Message 2 in thread

Hi,

> Qt developers, is this behaviour intended or is it a bug?
> Unfortunately I don't have the 4.1 source available at the moment to debug 
> the behaviour, but apparently Qt 4.2 introduced this incorrect behaviour.

I don't work on the Windows platform so I can't comment, but you might 
want to ask Trolltech support or file a bug report (preferably with a 
minimal compilable example) and someone will look into this:
	http://www.trolltech.com/bugreport-form

--
 [ signature omitted ] 

Message 3 in thread

The bug is filed:
http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=138570

Marco

> I don't work on the Windows platform so I can't comment, but you might 
> want to ask Trolltech support or file a bug report (preferably with a 
> minimal compilable example) and someone will look into this:
> http://www.trolltech.com/bugreport-form
>
> --
> Dimitri 


--
 [ signature omitted ]