Hi There, I have been using seperate windows for a while now, and manually setting seperate graphics context ids. I have done it as a part of a regular Win32 console App, in an MFC window, and as a part of Managed MFC/C++ library used in a C# app. I run into this issue with all of them, so it is not really an MFC thing. I have learned to set the context ID's, not use display lists, and not use the osgUtil::Optimizer. It almost always fixes the problem, but in this latest app (I have like 7 windows open, and 1 or two are usually missing their textures) but I still occasionally get this problem. I want to try what Robert describes here and see how it helps.
-- Rick On 5/5/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
HI Harash, The lastest dev versions (SVN and 1.9.x series) of the OSG have support for multiple views onto one or more scenes, this is supported by the osgViewer::CompositeViewer class. To use this you'll create a osgViewer::View for each view you have and this to the CompostiteViewer object (you'll maintain one per app). For each View you'll probably just have one master Camera, and to this you need to attach what it'll be rendering to - a GraphicsContext/GraphicsWindow. To attach a GraphicsWindow you'll need to create it, and in your case most likely attaching it to a pre-existing MFC window, this is possible by the inheritedWindowData filed in osg::GraphicsContext::Triats structure used to describe the window you want to create. This is a lot to take in, so take it bit by bit, first up familiarise yourself with the osgcamera and osgmultiplecamera examples, the later uses CompositeViewer. I wouldn't recommend looking too long at OSGMFC as this is very old now, long before the new osgViewer library included with the OSG. Robert. On 5/4/07, Harash Sharma <[EMAIL PROTECTED]> wrote: > Hi Robert, > > I have started using OSG the previous month. It is fantastic. But I > have a lot of queries which I intend to clear through you. I am using > VS-2005. My application uses the standard Document - View Architecture > provided by MFC. The application is of Multiple Document Interface type. The > software is supposed to load a scene graph database and use multiple views > to render this scene with each view attached to a different camera position. > I downloaded the recommended OSGMFC sample application for the purpose of > learning the mechanism to do so. Now my doubts: > > 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? > > 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. > > > Regards > > > Harash > > > ------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos.<http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-> > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
