Skip to content

Commit

Permalink
Improve testgles2 exit behavior (useful on Android)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabomdq committed Feb 20, 2014
1 parent e3f0d53 commit 01550b9
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions test/testgles2.c
Expand Up @@ -629,7 +629,7 @@ main(int argc, char *argv[])
while (!done) {
/* Check for events */
++frames;
while (SDL_PollEvent(&event)) {
while (SDL_PollEvent(&event) && !done) {
switch (event.type) {
case SDL_WINDOWEVENT:
switch (event.window.event) {
Expand All @@ -654,16 +654,18 @@ main(int argc, char *argv[])
}
SDLTest_CommonEvent(state, &event, &done);
}
for (i = 0; i < state->num_windows; ++i) {
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
if (status) {
SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());

/* Continue for next window */
continue;
}
Render(state->window_w, state->window_h, &datas[i]);
SDL_GL_SwapWindow(state->windows[i]);
if (!done) {
for (i = 0; i < state->num_windows; ++i) {
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
if (status) {
SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());

/* Continue for next window */
continue;
}
Render(state->window_w, state->window_h, &datas[i]);
SDL_GL_SwapWindow(state->windows[i]);
}
}
}

Expand Down

0 comments on commit 01550b9

Please sign in to comment.