Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Access the mouse from anywhere?  (Read 754 times)

Muller

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Access the mouse from anywhere?
« on: June 01, 2007, 02:32:31 AM »

I have some sort of Tool class for my in-game editor which requires access to the mouse. I'm using Ogre 1.4, so initially the FrameListener has a pointer to OIS::Mouse which is created on start-up. I tried passing this pointer to the Tool class constructor, and using it in the Tool class methods. However:

Code: [Select]
const OIS::MouseState &state = mMouse->getMouseState()

That line of code is causing a linker error. Any ideas? How do I acess the mouse from anywhere in my game?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Access the mouse from anywhere?
« Reply #1 on: June 01, 2007, 06:20:58 PM »

Hmm, what kind of linker error?

If unresolved/undefined, you simply need to link against OIS lib.
Logged

Muller

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: Access the mouse from anywhere?
« Reply #2 on: June 02, 2007, 12:58:44 AM »

The opposite - I'm getting an already defined.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Access the mouse from anywhere?
« Reply #3 on: June 02, 2007, 06:50:01 AM »

Hmm, already defined is weird. Do you have header guards in all your headers to prevent multiple inclusion of stuff (especially in your headers which include OIS)?
Logged