mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-10-30 21:20:10 +00:00
55 lines
1.4 KiB
C
55 lines
1.4 KiB
C
|
|
||
|
#ifndef ISTEAMCONTROLLER001_H
|
||
|
#define ISTEAMCONTROLLER001_H
|
||
|
#ifdef STEAM_WIN32
|
||
|
#pragma once
|
||
|
#endif
|
||
|
|
||
|
struct SteamControllerState001_t
|
||
|
{
|
||
|
// If packet num matches that on your prior call, then the controller state hasn't been changed since
|
||
|
// your last call and there is no need to process it
|
||
|
uint32 unPacketNum;
|
||
|
|
||
|
// bit flags for each of the buttons
|
||
|
uint64 ulButtons;
|
||
|
|
||
|
// Left pad coordinates
|
||
|
short sLeftPadX;
|
||
|
short sLeftPadY;
|
||
|
|
||
|
// Right pad coordinates
|
||
|
short sRightPadX;
|
||
|
short sRightPadY;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
class ISteamController001
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
//
|
||
|
// Native controller support API
|
||
|
//
|
||
|
|
||
|
// Must call init and shutdown when starting/ending use of the interface
|
||
|
virtual bool Init( const char *pchAbsolutePathToControllerConfigVDF ) = 0;
|
||
|
virtual bool Shutdown() = 0;
|
||
|
|
||
|
// Pump callback/callresult events, SteamAPI_RunCallbacks will do this for you,
|
||
|
// normally never need to call directly.
|
||
|
virtual void RunFrame() = 0;
|
||
|
|
||
|
// Get the state of the specified controller, returns false if that controller is not connected
|
||
|
virtual bool GetControllerState( uint32 unControllerIndex, SteamControllerState001_t *pState ) = 0;
|
||
|
|
||
|
// Trigger a haptic pulse on the controller
|
||
|
virtual void TriggerHapticPulse( uint32 unControllerIndex, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0;
|
||
|
|
||
|
// Set the override mode which is used to choose to use different base/legacy bindings from your config file
|
||
|
virtual void SetOverrideMode( const char *pchMode ) = 0;
|
||
|
};
|
||
|
|
||
|
#endif
|