• Advertisement
Sign in to follow this  

Buffered DirectInput Problem

This topic is 4914 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:

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
Sign in to follow this  

  • Advertisement