complete left click event handle

This commit is contained in:
2017-02-09 22:08:30 +00:00
parent de1784e932
commit 914fc34331
8 changed files with 140 additions and 11 deletions

View File

@@ -1,3 +1,15 @@
#include "pch.h"
#include "util.h"
bool point_in_rect(const glm::vec2& p, const glm::vec4& r)
{
return p.x > r.x && p.x < r.x+r.z && p.y > r.y && p.y < r.y+r.w;
}
glm::vec4 rand_color()
{
float r = (rand() % 256) / 256.f;
float g = (rand() % 256) / 256.f;
float b = (rand() % 256) / 256.f;
return { r, g, b, 1.f };
}