30 virtual bool set_device_vibration(
void* device_handle,
float low_frequency_strength,
float high_frequency_strength) = 0;
33 extern CGV_API std::vector<device_info>& ref_device_infos();
35 extern CGV_API
device_info* ref_device_info(
void* device_handle);
37 extern CGV_API std::vector<driver_info>& ref_driver_infos();
39 extern CGV_API std::vector<gamepad_driver*>& ref_drivers();
48 register_driver(
new T(options));
53#include <cgv/config/lib_end.h>
information provided per gamepad device
use this template to register your own driver
interface class for gamepad drivers, when implementing your driver, provide a constructor with a sing...
virtual void set_driver_state(bool enabled)=0
set the state to enabled or disabled
virtual bool query_device_key_event(void *device_handle, GamepadKeys &gk, KeyAction &action)=0
query event queue of given device for single gamepad key event
virtual void scan_devices(std::vector< device_info > &infos)=0
scan all connected devices found by driver
virtual std::string get_name()=0
return name of driver
unsigned driver_index
driver index is set during registration
virtual bool get_device_battery_info(void *device_handle, BatteryType &battery_type, float &fill_state)=0
return the battery type and state of a device, fill_state in [0,1] is only given for alkaline or nick...
virtual void set_device_state(void *device_handle, bool enabled)=0
set the state of a device to enabled or disabled
virtual bool set_device_vibration(void *device_handle, float low_frequency_strength, float high_frequency_strength)=0
set the vibration strength between 0 and 1 of low and high frequency motors, return false if device i...
virtual bool get_device_state(void *device_handle, gamepad_state &state)=0
retrieve the current state of gamepad stick and trigger positions
see https://upload.wikimedia.org/wikipedia/commons/2/2c/360_controller.svg for an explanation of the ...