From 3441e42dd23f7b951e83a902cb2a3fa758341638 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 13 Jan 2019 09:25:20 -0500 Subject: add comments --- src/sdl/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/sdl/main.c b/src/sdl/main.c index 882eefb..12f296b 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -59,6 +59,7 @@ int main(int argc, char *argv[]) { die("SDL_Init(): %s", SDL_GetError()); } + // register exit handler if (atexit(SDL_Quit)) { die("atexit(): %s", strerror(errno)); exit(EXIT_FAILURE); @@ -83,9 +84,12 @@ int main(int argc, char *argv[]) { bool done = false; SDL_Event ev; while (!done) { + // read events while (SDL_PollEvent(&ev)) { + // get action const action_t action = get_action(&ev); + // handle action switch (action.type) { case ACTION_NONE: // do nothing @@ -183,6 +187,7 @@ int main(int argc, char *argv[]) { } } + // draw draw(&draw_ctx); } -- cgit v1.2.3