Thanks both for answering
i did what robert said and now i have a nice wxwidgets app with osg´s new viewer running on it ;)
thanks a lot
From: Doug McCorkle <[EMAIL PROTECTED]>
Reply-To: osg users <osg-users@openscenegraph.net>
To: osg users <osg-users@openscenegraph.net>
Subject: Re: [osg-users] problem with wxwidgets and osg
Date: Tue, 12 Jun 2007 18:17:34 -0500
>Hello David,
>
> Another option would be to try the producer users list for
>some insight. The new ProducerOSG library works pretty nice with
>wx/osg as well.
>
>Doug
>
>On Jun 12, 2007, at 11:37 AM, Robert Osfield wrote:
>
>>Hi David,
>>
>>In the SVN version of the OSG there is an WxWidget example called
>>osgviewerWX. It uses the new osgViewer rather than osgProducer,
>>but
>>it'll give you all the osgGA and database pager functionality.
>>
>>Robert.
>>
>>On 6/12/07, David _ <[EMAIL PROTECTED]> wrote:
>>>Hi
>>>
>>>i´ve done a simple app with osg and wxwidgets using just the
>>>producer and it
>>>works, but now i would like to use the osgproducer::Viewer because
>>> the way
>>>it handles the osgas and pagelods saves me some work
>>>
>>>the problem is that i can´t get nothing on the screen. I´ve made
>>>my
>>>glcontext using wx and passed it to the camera like i did with the
>>> producer,
>>>but now with the viewer involved it doesn´t work. I have no image
>>>on the
>>>screen or i receive a non valid pixel format (it´s valid because
>>>it works
>>>with the previous app)
>>>
>>>this is the parts of my code which are related to this
>>>
>>>---------------------------------------------------------------------
>>>------------
>>>camara = new Producer::Camera;
>>>
>>>
>>>m_canvas->escena->camara->getRenderSurface()->setWindow(
>>>(HWND)m_canvas->GetHandle() ); //this line is from other file, and
>>> it does
>>>the set window ok because i worked with the previous app
>>>
>>>Producer::CameraConfig* camara_config = new
>>>Producer::CameraConfig();
>>>std::string ristra = "camara1";
>>>camara_config->addCamera(ristra, camara.get());
>>>
>>>osg::BoundingSphere bs = rootNode->getBound();
>>>camara->setViewByLookat( bs.center()[0], bs.center()[1] -
>>>bs.radius () * 3.0,
>>>bs.center()[2],
>>> bs.center()[0], bs.center()[1],
>>>bs.center()[2],
>>> 0, 0, 1 );
>>>
>>>viewer = new osgProducer::Viewer(camara_config);
>>>viewer.get()->setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
>>>viewer.get()->realize();
>>>viewer.get()->setSceneData(rootNode.get());
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>------
>>>
>>>i´ve tried commenting the realize call of the viewer and calling
>>>to the void
>>>parameter constructor of the viewer instead and then modifying the
>>> camera(0)
>>>like this -->>
>>>//viewer.get()->getCamera(0)->getRenderSurface()->setWindow((const
>>>Producer::Window)win);
>>>
>>>but i have no results
>>>
>>>i managed to get full screen but that´s not what i want, i would
>>>like to
>>>have the viewer running in my window to keep all the wxwidgets
>>>controls on
>>>sight
>>>
>>>if somebody could help me i would really apreciate it.
>>>
>>>PS: sorry for my english
>
>_______________________________________________
>osg-users mailing list
>osg-users@openscenegraph.net
>http://openscenegraph.net/mailman/listinfo/osg-users
>http://www.openscenegraph.org/
Ofertas y reservas para viajar por todo el mundo. Organiza y contrata tus viajes aquí.
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/