test/testdrawchessboard.c
changeset 7639 9406b7dd2f2d
parent 7541 913786dec9d5
child 7905 586eddae6340
     1.1 --- a/test/testdrawchessboard.c	Mon Aug 12 22:00:21 2013 -0700
     1.2 +++ b/test/testdrawchessboard.c	Wed Aug 14 23:30:10 2013 -0700
     1.3 @@ -54,10 +54,13 @@
     1.4  	SDL_Surface *surface;
     1.5  	SDL_Renderer *renderer;
     1.6  
     1.7 +    /* Enable standard application logging */
     1.8 +    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
     1.9 +
    1.10  	/* Initialize SDL */
    1.11  	if(SDL_Init(SDL_INIT_VIDEO) != 0)
    1.12  	{
    1.13 -		fprintf(stderr,"SDL_Init fail : %s\n", SDL_GetError());
    1.14 +		SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init fail : %s\n", SDL_GetError());
    1.15  		return 1;
    1.16  	}
    1.17  
    1.18 @@ -66,14 +69,14 @@
    1.19  	window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
    1.20  	if(!window)
    1.21  	{
    1.22 -		fprintf(stderr,"Window creation fail : %s\n",SDL_GetError());
    1.23 +		SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError());
    1.24  		return 1;
    1.25  	}	
    1.26  	surface = SDL_GetWindowSurface(window);
    1.27  	renderer = SDL_CreateSoftwareRenderer(surface);
    1.28  	if(!renderer)
    1.29  	{
    1.30 -		fprintf(stderr,"Render creation for surface fail : %s\n",SDL_GetError());
    1.31 +		SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n",SDL_GetError());
    1.32  		return 1;
    1.33  	}
    1.34