viz1090/sdl1090/input.c
Nathan d450dc59ce initial SDL version
Former-commit-id: 3714e6bfc11cd1ccb095602b2f93d64b4d107346
Former-commit-id: cfe3cc42c26367d1875c31c581ef1dbf4e2d89e5
2017-09-13 22:21:36 -05:00

32 lines
459 B
C

#include "input.h"
void getInput()
{
SDL_Event event;
/* Loop through waiting messages and process them */
while (SDL_PollEvent(&event))
{
switch (event.type)
{
/* Closing the Window or pressing Escape will exit the program */
case SDL_QUIT:
exit(0);
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym)
{
case SDLK_ESCAPE:
exit(0);
break;
default:
break;
}
break;
}
}
}