Beispiel #1
0
sge::systems::impl::window::quit::quit(
	sge::window::system &_system,
	sge::window::object &_window
)
:
	system_(
		_system
	),
	destroy_connection_(
		_window.awl_window_event_processor().destroy_callback(
			awl::window::event::destroy_callback{
				std::bind(
					&sge::systems::impl::window::quit::on_destroy,
					this,
					std::placeholders::_1
				)
			}
		)
	)
{
}
Beispiel #2
0
sge::dinput::processor::processor(
	fcppt::log::object &_log,
	sge::window::object const &_window,
	sge::window::system const &_window_system
)
:
	log_{
		_log
	},
	dinput_(
		sge::dinput::create_dinput()
	),
	windows_window_(
		fcppt::cast::dynamic_cross_exn<
			awl::backends::windows::window::object &
		>(
			_window.awl_object()
		)
	),
	event_processor_(
		fcppt::cast::dynamic_exn<
			awl::backends::windows::window::event::processor &
		>(
			_window.awl_window_event_processor()
		)
	),
	system_processor_(
		fcppt::cast::dynamic_exn<
			awl::backends::windows::system::event::processor &
		>(
			_window_system.awl_system_event_processor()
		)
	),
	devices_(),
	event_handle_(
		system_processor_.create_event_handle()
	),
	has_focus_(
		false
	),
	keyboard_discover_(),
	keyboard_remove_(),
	mouse_discover_(),
	mouse_remove_(),
	joypad_discover_(),
	joypad_remove_(),
	init_message_(
		system_processor_
	),
	connections_(
		fcppt::assign::make_container<
			fcppt::signal::auto_connection_container
		>(
			event_processor_.register_callback(
				fcppt::strong_typedef_construct_cast<
					awl::backends::windows::message_type,
					fcppt::cast::to_unsigned_fun
				>(
					WM_SETFOCUS
				),
				awl::backends::windows::window::event::callback{
					std::bind(
						&sge::dinput::processor::on_focus_in,
						this,
						std::placeholders::_1
					)
				}
			),
			event_processor_.register_callback(
				fcppt::strong_typedef_construct_cast<
					awl::backends::windows::message_type,
					fcppt::cast::to_unsigned_fun
				>(
					WM_KILLFOCUS
				),
				awl::backends::windows::window::event::callback{
					std::bind(
						&sge::dinput::processor::on_focus_out,
						this,
						std::placeholders::_1
					)
				}
			),
			event_processor_.register_callback(
				init_message_.type(),
				awl::backends::windows::window::event::callback{
					std::bind(
						&sge::dinput::processor::on_init,
						this,
						std::placeholders::_1
					)
				}
			),
			system_processor_.register_handle_callback(
				awl::backends::windows::system::event::handle_callback{
					std::bind(
						&sge::dinput::processor::on_handle_ready,
						this
					)
				}
			)
		)
	)
{
	awl::backends::windows::post_message(
		windows_window_.hwnd(),
		init_message_.type(),
		awl::backends::windows::wparam(
			0u
		),
		awl::backends::windows::lparam(
			0
		)
	);
}