Atlas - SDL_sysjoystick.c
Home / ext / SDL2 / src / joystick / dummy Lines: 1 | Size: 2606 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2018 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "../../SDL_internal.h" 22 23#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED) 24 25/* This is the dummy implementation of the SDL joystick API */ 26 27#include "SDL_joystick.h" 28#include "../SDL_sysjoystick.h" 29#include "../SDL_joystick_c.h" 30 31 32static int 33DUMMY_JoystickInit(void) 34{ 35 return 0; 36} 37 38static int 39DUMMY_JoystickGetCount(void) 40{ 41 return 0; 42} 43 44static void 45DUMMY_JoystickDetect(void) 46{ 47} 48 49static const char * 50DUMMY_JoystickGetDeviceName(int device_index) 51{ 52 return NULL; 53} 54 55static SDL_JoystickGUID 56DUMMY_JoystickGetDeviceGUID(int device_index) 57{ 58 SDL_JoystickGUID guid; 59 SDL_zero(guid); 60 return guid; 61} 62 63static SDL_JoystickID 64DUMMY_JoystickGetDeviceInstanceID(int device_index) 65{ 66 return -1; 67} 68 69static int 70DUMMY_JoystickOpen(SDL_Joystick * joystick, int device_index) 71{ 72 return SDL_SetError("Logic error: No joysticks available"); 73} 74 75static int 76DUMMY_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) 77{ 78 return SDL_Unsupported(); 79} 80 81static void 82DUMMY_JoystickUpdate(SDL_Joystick * joystick) 83{ 84} 85 86static void 87DUMMY_JoystickClose(SDL_Joystick * joystick) 88{ 89} 90 91static void 92DUMMY_JoystickQuit(void) 93{ 94} 95 96SDL_JoystickDriver SDL_DUMMY_JoystickDriver = 97{ 98 DUMMY_JoystickInit, 99 DUMMY_JoystickGetCount, 100 DUMMY_JoystickDetect, 101 DUMMY_JoystickGetDeviceName, 102 DUMMY_JoystickGetDeviceGUID, 103 DUMMY_JoystickGetDeviceInstanceID, 104 DUMMY_JoystickOpen, 105 DUMMY_JoystickRumble, 106 DUMMY_JoystickUpdate, 107 DUMMY_JoystickClose, 108 DUMMY_JoystickQuit, 109}; 110 111#endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */ 112 113/* vi: set ts=4 sw=4 expandtab: */ 114[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.