mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sokol.sapp,gg: add a tool_type
field to gg.TouchPoint
(differenciate different types of touch input) (#15822)
This commit is contained in:
2
thirdparty/sokol/sokol_app.h
vendored
2
thirdparty/sokol/sokol_app.h
vendored
@ -1230,6 +1230,7 @@ typedef struct sapp_touchpoint {
|
||||
uintptr_t identifier;
|
||||
float pos_x;
|
||||
float pos_y;
|
||||
int tool_type; // __v_
|
||||
bool changed;
|
||||
} sapp_touchpoint;
|
||||
|
||||
@ -8569,6 +8570,7 @@ _SOKOL_PRIVATE bool _sapp_android_touch_event(const AInputEvent* e) {
|
||||
dst->identifier = (uintptr_t)AMotionEvent_getPointerId(e, (size_t)i);
|
||||
dst->pos_x = (AMotionEvent_getRawX(e, (size_t)i) / _sapp.window_width) * _sapp.framebuffer_width;
|
||||
dst->pos_y = (AMotionEvent_getRawY(e, (size_t)i) / _sapp.window_height) * _sapp.framebuffer_height;
|
||||
dst->tool_type = AMotionEvent_getToolType(e, (size_t)i); // __v_
|
||||
|
||||
if (action == AMOTION_EVENT_ACTION_POINTER_DOWN ||
|
||||
action == AMOTION_EVENT_ACTION_POINTER_UP) {
|
||||
|
Reference in New Issue
Block a user