# HG changeset patch # User jimtla # Date 1275717536 14400 # Node ID 35a80b0791aa1f3d8cc7eb1b653f30e49493951f # Parent 0350b634c04497486b67a482a48e565d44e3c9ac Addition of VC project for touchTest.c diff -r 0350b634c044 -r 35a80b0791aa include/SDL_touch.h --- a/include/SDL_touch.h Thu Jun 03 13:21:35 2010 -0400 +++ b/include/SDL_touch.h Sat Jun 05 01:58:56 2010 -0400 @@ -41,8 +41,6 @@ /* *INDENT-ON* */ #endif -typedef struct SDL_Touch SDL_Touch; -typedef struct SDL_Finger SDL_Finger; struct SDL_Finger { int id; @@ -55,9 +53,11 @@ int pressure; }; +typedef struct SDL_Touch SDL_Touch; +typedef struct SDL_Finger SDL_Finger; -struct SDL_Touch -{ + +struct SDL_Touch { /* Free the touch when it's time */ void (*FreeTouch) (SDL_Touch * touch); @@ -87,6 +87,7 @@ }; + /* Function prototypes */ /** diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest.c --- a/touchTest/touchTest.c Thu Jun 03 13:21:35 2010 -0400 +++ b/touchTest/touchTest.c Sat Jun 05 01:58:56 2010 -0400 @@ -3,6 +3,8 @@ #include #include + + #define PI 3.1415926535897 #define WIDTH 640 #define HEIGHT 480 @@ -32,7 +34,7 @@ void handler (int sig) { - printf ("\exiting...(%d)\n", sig); + printf ("exiting...(%d)\n", sig); exit (0); } @@ -81,7 +83,7 @@ void DrawScreen(SDL_Surface* screen, int h) { - int x, y, xm,ym,c; + int x, y, xm,ym,c,i; if(SDL_MUSTLOCK(screen)) { if(SDL_LockSurface(screen) < 0) return; @@ -98,9 +100,10 @@ setpix(screen,x,y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255); } } + drawCircle(screen,mousx,mousy,-30,0xFFFFFF); - int i; + for(i=0;i= 0 && finger[i].p.y >= 0) if(finger[i].pressure > 0) @@ -131,8 +134,8 @@ memset(keystat,0,512*sizeof(keystat[0])); if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1; - - if (!(screen = initScreen(WIDTH,HEIGHT))) + screen = initScreen(WIDTH,HEIGHT); + if (!screen) { SDL_Quit(); return 1; @@ -179,21 +182,22 @@ ; //printf("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId, // event.tfinger.x,event.tfinger.y); - SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId); - SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId); - + //SDL_Touch *inTouch = SDL_GetTouch(event.tfinger.touchId); + //SDL_Finger *inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId); + /* finger[event.tfinger.fingerId].p.x = ((float)event.tfinger.x)/ inTouch->xres; finger[event.tfinger.fingerId].p.y = ((float)event.tfinger.y)/ inTouch->yres; finger[event.tfinger.fingerId].pressure = - ((float)event.tfinger.pressure)/inTouch->pressureres; - + ((float)event.tfinger.pressure)/inTouch->pressureres;*/ + /* printf("Finger: %i, Pressure: %f Pressureres: %i\n", event.tfinger.fingerId, finger[event.tfinger.fingerId].pressure, inTouch->pressureres); + */ //printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId, // finger[event.tfinger.fingerId].pressure); diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2.ncb Binary file touchTest/touchTest2/touchTest2.ncb has changed diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/touchTest/touchTest2/touchTest2.sln Sat Jun 05 01:58:56 2010 -0400 @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "touchTest2", "touchTest2\touchTest2.vcproj", "{42BC83F1-CF20-4CEC-AC81-12EA804639E2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42BC83F1-CF20-4CEC-AC81-12EA804639E2}.Debug|Win32.ActiveCfg = Debug|Win32 + {42BC83F1-CF20-4CEC-AC81-12EA804639E2}.Debug|Win32.Build.0 = Debug|Win32 + {42BC83F1-CF20-4CEC-AC81-12EA804639E2}.Release|Win32.ActiveCfg = Release|Win32 + {42BC83F1-CF20-4CEC-AC81-12EA804639E2}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2.suo Binary file touchTest/touchTest2/touchTest2.suo has changed diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2/SDL.dll Binary file touchTest/touchTest2/touchTest2/SDL.dll has changed diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2/touchTest2.vcproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/touchTest/touchTest2/touchTest2/touchTest2.vcproj Sat Jun 05 01:58:56 2010 -0400 @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0350b634c044 -r 35a80b0791aa touchTest/touchTest2/touchTest2/touchTest2.vcproj.jgran-virtualPC.jgran.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/touchTest/touchTest2/touchTest2/touchTest2.vcproj.jgran-virtualPC.jgran.user Sat Jun 05 01:58:56 2010 -0400 @@ -0,0 +1,65 @@ + + + + + + + + + + +