Callbacks on events ?

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
khayyam
Posts: 7
Joined: Fri Mar 09, 2007 8:52 pm
Location: France

Callbacks on events ?

Post by khayyam »

Hi all,

My question is very simple : how to trigger a function when an event happens ?
for example I'm playing a sound, how to play another one just when the first will be finished ?
One solution could be to watch regularly by irr::audio::ISound::isFinished () if the sound is finished and so to start the new one, but it's dirty coding.

I'm looking for something like irr::audio::ISound::onEvent( ON_FINISH or ON_OPEN ... , f)
and a f function that would be triggered on event (and use boost::bind to customize the authorized f prototypes, ok ok, I'm extrapolating)

any idea ?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

This feature is missing, but planned. Until then, it's no problem to poll isFinished(), it doesn't cost any cpu time.
Post Reply