diff options
Diffstat (limited to 'src/engine/graphics/window.cpp')
-rw-r--r-- | src/engine/graphics/window.cpp | 13 |
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}); +} |