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

« back to all changes in this revision

Viewing changes to test/testintersections.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:
84
84
    if ((x1 == x2) && (y1 == y2))
85
85
        return 0;
86
86
 
87
 
    printf("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2);
 
87
    SDL_Log("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2);
88
88
    lines[num_lines].x = x1;
89
89
    lines[num_lines].y = y1;
90
90
    lines[num_lines].w = x2;
133
133
    if (y1 > y2)
134
134
        SWAP(int, y1, y2);
135
135
 
136
 
    printf("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2,
 
136
    SDL_Log("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2,
137
137
           x2 - x1, y2 - y1);
138
138
 
139
139
    rects[num_rects].x = x1;
199
199
    SDL_Event event;
200
200
    Uint32 then, now, frames;
201
201
 
 
202
    /* Enable standard application logging */
 
203
    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
204
 
202
205
    /* Initialize parameters */
203
206
    num_objects = NUM_OBJECTS;
204
207
 
241
244
            }
242
245
        }
243
246
        if (consumed < 0) {
244
 
            fprintf(stderr,
245
 
                    "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
 
247
            SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
246
248
                    argv[0], SDLTest_CommonUsage(state));
247
249
            return 1;
248
250
        }
308
310
        }
309
311
        for (i = 0; i < state->num_windows; ++i) {
310
312
            SDL_Renderer *renderer = state->renderers[i];
 
313
            if (state->windows[i] == NULL)
 
314
                continue;
311
315
            SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
312
316
            SDL_RenderClear(renderer);
313
317
 
327
331
    now = SDL_GetTicks();
328
332
    if (now > then) {
329
333
        double fps = ((double) frames * 1000) / (now - then);
330
 
        printf("%2.2f frames per second\n", fps);
 
334
        SDL_Log("%2.2f frames per second\n", fps);
331
335
    }
332
336
    return 0;
333
337
}