Hello,
I'm trying to use a Wiimote as a joystick in Ogre, in order to create a kind of Monkey Ball. The problem is, everything works fine with keyboard (I don't use the mouse right now), by when I declare
pWiimote = static_cast<OIS::JoyStick*>(pInputManager->createInputObject(OIS::OISJoyStick, true));
and launch the program, I get a Runtime Error, without any explanation (I get no errors when compiling)
I'm working under Visual Express 2008, using Bluesoleil as HID. Here's the full code.
#include "gestionentree.h"
void GestionEntree::InitOIS(Ogre::RenderWindow *pRenderWindow)
{
OIS::ParamList pl;size_t windowHnd = 0;
std::ostringstream windowHndStr;
pRenderWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
pInputManager = OIS::InputManager::createInputSystem( pl );
// création d'objets OIS pour le clavier et la souris
pMouse = static_cast<OIS::Mouse*>(pInputManager->createInputObject(OIS::OISMouse, true));
pKeyboard = static_cast<OIS::Keyboard*>(pInputManager->createInputObject(OIS::OISKeyboard, false));
pWiimote = static_cast<OIS::JoyStick*>(pInputManager->createInputObject(OIS::OISJoyStick, true));
// définit la taille de la fenêtre de rendu (pRenderWindow)
unsigned int width, height, depth;
int top, left;
pRenderWindow->getMetrics(width, height, depth, left, top);
const OIS::MouseState &ms = pMouse->getMouseState();
ms.width = width;
ms.height = height;
}
Do you have any ideas of what is wrong? Thanks