1#ifndef NNGN_OS_TERMINAL_H
2#define NNGN_OS_TERMINAL_H
8#include "utils/utils.h"
37 bool write(std::size_t
n,
const char *
p)
const;
39 bool write(
const std::ranges::sized_range
auto &
v)
const;
40 bool flush(
void)
const;
41 bool drain(
void)
const;
62 return this->
write(std::size(
v), std::data(
v));
Handles interactions with the output terminal.
Definition: terminal.h:17
bool hide_cursor(void) const
Definition: terminal.h:69
uvec2 m_size
Size of the terminal in characters.
Definition: terminal.h:56
bool show_cursor(void) const
Definition: terminal.h:65
FILE * f
fdopen(3)ed version of fd.
Definition: terminal.h:49
auto pixel_size(void) const
Size of the terminal in pixels.
Definition: terminal.h:25
auto size(void) const
Size of the terminal in characters.
Definition: terminal.h:23
uvec2 m_pixel_size
Size of the terminal in screen pixels, if available.
Definition: terminal.h:58
bool flush(void) const
Definition: terminal.cpp:77
bool write(std::size_t n, const char *p) const
Outputs the entire contents of a buffer.
Definition: terminal.cpp:66
int tty_fd
File descriptor for the controlling TTY.
Definition: terminal.h:54
std::tuple< bool, bool > update_size(void)
Retrieves the terminal size from the operating system.
Definition: terminal.cpp:43
bool drain(void) const
Definition: terminal.cpp:85
init
Definition: img_common.lua:34
n
Definition: dump_lights.lua:5
v[1]
Definition: math.lua:19
std::chrono::duration< float, typename T::period > fd
Definition: timing.cpp:8
#define NNGN_MOVE_ONLY(x)
Definition: utils.h:39
static constexpr auto hide_cursor
Definition: os.h:30
static constexpr auto show_cursor
Definition: os.h:29