summaryrefslogtreecommitdiff
path: root/test/testscale.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/testscale.c')
-rw-r--r--test/testscale.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/testscale.c b/test/testscale.c
index 0f0096c6e2..f81ccdc243 100644
--- a/test/testscale.c
+++ b/test/testscale.c
@@ -48,7 +48,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
/* Load the sprite image */
temp = SDL_LoadBMP(file);
if (temp == NULL) {
- fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
return NULL;
}
@@ -79,7 +79,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
/* Create textures from the image */
texture = SDL_CreateTextureFromSurface(renderer, temp);
if (!texture) {
- fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
SDL_FreeSurface(temp);
return NULL;
}
@@ -129,6 +129,9 @@ main(int argc, char *argv[])
int frames;
Uint32 then, now;
+ /* Enable standard application logging */
+ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
@@ -139,7 +142,7 @@ main(int argc, char *argv[])
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
- fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
+ SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
return 1;
}
i += consumed;
@@ -183,7 +186,7 @@ main(int argc, char *argv[])
now = SDL_GetTicks();
if (now > then) {
double fps = ((double) frames * 1000) / (now - then);
- printf("%2.2f frames per second\n", fps);
+ SDL_Log("%2.2f frames per second\n", fps);
}
SDL_stack_free(drawstates);