/
Tias
/
UIToolkit
Обзор
Документация
Войти
/
Tias
/
UIToolkit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/core/primitives/Rectangle.cpp
31 строка
769 B
Tias
rework shifting and scaling to match window resolution, rework MP test to show depth impact
29 июн 2025, 20:13
29 июн 2025, 20:13
8d1dd70
Код
Авторство
О чём код?
#include "core/primitives/Rectangle.hpp" #include <stdexcept> namespace core::primitives { Rectangle::Rectangle(std::shared_ptr<render::IProgram> program) : parent_t(program) { std::vector<glm::vec3> coords{ {0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0} }; std::vector<GLubyte> indexes{0, 1, 2, 3}; setVertexes(coords, indexes); } Rectangle::Rectangle(std::shared_ptr<render::IProgram> program, glm::vec3 color) : Rectangle(program) { std::vector<glm::vec3> colors(nVertexes(), color); setColor(colors); } Rectangle::Rectangle(std::shared_ptr<render::IProgram> program, std::shared_ptr<render::ITexture> texture) : Rectangle(program) { throw std::runtime_error("Textured rectangle not supported yet"); } } // namespace core::primitives