-
-
Save errpr/571bc7b9e65f5153294699f8937190b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const XINPUT_GAMEPAD = struct { | |
wButtons: c_ushort, | |
bLeftTrigger: u8, | |
bRightTrigger: u8, | |
sThumbLX: c_short, | |
sThumbLY: c_short, | |
sThumbRX: c_short, | |
sThumbRY: c_short, | |
}; | |
const XINPUT_STATE = struct { | |
dwPacketNumber: c_ulong, | |
Gamepad: XINPUT_GAMEPAD, | |
}; | |
extern "xinput1_4" stdcallcc fn XInputGetState(dwUserIndex: c_ulong, pState: *XINPUT_STATE) c_ulong; | |
pub const HINSTANCE__ = extern struct { | |
unused: c_int, | |
}; | |
pub const HINSTANCE = ?*HINSTANCE__; | |
pub export fn WinMain(Instance: HINSTANCE, PrevInstance: HINSTANCE, lpCmdLine: ?[*]u8, nCmdShow: c_int) c_int | |
{ | |
var ControllerState: XINPUT_STATE = undefined; | |
const errorcode = XInputGetState(0, &ControllerState); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment