Class: Ogre::ApplicationWindowListener

Inherits:
WindowEventListenerProxy
  • Object
show all
Defined in:
lib/application_frame_listener.rb

Overview

Currently not used

Instance Method Summary collapse

Constructor Details

#initialize(input_manager, window, keyboard, mouse, joy_stick) ⇒ ApplicationWindowListener

:nodoc:



8
9
10
11
12
13
14
15
# File 'lib/application_frame_listener.rb', line 8

def initialize(input_manager, window, keyboard, mouse, joy_stick)
	super(window)
	@input_manager = input_manager
	@keyboard = keyboard
	@mouse = mouse
	@window = window
	@joy_stick = joy_stick
end

Instance Method Details

#windowClosed(window) ⇒ Object

Shut everything down nicely when we’re done



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/application_frame_listener.rb', line 28

def windowClosed(window)
	if @window == window
		if @input_manager
			@input_manager.destroy_input_object(@mouse)
			@input_manager.destroy_input_object(@keyboard)
			@input_manager.destroy_input_object(@joy_stick)

			OIS::InputManager.destroyInputSystem(@input_manager)
			@input_manager = nil
		end
	end
end

#windowResized(window) ⇒ Object

Adjust the mouse clipping area when the window has been resized



18
19
20
21
22
23
24
25
# File 'lib/application_frame_listener.rb', line 18

def windowResized(window)
	width = height = depth = left = top = 0
	window.getMetrics(width, height, depth, left, top)

	mouse_state = @mouse.getMouseState
	mouse_state.width = width
	mouse_state.height = height
end