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
cd31bd4a
Commit
cd31bd4a
authored
Dec 29, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed carriage returns
parent
bd88a605
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
SDL_win32events.c
src/video/win32/SDL_win32events.c
+31
-31
No files found.
src/video/win32/SDL_win32events.c
View file @
cd31bd4a
...
...
@@ -56,9 +56,9 @@
#ifndef WM_INPUT
#define WM_INPUT 0x00ff
#endif
#ifndef WM_TOUCH
#ifndef WM_TOUCH
#define WM_TOUCH 0x0240
#endif
#endif
static
WPARAM
...
...
@@ -520,11 +520,11 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break
;
case
WM_TOUCH
:
{
UINT
i
,
num_inputs
=
LOWORD
(
wParam
);
PTOUCHINPUT
inputs
=
SDL_stack_alloc
(
TOUCHINPUT
,
num_inputs
);
{
UINT
i
,
num_inputs
=
LOWORD
(
wParam
);
PTOUCHINPUT
inputs
=
SDL_stack_alloc
(
TOUCHINPUT
,
num_inputs
);
if
(
data
->
videodata
->
GetTouchInputInfo
((
HTOUCHINPUT
)
lParam
,
num_inputs
,
inputs
,
sizeof
(
TOUCHINPUT
)))
{
RECT
rect
;
RECT
rect
;
float
x
,
y
;
if
(
!
GetClientRect
(
hwnd
,
&
rect
)
||
...
...
@@ -532,14 +532,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break
;
}
ClientToScreen
(
hwnd
,
(
LPPOINT
)
&
rect
);
ClientToScreen
(
hwnd
,
(
LPPOINT
)
&
rect
+
1
);
rect
.
top
*=
100
;
rect
.
left
*=
100
;
rect
.
bottom
*=
100
;
rect
.
right
*=
100
;
for
(
i
=
0
;
i
<
num_inputs
;
++
i
)
{
PTOUCHINPUT
input
=
&
inputs
[
i
];
ClientToScreen
(
hwnd
,
(
LPPOINT
)
&
rect
+
1
);
rect
.
top
*=
100
;
rect
.
left
*=
100
;
rect
.
bottom
*=
100
;
rect
.
right
*=
100
;
for
(
i
=
0
;
i
<
num_inputs
;
++
i
)
{
PTOUCHINPUT
input
=
&
inputs
[
i
];
SDL_TouchID
touchId
=
(
SDL_TouchID
)
input
->
hSource
;
if
(
!
SDL_GetTouch
(
touchId
))
{
...
...
@@ -559,26 +559,26 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if
(
SDL_AddTouch
(
&
touch
,
""
)
<
0
)
{
continue
;
}
}
// Get the normalized coordinates for the window
x
=
(
float
)(
input
->
x
-
rect
.
left
)
/
(
rect
.
right
-
rect
.
left
);
y
=
(
float
)(
input
->
y
-
rect
.
top
)
/
(
rect
.
bottom
-
rect
.
top
);
}
// Get the normalized coordinates for the window
x
=
(
float
)(
input
->
x
-
rect
.
left
)
/
(
rect
.
right
-
rect
.
left
);
y
=
(
float
)(
input
->
y
-
rect
.
top
)
/
(
rect
.
bottom
-
rect
.
top
);
if
(
input
->
dwFlags
&
TOUCHEVENTF_DOWN
)
{
SDL_SendFingerDown
(
touchId
,
input
->
dwID
,
SDL_TRUE
,
x
,
y
,
1
);
}
SDL_SendFingerDown
(
touchId
,
input
->
dwID
,
SDL_TRUE
,
x
,
y
,
1
);
}
if
(
input
->
dwFlags
&
TOUCHEVENTF_MOVE
)
{
SDL_SendTouchMotion
(
touchId
,
input
->
dwID
,
SDL_FALSE
,
x
,
y
,
1
);
}
SDL_SendTouchMotion
(
touchId
,
input
->
dwID
,
SDL_FALSE
,
x
,
y
,
1
);
}
if
(
input
->
dwFlags
&
TOUCHEVENTF_UP
)
{
SDL_SendFingerDown
(
touchId
,
input
->
dwID
,
SDL_FALSE
,
x
,
y
,
1
);
}
}
}
SDL_stack_free
(
inputs
);
data
->
videodata
->
CloseTouchInputHandle
((
HTOUCHINPUT
)
lParam
);
SDL_SendFingerDown
(
touchId
,
input
->
dwID
,
SDL_FALSE
,
x
,
y
,
1
);
}
}
}
SDL_stack_free
(
inputs
);
data
->
videodata
->
CloseTouchInputHandle
((
HTOUCHINPUT
)
lParam
);
return
0
;
}
break
;
...
...
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