Beispiel #1
0
sge::cegui::impl::batch::batch(
	sge::renderer::device::core &_renderer,
	sge::renderer::vertex::declaration const &_vertex_declaration,
	sge::renderer::texture::planar &_texture,
	sge::renderer::vertex::count const _vertex_count,
	sge::cegui::impl::clip const _clip
)
:
	texture_(
		_texture
	),
	vertex_buffer_(
		_renderer.create_vertex_buffer(
			sge::renderer::vertex::buffer_parameters(
				_vertex_declaration,
				sge::renderer::vf::dynamic::part_index(
					0u
				),
				_vertex_count,
				sge::renderer::resource_flags_field::null()
			)
		)
	),
	clip_(
		_clip
	)
{
}
Beispiel #2
0
sge::renderer::vertex::buffer_unique_ptr
sge::renderer::vertex::create_buffer_from_view(
	sge::renderer::device::core &_device,
	sge::renderer::vertex::declaration &_vertex_declaration,
	sge::renderer::vf::dynamic::const_view const &_view,
	sge::renderer::resource_flags_field const &_resource_flags
)
{
	sge::renderer::vertex::buffer_unique_ptr buffer(
		_device.create_vertex_buffer(
			sge::renderer::vertex::buffer_parameters(
				_vertex_declaration,
				_view.part_index(),
				sge::renderer::vertex::count(
					_view.size()
				),
				_resource_flags
			)
		)
	);

	sge::renderer::vertex::scoped_lock const lock(
		*buffer,
		sge::renderer::lock_mode::writeonly
	);

	std::memcpy(
		lock.value().data(),
		_view.data(),
		_view.part().stride().get()
		* _view.size().get()
	);

	return
		buffer;
}