다음을 통해 공유


GetDeviceInfo

입력 장치의 전체 속성 및 기능에 대한 정적 정보에 액세스합니다.

구문

HRESULT GetDeviceInfo(
    const GameInputDeviceInfo** info
);

매개 변수

info _Outptr_
형식: GameInputDeviceInfo**

IGameInputDevice와 연결된 디바이스 정보입니다.

반환 값

형식: HRESULT

함수 결과입니다.

설명

응용 프로그램은 GetDeviceInfo 메서드를 소유하지 않습니다. 응용 프로그램이 IGameInput 인스턴스를 활성 상태로 유지하는 경우 메모리에 계속 액세스할 수 있습니다. IGameInput 개체에 대한 참조가 해제되면 메모리가 사라집니다.

다음 코드 예제는 레이싱 휠에 클러치가 있는지 여부를 확인하는 방법을 보여줍니다.

bool HasClutch(IGameInputDevice* wheel) noexcept
{
    const GameInputDeviceInfo* wheelInfo = nullptr;
    const bool succeeded = wheel->GetDeviceInfo(&wheelInfo);
    assert(succeeded);
    assert(wheelInfo->racingWheelInfo);

    const bool hasClutch = wheelInfo->racingWheelInfo->hasClutch;

    return hasClutch;
}

요건

헤더: GameInput.h

GameInput 개요
GameInputDeviceInfo
IGameInputDevice