Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
c2191447
Commit
c2191447
authored
Aug 03, 2010
by
Jim Grandpre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimized functionality of gestureSDLTest.
parent
a4c48513
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
24 deletions
+12
-24
SDL_gesture.c
src/events/SDL_gesture.c
+5
-10
gestureSDLTest.c
touchTest/gestureSDLTest.c
+7
-14
No files found.
src/events/SDL_gesture.c
View file @
c2191447
...
...
@@ -117,17 +117,12 @@ static int SaveTemplate(DollarTemplate *templ, SDL_RWops * src) {
int
i
;
//No Longer storing the Hash, rehash on load
//fprintf(fp,"%lu ",templ->hash);
//if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0;
/*
for(i = 0;i < DOLLARNPOINTS;i++) {
fprintf(fp,"%i %i ",(int)templ->path[i].x,(int)templ->path[i].y);
}
fprintf(fp,"\n");
if
(
SDL_RWwrite
(
src
,
templ
->
path
,
sizeof
(
templ
->
path
[
0
]),
DOLLARNPOINTS
)
!=
DOLLARNPOINTS
)
return
0
;
*/
if
(
SDL_RWwrite
(
src
,
templ
->
path
,
sizeof
(
templ
->
path
[
0
]),
DOLLARNPOINTS
)
!=
DOLLARNPOINTS
)
return
0
;
return
1
;
}
...
...
@@ -499,7 +494,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
j
=
-
1
;
break
;
}
else
{
else
if
(
event
->
type
==
SDL_FINGERMOTION
)
{
float
dx
=
x
-
inTouch
->
gestureLast
[
j
].
f
.
p
.
x
;
float
dy
=
y
-
inTouch
->
gestureLast
[
j
].
f
.
p
.
y
;
DollarPath
*
path
=
&
inTouch
->
gestureLast
[
j
].
dollarPath
;
...
...
touchTest/gestureSDLTest.c
View file @
c2191447
...
...
@@ -240,19 +240,10 @@ void DrawScreen(SDL_Surface* screen, int h)
drawCircle
(
screen
,
x
*
screen
->
w
,
y
*
screen
->
h
,
5
,
col
);
else
if
(
event
.
type
==
SDL_FINGERDOWN
)
drawCircle
(
screen
,
x
*
screen
->
w
,
y
*
screen
->
h
,
-
10
,
col
);
/*
//if there is a centroid, draw it
if(numDownFingers > 1) {
unsigned int col =
((unsigned int)(0xFFFFFF)) |
((unsigned int)((0xFF*(1-((float)age)/EVENT_BUF_SIZE))) & 0xFF)<<24;
drawCircle(screen,centroid.x*screen->w,centroid.y*screen->h,5,col);
}
*/
}
}
/*
for(i=0;i<MAXFINGERS;i++)
if(finger[i].p.x >= 0 && finger[i].p.y >= 0)
if(finger[i].pressure > 0)
...
...
@@ -261,7 +252,7 @@ void DrawScreen(SDL_Surface* screen, int h)
else
drawCircle(screen,finger[i].p.x*screen->w,finger[i].p.y*screen->h
,20,0xFF);
*/
keystat
[
32
]
=
0
;
...
...
@@ -375,7 +366,7 @@ int main(int argc, char* argv[])
// event.tfinger.x,event.tfinger.y);
SDL_Touch
*
inTouch
=
SDL_GetTouch
(
event
.
tfinger
.
touchId
);
SDL_Finger
*
inFinger
=
SDL_GetFinger
(
inTouch
,
event
.
tfinger
.
fingerId
);
/*
for(i = 0;i<MAXFINGERS;i++)
if(index2fingerid[i] == event.tfinger.fingerId)
break;
...
...
@@ -388,6 +379,7 @@ int main(int argc, char* argv[])
finger[i].pressure =
((float)event.tfinger.pressure)/inTouch->pressureres;
*/
/*
printf("Finger: %i, Pressure: %f Pressureres: %i\n",
event.tfinger.fingerId,
...
...
@@ -396,12 +388,12 @@ int main(int argc, char* argv[])
*/
//printf("Finger: %i, pressure: %f\n",event.tfinger.fingerId,
// finger[event.tfinger.fingerId].pressure);
}
//
}
break
;
case
SDL_FINGERDOWN
:
//printf("Finger: %"PRIs64" down - x: %i, y: %i\n",event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
/*
for(i = 0;i<MAXFINGERS;i++)
if(index2fingerid[i] == -1) {
index2fingerid[i] = event.tfinger.fingerId;
...
...
@@ -419,6 +411,7 @@ int main(int argc, char* argv[])
}
finger[i].p.x = -1;
finger[i].p.y = -1;
*/
break
;
case
SDL_MULTIGESTURE
:
printf
(
"Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment