Changed test program to be more compatible C.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 27 Jul 2013 21:11:12 +0200
changeset 7541 913786dec9d5
parent 7540 b1c08daea9cd
child 7542 399ff49069a5
Changed test program to be more compatible C.
test/testdrawchessboard.c
--- a/test/testdrawchessboard.c	Sat Jul 27 21:07:07 2013 +0200
+++ b/test/testdrawchessboard.c	Sat Jul 27 21:11:12 2013 +0200
@@ -50,6 +50,9 @@
 int
 main(int argc, char *argv[])
 {
+	SDL_Window *window;
+	SDL_Surface *surface;
+	SDL_Renderer *renderer;
 
 	/* Initialize SDL */
 	if(SDL_Init(SDL_INIT_VIDEO) != 0)
@@ -60,14 +63,14 @@
 
 
 	/* Create window and renderer for given surface */
-	SDL_Window *window = SDL_CreateWindow("Chess Board",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,640,480,SDL_WINDOW_SHOWN);
+	window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
 	if(!window)
 	{
 		fprintf(stderr,"Window creation fail : %s\n",SDL_GetError());
 		return 1;
 	}	
-	SDL_Surface *surface = SDL_GetWindowSurface(window);
-	SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(surface);
+	surface = SDL_GetWindowSurface(window);
+	renderer = SDL_CreateSoftwareRenderer(surface);
 	if(!renderer)
 	{
 		fprintf(stderr,"Render creation for surface fail : %s\n",SDL_GetError());