Problem with OIS and windows form

stalker87

04-06-2007 01:11:03

Hi all !

I have a strange problem.

I render my OgreApplication in a System::Windows::Forms::Panel.

When i try to create a OIS::Keyboard* program throw an error :\

I use this code to set OIS:


ParamList pl;
size_t hnd;
win->getCustomAttribute("WINDOW",&hnd);
std::ostringstream hndString;
hndString << (size_t)hnd;
pl.insert(std::make_pair(std::string("WINDOW"),hndString.str()));
this->mInputManager = OIS::InputManager::createInputSystem(pl);


And here become the error :

mKey = static_cast<Keyboard*>(input->createInputObject(OISKeyboard,true));

pjcast

06-06-2007 23:11:51

Make sure you are passing your top window form, not the panel handle. As, DirectInput (what OIS uses) requires that.