/
leanid
/
om
Обзор
Документация
Войти
/
leanid
/
om
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
01-basic-game-dev/04-0-render-basic/00_canvas_basic.cxx
27 строк
613 B
Leanid Chaika
minor code fix
20 апр 2023, 09:26
20 апр 2023, 09:26
2bf1bf7
Код
Авторство
О чём код?
#include "00_canvas_basic.hxx" irender::~irender() {} bool operator==(const color& l, const color& r) { return l.r == r.r && l.g == r.g && l.b == r.b; } constexpr size_t color_size = sizeof(color); static_assert(3 == color_size, "24 bit per pixel(r,g,b)"); position operator-(const position& left, const position& right) { return { left.x - right.x, left.y - right.y }; } bool operator==(const position& left, const position& right) { return left.x == right.x && left.y == right.y; } position position::generate_random(int width, int height) { return { rand() % width, rand() % height }; }