Hello,
I’d like to use the function
SMPEG_setdisplay(SMPEG*, SDL_Surface*, SDL_mutex*,
void()(SDL_Surface, int, int, unsigned int, unsigned int))
which takes a function for its fourth argument.
e.g.
void update(SDL_Surface*, int, int, unsigned int, unsigned int)
{
…
}
int main(…)
{
…
SMPEG_setdisplay( …,…,…,update);
…
}
this works fine
but i’d like to keep the design OO, so i’d like to use
class Foo
{
public:
Foo();
Update();
}
int main(…)
{
…
Foo* foo = new Foo();
SMPEG_setdisplay( …,…,…,foo->update);
…
}
this code doesn’t compile and gives an error like:
argument of type void (Foo::)(SDL_Surface*, int, int, unsigned int, unsigned int)' does not match
void ()(SDL_Surface, int, int, unsigned
int, unsigned int)’
How can I solve this? I’m sorry if this question is more C++ oriented
then SDL oriented. But perhaps it can be solved with a typedef or a
cast?
Thank you,
Maarten