src/haptic/dummy/SDL_syshaptic.c
author Edgar Simo <bobbens@gmail.com>
Thu, 10 Jul 2008 08:38:08 +0000
branchgsoc2008_force_feedback
changeset 2512 ef147ee4896c
parent 2509 3b54b3a97046
child 2517 37c13c12c878
permissions -rw-r--r--
Improved some ioctl handling.
Implemented SDL_MouseIsHaptic and SDL_HapticOpenFromMouse.
More code comments.
bobbens@2474
     1
/*
bobbens@2474
     2
    SDL - Simple DirectMedia Layer
bobbens@2474
     3
    Copyright (C) 2008 Edgar Simo
bobbens@2474
     4
bobbens@2474
     5
    This library is free software; you can redistribute it and/or
bobbens@2474
     6
    modify it under the terms of the GNU Lesser General Public
bobbens@2474
     7
    License as published by the Free Software Foundation; either
bobbens@2474
     8
    version 2.1 of the License, or (at your option) any later version.
bobbens@2474
     9
bobbens@2474
    10
    This library is distributed in the hope that it will be useful,
bobbens@2474
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
bobbens@2474
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
bobbens@2474
    13
    Lesser General Public License for more details.
bobbens@2474
    14
bobbens@2474
    15
    You should have received a copy of the GNU Lesser General Public
bobbens@2474
    16
    License along with this library; if not, write to the Free Software
bobbens@2474
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
bobbens@2474
    18
bobbens@2474
    19
    Sam Lantinga
bobbens@2474
    20
    slouken@libsdl.org
bobbens@2474
    21
*/
bobbens@2474
    22
#include "SDL_config.h"
bobbens@2474
    23
bobbens@2508
    24
#if defined(SDL_HAPTIC_DUMMY) || defined(SDL_HAPTIC_DISABLED)
bobbens@2474
    25
bobbens@2474
    26
#include "SDL_haptic.h"
bobbens@2474
    27
#include "../SDL_syshaptic.h"
bobbens@2474
    28
bobbens@2474
    29
bobbens@2474
    30
int
bobbens@2474
    31
SDL_SYS_HapticInit(void)
bobbens@2474
    32
{
bobbens@2492
    33
   return 0;
bobbens@2474
    34
}
bobbens@2474
    35
bobbens@2474
    36
bobbens@2474
    37
const char *
bobbens@2474
    38
SDL_SYS_HapticName(int index)
bobbens@2474
    39
{
bobbens@2492
    40
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
    41
   return NULL;
bobbens@2474
    42
}
bobbens@2474
    43
bobbens@2474
    44
bobbens@2474
    45
int
bobbens@2474
    46
SDL_SYS_HapticOpen(SDL_Haptic * haptic)
bobbens@2474
    47
{
bobbens@2492
    48
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
    49
   return -1;
bobbens@2492
    50
}
bobbens@2492
    51
bobbens@2492
    52
bobbens@2492
    53
int
bobbens@2512
    54
SDL_SYS_HapticMouse(void)
bobbens@2512
    55
{
bobbens@2512
    56
   return -1;
bobbens@2512
    57
}
bobbens@2512
    58
bobbens@2512
    59
bobbens@2512
    60
int
bobbens@2509
    61
SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
bobbens@2492
    62
{
bobbens@2492
    63
   return 0;
bobbens@2492
    64
}
bobbens@2492
    65
bobbens@2492
    66
bobbens@2492
    67
int
bobbens@2492
    68
SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
bobbens@2492
    69
{
bobbens@2492
    70
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
    71
   return -1;
bobbens@2492
    72
}
bobbens@2492
    73
bobbens@2492
    74
bobbens@2492
    75
int
bobbens@2492
    76
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
bobbens@2492
    77
{
bobbens@2492
    78
   return 0;
bobbens@2474
    79
}
bobbens@2474
    80
bobbens@2474
    81
bobbens@2474
    82
void
bobbens@2474
    83
SDL_SYS_HapticClose(SDL_Haptic * haptic)
bobbens@2474
    84
{
bobbens@2474
    85
   return;
bobbens@2474
    86
}
bobbens@2474
    87
bobbens@2474
    88
bobbens@2474
    89
void
bobbens@2474
    90
SDL_SYS_HapticQuit(void)
bobbens@2474
    91
{
bobbens@2474
    92
   return;
bobbens@2474
    93
}
bobbens@2474
    94
bobbens@2474
    95
bobbens@2492
    96
int
bobbens@2492
    97
SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
bobbens@2492
    98
                        struct haptic_effect * effect,
bobbens@2492
    99
                        SDL_HapticEffect * base)
bobbens@2492
   100
{
bobbens@2492
   101
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   102
   return -1;
bobbens@2492
   103
}
bobbens@2492
   104
bobbens@2492
   105
bobbens@2492
   106
int
bobbens@2492
   107
SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
bobbens@2492
   108
                           struct haptic_effect * effect,
bobbens@2492
   109
                           SDL_HapticEffect * data)
bobbens@2492
   110
{
bobbens@2492
   111
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   112
   return -1;
bobbens@2492
   113
}
bobbens@2492
   114
bobbens@2492
   115
bobbens@2492
   116
int
bobbens@2492
   117
SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
bobbens@2492
   118
{
bobbens@2492
   119
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   120
   return -1;
bobbens@2492
   121
}
bobbens@2492
   122
bobbens@2492
   123
bobbens@2492
   124
int
bobbens@2492
   125
SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
bobbens@2492
   126
{
bobbens@2492
   127
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   128
   return -1;
bobbens@2492
   129
}
bobbens@2492
   130
bobbens@2492
   131
bobbens@2492
   132
void
bobbens@2492
   133
SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
bobbens@2492
   134
{
bobbens@2492
   135
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2509
   136
   return;
bobbens@2492
   137
}
bobbens@2492
   138
bobbens@2492
   139
bobbens@2495
   140
int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
bobbens@2495
   141
{
bobbens@2495
   142
   SDL_SetError("Logic error: No Haptic devices available.");
bobbens@2495
   143
   return -1;
bobbens@2495
   144
}
bobbens@2495
   145
bobbens@2495
   146
bobbens@2492
   147
int
bobbens@2492
   148
SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
bobbens@2492
   149
{
bobbens@2492
   150
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   151
   return -1;
bobbens@2492
   152
}
bobbens@2492
   153
bobbens@2492
   154
bobbens@2492
   155
int
bobbens@2492
   156
SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
bobbens@2492
   157
{
bobbens@2492
   158
   SDL_SetError("Logic error: No haptic devices available.");
bobbens@2492
   159
   return -1;
bobbens@2492
   160
}
bobbens@2492
   161
bobbens@2492
   162
bobbens@2474
   163
#endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */