From 2db0d27e7f1744443958717c19b732eed57455f2 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sat, 9 Jan 2021 20:42:24 +0100 Subject: Replace old classes with compute shader structs --- include/utils.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/utils.hpp') diff --git a/include/utils.hpp b/include/utils.hpp index efa007d..0bef213 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -5,6 +5,26 @@ #include +#include +#include + std::vector get_shader_code(const char* path); +inline float deg_to_rad(float deg) { + return deg * M_PI / 180.0; +} + +inline float randd() { + return rand() / (RAND_MAX + 1.0); +} + +inline float randd(float min, float max) { + return min + randd() * (max - min); +} +inline float clamp(float x, float min, float max) { + if (x < min) return min; + if (x > max) return max; + return x; +} + #endif // !__UTILS_HPP_ -- cgit v1.3