SDL_touch.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_touch.h
  20. *
  21. * Include file for SDL touch event handling.
  22. */
  23. #ifndef SDL_touch_h_
  24. #define SDL_touch_h_
  25. #include "SDL_stdinc.h"
  26. #include "SDL_error.h"
  27. #include "SDL_video.h"
  28. #include "begin_code.h"
  29. /* Set up for C function definitions, even when using C++ */
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. typedef Sint64 SDL_TouchID;
  34. typedef Sint64 SDL_FingerID;
  35. typedef struct SDL_Finger
  36. {
  37. SDL_FingerID id;
  38. float x;
  39. float y;
  40. float pressure;
  41. } SDL_Finger;
  42. /* Used as the device ID for mouse events simulated with touch input */
  43. #define SDL_TOUCH_MOUSEID ((Uint32)-1)
  44. /* Function prototypes */
  45. /**
  46. * \brief Get the number of registered touch devices.
  47. */
  48. extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
  49. /**
  50. * \brief Get the touch ID with the given index, or 0 if the index is invalid.
  51. */
  52. extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
  53. /**
  54. * \brief Get the number of active fingers for a given touch device.
  55. */
  56. extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
  57. /**
  58. * \brief Get the finger object of the given touch, with the given index.
  59. */
  60. extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
  61. /* Ends C function definitions when using C++ */
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #include "close_code.h"
  66. #endif /* SDL_touch_h_ */
  67. /* vi: set ts=4 sw=4 expandtab: */