Hi there,

I'm trying to get CEGUI working with OSG, so I set up a test application 
(osganimate.cpp) and added a function to initialize CEGUI after the viewer is 
realized() (CEGUI needs the window to be there when creating the OpenGL 
renderer).  Apart from the usual CEGUI stuff, I prepare a callback for the 
camera (global scope):

-----------------
struct CB : public osg::CameraNode::DrawCallback {
        virtual void operator()(const osg::CameraNode& /*camera*/) const {
                printf("callback\n");
                CEGUI::System::getSingleton().renderGUI();
        }
} cb;
------------------

And add it to the camera in the setupCEGUI() function, trying to follow this 
guide [1]:

--------
viewer->getSceneHandlerList()[0]
        ->getSceneView()->getCamera()->setPostDrawCallback(&cb);
--------

But the callback doesn't even get called, since nothing is ever printed, while 
the cessna and glider are turning around as in the normal osganimate app.  Is 
there any problem with my approach?  Or is there any other way, more 
appropriate, to get this done?  I saw examples that might work by rendering 
CEGUI to a texture and then show it in the engine as HUD, but this approach 
seems a bit overdone and needs much more code...


[1] 
http://www.cegui.org.uk/wiki/index.php/Using_CEGUI_with_Producer_and_OpenGL


Greetings.
-- 
Manuel A. Fernandez Montecelo <[EMAIL PROTECTED]>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to