Sign in to follow this  

Buffered DirectInput Problem

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have my buffered DInput working perfectly fine, but there is a small hack I had to use and it's bothering me! This is what I have:
DIDEVICEOBJECTDATA didod[ DINPUT_BUFFERSIZE ];      
DWORD dwElements = DINPUT_BUFFERSIZE;

HRESULT hr = m_pDirectInput->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), didod, &dwElements, 0 );
    
for( int i = 0; i < DINPUT_BUFFERSIZE; i++ )
  m_KeyBuffer[ i ] = didod[ i ];

m_dwElements = dwElements;

Now that works fine.. but notice how I read to a local array of DIDEVICEOBJECTDATA and later on just copied over to the class member variable? This is because when I try to make the call like this:
m_pDirectInput->GetDeviceData( sizeof( DIDEVICEOBJECTDATA), m_KeyBuffer, &dwElements, 0 );
It wouldn't work.. or would give me FAILs. Is there a better way to do this assigning directly to a member variable? Or do I have to keep my little copy-hack? Thanks!

Share this post


Link to post
Share on other sites

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this