Original Post
Is there someone here who can help me out with setting up a callback function for SDL_AddTimer() ?
I''m wanting to create a callback function that will simply call SDL_Flip().I guess what I''m really asking is what the function prototype should look like.
I''m coding in C++, and I read somewhere that you must declare the callback member function as static? (This is to negate the fact that non-static member functions contain a "this" pointer which doesn''t jive with the SDL_AddTimer function)
Anyhow, here is what the SDL docs have on SDL_AddTimer()...
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has elapsed.
Synopsis
#include "SDL.h"
SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
Callback
/* type definition for the "new" timer callback function */
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);
Any help or suggestions are appreciated and TIA.