indent
authorSam Lantinga <slouken@libsdl.org>
Sun, 31 Aug 2008 16:03:55 +0000
changeset 2736ae653575d4af
parent 2735 204be4fc2726
child 2737 140a7edcf2bd
indent
include/SDL_config_win32.h
test/testmmousetablet.c
     1.1 --- a/include/SDL_config_win32.h	Wed Aug 27 15:10:03 2008 +0000
     1.2 +++ b/include/SDL_config_win32.h	Sun Aug 31 16:03:55 2008 +0000
     1.3 @@ -71,7 +71,7 @@
     1.4  #define SDL_HAS_64BIT_TYPE	1
     1.5  
     1.6  /* Enabled for SDL 1.2 (binary compatibility) */
     1.7 -//#define HAVE_LIBC	1
     1.8 +//#define HAVE_LIBC     1
     1.9  #ifdef HAVE_LIBC
    1.10  /* Useful headers */
    1.11  #define HAVE_STDIO_H 1
     2.1 --- a/test/testmmousetablet.c	Wed Aug 27 15:10:03 2008 +0000
     2.2 +++ b/test/testmmousetablet.c	Sun Aug 31 16:03:55 2008 +0000
     2.3 @@ -1,60 +1,67 @@
     2.4  #include <stdio.h>
     2.5  #include "SDL.h"
     2.6  
     2.7 -SDL_Surface* screen;
     2.8 -int quit=0;
     2.9 +SDL_Surface *screen;
    2.10 +int quit = 0;
    2.11  
    2.12 -int main()
    2.13 +int
    2.14 +main()
    2.15  {
    2.16 -	SDL_Event event;
    2.17 -	int mice;
    2.18 -	int i;
    2.19 -	printf("Initing...\n");
    2.20 -	if (SDL_Init(0)!=0) {
    2.21 -		return 1;
    2.22 -    	}
    2.23 -	if (SDL_InitSubSystem(SDL_INIT_VIDEO)!=0) {
    2.24 -		return 1;
    2.25 -	}
    2.26 -	else {
    2.27 -		screen = SDL_SetVideoMode(640, 480, 32, SDL_DOUBLEBUF);
    2.28 -      	}
    2.29 -	mice = SDL_GetNumMice();
    2.30 -	printf("%d pointing devices found\n", mice);
    2.31 -	for(i=0; i<mice; ++i) {
    2.32 -		printf("device index: %d name:%s\n",i,SDL_GetMouseName(i));
    2.33 -	}
    2.34 -	while(quit!=1) {
    2.35 -		if(SDL_PollEvent(&event)==0) {}
    2.36 -		else {
    2.37 -			switch (event.type) {
    2.38 -				case SDL_MOUSEMOTION:
    2.39 -					printf("Device id: %d x: %d y: %d relx: %d rely: %d pressure: %d\n \
    2.40 -					pressure_max: %d pressure_min: %d current cursor:%d\n", event.motion.which, event.motion.x,\
    2.41 -				       	event.motion.y, event.motion.xrel, event.motion.yrel, event.motion.pressure, event.motion.pressure_max,\
    2.42 -				       	event.motion.pressure_min, event.motion.cursor);
    2.43 -				break;
    2.44 -				case SDL_PROXIMITYIN:
    2.45 -					printf("proximity in id: %d x: %d y: %d\n", (int) event.proximity.which, event.proximity.x, event.proximity.y);
    2.46 -				break;
    2.47 -				case SDL_PROXIMITYOUT:
    2.48 -					printf("proximity out id: %d x: %d y: %d\n", (int) event.proximity.which, event.proximity.x, event.proximity.y);
    2.49 -				break;
    2.50 -				case SDL_MOUSEBUTTONDOWN:
    2.51 -					printf("mouse button down id: %d button:%d\n", event.button.which, event.button.button);
    2.52 -				break;
    2.53 -				case SDL_MOUSEBUTTONUP:
    2.54 -					printf("mouse button up id: %d button: %d\n", event.button.which, event.button.button);
    2.55 -				break;
    2.56 -				case SDL_QUIT:
    2.57 -					printf("Quitting\n");
    2.58 -					SDL_QuitSubSystem(SDL_INIT_VIDEO);
    2.59 -					SDL_Quit();
    2.60 -					quit=1;
    2.61 -				break;
    2.62 -			}
    2.63 -		}
    2.64 -	}
    2.65 -	return 0;
    2.66 +    SDL_Event event;
    2.67 +    int mice;
    2.68 +    int i;
    2.69 +    printf("Initing...\n");
    2.70 +    if (SDL_Init(0) != 0) {
    2.71 +        return 1;
    2.72 +    }
    2.73 +    if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
    2.74 +        return 1;
    2.75 +    } else {
    2.76 +        screen = SDL_SetVideoMode(640, 480, 32, SDL_DOUBLEBUF);
    2.77 +    }
    2.78 +    mice = SDL_GetNumMice();
    2.79 +    printf("%d pointing devices found\n", mice);
    2.80 +    for (i = 0; i < mice; ++i) {
    2.81 +        printf("device index: %d name:%s\n", i, SDL_GetMouseName(i));
    2.82 +    }
    2.83 +    while (quit != 1) {
    2.84 +        if (SDL_PollEvent(&event) == 0) {
    2.85 +        } else {
    2.86 +            switch (event.type) {
    2.87 +            case SDL_MOUSEMOTION:
    2.88 +                printf
    2.89 +                    ("Device id: %d x: %d y: %d relx: %d rely: %d pressure: %d\n \
    2.90 +					pressure_max: %d pressure_min: %d current cursor:%d\n",
    2.91 +                     event.motion.which, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel,
    2.92 +                     event.motion.pressure, event.motion.pressure_max, event.motion.pressure_min,
    2.93 +                     event.motion.cursor);
    2.94 +                break;
    2.95 +            case SDL_PROXIMITYIN:
    2.96 +                printf("proximity in id: %d x: %d y: %d\n",
    2.97 +                       (int) event.proximity.which, event.proximity.x,
    2.98 +                       event.proximity.y);
    2.99 +                break;
   2.100 +            case SDL_PROXIMITYOUT:
   2.101 +                printf("proximity out id: %d x: %d y: %d\n",
   2.102 +                       (int) event.proximity.which, event.proximity.x,
   2.103 +                       event.proximity.y);
   2.104 +                break;
   2.105 +            case SDL_MOUSEBUTTONDOWN:
   2.106 +                printf("mouse button down id: %d button:%d\n",
   2.107 +                       event.button.which, event.button.button);
   2.108 +                break;
   2.109 +            case SDL_MOUSEBUTTONUP:
   2.110 +                printf("mouse button up id: %d button: %d\n",
   2.111 +                       event.button.which, event.button.button);
   2.112 +                break;
   2.113 +            case SDL_QUIT:
   2.114 +                printf("Quitting\n");
   2.115 +                SDL_QuitSubSystem(SDL_INIT_VIDEO);
   2.116 +                SDL_Quit();
   2.117 +                quit = 1;
   2.118 +                break;
   2.119 +            }
   2.120 +        }
   2.121 +    }
   2.122 +    return 0;
   2.123  }
   2.124 -