Skip to main content
New Participant
April 28, 2014

GetGamepadState does not work for me

Hi,
I'm integrating OculusSDK.
I'm now integrating only the "gamepad" (input) and not the rendering.

Initialization is:
    ovr_Initialize();
ovrHmd l_Hmd = ovrHmd_Create(0);
ovrHmdDesc l_HmdDesc ;
ovrHmd_GetDesc(l_Hmd, &l_HmdDesc);

That works fine and I get a seems-legal descriptor.

Later I call:
 XINPUT_STATE xis;
int l_rc = XInputGetState(0, &xis);
if (l_rc == ERROR_SUCCESS )
Log("Controller connrected");

But I always get l_rc==1167 and constant looks-like-garbage state.

Could you help?

    3 replies

    kojack
    Honored Contributor
    April 28, 2014
    1167 is ERROR_DEVICE_NOT_CONNECTED.
    Is the 360 controller working with other software? How about in the windows game controllers properties?
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3
    yeilamAuthor
    New Participant
    April 29, 2014
    Thanks for the hints.
    1167 is ERROR_DEVICE_NOT_CONNECTED.
    Is the 360 controller working with other software?

    Yes. I can run OculusWorldDemo.exe, it works.

    How about in the windows game controllers properties?

    Is it the "Set up USB game controllers"?
    There are no controllers listed there.
    Should they?

    I could not find anything in the OculusWorldDemo code besides:
    XInputGetState(0, &xis);

    Is there something else?

    Thanks.
    kojack
    Honored Contributor
    April 29, 2014
    "yeilam" wrote:

    Is it the "Set up USB game controllers"?
    There are no controllers listed there.
    Should they?

    Yep, that's the one.
    It should look like this:


    You might need to install the drivers manually if it hasn't auto detected it.
    http://www.microsoft.com/hardware/en-au/d/xbox-360-controller-for-windows
    I think XP needed manual drivers, while win 7 and above come with them. (At least I remember 6 or more years ago needing to install 360 drivers for my students whenever they moved to a different computer)
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3