Dirk Reiners wrote:
Hi Allen,
On Sat, 2005-07-16 at 15:12 -0500, Allen Bierbaum wrote:
Sorry if any of this sounds harsh, but why doesn't OpenSG use
glGenLists() to allocate it's display list ids?
We had that before. The main problem is that not every thread can call
it but only the rendering threads, and given that OpenGL allows you to
use your own ids, that seemed like an unnecessary indirection.
Why not use a lazy allocation method like they use in that other
Open-Source-Scene-Graph-Who-Must-Not-Be-Named? :)
I think they just have a concept of a dirty object that needs an id
allocated for it. Then the next render pass each render context
allocates new ids on depend for each GL object per context. It seems to
work very well and the design seems very clean.
Not being able to reliably call glGenLists() in my own OpenGL code makes
it very difficult to integrate standard OpenGL with OpenSG.
Honestly, I never expected people to use OpenSG together with OpenGL,
and I'm surprised that it works as well as it does. ;)
And here I thought that was one of the main selling points of OpenSG.
It uses OpenGL so you can mix it with anything else using OpenGL that
you would like. :)
I know that
I can work around this by just manually allocating a large number of
display lists at the beginning of my application, but this really just
works around the problem. It does not solve it. Until OpenSG uses
glGenLists(), it will always be possible to write OpenGL code that will
not integrate with OpenSG.
Well, not all OpenGL code uses GenLists, so there will always be OpenGL
code that doesn't integrate well with anything.
And for your own code you can just ask OpenSG for ids:
UInt32 id = Window::registerGLObject
(osgTypedFunctionVoidFunctor2Ptr<Window,UInt32>(NULL), 1);
As long as you don't call validate() on them this will work just fine.
This won't work for the OpenGL libraries and routines I use though
because they are designed to be used with only OpenGL (ie. without
OpenSG in the mix at all). For example I may want to use them in a pure
OpenGL application or in combination with a different OpenGL-based scene
graph.
On a related note, does OpenSG behave similarly for texture objects,
vbos, shader objects, etc?
They use the same mechanism, so yes. OpenSG only has a single unified
namespace, as there didn't seem to be any reasons for keeping them
separate.
Darn, that is what I thought. So that means all my OpenSG applications
where I mix OpenGL code must start by manually allocating some huge
number of display lists, texture objects, shaders, etc. I guess as long
as I know how to work around this problem I can get everything to work.
-Allen
Hope it helps
Dirk
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users