Skip to content

Commit

Permalink
Tests: Mir needs the window to swap at lease 1 frame for the cursor t…
Browse files Browse the repository at this point in the history
…o show. So render in testwm2
  • Loading branch information
BrandonSchaefer committed Jul 13, 2016
1 parent eadb30c commit d8866e8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/testwm2.c
Expand Up @@ -50,6 +50,7 @@ quit(int rc)
void
loop()
{
int i;
SDL_Event event;
/* Check for events */
while (SDL_PollEvent(&event)) {
Expand Down Expand Up @@ -100,6 +101,12 @@ loop()
}
}
}

for (i = 0; i < state->num_windows; ++i) {
SDL_Renderer *renderer = state->renderers[i];
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
}
#ifdef __EMSCRIPTEN__
if (done) {
emscripten_cancel_main_loop();
Expand All @@ -122,7 +129,6 @@ main(int argc, char *argv[])
if (!state) {
return 1;
}
state->skip_renderer = SDL_TRUE;
for (i = 1; i < argc;) {
int consumed;

Expand All @@ -140,6 +146,12 @@ main(int argc, char *argv[])
quit(2);
}

for (i = 0; i < state->num_windows; ++i) {
SDL_Renderer *renderer = state->renderers[i];
SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
SDL_RenderClear(renderer);
}

/* Main render loop */
done = 0;
#ifdef __EMSCRIPTEN__
Expand Down

0 comments on commit d8866e8

Please sign in to comment.