1#ifndef NNGN_GRAPHICS_TERMINAL_TERMINAL_H
2#define NNGN_GRAPHICS_TERMINAL_TERMINAL_H
6#include "utils/utils.h"
32 bool write(std::size_t
n,
const char *
p)
const;
35 bool write(
const T &
v)
const {
return this->
write(v.size(),
v.data()); }
44 std::FILE *
f =
nullptr;
52 constexpr std::size_t max = 1;
53 for(std::size_t
w = 0;
n;
n -=
w,
p +=
static_cast<std::ptrdiff_t
>(
w)) {
54 w = fwrite(
p, 1, std::min(
n, max), this->
f);
Handles interactions with the output terminal.
Definition: terminal.h:13
auto pixel_size(void) const
Size of the terminal in pixels.
Definition: terminal.h:27
uvec2 pixel
Definition: terminal.h:46
int tty_fd
Definition: terminal.h:42
uvec2 m_size
Definition: terminal.h:45
bool write(std::size_t n, const char *p) const
Outputs the entire contents of a buffer.
std::tuple< bool, bool > update_size(void)
Asks the OS for the terminal size.
bool flush(void) const
Synchronizes the output file descriptor.
bool write(const T &v) const
Outputs the entire contents of a container.
Definition: terminal.h:35
auto size(void) const
Size of the terminal in characters.
Definition: terminal.h:25
std::FILE * f
fopened version of fd.
Definition: terminal.h:44
n
Definition: dump_lights.lua:5
v[1]
Definition: math.lua:19
w
Definition: strict.lua:12
std::chrono::duration< float, typename T::period > fd
Definition: timing.cpp:8
#define NNGN_MOVE_ONLY(x)
Definition: utils.h:39