1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include <UIClass.h> void UIClass::handleEvents(){ SDL_Event e; while(SDL_PollEvent(&e)){ switch(e.type){ case SDL_QUIT: gameRunning=false; break; case SDL_KEYDOWN: switch(e.key.keysym.sym){ case 27: gameRunning=false; break; default: break; } default: break; } } }