From: Dirk R. <re...@ig...> - 2002-08-29 16:18:31
|
On Thu, 2002-08-29 at 17:58, Daniel Grest wrote: > Hello, > is it possible to have the graph render itself only, > I mean, to have all nodes call their specific gl functions, > given that a valid GL rendering context and a window exist. > i want to do something like this: > > at some init point: > { > osg::osgInit(argc,argv); > myscene = new testscene("MyScene"); > char fileName[255] = "test.wrl"; > myscene->root_= osg::SceneFileHandler::the().read(fileName); > // the loading seems to work > ... > } > > then at testscene::display: > { > glClear(...); > DrawMystuff(); > > // here I expect the graph to have it call the desired GL functions > action_->apply(root_); > // the action_ is created with action_= osg::RenderAction::create(); > // but empty otherwise, no viewport, camera etc. set > // is it necessary to set the viewport? > glutSwapBuffers(); > } You can do that, but you do need the Window/Viewport/Background, as some internal calculations depend on them being set. You can use the Passive variants, though. These are made to interfere as little as possible with a surrounding applications OpenGL setup. Take a look at testPassiveViewport and testPassiveWindow on how to use OpenSG and OpenGL in different parts of the Window. If you want to add OpenSG on top of your rednering you'll need a PassiveBackground, too. Hope it helps Dirk -- -- -- Dirk Reiners OpenSG Forum di...@op... -- The OpenSG Open Source Scenegraph: http://www.opensg.org -- Announcements: http://lists.sf.net/lists/listinfo/opensg-announce |