Android touch issue after update SDL from 2.0.1 to 2.0.8

I noticed a touch input issue on this project:


It seems that the touch is not detected in all frames… Like a lag…
Then I noticed that this problem is not present if the screen is stretched (and it fills the whole screen).
It can be depend by the blend mode? Or by touching screen point with no texture? Can you help me?

files:


Maybe there is an input issue on touch out of first layer texture?
This is a SDL2 bug I think… please help…
Tested with API from 14 to 22.

Edit: I tried to create a texture and I placed it under all texture as a “texture base”.
Now the touch is detected better… but it doesn’t work properly… Why?
Edit2: it seems to be a ghost touch (wrong screen position touch) ex.: i i touch upper/left at random time it seems to touch the bottom/right screen for example…

touchId can be useful?

I noticed that event.tfinger.x and y return negative value…
doc tells that them retur a value 0…1
is it a bug? it’s strange…

Any help?
Please I can’t fix this bug…

Something like this happened to me when I used SDL_SetRelativeMouseMode(). Android doesn’t support this feature, so it produces this bug. Not sure if this is the case for you though. I’m struggling to get SDL2 working under Android Studio, so I can’t test it.

I don’t use SDL_SetRelativeMouseMode() but thanks…

Not resolved…
I really have no idea!

maybe the issue / bug is related to SDL_RenderSetLogicalSize().
it SDL_FINGERDOWN/SDL_FINGERUP/SDL_FINGERMOTION etc. return wrong (and/or negative) touch input positions…

ok, there is a bug with SDL_RenderSetLogicalSize()
used SDL_RenderCopy(renderer, texture, NULL, &d_rect); for now…

1 Like

Nice find. If you can reproduce the bug using a simple test.c, then post the bug on https://bugzilla.libsdl.org/ and someone there will fix it.

Not many people here are using Android in much depth, which is why you haven’t got a reply. I’m using it extensively, but I’ve not used LogicalSize yet… but I will soon.