aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics/window.cpp
blob: 2d880fcc1235ec29f2ae08860c068dc213e78fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "window.hpp"

#include <sys/ioctl.h>

auto Window::size() const noexcept -> Bounds
{
	winsize window_size = {};

	// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
	ioctl(0, TIOCGWINSZ, &window_size);

	return Bounds({ window_size.ws_col, window_size.ws_row });
}