[osg-users] My own main loop witout viewer.run()

Вячеслав SlavStuff at yandex.ru
Wed Mar 18 13:10:00 PDT 2009


Hi,

I learn osg now and want to use it for 3D-game. So the architecture based on viewer.run() can't be used.
In "OpenSceneGraph Quick Start Guide" about other approach was explained in a pretty general sense:

> 3.1 Rendering
> OSG doesn’t hide any functionality. OSG exposes the lowest levels of its functionality
> to your application. If you want complete scene graph rendering control, you can write
> code to perform the following operations in your application.
>      •   Develop your own view management code to modify the OpenGL model-
>          view matrix.
>      •   Create a window and an OpenGL context, and make them current. Write the
>          code to manage multiple windows and contexts if your application requires it.
>      •   If your application uses paged databases, start the osgDB::DatabasePager.
>      •   Instantiate osgUtil::UpdateVisitor, osgUtil::CullVisitor, and
>          osgUtil::RenderStage objects to implement the update, cull, and draw
>          traversals. If you really want total control, design your own classes to perform
>          these traversals.
>      •   Write a main loop that handles events from the operating system. Call into
>          your view code to update the model-view matrix.
>      •   Call glClear() before rendering a frame. Execute update, cull, and draw
>      ...


So how to use osg as a complement to OpenGL but without letting osg to control OpenGL (and my main loop) fully?
Any references will be helpful.

Thank you.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8732#8732








More information about the osg-users mailing list