aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics/window.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-10 19:12:31 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit38f14606c78c119d452f302f17329455e29a9a6f (patch)
tree03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/engine/graphics/window.cpp
parent09848ad31af6a1c70d64fccee711e231afb5a77f (diff)
refactor: rename game initializer & move input config
Diffstat (limited to 'src/engine/graphics/window.cpp')
-rw-r--r--src/engine/graphics/window.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/graphics/window.cpp b/src/engine/graphics/window.cpp
new file mode 100644
index 0000000..d6bae0c
--- /dev/null
+++ b/src/engine/graphics/window.cpp
@@ -0,0 +1,13 @@
+#include "window.hpp"
+
+#include <sys/ioctl.h>
+
+Bounds Window::size() const noexcept
+{
+ winsize window_size = {};
+
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
+ ioctl(0, TIOCGWINSZ, &window_size);
+
+ return Bounds({window_size.ws_col, window_size.ws_row});
+}