Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Access violation inside OIS::Keyboard->isKeyDown  (Read 903 times)

tgraupmann

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 43
    • View Profile
    • The Code Blog of Tag
Access violation inside OIS::Keyboard->isKeyDown
« on: February 16, 2008, 11:23:02 AM »

I'm seeing an access violation inside OIS.dll when running isKeyDown in release mode. I know my keyboard is valid.

Code: [Select]
bool S13OISInputManager::IsKeyDown(OIS::KeyCode _kc)
{
S13OISInputManager::KeyboardList::iterator keyboardIterator = m_KeyboardList.begin();
S13OISInputManager::KeyboardList::iterator keyboardIteratorEnd = m_KeyboardList.end();
for (; keyboardIterator != keyboardIteratorEnd; ++keyboardIterator)
{
S13OISKeyboard* s13OISKeyboard = *keyboardIterator;
if (s13OISKeyboard)
{
OIS::Keyboard* keyboard = s13OISKeyboard->GetKeyboard();
if (keyboard)
{
if (keyboard->isKeyDown(_kc))
{
return true;
}
}
}
}
return false;
}

Somehow the KeyBuffer is invalid?
Code: [Select]
bool Win32Keyboard::isKeyDown( KeyCode key )
{
return (KeyBuffer[key] & 0x80) != 0;
}

KeyBuffer = 0x07c6d3f0 <Bad Ptr>

key = 1570640

-      this   0x07c6d3a8 {mDirectInput=??? mKeyboard=??? coopSetting=??? ...}   OIS::Win32Keyboard * const
Logged

tgraupmann

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 43
    • View Profile
    • The Code Blog of Tag
Re: Access violation inside OIS::Keyboard->isKeyDown
« Reply #1 on: February 16, 2008, 11:47:14 AM »

Nevermind, it's looking like my own bug.
Logged