~ubuntu-branches/ubuntu/trusty/libsdl2/trusty-proposed

« back to all changes in this revision

Viewing changes to test/testdraw2.c

  • Committer: Package Import Robot
  • Author(s): Manuel A. Fernandez Montecelo
  • Date: 2013-12-28 12:31:19 UTC
  • mto: (7.1.3 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: package-import@ubuntu.com-20131228123119-wehupm72qsjvh6vz
Tags: upstream-2.0.1+dfsg1
ImportĀ upstreamĀ versionĀ 2.0.1+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    SDL_Event event;
177
177
    Uint32 then, now, frames;
178
178
 
 
179
        /* Enable standard application logging */
 
180
        SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
181
 
179
182
    /* Initialize parameters */
180
183
    num_objects = NUM_OBJECTS;
181
184
 
218
221
            }
219
222
        }
220
223
        if (consumed < 0) {
221
 
            fprintf(stderr,
222
 
                    "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
 
224
            SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
223
225
                    argv[0], SDLTest_CommonUsage(state));
224
226
            return 1;
225
227
        }
251
253
        }
252
254
        for (i = 0; i < state->num_windows; ++i) {
253
255
            SDL_Renderer *renderer = state->renderers[i];
 
256
            if (state->windows[i] == NULL)
 
257
                continue;
254
258
            SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
255
259
            SDL_RenderClear(renderer);
256
260
 
268
272
    now = SDL_GetTicks();
269
273
    if (now > then) {
270
274
        double fps = ((double) frames * 1000) / (now - then);
271
 
        printf("%2.2f frames per second\n", fps);
 
275
        SDL_Log("%2.2f frames per second\n", fps);
272
276
    }
273
277
    return 0;
274
278
}