| 36 | int done; |
| 37 | |
| 38 | void |
| 39 | DrawPoints(SDL_Renderer * renderer) |
| 40 | { |
| 41 | int i; |
| 42 | int x, y; |
| 43 | SDL_Rect viewport; |
| 44 | |
| 45 | /* Query the sizes */ |
| 46 | SDL_RenderGetViewport(renderer, &viewport); |
| 47 | |
| 48 | for (i = 0; i < num_objects * 4; ++i) { |
| 49 | /* Cycle the color and alpha, if desired */ |
| 50 | if (cycle_color) { |
| 51 | current_color += cycle_direction; |
| 52 | if (current_color < 0) { |
| 53 | current_color = 0; |
| 54 | cycle_direction = -cycle_direction; |
| 55 | } |
| 56 | if (current_color > 255) { |
| 57 | current_color = 255; |
| 58 | cycle_direction = -cycle_direction; |
| 59 | } |
| 60 | } |
| 61 | if (cycle_alpha) { |
| 62 | current_alpha += cycle_direction; |
| 63 | if (current_alpha < 0) { |
| 64 | current_alpha = 0; |
| 65 | cycle_direction = -cycle_direction; |
| 66 | } |
| 67 | if (current_alpha > 255) { |
| 68 | current_alpha = 255; |
| 69 | cycle_direction = -cycle_direction; |
| 70 | } |
| 71 | } |
| 72 | SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, |
| 73 | (Uint8) current_color, (Uint8) current_alpha); |
| 74 | |
| 75 | x = rand() % viewport.w; |
| 76 | y = rand() % viewport.h; |
| 77 | SDL_RenderDrawPoint(renderer, x, y); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | void |
| 82 | DrawLines(SDL_Renderer * renderer) |
no test coverage detected