Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "video.h"
- int VideoThread(void* data)
- {
- //Hack for passing a void pointer array
- //to a function that only can accept a void
- //pointer
- Uint32* voidArray = (Uint32*)data;
- SDL_mutex* threadDrawLock = reinterpret_cast<SDL_mutex*> (*voidArray);
- voidArray++;
- SDL_cond* threadCanDraw = reinterpret_cast<SDL_cond*> (*voidArray);
- //While the program is not over
- while(true)
- {
- //SDL_LockMutex(drawLock);
- //Do the caption animation
- SDL_WM_SetCaption( "Thread is running", NULL );
- SDL_Delay( 250 );
- SDL_WM_SetCaption( "Thread is running.", NULL );
- SDL_Delay( 250 );
- SDL_WM_SetCaption( "Thread is running..", NULL );
- SDL_Delay( 250 );
- SDL_WM_SetCaption( "Thread is running...", NULL );
- SDL_Delay( 250 );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment