src/joystick/dummy/SDL_sysjoystick.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 03 Apr 2009 13:35:05 +0000
changeset 3104 86ea6c073d87
parent 2859 99210400e8b9
child 3697 f7b03b6838cb
permissions -rw-r--r--
Fixed undefined references to joystick code
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 Sam Lantinga
     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 #include "SDL_config.h"
    23 
    24 #if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
    25 
    26 /* This is the system specific header for the SDL joystick API */
    27 
    28 #include "SDL_joystick.h"
    29 #include "../SDL_sysjoystick.h"
    30 #include "../SDL_joystick_c.h"
    31 
    32 /* Function to scan the system for joysticks.
    33  * This function should set SDL_numjoysticks to the number of available
    34  * joysticks.  Joystick 0 should be the system default joystick.
    35  * It should return 0, or -1 on an unrecoverable fatal error.
    36  */
    37 int
    38 SDL_SYS_JoystickInit(void)
    39 {
    40     SDL_numjoysticks = 0;
    41     return (0);
    42 }
    43 
    44 /* Function to get the device-dependent name of a joystick */
    45 const char *
    46 SDL_SYS_JoystickName(int index)
    47 {
    48     SDL_SetError("Logic error: No joysticks available");
    49     return (NULL);
    50 }
    51 
    52 /* Function to open a joystick for use.
    53    The joystick to open is specified by the index field of the joystick.
    54    This should fill the nbuttons and naxes fields of the joystick structure.
    55    It returns 0, or -1 if there is an error.
    56  */
    57 int
    58 SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
    59 {
    60     SDL_SetError("Logic error: No joysticks available");
    61     return (-1);
    62 }
    63 
    64 /* Function to update the state of a joystick - called as a device poll.
    65  * This function shouldn't update the joystick structure directly,
    66  * but instead should call SDL_PrivateJoystick*() to deliver events
    67  * and update joystick device state.
    68  */
    69 void
    70 SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
    71 {
    72     return;
    73 }
    74 
    75 /* Function to close a joystick after use */
    76 void
    77 SDL_SYS_JoystickClose(SDL_Joystick * joystick)
    78 {
    79     return;
    80 }
    81 
    82 /* Function to perform any system-specific joystick related cleanup */
    83 void
    84 SDL_SYS_JoystickQuit(void)
    85 {
    86     return;
    87 }
    88 
    89 #endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */
    90 
    91 /* vi: set ts=4 sw=4 expandtab: */