Jump to content
  • Advertisement
Sign in to follow this  
Integra

Buffered DirectInput Problem

This topic is 5034 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!