[osg-users] Camera::setPreDrawCallback -> add?
andersb at cs.umu.se
Wed Sep 5 00:49:29 PDT 2007
Yes, thats the way we are using it now.
The problem as I see it is that if someone is adding a callback inside a
3:rd library (not uncommon), then someone can undo that by accessing the
camera and attaching their own callback.
void setupCamera(Camera *cam)
Which sort of moves the responsibility of the callbacks to the documentation
of any method that accesses the callbacks.
Mixing a bunch of libraries will then be......less easy :-)
I totally agree about keeping the API simple.
So I guess I have to stick whats there....
It was just a suggestion.
On 8/31/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> Hi Anders,
> There is only one callback for pre and post draw callbacks to keep the
> API as simple as possible - just two methods per callback - a get and
> set. Once you add a list you end with add/remove/get/getnumber.
> One way to do multiple callbacks is to nest the callbacks, so you have
> your own CompositeCameraCallback which contains a list of Camera
> On 8/31/07, Anders Backman <andersb at cs.umu.se> wrote:
> > Hi.
> > In osgProducer there was the concept of a list of pre/post
> > In osgViewer there can be only one.
> > Is purposely done for a specific reason (performance, complexity, ..)?
> > It is not very uncommon to have several pre/post draw callbacks for a
> > viewer, and if you are developing an API where you internally to the API
> > drawcallbacks, and the user of the api accesses the camera later on and
> > camera->setPreDrawCallback(myCallback), well then you are
> > fried.
> > So could it be possible to refactor that into a list of callbacks?
> > /Anders
> > --
> > ________________________________________________________________
> > Anders Backman Email: andersb at cs.umu.se
> > HPC2N/VRlab Phone: +46 (0)90-786 9936
> > Umea university Cellular: +46 (0)70-392 64 67
> > S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
> > http://www.cs.umu.se/~andersb
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> osg-users mailing list
> osg-users at lists.openscenegraph.org
Anders Backman Email: andersb at cs.umu.se
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users