include/SDL_haptic.h
author Edgar Simo <bobbens@gmail.com>
Sun, 01 Jun 2008 11:44:25 +0000
branchgsoc2008_force_feedback
changeset 2472 3f73c88c9abb
child 2476 242d8a668ebb
permissions -rw-r--r--
First commit of the SDL_haptic subsystem.
Code compiles and works, very limited functionality (linux only).
bobbens@2472
     1
/*
bobbens@2472
     2
    SDL - Simple DirectMedia Layer
bobbens@2472
     3
    Copyright (C) 2008 Edgar Simo
bobbens@2472
     4
bobbens@2472
     5
    This library is free software; you can redistribute it and/or
bobbens@2472
     6
    modify it under the terms of the GNU Lesser General Public
bobbens@2472
     7
    License as published by the Free Software Foundation; either
bobbens@2472
     8
    version 2.1 of the License, or (at your option) any later version.
bobbens@2472
     9
bobbens@2472
    10
    This library is distributed in the hope that it will be useful,
bobbens@2472
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
bobbens@2472
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
bobbens@2472
    13
    Lesser General Public License for more details.
bobbens@2472
    14
bobbens@2472
    15
    You should have received a copy of the GNU Lesser General Public
bobbens@2472
    16
    License along with this library; if not, write to the Free Software
bobbens@2472
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
bobbens@2472
    18
bobbens@2472
    19
    Sam Lantinga
bobbens@2472
    20
    slouken@libsdl.org
bobbens@2472
    21
*/
bobbens@2472
    22
bobbens@2472
    23
/**
bobbens@2472
    24
 * \file SDL_haptic.h
bobbens@2472
    25
 *
bobbens@2472
    26
 * Include file for SDL haptic subsystem
bobbens@2472
    27
 */
bobbens@2472
    28
bobbens@2472
    29
#ifndef _SDL_haptic_h
bobbens@2472
    30
#define _SDL_haptic_h
bobbens@2472
    31
bobbens@2472
    32
#include "SDL_stdinc.h"
bobbens@2472
    33
#include "SDL_error.h"
bobbens@2472
    34
bobbens@2472
    35
#include "begin_code.h"
bobbens@2472
    36
/* Set up for C function definitions, even when using C++ */
bobbens@2472
    37
#ifdef __cplusplus
bobbens@2472
    38
/* *INDENT-OFF* */
bobbens@2472
    39
extern "C" {
bobbens@2472
    40
   /* *INDENT-ON* */                                                         
bobbens@2472
    41
#endif
bobbens@2472
    42
bobbens@2472
    43
/* The haptic structure used to identify an SDL haptic */
bobbens@2472
    44
struct _SDL_Haptic;                                                     
bobbens@2472
    45
typedef struct _SDL_Haptic SDL_Haptic;
bobbens@2472
    46
bobbens@2472
    47
bobbens@2472
    48
/* Different effects that can be generated */
bobbens@2472
    49
#define SDL_HAPTIC_CONSTANT   (1<<0)
bobbens@2472
    50
#define SDL_HAPTIC_PERIODIC   (1<<1)
bobbens@2472
    51
#define SDL_HAPTIC_RAMP       (1<<2)
bobbens@2472
    52
#define SDL_HAPTIC_SPRING     (1<<3)
bobbens@2472
    53
#define SDL_HAPTIC_FRICTION   (1<<4)
bobbens@2472
    54
#define SDL_HAPTIC_DAMPER     (1<<5)
bobbens@2472
    55
#define SDL_HAPTIC_RUMBLE     (1<<6)
bobbens@2472
    56
#define SDL_HAPTIC_INERTIA    (1<<7)
bobbens@2472
    57
#define SDL_HAPTIC_GAIN       (1<<8)
bobbens@2472
    58
#define SDL_HAPTIC_AUTOCENTER (1<<9)
bobbens@2472
    59
bobbens@2472
    60
bobbens@2472
    61
/* Function prototypes */
bobbens@2472
    62
/*
bobbens@2472
    63
 * Count the number of joysticks attached to the system
bobbens@2472
    64
 */
bobbens@2472
    65
extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
bobbens@2472
    66
bobbens@2472
    67
/*
bobbens@2472
    68
 * Get the implementation dependent name of a joystick.
bobbens@2472
    69
 * This can be called before any joysticks are opened.
bobbens@2472
    70
 * If no name can be found, this function returns NULL.
bobbens@2472
    71
 */
bobbens@2472
    72
extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
bobbens@2472
    73
bobbens@2472
    74
bobbens@2472
    75
/* Ends C function definitions when using C++ */
bobbens@2472
    76
#ifdef __cplusplus
bobbens@2472
    77
/* *INDENT-OFF* */
bobbens@2472
    78
}
bobbens@2472
    79
/* *INDENT-ON* */
bobbens@2472
    80
#endif
bobbens@2472
    81
#include "close_code.h"
bobbens@2472
    82
bobbens@2472
    83
#endif /* _SDL_haptic_h */
bobbens@2472
    84
bobbens@2472
    85
/* vi: set ts=4 sw=4 expandtab: */
bobbens@2472
    86
bobbens@2472
    87