SDL standard library

Dependents:   H261_encoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_touch.h Source File

SDL_touch.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   arising from the use of this software.
00008 
00009   Permission is granted to anyone to use this software for any purpose,
00010   including commercial applications, and to alter it and redistribute it
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 /**
00023  *  \file SDL_touch.h
00024  *
00025  *  Include file for SDL touch event handling.
00026  */
00027 
00028 #ifndef _SDL_touch_h
00029 #define _SDL_touch_h
00030 
00031 #include "SDL_stdinc.h"
00032 #include "SDL_error.h"
00033 #include "SDL_video.h"
00034 
00035 #include "begin_code.h"
00036 /* Set up for C function definitions, even when using C++ */
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 typedef Sint64 SDL_TouchID;
00042 typedef Sint64 SDL_FingerID;
00043 
00044 typedef struct SDL_Finger
00045 {
00046     SDL_FingerID id;
00047     float x;
00048     float y;
00049     float pressure;
00050 } SDL_Finger;
00051 
00052 /* Used as the device ID for mouse events simulated with touch input */
00053 #define SDL_TOUCH_MOUSEID ((Uint32)-1)
00054 
00055 
00056 /* Function prototypes */
00057 
00058 /**
00059  *  \brief Get the number of registered touch devices.
00060  */
00061 extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
00062 
00063 /**
00064  *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
00065  */
00066 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
00067 
00068 /**
00069  *  \brief Get the number of active fingers for a given touch device.
00070  */
00071 extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
00072 
00073 /**
00074  *  \brief Get the finger object of the given touch, with the given index.
00075  */
00076 extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
00077 
00078 /* Ends C function definitions when using C++ */
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 #include "close_code.h"
00083 
00084 #endif /* _SDL_touch_h */
00085 
00086 /* vi: set ts=4 sw=4 expandtab: */