Hi Manuel,
The CameraNode inside the the SceneView is currently only used for
holding view and projection matrices. Although the callback should
work, and it should be easy to add this, so I'll look into adding this
today.
BTW, the link you provide was for integrating with Producer rather
than SceneView.
However, its not how I'd integrated CEGUI. Personally I'd just create
a custom osg::Drawable to add custom OpenGL like the osgteapot example
does. You could also add an event callback to the drawable to pass
events to CEGUI.
Do things this way would then allow you to put the CEGUI anywhere in
your scene, or add it to a HUD, and anything you wish.
Robert.
On 8/1/06, Manuel A. Fernandez Montecelo <[EMAIL PROTECTED]> wrote:
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/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/