q to quit
This commit is contained in:
parent
21b8c0910d
commit
3b7d413390
22
src/input.c
22
src/input.c
|
@ -2,9 +2,27 @@
|
|||
|
||||
int checkQuit()
|
||||
{
|
||||
int quit = 0;
|
||||
SDL_Event event;
|
||||
|
||||
if (SDL_PollEvent(&event) && event.type == SDL_QUIT) return 1;
|
||||
if (SDL_PollEvent(&event))
|
||||
{
|
||||
switch(event.type)
|
||||
{
|
||||
case SDL_QUIT:
|
||||
quit = 1;
|
||||
break;
|
||||
|
||||
return 0;
|
||||
case SDL_KEYDOWN:
|
||||
if (event.key.keysym.sym == SDLK_q)
|
||||
{
|
||||
quit = 1;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return quit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue