Re: [Plib-users] multiple windows
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2001-12-28 03:35:11
|
Anthony Corriveau wrote:
>
> Yes, I probably mean textures. Do you think it is a glut command? If you
> find it let me know.
OK - I found a few moments to check this out...
The third parameter to glXCreateContext specifies that display lists
and textures are to be shared between two or more OpenGL "rendering contexts"
(ie windows).
I don't think GLUT does this - the only place that glXCreateContext is called
in GLUT is 'glut_win.c' which has:
window->ctx = glXCreateContext(__glutDisplay, window->vis, None, __glutTryDirect);
...the 'None' parameter is that 'share list'...so I think that nothing is shared. :-(
I also checked the 'freeglut' sources - it does the same thing as GLUT:
window->Window.Context = glXCreateContext(
fgDisplay.Display, window->Window.VisualInfo,
NULL, TRUE ) ;
PrettyPoly (which *does* share textures between multiple windows) uses the FLTK
library instead of GLUT - and looking into the FLTK source code, it calls
glXCreateContext as:
context = glXCreateContext(fl_display, fl_visual, fl_first_context, 1);
...which looks more convincing.
Somehow, I thought it was easier than this...and it's possible that it is - but
I don't know how.
> I have the source to PrettyPoly but it uses a few other libs, and it will
> take a while to sort through it.
Don't bother - it won't tell you anything. The difference is inside FLTK
with that glXCreateContext call.
So, it seems like you have two choices:
1) Take a copy of 'freeglut' (which has very liberal licensing conditions)
and hack it to make it share display lists and textures. I don't think
this is all *that* hard to do...but it's a pain because you now have
a non-standard library.
2) Switch to a different window library. We know that FLTK is good in
this regard...I have no idea about the other alternatives.
I confess that I'm suprised that GLUT doesn't share textures by default.
----------------------------- Steve Baker -------------------------------
Mail : <sjb...@ai...> WorkMail: <sj...@li...>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net
|