annotate src/haptic/dummy/SDL_syshaptic.c @ 2474:3f80bf1528b4 gsoc2008_force_feedback

Properly quit the SDL_haptic subsystem. Added SDL_Haptic dummy driver.
author Edgar Simo <bobbens@gmail.com>
date Sun, 01 Jun 2008 18:46:51 +0000
parents
children 31444718601e
rev   line source
2474
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
1 /*
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
3 Copyright (C) 2008 Edgar Simo
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
4
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
3f80bf1528b4 Properly quit 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.
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
9
3f80bf1528b4 Properly quit 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,
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
13 Lesser General Public License for more details.
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
14
3f80bf1528b4 Properly quit 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
3f80bf1528b4 Properly quit 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
3f80bf1528b4 Properly quit 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
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
18
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
19 Sam Lantinga
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
20 slouken@libsdl.org
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
21 */
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
22 #include "SDL_config.h"
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
23
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
24 #ifdef defined(SDL_HAPTIC_DUMMY) || defined(SDL_HAPTIC_DISABLED)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
25
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
26 #include "SDL_haptic.h"
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
27 #include "../SDL_haptic_c.h"
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
28 #include "../SDL_syshaptic.h"
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
29
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
30
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
31 int
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
32 SDL_SYS_HapticInit(void)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
33 {
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
34 SDL_numhaptics = 0;
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
35 return (0);
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
36 }
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
37
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
38
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
39 const char *
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
40 SDL_SYS_HapticName(int index)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
41 {
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
42 SDL_SetError("Logic error: No haptic (force feedback) devices available");
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
43 return (NULL);
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
44 }
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
45
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
46
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
47 int
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
48 SDL_SYS_HapticOpen(SDL_Haptic * haptic)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
49 {
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
50 SDL_SetError("Logic error: No joysticks available");
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
51 return (-1);
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
52 }
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
53
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
54
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
55 void
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
56 SDL_SYS_HapticClose(SDL_Haptic * haptic)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
57 {
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
58 return;
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
59 }
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
60
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
61
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
62 void
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
63 SDL_SYS_HapticQuit(void)
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
64 {
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
65 return;
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
66 }
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
67
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
68
3f80bf1528b4 Properly quit the SDL_haptic subsystem.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
69 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */