Hi Rui, I've just been reviewing your new CEGUI example and it certainly looks a big step up from the previous hack that I did. However, I do wonder if it might be simplified from the end user perpespective.
My thought it that it would probably be possible to have a custom CEGUI osg::Node which handles the drawable and event handling automatically. This custom node would probably be most convinient to just subclass from osg::Camera, and then could just be directly added to the scene graph or as a slave camera, with the internal drawable and event callback just managed internally. One thing I haven't worked out yet is why the initializeControls() exists, it looks from the context as if CEGUI requires a valid graphics context event to create and initialize objects. Also from reading the code, outwardly it looks like CEGUI relies entirely on singletons to manage all data structures, so that the OSG classes are there purely to provide a means for calling the CEGUI for a thread with a valid grpahics context, the OSG classes/objects aren't directly connected to specific CEGUI instances, rather call CEGUI via it's singletons. Am I reading it correctly? Robert. On Fri, Jul 8, 2011 at 7:28 AM, Wang Rui <[email protected]> wrote: > Hi Robert, > > I just spent some time designing an example that integrates OSG and > the latest CEGUI toolkit (http://www.cegui.org.uk). As CEGUI becomes > much more stable and useful than before and is used widely in game and > visualization developments, I hope this example could be of help to > people who expect them. It's a lot different from the old osgcegui > example which is obsolete and removed from the trunk. To add this > example you may have to modify the CMakeLists.txt in the examples/ > directory: > > IF(CEGUI_FOUND) > ADD_SUBDIRECTORY(osgcegui) > ENDIF(CEGUI_FOUND) > > And add FIND_PACKAGE(CEGUI) in CMakeLists.txt under the source code > root. You may either specify the CEGUI datafiles path with the CMake > option CEGUI_DATAFILE_DIR, or with the commandline argument > --datafile: > # ./osgcegui --datafile /home/cegui_root/datafiles > > Datafiles are required for CEGUI to start properly. It works well with > CEGUI 0.7.5 under Windows XP and Ubuntu 10.04 at present. I've also > compiled the example with CEGUI 0.6.x, but didn't do enough tests. > > Cheers, > > Wang Rui > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
