Bink SDK 1.5v |
Under Win32, to be polite, we are encouraged to share the processor time with other applications. To do this, we have to process messages while we're waiting for each frame. Bink handles timing with the BinkWait function, so we just need to check this function whenever we're not processing a message. So, we'll simply monitor the BinkWait function in our message loop - when BinkWait tells us that it's time for the next frame, we'll just call the code to advance a frame. A simple example of Windows playback would look something like this:
for ( ; ; ){ // check for a Windows message if ( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) ) { if ( msg.message == WM_QUIT ) break;
TranslateMessage( &msg ); DispatchMessage( &msg ); } else { // no Windows message, so check on our playback if ( !BinkWait( bink ) ) { // go process the next Bink frame Show_next_frame( bink, bink_buf ); } }}
Next Topic (Bink Examples for Win32)
Previous Topic (Memory management under Win32)
Group:
The Win32 Platform
Related Functions:
BinkWait
For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.