Guest User

video.cpp

a guest
Jul 31st, 2010
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include "video.h"
  2.  
  3. int VideoThread(void* data)
  4. {
  5.     //Hack for passing a void pointer array
  6.     //to a function that only can accept a void
  7.     //pointer
  8.     Uint32* voidArray = (Uint32*)data;
  9.     SDL_mutex* threadDrawLock = reinterpret_cast<SDL_mutex*> (*voidArray);
  10.     voidArray++;
  11.     SDL_cond* threadCanDraw = reinterpret_cast<SDL_cond*> (*voidArray);
  12.  
  13.     //While the program is not over
  14.     while(true)
  15.     {
  16.         //SDL_LockMutex(drawLock);
  17.         //Do the caption animation
  18.         SDL_WM_SetCaption( "Thread is running", NULL );
  19.         SDL_Delay( 250 );
  20.         SDL_WM_SetCaption( "Thread is running.", NULL );
  21.         SDL_Delay( 250 );
  22.         SDL_WM_SetCaption( "Thread is running..", NULL );
  23.         SDL_Delay( 250 );
  24.         SDL_WM_SetCaption( "Thread is running...", NULL );
  25.         SDL_Delay( 250 );
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment