[Qt-interest] Loading OpenGL Textures In A Separate Thread
Karol Krizka
kkrizka at gmail.com
Wed Apr 22 23:34:00 CEST 2009
On Wed, 2009-04-22 at 15:28 -0500, andrew.m.goth at l-3com.com wrote:
> Karol Krizka wrote:
> > textures are loading in the background in a separate thread.
>
> You could load the images from disk in the separate thread and make textures out of them in the main thread.
>
I'm actually using a third party library to load the textures and
perform the rendering, so that won't work.
> > create a new OpenGL context in the loader thread and have it share
> > it's lists with the original OpenGL context.
>
> I doubt this is possible. If it is in fact possible, it would be beneficial to me, since my application dynamically creates very large display lists as the camera is moved around. The display lists are computed in a separate thread, but the simple act of passing the arrays through glNewList(), etc., blocks the user interface for longer than I am comfortable with.
>
It's possible with pure OpenGL:
http://hacksoflife.blogspot.com/2008/02/creating-opengl-objects-in-second.html
http://veelck.wordpress.com/2008/11/28/multithread-texture-loading-in-opengl/
But I'm not sure if Qt's OpenGL would allow this too.
--
Cheers,
Karol Krizka
http://www.krizka.net
More information about the Qt-interest-old
mailing list