src/haptic/SDL_syshaptic.h
author Edgar Simo <bobbens@gmail.com>
Tue, 01 Jul 2008 14:09:53 +0000
branchgsoc2008_force_feedback
changeset 2483 9d52368ebcf5
parent 2480 b883974445fc
child 2484 666472fd4cb0
permissions -rw-r--r--
Setting effects memory to 0.
Added SDL_HapticSetGain().
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 2008 Edgar Simo
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #include "SDL_config.h"
    24 
    25 #include "SDL_haptic.h"
    26 
    27 
    28 struct haptic_effect
    29 {
    30    SDL_HapticEffect effect; /* The current event */
    31    struct haptic_hweffect *hweffect; /* The hardware behind the event */
    32 };
    33 
    34 /*
    35  * The real SDL_Haptic event.
    36  */
    37 struct _SDL_Haptic
    38 {  
    39    Uint8 index; /* Stores index it is attached to */
    40    const char* name; /* Stores the name of the device */
    41 
    42    struct haptic_effect *effects; /* Allocated effects */
    43    int neffects; /* Maximum amount of effects */
    44    unsigned int supported; /* Supported effects */
    45 
    46    struct haptic_hwdata *hwdata; /* Driver dependent */
    47    int ref_count; /* Count for multiple opens */
    48 };
    49 
    50 extern int SDL_SYS_HapticInit(void);
    51 extern const char * SDL_SYS_HapticName(int index);
    52 extern int SDL_SYS_HapticOpen(SDL_Haptic * haptic);
    53 extern void SDL_SYS_HapticClose(SDL_Haptic * haptic);
    54 extern void SDL_SYS_HapticQuit(void);
    55 extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
    56       struct haptic_effect * effect, SDL_HapticEffect * base);
    57 extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic,
    58       struct haptic_effect * effect);
    59 extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic,
    60       struct haptic_effect * effect);
    61 extern int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain);
    62 
    63