+ SDL_Delay(25);
+
+ while (SDL_PollEvent(&event)) {
+ if (event.type == SDL_QUIT) {
+ SDL_Quit();
+ return 0;
+ }
+ if (event.type == SDL_MOUSEBUTTONDOWN)
+ creating_lines = true;
+ else if (event.type == SDL_MOUSEBUTTONUP)
+ creating_lines = false;
+
+ if (creating_lines && event.type == SDL_MOUSEMOTION) {
+ struct line_segment *n = malloc(sizeof(*n));
+ n->start.x = event.motion.x - event.motion.xrel;
+ n->start.y = event.motion.y - event.motion.yrel;
+ n->end.x = event.motion.x;
+ n->end.y = event.motion.y;
+ n->ignore = false;
+ timeradd(&now, &line_life, &n->expires);
+ list_add_tail(&lines, &n->list);
+ thick_line(screen, n, 0);
+ }
+ }
+ }