Add 'Press any key to start...' introductory message

This commit is contained in:
Pradana AUMARS 2021-06-27 17:19:17 +02:00
parent d96d7485e5
commit 4efe0c2365

View File

@ -14,6 +14,19 @@ int main (int argc, char* args[])
} }
p = Pong_init(); p = Pong_init();
Pong_render(p);
int start = false;
while (!start) {
printf("Press any key to start...\r");
fflush(stdout);
while( SDL_PollEvent( &(p->e) ) != 0 )
{
if( p->e.type == SDL_KEYDOWN) start = true;
}
}
putc('\n', stdout);
Pong_run(p); Pong_run(p);
Pong_free(p); Pong_free(p);