On 7/31/06, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:
I think I found the reason this is jamming up. My database is loaded
when certain conditions are met in a viewer event handler. The viewer
event handler calls the method which turns on the switch to show
osg::Text and load the terrain, but my feeling is that the viewer must
halt while running event handler and therefore the viewer never draws
the osg::Text to send the draw callback.
Event handlers are all called during the update phase of the scene
graph, and update is designed to be single threaded, and you calling
readNodeFile in such a callback will basically means that update will
stall waiting for the load to be completed, once it is the rest of the
frame will commense.
If you want to tell the user that a load is about to commense then you
have two options:
1) Break the loading into two frames, first frame up update the HUD
text, then the next
frame do the load during the update phase (between sync() and
frame()) and once
the load is complete simply reset the HUD text.
2) Create a thread to read the file and let the frame rendering go
on without stopping,
but on each frame, during the update phase check to see if the
model has been
loaded, once it has you merge this new model.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/