1#ifndef VRPN_RUMBLEPAD_H
3#include "vrpn_Configure.h"
5#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT)
7#include "vrpn_Analog.h"
8#include "vrpn_Analog_Output.h"
9#include "vrpn_Button.h"
10#include "vrpn_Connection.h"
12#ifndef DIRECTINPUT_VERSION
13#define DIRECTINPUT_VERSION 0x0800
15#include "vrpn_Shared.h"
26 GUID device_guid = GUID_NULL);
28 ~vrpn_DirectXRumblePad();
34 static int VRPN_CALLBACK handle_request_message(
void *userdata,
36 static int VRPN_CALLBACK handle_request_channels_message(
void* userdata,
38 static int VRPN_CALLBACK handle_last_connection_dropped(
void *selfPtr,
vrpn_HANDLERPARAM data);
46 static BOOL CALLBACK joystick_enum_cb(LPCDIDEVICEINSTANCE lpddi, LPVOID ref);
47 static DWORD CALLBACK thread_proc(LPVOID ref);
48 static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
49 static BOOL CALLBACK axis_enum_cb(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID ref);
52 inline void FAIL(
const char *msg) {
54 vrpn_gettimeofday(&now, NULL);
60 void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
62 void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
79 LPDIRECTINPUT8 _directInput;
82 LPDIRECTINPUTDEVICE8 _gamepad;
83 LPDIRECTINPUTEFFECT _effect;
85 DIPERIODIC _diPeriodic;
91#define VRPN_RUMBLEPAD_H
定义 vrpn_Analog_Output.h:26
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
int send_text_message(const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0)
Sends a NULL-terminated text message from the device d_sender_id
virtual void mainloop()=0
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41