1#ifndef __CPP_CONSOLE_DIMENSIONS_HPP__
2#define __CPP_CONSOLE_DIMENSIONS_HPP__
32 CONSOLE_SCREEN_BUFFER_INFO csbi;
33 GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
34 return {csbi.srWindow.Right - csbi.srWindow.Left + 1,
35 csbi.srWindow.Bottom - csbi.srWindow.Top + 1};
38 ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
39 return {w.ws_row, w.ws_col};
Namespace Containing all console commands.
Definition ansi.hpp:16
Dimensions getDimensions()
Gets the width and height of the console.
Definition dimensions.hpp:30
A structure representing the dimensions of the console.
Definition dimensions.hpp:20
int width
Definition dimensions.hpp:21
int height
Definition dimensions.hpp:22