1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-05 17:13:36 +08:00
hl2sdk/public/steam/isteamcontroller.h

92 lines
2.5 KiB
C
Raw Normal View History

2014-10-30 12:30:57 -04:00
//====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
2013-06-26 15:22:04 -07:00
//
// Purpose: interface to valve controller
//
//=============================================================================
#ifndef ISTEAMCONTROLLER_H
#define ISTEAMCONTROLLER_H
#ifdef _WIN32
#pragma once
#endif
#include "isteamclient.h"
2014-10-30 12:30:57 -04:00
#include "steamcontrollerpublic.h"
2013-06-26 15:22:04 -07:00
// callbacks
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error isteamclient.h must be included
#endif
2014-10-30 12:30:57 -04:00
#define MAX_STEAM_CONTROLLERS 16
2013-06-26 15:22:04 -07:00
#pragma pack( pop )
2014-10-30 12:30:57 -04:00
enum ESteamControllerPad
{
k_ESteamControllerPad_Left,
k_ESteamControllerPad_Right
};
2013-06-26 15:22:04 -07:00
//-----------------------------------------------------------------------------
2014-10-30 12:30:57 -04:00
// Purpose: Native Steam controller support API
2013-06-26 15:22:04 -07:00
//-----------------------------------------------------------------------------
class ISteamController
{
public:
2014-10-30 12:30:57 -04:00
//
// 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, SteamControllerState_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;
2013-06-26 15:22:04 -07:00
};
#define STEAMCONTROLLER_INTERFACE_VERSION "STEAMCONTROLLER_INTERFACE_VERSION"
// callbacks
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error isteamclient.h must be included
#endif
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
/*
struct ControllerCallback_t
{
enum { k_iCallback = k_iSteamControllerCallbacks + 1 };
};
*/
#pragma pack( pop )
#endif // ISTEAMCONTROLLER_H