Improve testgles2 exit behavior (useful on Android)
parent
e3f0d53b55
commit
01550b96cc
|
@ -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) {
|
||||
|
@ -654,6 +654,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
SDLTest_CommonEvent(state, &event, &done);
|
||||
}
|
||||
if (!done) {
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
|
||||
if (status) {
|
||||
|
@ -666,6 +667,7 @@ main(int argc, char *argv[])
|
|||
SDL_GL_SwapWindow(state->windows[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Print out some timing information */
|
||||
now = SDL_GetTicks();
|
||||
|
|
Loading…
Reference in New Issue