diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-01-13 09:25:20 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-01-13 09:25:20 -0500 |
commit | 3441e42dd23f7b951e83a902cb2a3fa758341638 (patch) | |
tree | 0f0da1bbfcfe91fb7055b01a5cd43dfc941171da | |
parent | cd0f70f86d1cedffcd1bacf57d9250fdff1f7af3 (diff) | |
download | sok-3441e42dd23f7b951e83a902cb2a3fa758341638.tar.bz2 sok-3441e42dd23f7b951e83a902cb2a3fa758341638.zip |
add comments
-rw-r--r-- | src/sdl/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |