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); }
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(); }