Hi Edgar,
   
     Thanks for your quick reply. I will just try these things out and come 
back to you.
   
  Harash

Edgar Ellis <[EMAIL PROTECTED]> wrote:
  I'm not familiar with OSGMFC, but I do use osg in MFC apps.
>
> 1. The osgDB reads the file in the view class, which means that each 
> time I open a new window, the database is reloaded. Is it true that 
> due to maintainence of multiple copies of the scene, the memory 
> consumption increases?
>
Multiple loads of the same file may be cached, depending on the 
ReaderWriter::Options.
You can change the default options with Registry::getOptions().

> 2. Next I tried to move the reference pointer to the scene node to the 
> document class and read the scene database once and for all in the 
> Document class. The program works fine as long as only one view window 
> is opened. The moment we open another window, the whole texture 
> disappears. Why does this happen? What is the best way to achieve what 
> I am doing with high efficiency and minimum memory utilisation.
>
>
Sounds like osg is trying to use the same openGL objects in multiple 
openGL contexts.
Sharing the contexts should solve this problem, I'm not sure how things 
are setup in OSGMFC but wglShareLists is the windows call for sharing them.

Alternatively if you have multiple osg::SceneViews you can assign each a 
unique context id:
myOsgSceneView->getState()->setContextID(
osg::GraphicsContext::createNewContextID() );
This will cause osg to compile OpenGL objects separately for each context.

(This is all based on osg 1.2, things may have changed a bit since then)

Hope this helps,
- Edgar

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to