summaryrefslogtreecommitdiff
path: root/test/testspriteminimal.c
diff options
context:
space:
mode:
authorAndreas Schiffler <aschiffler@ferzkopp.net>2013-08-14 23:30:10 -0700
committerAndreas Schiffler <aschiffler@ferzkopp.net>2013-08-14 23:30:10 -0700
commitd18b52844dcacef57721a81bd2424a9de6baaa5b (patch)
treea4332e394e69a39b6e7ae5d0619f1baa6e8dd2b7 /test/testspriteminimal.c
parent874dd7a8c5ef9a1fd36a2f89fe467631886b1215 (diff)
downloadsdl-d18b52844dcacef57721a81bd2424a9de6baaa5b.tar.gz
Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency
Diffstat (limited to 'test/testspriteminimal.c')
-rw-r--r--test/testspriteminimal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c
index 6f3ac25c0..157293f30 100644
--- a/test/testspriteminimal.c
+++ b/test/testspriteminimal.c
@@ -42,7 +42,7 @@ LoadSprite(char *file, SDL_Renderer *renderer)
/* Load the sprite image */
temp = SDL_LoadBMP(file);
if (temp == NULL) {
- fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", file, SDL_GetError());
return (-1);
}
sprite_w = temp->w;
@@ -73,7 +73,7 @@ LoadSprite(char *file, SDL_Renderer *renderer)
/* Create textures from the image */
sprite = SDL_CreateTextureFromSurface(renderer, temp);
if (!sprite) {
- 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 (-1);
}
@@ -126,6 +126,9 @@ main(int argc, char *argv[])
int i, done;
SDL_Event event;
+ /* Enable standard application logging */
+ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+
if (SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer) < 0) {
quit(2);
}