[SDL] Mix_ChannelFinished and OO

Byron Wright bslayerw at mindspring.com
Fri Sep 6 17:39:01 PDT 2002


Hi everyone,

I am new to SDL (SDL_mixer) and relatively new to C++ so this is both an
SDL and C++ question. I search the archives and could not find an
answer. 

I created a wrapper class called SoundEffect to make the SDL_mixer calls
OO. The issue I am having is trying to get the Mix_ChannelFinished
callback working with my class. I would like to pass my "void
SoundEffect::onDone(int val)" member function to Mix_ChannelFinished.

This is what I currently have :

		void (SoundEffect::*done)(int); 
		done = &SoundEffect::onDone;
		Mix_ChannelFinished(done);

Clearly this does not work as the parameter to the Mix_ChannelFisished
is : void (*channel_finished)(int channel)) 

Any thoughts and suggestions would be gladly appreciated. 

Byron Wright





More information about the SDL mailing list