if this is just a visual effect - an animation, you don't need another thread, and you definitely don't need to use the audio thread.
create a member variable mCountdown in your IControl, initialise it to 0 and on MouseUp/whatever set it to a certain number of frames e.g., if IGraphics FPS = 25 (the default) and you want the animation to continue for 1 sec, you would set mCountdown to 25.
override IsDirty to do your animation... I think this would work...
bool MyControl::IsDirty()
{
if( mCountdown--) {
// do animation
return true;
}
return mDirty;
}
|