'Press any key' message functionality is moved to pong struct.
NOTE: Last commit was sent by mistake, it is part of this one
This commit is contained in:
parent
d0166b0802
commit
54ecb1f828
14
src/main.c
14
src/main.c
|
@ -7,8 +7,6 @@
|
|||
int main (int argc, char* args[])
|
||||
{
|
||||
Pong *p = NULL;
|
||||
int start = false;
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
|
||||
|
@ -27,18 +25,6 @@ int main (int argc, char* args[])
|
|||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
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);
|
||||
|
||||
Pong_run(p);
|
||||
Pong_free(p);
|
||||
|
||||
|
|
Loading…
Reference in New Issue