viz1090/sdl1090/input.c
Nathan c28bebc294 initial SDL version
Former-commit-id: eec0da8c0de0a6761c0f54fcf2dd3668181b260a
Former-commit-id: d9bbbde7a4209187620f4464b88f33f0b81cc73e
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;
}
}
}