[osg-users] I cant get DrawCallback to work...

Robert Osfield robert.osfield at gmail.com
Fri Sep 28 03:21:09 PDT 2007


Hi Carlos,

You need to be a bit more careful with your method signature - the
DrawCallback functor method is :

            virtual void operator () (const osg::Camera& /*camera*/) const {}

You've not got the const.

Robert.

On 9/28/07, Carlos Zoido <mrgalleta at gmail.com> wrote:
> Hi all!,
>
> I'm trying to add a DrawCallback in order to set a PostDrawCallback to
> a camera and make a delay before SwapBuffers happen. At las I'm Trying
> to control the frame rate of my application. I make something like
> this:
>
> class SincronizacionCallback : public osg::Camera::DrawCallback
> {
> public:
>
>         virtual void operator()(const osg::Camera &camera);
>
> protected:
>
> };
>
> void SincronizacionCallback::operator()(const osg::Camera &camera)
> {
>
>                 SleepForSomeTime....
>         return;
> };
>
>
> main_camera->setPostDrawCallback(new SincronizacionCallback);
>
>
> I'm debugging the application and It doesnt seem to work as i never
> see that the program enters in the CallBack. Could there be any bug or
> anything, or maybe I'm doing something wrong ?
>
> Thanks a lot for your help and keep doing that great work!,
>
>
> Carlos.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list