If you're a decent windows programmer then I'll assume that you know what this all means:
Code:
MSG Msg;
Uint32 offset = SDL_GetTicks();
for (unsigned int i=0; i<videoFileManager.getFramesNumber(); i++){
if (PeekMessage(&Msg, 0, 0, 0, PM_REMOVE)
{
if (Msg.message == WM_QUIT)
break;
TranslateMessage(&Msg);
DisplatchMessage(&Msg);
}
showNextFrame();
while ((SDL_GetTicks() - offset) < (i*1000/videoFileManager.getFPS()) ){} //Waits until it's time to show the next frame
}
Checking for messages, displaying a frame, then syncing you FPS should all be part of any game loop you ever write. Nuff said.