nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
Ncurses Namespace Reference

Everything related to the terminal library Ncurses. More...

Functions

bool init ()
 Initializes Ncurses mode.
 
void exit ()
 Quits Ncurses mode.
 
void delay_ms (int delay)
 Sleeps for #delay miliseconds.
 
int getInput (int delay_ms=-1)
 Returns a pressed character within a timespan of delay_ms (milliseconds).
 

Detailed Description

Everything related to the terminal library Ncurses.

Function Documentation

◆ delay_ms()

void Ncurses::delay_ms ( int delay)

Sleeps for #delay miliseconds.

Definition at line 32 of file Ncurses.cpp.

◆ exit()

void Ncurses::exit ( )

Quits Ncurses mode.

Definition at line 25 of file Ncurses.cpp.

◆ getInput()

int Ncurses::getInput ( int delay_ms = -1)

Returns a pressed character within a timespan of delay_ms (milliseconds).

Note
If you send -1, it'll block the execution, waiting for the input indefinitely.
It's #int because nCurses uses some other values that don't fit on a #char variable.

Definition at line 37 of file Ncurses.cpp.

◆ init()

bool Ncurses::init ( )

Initializes Ncurses mode.

Definition at line 3 of file Ncurses.cpp.