+
+static void process_event(SDL_Event *ev)
+{
+ switch(ev->type) {
+ case SDL_QUIT:
+ quit = true;
+ break;
+
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ app_keyboard(ev->key.keysym.sym, ev->key.state == SDL_PRESSED);
+ break;
+
+ case SDL_MOUSEBUTTONDOWN:
+ case SDL_MOUSEBUTTONUP:
+ app_mouse_button(ev->button.button - SDL_BUTTON_LEFT, ev->button.state == SDL_PRESSED,
+ ev->button.x, ev->button.y);
+ break;
+
+ case SDL_MOUSEMOTION:
+ app_mouse_motion(ev->motion.x, ev->motion.y);
+ break;
+
+ case SDL_WINDOWEVENT:
+ if(ev->window.event == SDL_WINDOWEVENT_RESIZED) {
+ win_width = ev->window.data1;
+ win_height = ev->window.data2;
+ win_aspect = (float)win_width / (float)win_height;
+ app_reshape(win_width, win_height);
+ }
+ break;
+ }
+}