Sha256: 316381eb929166ead1c795632d9e389a7f03ba9f6c23491e89201df8b25202ff

Contents?: true

Size: 1.64 KB

Versions: 3

Compression:

Stored size: 1.64 KB

Contents

#include "OISInputManager.h"

/**
	*  Listeners needs a proxy because the input system requires a 
	*  Listener object to subscribe to events.  Ruby can't subclass and
	*  subscribe without proxy.
	*/
namespace OIS {
	/*
	* KeyListenerProxy is added through the constructor.
	*	The constructor takes a pre-initialized OIS::InputManager.
	*/
	class KeyListenerProxy : public KeyListener {
	public:
		KeyListenerProxy(OIS::Keyboard *kb) {
			kb->setEventCallback( this );
		}
		
		~KeyListenerProxy() {}
		virtual bool keyPressed( const OIS::KeyEvent &arg ) =0;
		virtual bool keyReleased( const OIS::KeyEvent &arg ) =0;

	};
	
	
	/*
	*	Same as KeyListenerProxy.
	*/
	class MouseListenerProxy : public MouseListener {
	public:		
		MouseListenerProxy(OIS::Mouse *mouse) {
			mouse->setEventCallback( this );
		}
		
    virtual bool mouseMoved( const OIS::MouseEvent &e )=0;
    virtual bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id )=0;
    virtual bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id )=0;
    
	};
	
	/*
	*	Same as KeyListenerProxy.
	*/
	class JoyStickListenerProxy : public JoyStickListener {
	public:
		JoyStickListenerProxy(OIS::JoyStick *joy) {
     joy->setEventCallback( this );
		}
		
    virtual bool povMoved( const OIS::JoyStickEvent &e, int pov )=0;
    virtual bool axisMoved( const OIS::JoyStickEvent &e, int axis )=0;
    virtual bool sliderMoved( const OIS::JoyStickEvent &e, int sliderID )=0;
    virtual bool buttonPressed( const OIS::JoyStickEvent &e, int button )=0;
    virtual bool buttonReleased( const OIS::JoyStickEvent &e, int button )=0;


	};
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shattered_ogrerb-0.5.0.1 vendor/ogrerb/src_headers/wrappers/OISProxies.h
shattered_ogrerb-0.5.0.2 vendor/ogrerb/src_headers/wrappers/OISProxies.h
shattered_ogrerb-0.5.1 vendor/ogrerb/src_headers/wrappers/OISProxies.h