annotate include/SDL_haptic.h @ 2498:ab567bd667bf gsoc2008_force_feedback

Fixed various mistakes in the doxygen.
author Edgar Simo <bobbens@gmail.com>
date Sun, 06 Jul 2008 17:06:37 +0000
parents 0893fbf73b3d
children cc2b270608b2
rev   line source
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
1 /*
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
3 Copyright (C) 2008 Edgar Simo
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
4
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
9
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
13 Lesser General Public License for more details.
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
14
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
18
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
19 Sam Lantinga
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
20 slouken@libsdl.org
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
21 */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
22
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
23 /** \file SDL_Haptic.h */
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
24
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
25 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
26 * \mainpage SDL_haptic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
27 *
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
28 * \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
29 * devices.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
30 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
31 * The basic usage is as follows:
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
32 * - Initialize the Subsystem (SDL_INIT_HAPTIC).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
33 * - Open a Haptic Device.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
34 * - SDL_HapticOpen(...) to open from index.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
35 * - SDL_HapticOpenFromJoystick(...) to open from an existing joystick.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
36 * - Create an effect (SDL_HapticEffect).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
37 * - Upload the effect with SDL_HapticNewEffect(...).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
38 * - Run the effect with SDL_HapticRunEffect(...).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
39 * - (optional) Free the effect with SDL_HapticDestroyEffect(...).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
40 * - Close the haptic device with SDL_HapticClose(...).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
41 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
42 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
43 * Example:
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
44 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
45 * \code
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
46 * int test_haptic( SDL_Joystick * joystick ) {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
47 * SDL_Haptic *haptic;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
48 * SDL_HapticEffect effect;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
49 * int effect_id;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
50 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
51 * // Open the device
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
52 * haptic = SDL_HapticOpenFromJoystick( joystick );
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
53 * if (haptic == NULL) return -1; // Most likely joystick isn't haptic
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
54 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
55 * // See if it can do sine waves
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
56 * if ((SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_SINE)==0) {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
57 * SDL_HapticClose(haptic); // No sine effect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
58 * return -1;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
59 * }
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
60 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
61 * // Create the effect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
62 * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
63 * effect.type = SDL_HAPTIC_SINE;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
64 * effect.periodic.period = 1000; // 1000 ms
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
65 * effect.periodic.magnitude = 20000; // 20000/32767 strength
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
66 * effect.periodic.length = 5000; // 5 seconds long
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
67 * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
68 * effect.periodic.fade_length = 1000; // Takes 1 second to fade away
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
69 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
70 * // Upload the effect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
71 * effect_id = SDL_HapticNewEffect( haptic, &effect );
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
72 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
73 * // Test the effect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
74 * SDL_HapticRunEffect( haptic, effect_id );
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
75 * SDL_Delay( 5000); // Wait for the effect to finish
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
76 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
77 * // We destroy the effect, although closing the device also does this
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
78 * SDL_HapticDestroyEffect( haptic, effect_id );
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
79 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
80 * // Close the device
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
81 * SDL_HapticClose(haptic);
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
82 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
83 * return 0; // Success
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
84 * }
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
85 * \endcode
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
86 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
87 * \author Edgar Simo Serra
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
88 */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
89
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
90 #ifndef _SDL_haptic_h
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
91 #define _SDL_haptic_h
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
92
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
93 #include "SDL_stdinc.h"
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
94 #include "SDL_error.h"
2489
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
95 #include "SDL_joystick.h"
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
96
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
97 #include "begin_code.h"
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
98 /* Set up for C function definitions, even when using C++ */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
99 #ifdef __cplusplus
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
100 /* *INDENT-OFF* */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
101 extern "C" {
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
102 /* *INDENT-ON* */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
103 #endif /* __cpluspuls */
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
104
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
105 /**
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
106 * \typedef SDL_Haptic
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
107 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
108 * \brief The haptic structure used to identify an SDL haptic.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
109 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
110 * \sa SDL_HapticOpen
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
111 * \sa SDL_HapticOpenFromJoystick
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
112 * \sa SDL_HapticClose
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
113 */
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
114 struct _SDL_Haptic;
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
115 typedef struct _SDL_Haptic SDL_Haptic;
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
116
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
117
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
118 /*
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
119 * Different haptic features a device can have.
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
120 */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
121 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
122 * \def SDL_HAPTIC_CONSTANT
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
123 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
124 * \brief Constant haptic effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
125 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
126 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
127 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
128 #define SDL_HAPTIC_CONSTANT (1<<0) /* Constant effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
129 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
130 * \def SDL_HAPTIC_SINE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
131 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
132 * \brief Periodic haptic effect that simulates sine waves.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
133 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
134 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
135 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
136 #define SDL_HAPTIC_SINE (1<<1) /* Sine wave effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
137 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
138 * \def SDL_HAPTIC_SQUARE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
139 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
140 * \brief Periodic haptic effect that simulates square waves.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
141 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
142 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
143 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
144 #define SDL_HAPTIC_SQUARE (1<<2) /* Square wave effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
145 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
146 * \def SDL_HAPTIC_TRIANGLE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
147 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
148 * \brief Periodic haptic effect that simulates triangular waves.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
149 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
150 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
151 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
152 #define SDL_HAPTIC_TRIANGLE (1<<3) /* Triangle wave effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
153 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
154 * \def SDL_HAPTIC_SAWTOOTHUP
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
155 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
156 * \brief Periodic haptic effect that simulates saw tooth up waves.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
157 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
158 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
159 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
160 #define SDL_HAPTIC_SAWTOOTHUP (1<<4) /* Sawtoothup wave effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
161 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
162 * \def SDL_HAPTIC_SAWTOOTHDOWN
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
163 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
164 * \brief Periodic haptic effect that simulates saw tooth down waves.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
165 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
166 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
167 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
168 #define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) /* Sawtoothdown wave effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
169 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
170 * \def SDL_HAPTIC_RAMP
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
171 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
172 * \brief Ramp haptic effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
173 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
174 * \sa SDL_HapticRamp
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
175 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
176 #define SDL_HAPTIC_RAMP (1<<6) /* Ramp effect supported */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
177 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
178 * \def SDL_HAPTIC_SPRING
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
179 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
180 * \brief Condition haptic effect that simulates a spring. Effect is based on the
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
181 * axes position.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
182 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
183 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
184 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
185 #define SDL_HAPTIC_SPRING (1<<7) /* Spring effect supported - uses axes position */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
186 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
187 * \def SDL_HAPTIC_DAMPER
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
188 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
189 * \brief Condition haptic effect that simulates dampening. Effect is based on the
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
190 * axes velocity.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
191 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
192 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
193 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
194 #define SDL_HAPTIC_DAMPER (1<<8) /* Damper effect supported - uses axes velocity */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
195 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
196 * \def SDL_HAPTIC_INERTIA
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
197 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
198 * \brief Condition haptic effect that simulates inertia. Effect is based on the axes
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
199 * acceleration.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
200 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
201 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
202 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
203 #define SDL_HAPTIC_INERTIA (1<<9) /* Inertia effect supported - uses axes acceleration */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
204 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
205 * \def SDL_HAPTIC_FRICTION
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
206 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
207 * \brief Condition haptic effect that simulates friction. Effect is based on the axes
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
208 * movement.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
209 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
210 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
211 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
212 #define SDL_HAPTIC_FRICTION (1<<10) /* Friction effect supported - uses axes movement */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
213 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
214 * \def SDL_HAPTIC_CUSTOM
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
215 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
216 * \brief User defined custom haptic effect. TODO.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
217 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
218 #define SDL_HAPTIC_CUSTOM (1<<11) /* Custom effect is supported */
2487
4c8e25ef2d97 Merged seperate waveforms into types to be more compatible.
Edgar Simo <bobbens@gmail.com>
parents: 2486
diff changeset
219 /* These last two are features the device has, not effects */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
220 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
221 * \def SDL_HAPTIC_GAIN
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
222 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
223 * \brief Device supports setting the global gain.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
224 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
225 * \sa SDL_HapticSetGain
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
226 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
227 #define SDL_HAPTIC_GAIN (1<<12) /* Device can set global gain */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
228 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
229 * \def SDL_HAPTIC_AUTOCENTER
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
230 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
231 * \brief Device supports setting autocenter.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
232 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
233 * \sa SDL_HapticSetAutocenter
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
234 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
235 #define SDL_HAPTIC_AUTOCENTER (1<<13) /* Device can set autocenter */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
236 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
237 * \def SDL_HAPTIC_STATUS
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
238 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
239 * \brief Device can be queried for effect status.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
240 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
241 * \sa SDL_HapticGetEffectStatus
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
242 */
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
243 #define SDL_HAPTIC_STATUS (1<<14) /* Device can be queried for effect status */
2481
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
244
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
245
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
246 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
247 * \struct SDL_HapticConstant
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
248 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
249 * \brief A structure containing a template for a Constant effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
250 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
251 * The struct is exclusive to the SDL_HAPTIC_CONSTANT effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
252 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
253 * \sa SDL_HAPTIC_CONSTANT
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
254 * \sa SDL_HapticEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
255 */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
256 typedef struct SDL_HapticConstant {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
257 /* Header */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
258 Uint16 type; /**< SDL_HAPTIC_CONSTANT */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
259 Uint16 direction;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
260
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
261 /* Replay */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
262 Uint16 length; /**< Duration of the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
263 Uint16 delay; /**< Delay before starting the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
264
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
265 /* Trigger */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
266 Uint16 button; /**< Button that triggers the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
267 Uint16 interval; /**< How soon it can be triggered again after button. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
268
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
269 /* Constant */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
270 Sint16 level; /**< Strength of the constant effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
271
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
272 /* Envelope */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
273 Uint16 attack_length; /**< Duration of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
274 Uint16 attack_level; /**< Level at the start of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
275 Uint16 fade_length; /**< Duration of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
276 Uint16 fade_level; /**< Level at the end of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
277 } SDL_HapticConstant;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
278 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
279 * \struct SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
280 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
281 * \brief A structure containing a template for a Periodic effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
282 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
283 * The struct handles the following effects:
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
284 * - SDL_HAPTIC_SINE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
285 * - SDL_HAPTIC_SQUARE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
286 * - SDL_HAPTIC_TRIANGLE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
287 * - SDL_HAPTIC_SAWTOOTHUP
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
288 * - SDL_HAPTIC_SAWTOOTHDOWN
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
289 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
290 * \sa SDL_HAPTIC_SINE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
291 * \sa SDL_HAPTIC_SQUARE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
292 * \sa SDL_HAPTIC_TRIANGLE
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
293 * \sa SDL_HAPTIC_SAWTOOTHUP
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
294 * \sa SDL_HAPTIC_SAWTOOTHDOWN
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
295 * \sa SDL_HapticEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
296 */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
297 typedef struct SDL_HapticPeriodic {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
298 /* Header */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
299 Uint16 type; /* SDL_HAPTIC_{SINE,SQUARE,TRIANGLE,SAWTOOTHUP,SAWTOOTHDOWN} */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
300 Uint16 direction;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
301
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
302 /* Replay */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
303 Uint16 length; /**< Duration of the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
304 Uint16 delay; /**< Delay before starting the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
305
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
306 /* Trigger */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
307 Uint16 button; /**< Button that triggers the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
308 Uint16 interval; /**< How soon it can be triggered again after button. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
309
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
310 /* Periodic */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
311 Uint16 period; /**< Period of the wave. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
312 Sint16 magnitude; /**< Peak value. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
313 Sint16 offset; /**< Mean value of the wave. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
314 Uint16 phase; /**< Horizontal shift. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
315
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
316 /* Envelope */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
317 Uint16 attack_length; /**< Duration of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
318 Uint16 attack_level; /**< Level at the start of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
319 Uint16 fade_length; /**< Duration of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
320 Uint16 fade_level; /**< Level at the end of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
321 } SDL_HapticPeriodic;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
322 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
323 * \struct SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
324 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
325 * \brief A structure containing a template for a Condition effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
326 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
327 * The struct handles the following effects:
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
328 * - SDL_HAPTIC_SPRING
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
329 * - SDL_HAPTIC_DAMPER
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
330 * - SDL_HAPTIC_INERTIA
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
331 * - SDL_HAPTIC_FRICTION
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
332 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
333 * \sa SDL_HAPTIC_SPRING
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
334 * \sa SDL_HAPTIC_DAMPER
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
335 * \sa SDL_HAPTIC_INERTIA
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
336 * \sa SDL_HAPTIC_FRICTION
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
337 * \sa SDL_HapticEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
338 */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
339 typedef struct SDL_HapticCondition {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
340 /* Header */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
341 Uint16 type; /**< SDL_HAPTIC_{SPRING,DAMPER,INERTIA,FRICTION} */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
342 Uint16 direction;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
343
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
344 /* Replay */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
345 Uint16 length; /**< Duration of the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
346 Uint16 delay; /**< Delay before starting the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
347
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
348 /* Trigger */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
349 Uint16 button; /**< Button that triggers the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
350 Uint16 interval; /**< How soon it can be triggered again after button. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
351
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
352 /* Condition */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
353 Uint16 right_sat; /**< Level when joystick is to the right. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
354 Uint16 left_sat; /**< Level when joystick is to the left. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
355 Sint16 right_coeff; /**< How fast to increase the force towards the right. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
356 Sint16 left_coeff; /**< How fast to increase the force towards the left. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
357 Uint16 deadband; /**< Size of the dead zone. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
358 Sint16 center; /**< Position of the dead zone. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
359 } SDL_HapticCondition;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
360 /**
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
361 * \struct SDL_HapticRamp
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
362 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
363 * \brief A structure containing a template for a Ramp effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
364 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
365 * This struct is exclusively for the SDL_HAPTIC_RAMP effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
366 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
367 * \sa SDL_HAPTIC_RAMP
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
368 * \sa SDL_HapticEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
369 */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
370 typedef struct SDL_HapticRamp {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
371 /* Header */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
372 Uint16 type; /**< SDL_HAPTIC_RAMP */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
373 Uint16 direction;
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
374
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
375 /* Replay */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
376 Uint16 length; /**< Duration of the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
377 Uint16 delay; /**< Delay before starting the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
378
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
379 /* Trigger */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
380 Uint16 button; /**< Button that triggers the effect. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
381 Uint16 interval; /**< How soon it can be triggered again after button. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
382
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
383 /* Ramp */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
384 Sint16 start; /**< Beginning strength level. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
385 Sint16 end; /**< Ending strength level. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
386
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
387 /* Envelope */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
388 Uint16 attack_length; /**< Duration of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
389 Uint16 attack_level; /**< Level at the start of the attack. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
390 Uint16 fade_length; /**< Duration of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
391 Uint16 fade_level; /**< Level at the end of the fade. */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
392 } SDL_HapticRamp;
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
393 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
394 * \union SDL_HapticEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
395 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
396 * \brief The generic template for any haptic effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
397 *
2481
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
398 * All values max at 32767 (0x7fff). Signed values also can be negative.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
399 * Time values unless specified otherwise are in milliseconds.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
400 *
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
401 * Common parts:
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
402 *
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
403 * Replay:
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
404 * Uint16 length; Duration of effect.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
405 * Uint16 delay; Delay before starting effect.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
406 *
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
407 * Trigger:
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
408 * Uint16 button; Button that triggers effect.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
409 * Uint16 interval; How soon before effect can be triggered again.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
410 *
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
411 * Envelope:
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
412 * Uint16 attack_length; Duration of the attack.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
413 * Uint16 attack_level; Level at the start of the attack.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
414 * Uint16 fade_length; Duration of the fade out.
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
415 * Uint16 fade_level; Level at the end of the fade.
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
416 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
417 * \sa SDL_HapticConstant
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
418 * \sa SDL_HapticPeriodic
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
419 * \sa SDL_HapticCondition
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
420 * \sa SDL_HaptiRamp
2481
5d0ea4576f20 More comments.
Edgar Simo <bobbens@gmail.com>
parents: 2480
diff changeset
421 */
2477
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
422 typedef union SDL_HapticEffect {
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
423 /* Common for all force feedback effects */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
424 Uint16 type; /**< Effect type */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
425 SDL_HapticConstant constant; /**< Constant effect */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
426 SDL_HapticPeriodic periodic; /**< Periodic effect */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
427 SDL_HapticCondition condition; /**< Condition effect */
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
428 SDL_HapticRamp ramp; /**< Ramp effect */
2477
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
429 } SDL_HapticEffect;
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
430
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
431
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
432 /* Function prototypes */
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
433 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
434 * \fn int SDL_NumHaptics(void)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
435 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
436 * \brief Count the number of joysticks attached to the system.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
437 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
438 * \return Number of haptic devices detected on the system.
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
439 */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
440 extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
441
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
442 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
443 * \fn const char * SDL_HapticName(int device_index)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
444 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
445 * \brief Get the implementation dependent name of a Haptic device.
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
446 * This can be called before any joysticks are opened.
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
447 * If no name can be found, this function returns NULL.
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
448 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
449 * \param device_index Index of the device to get it's name.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
450 * \return Name of the device or NULL on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
451 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
452 * \sa SDL_NumHaptics
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
453 */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
454 extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
455
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
456 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
457 * \fn SDL_Haptic * SDL_HapticOpen(int device_Index)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
458 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
459 * \brief Opens a Haptic device for usage - the index passed as an
2476
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
460 * argument refers to the N'th Haptic device on this system.
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
461 *
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
462 * This function returns a Haptic device identifier, or Null
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
463 * if an error occurred.
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
464 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
465 * \param device_index Index of the device to open.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
466 * \return Device identifier or NULL on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
467 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
468 * \sa SDL_HapticOpenFromJoystick
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
469 * \sa SDL_HapticClose
2476
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
470 */
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
471 extern DECLSPEC SDL_Haptic * SDL_HapticOpen(int device_index);
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
472
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
473 /**
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
474 * \fn int SDL_JoystickIsHaptic(SDL_Joystick * joystick)
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
475 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
476 * \brief Checks to see if a joystick has haptic features.
2489
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
477 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
478 * \param joystick Joystick to test for haptic capabilities.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
479 * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
480 * or -1 if an error ocurred.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
481 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
482 * \sa SDL_HapticOpenFromJoystick
2489
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
483 */
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
484 extern DECLSPEC int SDL_JoystickIsHaptic(SDL_Joystick * joystick);
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
485
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
486 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
487 * \fn SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
488 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
489 * \brief Opens a Haptic device for usage from a Joystick device. Still has
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
490 * to be closed seperately to the joystick.
2489
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
491 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
492 * \param joystick Joystick to create a haptic device from.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
493 * \return A valid haptic device identifier on success or NULL on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
494 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
495 * \sa SDL_HapticOpen
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
496 * \sa SDL_HapticClose
2489
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
497 */
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
498 extern DECLSPEC SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick);
96adc8025331 Exposed some of the joystick stuff to the haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents: 2488
diff changeset
499
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
500 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
501 * \fn void SDL_HapticClose(SDL_Haptic * haptic)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
502 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
503 * \brief Closes a Haptic device previously opened with SDL_HapticOpen.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
504 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
505 * \param haptic Haptic device to close.
2476
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
506 */
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
507 extern DECLSPEC void SDL_HapticClose(SDL_Haptic * haptic);
242d8a668ebb * Implemented opening and closing of haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2472
diff changeset
508
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
509 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
510 * \fn int SDL_HapticNumEffects(SDL_Haptic * haptic)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
511 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
512 * \brief Returns the number of effects a haptic device can store.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
513 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
514 * \param haptic The haptic device to query effect max.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
515 * \return The number of effects the haptic device can store or
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
516 * -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
517 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
518 * \sa SDL_HapticQuery
2478
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
519 */
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
520 extern DECLSPEC int SDL_HapticNumEffects(SDL_Haptic * haptic);
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
521
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
522 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
523 * \fn unsigned int SDL_HapticQueryEffects(SDL_Haptic * haptic)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
524 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
525 * \brief Gets the haptic devices supported features in bitwise matter.
2478
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
526 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
527 * Example:
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
528 * \code
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
529 * if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) {
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
530 * printf("We have constant haptic effect!");
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
531 * }
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
532 * \endcode
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
533 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
534 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
535 * \param haptic The haptic device to query.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
536 * \return Haptic features in bitwise manner (OR'd).
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
537 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
538 * \sa SDL_HapticNumEffects
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
539 * \sa SDL_HapticEffectSupported
2478
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
540 */
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
541 extern DECLSPEC unsigned int SDL_HapticQuery(SDL_Haptic * haptic);
2478
4fd783e0f34b Added query functions for haptic devices.
Edgar Simo <bobbens@gmail.com>
parents: 2477
diff changeset
542
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
543 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
544 * \fn int SDL_HapticEffectSupported
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
545 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
546 * \brief Checks to see if effect is supported by haptic.
2486
24dd8b8669fa Added SDL_HAPTIC_CUSTOM (not supported on linux).
Edgar Simo <bobbens@gmail.com>
parents: 2485
diff changeset
547 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
548 * \param haptic Haptic device to check on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
549 * \param effect Effect to check to see if it is supported.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
550 * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
551 * -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
552 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
553 * \sa SDL_HapticQuery
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
554 * \sa SDL_HapticNewEffect
2486
24dd8b8669fa Added SDL_HAPTIC_CUSTOM (not supported on linux).
Edgar Simo <bobbens@gmail.com>
parents: 2485
diff changeset
555 */
24dd8b8669fa Added SDL_HAPTIC_CUSTOM (not supported on linux).
Edgar Simo <bobbens@gmail.com>
parents: 2485
diff changeset
556 extern DECLSPEC int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect);
24dd8b8669fa Added SDL_HAPTIC_CUSTOM (not supported on linux).
Edgar Simo <bobbens@gmail.com>
parents: 2485
diff changeset
557
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
558 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
559 * \fn int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
560 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
561 * \brief Creates a new haptic effect on the device.
2483
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
562 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
563 * \param haptic Haptic device to create the effect on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
564 * \param effect Properties of the effect to create.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
565 * \return The id of the effect on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
566 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
567 * \sa SDL_HapticUpdateEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
568 * \sa SDL_HapticRunEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
569 * \sa SDL_HapticDestroyEffect
2477
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
570 */
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
571 extern DECLSPEC int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect);
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
572
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
573 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
574 * \fn int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
575 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
576 * \brief Updates an effect. Can be used dynamically, although behaviour when
2488
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
577 * dynamically changing direction may be strange. Specifically the effect
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
578 * may reupload itself and start playing from the start. You cannot change
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
579 * the type either when running UpdateEffect.
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
580 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
581 * \param haptic Haptic device that has the effect.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
582 * \param effect Effect to update.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
583 * \param data New effect properties to use.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
584 * \return The id of the effect on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
585 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
586 * \sa SDL_HapticNewEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
587 * \sa SDL_HapticRunEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
588 * \sa SDL_HapticDestroyEffect
2488
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
589 */
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
590 extern DECLSPEC int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data);
8e2bdbccf7ff Added SDL_HapticUpdateEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2487
diff changeset
591
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
592 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
593 * \fn int SDL_HapticRunEffects(SDL_Haptic * haptic, int effect)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
594 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
595 * \brief Runs the haptic effect on it's assosciated haptic device.
2483
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
596 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
597 * \param haptic Haptic device to run the effect on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
598 * \param effect Identifier of the haptic effect to run.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
599 * \return 0 on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
600 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
601 * \sa SDL_HapticStopEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
602 * \sa SDL_HapticDestroyEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
603 * \sa SDL_HapticGetEffectStatus
2477
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
604 */
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
605 extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect);
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
606
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
607 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
608 * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
609 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
610 * \brief Stops the haptic effect on it's assosciated haptic device.
2485
67978eea6d10 Added SDL_HapticStopEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2484
diff changeset
611 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
612 * \param haptic Haptic device to stop the effect on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
613 * \praam effect Identifier of the effect to stop.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
614 * \return 0 on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
615 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
616 * \sa SDL_HapticRunEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
617 * \sa SDL_HapticDestroyEffect
2485
67978eea6d10 Added SDL_HapticStopEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2484
diff changeset
618 */
67978eea6d10 Added SDL_HapticStopEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2484
diff changeset
619 extern DECLSPEC int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect);
67978eea6d10 Added SDL_HapticStopEffect().
Edgar Simo <bobbens@gmail.com>
parents: 2484
diff changeset
620
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
621 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
622 * \fn void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
623 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
624 * \brief Destroys a haptic effect on the device. This will stop the effect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
625 * if it's running. Effects are automatically destroyed when the device is
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
626 * closed.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
627 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
628 * \param haptic Device to destroy the effect on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
629 * \param effect Identifier of the effect to destroy.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
630 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
631 * \sa SDL_HapticNewEffect
2477
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
632 */
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
633 extern DECLSPEC void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect);
97f75ea43a93 Starting to add infrastructure to handle haptic effects.
Edgar Simo <bobbens@gmail.com>
parents: 2476
diff changeset
634
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
635 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
636 * \fn int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
637 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
638 * \brief Gets the status of the current effect on the haptic device.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
639 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
640 * Device must support the SDL_HAPTIC_STATUS feature.
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
641 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
642 * \param haptic Haptic device to query the effect status on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
643 * \param effect Identifier of the effect to query it's status.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
644 * \return 0 if it isn't playing, SDL_HAPTIC_PLAYING if it is playing
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
645 * or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
646 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
647 * \sa SDL_HapticRunEffect
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
648 * \sa SDL_HapticStopEffect
2495
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
649 */
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
650 extern DECLSPEC int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect);
66c02abeef0e Added SDL_HapticGetEffectStatus().
Edgar Simo <bobbens@gmail.com>
parents: 2489
diff changeset
651
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
652 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
653 * \fn int SDL_HapticSetGain(SDL_Haptic * haptic, int gain)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
654 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
655 * \brief Sets the global gain of the device. Gain should be between 0 and 100.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
656 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
657 * Device must support the SDL_HAPTIC_GAIN feature.
2483
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
658 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
659 * \param haptic Haptic device to set the gain on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
660 * \param gain Value to set the gain to, should be between 0 and 100.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
661 * \return 0 on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
662 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
663 * \sa SDL_HapticQuery
2483
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
664 */
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
665 extern DECLSPEC int SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
9d52368ebcf5 Setting effects memory to 0.
Edgar Simo <bobbens@gmail.com>
parents: 2482
diff changeset
666
2498
ab567bd667bf Fixed various mistakes in the doxygen.
Edgar Simo <bobbens@gmail.com>
parents: 2497
diff changeset
667 /**
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
668 * \fn int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
669 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
670 * \brief Sets the global autocenter of the device. Autocenter should be between
2484
666472fd4cb0 HapticSetGain checks to see if device supports it.
Edgar Simo <bobbens@gmail.com>
parents: 2483
diff changeset
671 * 0 and 100. Setting it to 0 will disable autocentering.
666472fd4cb0 HapticSetGain checks to see if device supports it.
Edgar Simo <bobbens@gmail.com>
parents: 2483
diff changeset
672 *
2497
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
673 * Device must support the SDL_HAPTIC_AUTOCENTER feature.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
674 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
675 * \param haptic Haptic device to set autocentering on.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
676 * \param autocenter Value to set autocenter to, 0 disables autocentering.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
677 * \return 0 on success or -1 on error.
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
678 *
0893fbf73b3d Renamed SDL_HapticQueryEffects to SDL_HapticQuery.
Edgar Simo <bobbens@gmail.com>
parents: 2495
diff changeset
679 * \sa SDL_HapticQuery
2484
666472fd4cb0 HapticSetGain checks to see if device supports it.
Edgar Simo <bobbens@gmail.com>
parents: 2483
diff changeset
680 */
666472fd4cb0 HapticSetGain checks to see if device supports it.
Edgar Simo <bobbens@gmail.com>
parents: 2483
diff changeset
681 extern DECLSPEC int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter);
666472fd4cb0 HapticSetGain checks to see if device supports it.
Edgar Simo <bobbens@gmail.com>
parents: 2483
diff changeset
682
2472
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
683
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
684 /* Ends C function definitions when using C++ */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
685 #ifdef __cplusplus
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
686 /* *INDENT-OFF* */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
687 }
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
688 /* *INDENT-ON* */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
689 #endif
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
690 #include "close_code.h"
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
691
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
692 #endif /* _SDL_haptic_h */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
693
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
694 /* vi: set ts=4 sw=4 expandtab: */
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
695
3f73c88c9abb First commit of the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
696