Hi Sergey,

First up, from my brief experience with CEGUI I can say it's not up to
scratch, as well as being a bit of coding mess it lacks support for
threading and multiple graphics contexts, it falls a long way short of
the capabilities of what OSG applications are capable of.  The
osgWidget that's in development has much greater potential in this
respect.

That being said, if you must get the OSG and CEGUI to work together
you have to bring the OSG down to CEGUI level - you must just use it
with a single window, and you must use it single threaded.   The OSG
2.x by default will go multi-threaded if you have a multi-core system,
even with a single window, whereas OSG 1.x would only go
multi-threaded when you have multiple windows with a single camera on
each - which is probably why you were lucky with OSG 1.x.

Try adding:

   viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);

Before your viewer.realize();

However, osgWidget does have much greater potential, so I'd recommend
you pitch in an help get it up to speed.

  http://code.google.com/p/osgwidget/

Robert.

On Wed, Mar 12, 2008 at 7:34 PM, Leontyev, Sergey <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hello Serge,
>
>
>
> It still does not work, I tried to add viewer.renderTraversals() before
> CEGUI init, it did not do the trick… I also found some of your other posts
> and tried to add
>
>       state.setActiveTextureUnit(0);
>
> state.setClientActiveTextureUnit(0);
>
> inside of drawImplementation… , still did not work
>
>
>
> Everything seems to work but all images are WHITE, there are no errors in
> CEGUI log….
>
> Can I ask for the code you are using I can contact you by your gmail email
> if you wish
>
>
>
> So you are saying it works for you OSG 2.2?  I cant understand what I am
> doing wrong
>
>
>
> Thank you for your time
>
> Sergey
>
>
>
> PS here is my main
>
>
>
>    osgViewer::Viewer viewer;
>
>
>
>     osg::ref_ptr<osg::Group> group = new osg::Group;
>
>     osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("C:/Program
> Files/OpenSceneGraph2/data/cow.osg");
>
>     group->addChild(loadedModel.get());
>
>
>
>
>
>     viewer.setSceneData(group.get());
>
>
>
>
>
>     viewer.realize();
>
>     viewer.renderingTraversals();
>
>
>
>     osg::ref_ptr<osg::Geode> geode = new osg::Geode;
>
>     osg::ref_ptr<CEGUIDrawable> cd = new CEGUIDrawable();
>
>     geode->addDrawable(cd.get());
>
>
>
>     group->addChild(geode.get());
>
>
>
>     CEGUI::DefaultResourceProvider* rp = (CEGUI::DefaultResourceProvider*)
> (CEGUI::System::getSingleton().getResourceProvider());
>
>
>
>     //    std::string s = "C:\\Program
> Files\\CEGUI-SDK-0.5.0b-vc8\\datafiles\\";
>
>     std::string s = "datafiles\\";
>
>     rp->setResourceGroupDirectory("schemes",    s+"schemes\\");
>
>     rp->setResourceGroupDirectory("imagesets",  s+"imagesets\\");
>
>     rp->setResourceGroupDirectory("fonts",      s+"fonts\\");
>
>     rp->setResourceGroupDirectory("layouts",    s+"layouts\\");
>
>     rp->setResourceGroupDirectory("looknfeels", s+"looknfeel\\");
>
>     rp->setResourceGroupDirectory("lua_scripts",s+"lua_scripts\\");
>
>
>
>     CEGUI::Font::setDefaultResourceGroup("fonts");
>
>     CEGUI::Imageset::setDefaultResourceGroup("imagesets");
>
>     CEGUI::WindowManager::setDefaultResourceGroup("layouts");
>
>     CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
>
>     CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
>
>     CEGUI::Scheme::setDefaultResourceGroup("schemes");
>
>
>
>
>
>     cd->loadFont("Commonwealth-10.font");
>
>     cd->loadFont("DejaVuSans-10.font");
>
>     cd->loadScheme("WindowsLook.scheme");
>
>     cd->loadScheme("TaharezLook.scheme");
>
>
>
>     //cd->loadLayout("unnamed1.layout");
>
>
>
>      cd->loadLayout("demo8.layout");
>
>
>
>     //cd->loadLayout("demo7Windows.layout");
>
>
>
>
>
>
>
>     viewer.getCamera()->setViewMatrixAsLookAt( osg::Vec3(100, 100, 0),
> osg::Vec3(0, 0, 0), osg::Vec3(0, 0, 1));
>
>
>
>
>
>     while(!viewer.done())
>
>     {
>
>         viewer.frame();
>
>     }
>
>
>
>
>
>
>
> And  here I added 1900, 1200  ( I also tried  to leave it alone  and resize
> later in main to make it work
>
> CEGUIDrawable::CEGUIDrawable()
>
> {
>
>     setSupportsDisplayList(false);
>
>
>
>     setEventCallback(new CEGUIEventCallback());
>
>
>
>
>     new CEGUI::System( new CEGUI::OpenGLRenderer(0, 1900, 1200) );
>
>
>
> }
>
>
>
>
> _______________________________________________
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to