src/main.c
This commit is contained in:
parent
f893c57598
commit
d0166b0802
12
src/pong.c
12
src/pong.c
@ -102,7 +102,19 @@ Ball_move(Ball *b, Pong *p)
|
|||||||
|
|
||||||
void
|
void
|
||||||
Pong_run(Pong *p) {
|
Pong_run(Pong *p) {
|
||||||
|
int start = false;
|
||||||
int quit = false;
|
int quit = false;
|
||||||
|
Pong_render(p);
|
||||||
|
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);
|
||||||
|
|
||||||
while (!quit) {
|
while (!quit) {
|
||||||
|
|
||||||
while( SDL_PollEvent( &(p->e) ) != 0 )
|
while( SDL_PollEvent( &(p->e) ) != 0 )
|
||||||
|
Loading…
Reference in New Issue
Block a user