MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / loop

Function loop

deps/SDL2/test/testdraw2.c:178–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void
179loop()
180{
181 int i;
182 SDL_Event event;
183
184 /* Check for events */
185 while (SDL_PollEvent(&event)) {
186 SDLTest_CommonEvent(state, &event, &done);
187 }
188 for (i = 0; i < state->num_windows; ++i) {
189 SDL_Renderer *renderer = state->renderers[i];
190 if (state->windows[i] == NULL)
191 continue;
192 SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
193 SDL_RenderClear(renderer);
194
195 DrawRects(renderer);
196 DrawLines(renderer);
197 DrawPoints(renderer);
198
199 SDL_RenderPresent(renderer);
200 }
201#ifdef __EMSCRIPTEN__
202 if (done) {
203 emscripten_cancel_main_loop();
204 }
205#endif
206}
207
208int
209main(int argc, char *argv[])

Callers 1

mainFunction · 0.70

Calls 8

SDL_PollEventFunction · 0.85
SDLTest_CommonEventFunction · 0.85
SDL_SetRenderDrawColorFunction · 0.85
SDL_RenderClearFunction · 0.85
SDL_RenderPresentFunction · 0.85
DrawRectsFunction · 0.70
DrawLinesFunction · 0.70
DrawPointsFunction · 0.70

Tested by

no test coverage detected