Exemplo n.º 1
0
void App::draw_cpu(clan::Canvas &canvas, clan::PixelBuffer &cpu_buffer, clan::PixelBuffer &tux, clan::Texture2D &texture_to_write_into, clan::Texture2D &texture_to_draw)
{
	upload_pixel_buffer(canvas, tux, cpu_buffer);
	texture_to_write_into.set_subimage(canvas, 0, 0, cpu_buffer, cpu_buffer.get_size());

	draw_texture(canvas, texture_to_draw, 32, 32);
}
Exemplo n.º 2
0
void App::upload_pixel_buffer(clan::Canvas &canvas, clan::PixelBuffer &pbuff_source, clan::PixelBuffer &pbuff_dest)
{
	pbuff_source.lock(canvas, clan::access_read_only);
	pbuff_dest.upload_data(canvas, clan::Rect(0,0, pbuff_source.get_size()), pbuff_source.get_data());
	pbuff_source.unlock();
}