/
SilovAndrey
/
easel_examples
Обзор
Документация
Войти
/
SilovAndrey
/
easel_examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
space.cpp
39 строк
820 B
Andrey HomePC
Add easel_examples v0.1.0 with shapes, space, paths examples
10 июл 2026, 10:34
10 июл 2026, 10:34
8ecc405
Код
Авторство
О чём код?
module App; using namespace easel; auto constexpr window_size = extent{640.0f, 480.0f}; //Добавляем пути перед первым объявлением Image static Initialiser<init_paths> setter; auto space = Image{"space.jpg"}; auto size = space.size(); float x_incr = 0.5; float y_incr = 0.5; float x = 0; float y = 0; void draw(canvas& cnv, int w, int h) { cnv.translate(x, y); cnv.draw(space); x += x_incr; y += y_incr; if (x > 0) x_incr = -x_incr; if (y > 0) y_incr = -y_incr; if (x < -(size.x-640)) x_incr = -x_incr; if (y < -(size.y-480)) y_incr = -y_incr; //cnv.translate(-x, -y); //print_elapsed(cnv, window_size, colors::black.opacity(0)); } int start(int argc, char const* argv[]) { return run_app(argc, argv, window_size, colors::black, true); }