Sanjay Kumar
Sanjay Kumar

Reputation: 379

how to implement touch event with SDL1.2.15?

I am newbie to SDL, i almost completed my game project with SDL1.2.15 using keyboard event. now i want to implement touch event also with my project. but there is no touch.h or any other touch library in SDL1.2.15.

i copied touch.h file from SDL2.0 to my SDL library and made changes in SDL_event.h. it compiling fine but not able to use SDL_Point object.

any suggestion.

Upvotes: 0

Views: 284

Answers (1)

keltar
keltar

Reputation: 18409

Last time I checked (it was quite a time ago), my android version of SDL generated SDL_MOUSEMOTION. It worked for very basic things, but if you need multitouch - you're out of luck.

Best option is to switch to SDL2. Another way is to use your target platform's touch interface directly, which is very platform-specific.

i copied touch.h file from SDL2.0 to my SDL library and made changes in SDL_event.h. it compiling fine but not able to use SDL_Point object. - don't ever do that, neither with SDL nor with any other library. It never makes the code that is simply not there to magically appear. Header and binary have to be the same version unless you want resulting program to misbehave (and even if you do - there are much more effective ways to make it very misbehaving).

Upvotes: 1

Related Questions