Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OIS as an input system  (Read 1905 times)

0 Members and 1 Guest are viewing this topic.

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
OIS as an input system
« 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?
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

P@u1

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
OIS as an input system
« Reply #1 on: November 08, 2011, 11:10:57 am »
You also get the events from sfml when using PollEvent.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
OIS as an input system
« Reply #2 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 on top of SFML, maybe it can help you. Or use Boost.Signals ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: