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