aboutsummaryrefslogtreecommitdiff
path: root/src/client/window/basic_window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/window/basic_window.cc')
-rw-r--r--src/client/window/basic_window.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/client/window/basic_window.cc b/src/client/window/basic_window.cc
new file mode 100644
index 0000000..c96f94a
--- /dev/null
+++ b/src/client/window/basic_window.cc
@@ -0,0 +1,33 @@
+#include "client/window/basic_window.hh"
+
+namespace client {
+namespace window {
+
+using bw = basic_window;
+
+bool bw::is_inside(const glm::vec2& v, const glm::vec2& p,
+ const glm::vec2& s) noexcept {
+ if (v.x < p.x || v.x > p.x + s.x) {
+ return false;
+ }
+ if (v.y < p.y || v.y > p.y + s.y) {
+ return false;
+ }
+ return true;
+}
+
+bool bw::is_inside(const glm::vec2& v) const noexcept {
+ return is_inside(v, this->pos, this->size);
+}
+
+void bw::draw() noexcept {
+ client::render::draw_rectangle({.pos = {.offset = this->pos + 6.0f},
+ .size = {.offset = this->size},
+ .colour = {this->tertiary_clr, 0.9f}});
+ client::render::draw_rectangle({.pos = {.offset = this->pos},
+ .size = {.offset = this->size},
+ .colour = {this->primary_clr, 1.0f}});
+}
+
+} // namespace window
+} // namespace client