hi su - we cover this (and more!) in the intermediate training course  
we teach. however, it's a pretty simple answer - the  
drawImplementation is only executed once, because it's converted to a  
display list the first time drawn. so, disable display lists on that  
drawable, and you'll be set!

bob

On May 2, 2008, at 5:13 AM, su hu wrote:

> Hi all,
>
> I have some opengl codes and want to use these codes in osg program.
>
> I do it as follow:
>
> 1. Add a geode to root scene and define a drawable (derived from  
> osg::Drawable).
> 2. The drawable is added as child of the geode. OpenGL code is added  
> in DrawCallback of the drawable(in drawImplementation).
>
> But it seems that the DrawCallback function is called by osg only  
> once. When I add other node to root scene, the drawable will  
> disappear.
>
> Could you please tell me how to add opengl code to osg program?A  
> simple sample will be appreciated. Thanks a lot.
>
> Regards,
>
> t s
> _______________________________________________
> 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