Original Post
Has anyone experienced SDL_PollEvent(&event) in a function quits its while loop at the beginning it's executed? while(SDL_PollEvent(&event)) ...in this code: int title_screen() { bool quit = false; Title theTitle; while( quit == false ) { //While there's events to handle while( SDL_PollEvent( &event ) ) { theTitle.handle_input(); if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } //Apply surfaces apply_surface ( 0, 0, title, screen ); //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } } return 0; } I'm using Multithreaded DLL code generation. The first time title_screen()executed it's normal. That function title_screen() is called within main(). But second time it's executed (the flow is after title_screen() -> main_menu() -> title_screen(), so this function is called again) the SDL_PollEvent() returns false, avoiding the handle_input() function. The main_menu() uses SDL_PollEvent() too and experiencing same problem: First time called it's normal, second call PollEvent() quits irresponsibly. What possibly happening? [Edited by - andrern2000 on March 28, 2009 4:56:12 AM]