[SDL] [Need help] Why this code crached?

Igor Mironchick imironchick at gmail.com
Sat Jan 20 12:57:12 PST 2007


2007/1/20, David Olofson <david at olofson.net>:
>
> On Saturday 20 January 2007 21:07, Igor Mironchick wrote:
> [...]
> >     static void audio_callback( void *userdata, Uint8 *stream,
> >                                       int [...] len );
> [...]
>
> You can't pass this function as a C callback! It needs
> an "invisible" 'this' argument to work.
>
> You need to use a C calling convension wrapper callback, that
> casts 'userdata' to the type of your class, and then forwards the
> call to your audio_callback().


Ooops, and where I can read about "C calling convension wrapper callback"?


-- 
Regards,
Igor Mironchick,
Intervale (c)
#ICQ 492-597-570
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070120/601f8af2/attachment.html 


More information about the SDL mailing list