test/testgles2.c
changeset 8226 778fd6b223a6
parent 8149 681eb46b8ac4
child 8776 29aac8b813d9
equal deleted inserted replaced
8225:14846e56e099 8226:778fd6b223a6
   627     then = SDL_GetTicks();
   627     then = SDL_GetTicks();
   628     done = 0;
   628     done = 0;
   629     while (!done) {
   629     while (!done) {
   630         /* Check for events */
   630         /* Check for events */
   631         ++frames;
   631         ++frames;
   632         while (SDL_PollEvent(&event)) {
   632         while (SDL_PollEvent(&event) && !done) {
   633             switch (event.type) {
   633             switch (event.type) {
   634             case SDL_WINDOWEVENT:
   634             case SDL_WINDOWEVENT:
   635                 switch (event.window.event) {
   635                 switch (event.window.event) {
   636                     case SDL_WINDOWEVENT_RESIZED:
   636                     case SDL_WINDOWEVENT_RESIZED:
   637                         for (i = 0; i < state->num_windows; ++i) {
   637                         for (i = 0; i < state->num_windows; ++i) {
   652                         break;
   652                         break;
   653                 }
   653                 }
   654             }
   654             }
   655             SDLTest_CommonEvent(state, &event, &done);
   655             SDLTest_CommonEvent(state, &event, &done);
   656         }
   656         }
   657         for (i = 0; i < state->num_windows; ++i) {
   657         if (!done) {
   658             status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
   658           for (i = 0; i < state->num_windows; ++i) {
   659             if (status) {
   659               status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
   660                 SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());
   660               if (status) {
   661 
   661                   SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());
   662                 /* Continue for next window */
   662 
   663                 continue;
   663                   /* Continue for next window */
   664             }
   664                   continue;
   665             Render(state->window_w, state->window_h, &datas[i]);
   665               }
   666             SDL_GL_SwapWindow(state->windows[i]);
   666               Render(state->window_w, state->window_h, &datas[i]);
       
   667               SDL_GL_SwapWindow(state->windows[i]);
       
   668           }
   667         }
   669         }
   668     }
   670     }
   669 
   671 
   670     /* Print out some timing information */
   672     /* Print out some timing information */
   671     now = SDL_GetTicks();
   673     now = SDL_GetTicks();