SDL_touch.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 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: */