| 147 | } |
| 148 | |
| 149 | void |
| 150 | loop() |
| 151 | { |
| 152 | int i; |
| 153 | SDL_Event event; |
| 154 | /* Check for events */ |
| 155 | while (SDL_PollEvent(&event)) { |
| 156 | SDLTest_CommonEvent(state, &event, &done); |
| 157 | if (event.type == SDL_MOUSEBUTTONDOWN) { |
| 158 | if (event.button.button == SDL_BUTTON_LEFT) { |
| 159 | ++current_cursor; |
| 160 | if (current_cursor == SDL_arraysize(cursors)) { |
| 161 | current_cursor = 0; |
| 162 | } |
| 163 | SDL_SetCursor(cursors[current_cursor]); |
| 164 | } else { |
| 165 | show_cursor = !show_cursor; |
| 166 | SDL_ShowCursor(show_cursor); |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | for (i = 0; i < state->num_windows; ++i) { |
| 172 | SDL_Renderer *renderer = state->renderers[i]; |
| 173 | SDL_RenderClear(renderer); |
| 174 | SDL_RenderPresent(renderer); |
| 175 | } |
| 176 | #ifdef __EMSCRIPTEN__ |
| 177 | if (done) { |
| 178 | emscripten_cancel_main_loop(); |
| 179 | } |
| 180 | #endif |
| 181 | } |
| 182 | |
| 183 | int |
| 184 | main(int argc, char *argv[]) |
no test coverage detected