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
_________________________________________________________________
Descubre la descarga digital con MSN Music. Más de un millón de canciones.
http://music.msn.es/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/