SFML community forums

Help => Window => Topic started by: Ockonal on November 07, 2011, 11:57:00 pm

Title: OIS as an input system
Post by: Ockonal on November 07, 2011, 11:57:00 pm
Hello, I have to include some of input system into sfml because It's not enough to catch them from main cycle but I need in callbacks for events. So I decided to use OIS in my app. Here is the code:

Code: [Select]
   OIS::ParamList params;
    std::string window = boost::lexical_cast<std::string>(mWindow->GetSystemHandle());
    // Logging of window variable shows 6-digits number

    params.insert(std::make_pair(std::string("WINDOW"), window));

    mInputSystem = OIS::InputManager::createInputSystem(params);


mWindow is pointer to the sf::RenderWindow. When running app I get:

Quote
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  2 (X_ChangeWindowAttributes)
  Serial number of failed request:  7
  Current serial number in output stream:  9


What's wrong?
Title: OIS as an input system
Post by: P@u1 on November 08, 2011, 11:10:57 am
You also get the events from sfml when using PollEvent.
Title: OIS as an input system
Post by: Nexus on November 12, 2011, 11:20:39 am
I don't know if you can easily use OIS and SFML's input system side-by-side. But I have written a callback system (http://www.bromeon.ch/thor/v1.1/tutorial-actions.html) on top of SFML, maybe it can help you. Or use Boost.Signals ;)