Path: blob/master/thirdparty/sdl/sensor/dummy/SDL_dummysensor.c
10279 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/20#include "SDL_internal.h"2122#if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED)2324#include "SDL_dummysensor.h"25#include "../SDL_syssensor.h"2627static bool SDL_DUMMY_SensorInit(void)28{29return true;30}3132static int SDL_DUMMY_SensorGetCount(void)33{34return 0;35}3637static void SDL_DUMMY_SensorDetect(void)38{39}4041static const char *SDL_DUMMY_SensorGetDeviceName(int device_index)42{43return NULL;44}4546static SDL_SensorType SDL_DUMMY_SensorGetDeviceType(int device_index)47{48return SDL_SENSOR_INVALID;49}5051static int SDL_DUMMY_SensorGetDeviceNonPortableType(int device_index)52{53return -1;54}5556static SDL_SensorID SDL_DUMMY_SensorGetDeviceInstanceID(int device_index)57{58return -1;59}6061static bool SDL_DUMMY_SensorOpen(SDL_Sensor *sensor, int device_index)62{63return SDL_Unsupported();64}6566static void SDL_DUMMY_SensorUpdate(SDL_Sensor *sensor)67{68}6970static void SDL_DUMMY_SensorClose(SDL_Sensor *sensor)71{72}7374static void SDL_DUMMY_SensorQuit(void)75{76}7778SDL_SensorDriver SDL_DUMMY_SensorDriver = {79SDL_DUMMY_SensorInit,80SDL_DUMMY_SensorGetCount,81SDL_DUMMY_SensorDetect,82SDL_DUMMY_SensorGetDeviceName,83SDL_DUMMY_SensorGetDeviceType,84SDL_DUMMY_SensorGetDeviceNonPortableType,85SDL_DUMMY_SensorGetDeviceInstanceID,86SDL_DUMMY_SensorOpen,87SDL_DUMMY_SensorUpdate,88SDL_DUMMY_SensorClose,89SDL_DUMMY_SensorQuit,90};9192#endif // SDL_SENSOR_DUMMY || SDL_SENSOR_DISABLED939495