Addition of VC project for touchTest.c
This commit is contained in:
parent
36b60b6ffd
commit
94b3f88fb2
8 changed files with 290 additions and 14 deletions
|
@ -41,8 +41,6 @@ extern "C" {
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct SDL_Touch SDL_Touch;
|
|
||||||
typedef struct SDL_Finger SDL_Finger;
|
|
||||||
|
|
||||||
struct SDL_Finger {
|
struct SDL_Finger {
|
||||||
int id;
|
int id;
|
||||||
|
@ -55,9 +53,11 @@ struct SDL_Finger {
|
||||||
int pressure;
|
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 */
|
/* Free the touch when it's time */
|
||||||
void (*FreeTouch) (SDL_Touch * touch);
|
void (*FreeTouch) (SDL_Touch * touch);
|
||||||
|
@ -87,6 +87,7 @@ struct SDL_Touch
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <SDL_touch.h>
|
#include <SDL_touch.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define PI 3.1415926535897
|
#define PI 3.1415926535897
|
||||||
#define WIDTH 640
|
#define WIDTH 640
|
||||||
#define HEIGHT 480
|
#define HEIGHT 480
|
||||||
|
@ -32,7 +34,7 @@ Finger finger[MAXFINGERS];
|
||||||
|
|
||||||
void handler (int sig)
|
void handler (int sig)
|
||||||
{
|
{
|
||||||
printf ("\exiting...(%d)\n", sig);
|
printf ("exiting...(%d)\n", sig);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +83,7 @@ void drawCircle(SDL_Surface* screen,int x,int y,int r,int c)
|
||||||
|
|
||||||
void DrawScreen(SDL_Surface* screen, int h)
|
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_MUSTLOCK(screen))
|
||||||
{
|
{
|
||||||
if(SDL_LockSurface(screen) < 0) return;
|
if(SDL_LockSurface(screen) < 0) return;
|
||||||
|
@ -98,9 +100,10 @@ void DrawScreen(SDL_Surface* screen, int h)
|
||||||
setpix(screen,x,y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255);
|
setpix(screen,x,y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drawCircle(screen,mousx,mousy,-30,0xFFFFFF);
|
drawCircle(screen,mousx,mousy,-30,0xFFFFFF);
|
||||||
|
|
||||||
int i;
|
|
||||||
for(i=0;i<MAXFINGERS;i++)
|
for(i=0;i<MAXFINGERS;i++)
|
||||||
if(finger[i].p.x >= 0 && finger[i].p.y >= 0)
|
if(finger[i].p.x >= 0 && finger[i].p.y >= 0)
|
||||||
if(finger[i].pressure > 0)
|
if(finger[i].pressure > 0)
|
||||||
|
@ -131,8 +134,8 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
memset(keystat,0,512*sizeof(keystat[0]));
|
memset(keystat,0,512*sizeof(keystat[0]));
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
|
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
|
||||||
|
screen = initScreen(WIDTH,HEIGHT);
|
||||||
if (!(screen = initScreen(WIDTH,HEIGHT)))
|
if (!screen)
|
||||||
{
|
{
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -179,21 +182,22 @@ int main(int argc, char* argv[])
|
||||||
;
|
;
|
||||||
//printf("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId,
|
//printf("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId,
|
||||||
// event.tfinger.x,event.tfinger.y);
|
// event.tfinger.x,event.tfinger.y);
|
||||||
SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
|
//SDL_Touch *inTouch = SDL_GetTouch(event.tfinger.touchId);
|
||||||
SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
|
//SDL_Finger *inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
|
||||||
|
/*
|
||||||
finger[event.tfinger.fingerId].p.x = ((float)event.tfinger.x)/
|
finger[event.tfinger.fingerId].p.x = ((float)event.tfinger.x)/
|
||||||
inTouch->xres;
|
inTouch->xres;
|
||||||
finger[event.tfinger.fingerId].p.y = ((float)event.tfinger.y)/
|
finger[event.tfinger.fingerId].p.y = ((float)event.tfinger.y)/
|
||||||
inTouch->yres;
|
inTouch->yres;
|
||||||
|
|
||||||
finger[event.tfinger.fingerId].pressure =
|
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",
|
printf("Finger: %i, Pressure: %f Pressureres: %i\n",
|
||||||
event.tfinger.fingerId,
|
event.tfinger.fingerId,
|
||||||
finger[event.tfinger.fingerId].pressure,
|
finger[event.tfinger.fingerId].pressure,
|
||||||
inTouch->pressureres);
|
inTouch->pressureres);
|
||||||
|
*/
|
||||||
//printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId,
|
//printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId,
|
||||||
// finger[event.tfinger.fingerId].pressure);
|
// finger[event.tfinger.fingerId].pressure);
|
||||||
|
|
||||||
|
|
BIN
touchTest/touchTest2/touchTest2.ncb
Normal file
BIN
touchTest/touchTest2/touchTest2.ncb
Normal file
Binary file not shown.
20
touchTest/touchTest2/touchTest2.sln
Normal file
20
touchTest/touchTest2/touchTest2.sln
Normal file
|
@ -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
|
BIN
touchTest/touchTest2/touchTest2.suo
Normal file
BIN
touchTest/touchTest2/touchTest2.suo
Normal file
Binary file not shown.
BIN
touchTest/touchTest2/touchTest2/SDL.dll
Normal file
BIN
touchTest/touchTest2/touchTest2/SDL.dll
Normal file
Binary file not shown.
186
touchTest/touchTest2/touchTest2/touchTest2.vcproj
Normal file
186
touchTest/touchTest2/touchTest2/touchTest2.vcproj
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9.00"
|
||||||
|
Name="touchTest2"
|
||||||
|
ProjectGUID="{42BC83F1-CF20-4CEC-AC81-12EA804639E2}"
|
||||||
|
RootNamespace="touchTest2"
|
||||||
|
TargetFrameworkVersion="196613"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
CharacterSet="0"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="C:\programs\gsoc10\VisualC\SDL\Debug\SDL.lib
C:\programs\gsoc10\VisualC\SDLmain\Debug\SDLmain.lib"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
EnableIntrinsicFunctions="true"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
EnableFunctionLevelLinking="true"
|
||||||
|
WarningLevel="3"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\touchTest.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||||
|
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioUserFile
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9.00"
|
||||||
|
ShowAllFiles="false"
|
||||||
|
>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command="$(TargetPath)"
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="JGRAN-VIRTUALPC"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command="$(TargetPath)"
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="JGRAN-VIRTUALPC"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
</VisualStudioUserFile>
|
Loading…
Add table
Add a link
Reference in a new issue