getCurrentReading method

GamepadReading getCurrentReading()

Implementation

GamepadReading getCurrentReading() {
  final retValuePtr = calloc<GamepadReading>();

  try {
    final hr =
        ptr.ref.vtable
                .elementAt(8)
                .cast<
                    Pointer<
                        NativeFunction<
                            HRESULT Function(
                                Pointer, Pointer<GamepadReading>)>>>()
                .value
                .asFunction<int Function(Pointer, Pointer<GamepadReading>)>()(
            ptr.ref.lpVtbl, retValuePtr);

    if (FAILED(hr)) throw WindowsException(hr);

    final retValue = retValuePtr.ref;
    return retValue;
  } finally {}
}