Exemple #1
0
sanguis::client::draw2d::scene::light::light(
	sanguis::client::load::context const &_load_context,
	sanguis::client::draw2d::sprite::client::system &_client_system,
	sge::viewport::manager &_viewport_manager
)
:
	client_system_(
		_client_system
	),
	texture_(
		_load_context.resources().textures().load(
			sanguis::client::load::resource::texture_identifier(
				FCPPT_TEXT("light")
			)
		)
	),
	sprite_(
		sge::sprite::roles::connection{} =
			client_system_.connection(
				sanguis::client::draw2d::sprite::client::category::light
			),
		sge::sprite::roles::pos{} =
			fcppt::math::vector::null<
				sanguis::client::draw2d::sprite::point
			>(),
		sge::sprite::roles::size{} =
			fcppt::math::dim::structure_cast<
				sanguis::client::draw2d::sprite::dim,
				fcppt::cast::size_fun
			>(
				fcppt::math::dim::to_signed(
					sanguis::client::draw2d::scene::background_dim(
						client_system_.renderer()
					)
				)
			),
		sge::sprite::roles::texture0{} =
			sanguis::client::draw2d::sprite::client::object::texture_type{
				texture_
			},
		sge::sprite::roles::texture_coordinates0{} =
			sanguis::client::draw2d::scene::light_texture_coordinates(
				client_system_.renderer(),
				texture_
			)
	),
	sampler_state_{
		_client_system.renderer().create_sampler_state(
			sge::renderer::state::core::sampler::parameters{
				sge::renderer::state::core::sampler::address::mode_all(
					sge::renderer::state::core::sampler::address::mode::clamp
				),
				sge::renderer::state::core::sampler::filter::point()
			}
		)
	},
	viewport_connection_(
		_viewport_manager.manage_callback(
			sge::viewport::manage_callback{
				std::bind(
					&sanguis::client::draw2d::scene::light::reset_viewport,
					this
				)
			}
		)
	)
{
}
Exemple #2
0
sanguis::client::draw2d::scene::background::background(
	sanguis::client::load::context const &_load_context,
	sanguis::client::draw2d::sprite::client::system &_client_system,
	sge::viewport::manager &_viewport_manager
)
:
	client_system_(
		_client_system
	),
	texture_(
		_load_context.resources().textures().load(
			sanguis::client::load::resource::texture_identifier(
				FCPPT_TEXT("background")
			)
		)
	),
	sprite_(
		sge::sprite::roles::connection{} =
			client_system_.connection(
				sanguis::client::draw2d::sprite::client::category::background
			),
		sge::sprite::roles::pos{} =
			fcppt::math::vector::null<
				sanguis::client::draw2d::sprite::point
			>(),
		sge::sprite::roles::size{} =
			fcppt::math::dim::structure_cast<
				sanguis::client::draw2d::sprite::dim,
				fcppt::cast::size_fun
			>(
				fcppt::math::dim::to_signed(
					sanguis::client::draw2d::scene::background_dim(
						client_system_.renderer()
					)
				)
			),
		sge::sprite::roles::texture0{} =
			sanguis::client::draw2d::sprite::client::object::texture_type{
				texture_
			},
		sge::sprite::roles::texture_coordinates0{} =
			sanguis::client::draw2d::scene::background_texture_coordinates(
				sanguis::client::draw2d::translation(
					fcppt::math::vector::null<
						sanguis::client::draw2d::translation::value_type
					>()
				),
				client_system_.renderer(),
				texture_
			)
	),
	viewport_connection_(
		_viewport_manager.manage_callback(
			sge::viewport::manage_callback{
				std::bind(
					&sanguis::client::draw2d::scene::background::reset_viewport,
					this
				)
			}
		)
	)
{
}