Changed test program to be more compatible C.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 27 Jul 2013 21:11:12 +0200
changeset 7541913786dec9d5
parent 7540 b1c08daea9cd
child 7542 399ff49069a5
Changed test program to be more compatible C.
test/testdrawchessboard.c
     1.1 --- a/test/testdrawchessboard.c	Sat Jul 27 21:07:07 2013 +0200
     1.2 +++ b/test/testdrawchessboard.c	Sat Jul 27 21:11:12 2013 +0200
     1.3 @@ -50,6 +50,9 @@
     1.4  int
     1.5  main(int argc, char *argv[])
     1.6  {
     1.7 +	SDL_Window *window;
     1.8 +	SDL_Surface *surface;
     1.9 +	SDL_Renderer *renderer;
    1.10  
    1.11  	/* Initialize SDL */
    1.12  	if(SDL_Init(SDL_INIT_VIDEO) != 0)
    1.13 @@ -60,14 +63,14 @@
    1.14  
    1.15  
    1.16  	/* Create window and renderer for given surface */
    1.17 -	SDL_Window *window = SDL_CreateWindow("Chess Board",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,640,480,SDL_WINDOW_SHOWN);
    1.18 +	window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
    1.19  	if(!window)
    1.20  	{
    1.21  		fprintf(stderr,"Window creation fail : %s\n",SDL_GetError());
    1.22  		return 1;
    1.23  	}	
    1.24 -	SDL_Surface *surface = SDL_GetWindowSurface(window);
    1.25 -	SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(surface);
    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());