Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 ANSI color strings, rlutil
 ANSI_BLACK, rlutil
 ANSI_BLUE, rlutil
 ANSI_BROWN, rlutil
 ANSI_CLS, rlutil
 ANSI_CYAN, rlutil
 ANSI_DARKGREY, rlutil
 ANSI_GREEN, rlutil
 ANSI_GREY, rlutil
 ANSI_LIGHTBLUE, rlutil
 ANSI_LIGHTCYAN, rlutil
 ANSI_LIGHTGREEN, rlutil
 ANSI_LIGHTMAGENTA, rlutil
 ANSI_LIGHTRED, rlutil
 ANSI_MAGENTA, rlutil
 ANSI_RED, rlutil
 ANSI_WHITE, rlutil
 ANSI_YELLOW, rlutil
 anykey, rlutil
 API Index
B
 BLACK, rlutil
 BLUE, rlutil
 BROWN, rlutil
C
 cls, rlutil
 Color codes, rlutil
 Color Codes
 Constants, rlutil
 Copyright
 CursorHider
 CYAN, rlutil
D
 DARKGREY, rlutil
 Description
 Developing
E
 Enumerations, rlutil
F
 Functions
G
 getANSIColor, rlutil
 getch
 getkey, rlutil
 gotoxy
 GREEN, rlutil
 GREY, rlutil
H
 hidecursor, rlutil
I
 Internal typedefs and macros, rlutil
K
 kbhit
 Key codes for keyhit, rlutil
 KEY_DELETE, rlutil
 KEY_DOWN, rlutil
 KEY_END, rlutil
 KEY_ENTER, rlutil
 KEY_ESCAPE, rlutil
 KEY_F1, rlutil
 KEY_F10, rlutil
 KEY_F11, rlutil
 KEY_F12, rlutil
 KEY_F2, rlutil
 KEY_F3, rlutil
 KEY_F4, rlutil
 KEY_F5, rlutil
 KEY_F6, rlutil
 KEY_F7, rlutil
 KEY_F8, rlutil
 KEY_F9, rlutil
 KEY_HOME, rlutil
 KEY_INSERT, rlutil
 KEY_LEFT, rlutil
 KEY_NUMDEL, rlutil
 KEY_NUMPAD0, rlutil
 KEY_NUMPAD1, rlutil
 KEY_NUMPAD2, rlutil
 KEY_NUMPAD3, rlutil
 KEY_NUMPAD4, rlutil
 KEY_NUMPAD5, rlutil
 KEY_NUMPAD6, rlutil
 KEY_NUMPAD7, rlutil
 KEY_NUMPAD8, rlutil
 KEY_NUMPAD9, rlutil
 KEY_PGDOWN, rlutil
 KEY_PGUP, rlutil
 KEY_RIGHT, rlutil
 KEY_SPACE, rlutil
 KEY_UP, rlutil
L
 License
 Licensing
 LIGHTBLUE, rlutil
 LIGHTCYAN, rlutil
 LIGHTGREEN, rlutil
 LIGHTMAGENTA, rlutil
 LIGHTRED, rlutil
 locate, rlutil
M
 Macros
 MAGENTA, rlutil
 max, rlutil
 min, rlutil
 msleep, rlutil
N
 nb_getch, rlutil
R
 RED, rlutil
 rlutil
 rlutil.h
 RLUTIL_PRINT(str), rlutil
 RLUTIL_STRING_T
 RLUTIL_USE_ANSI
S
 setColor, rlutil
 showcursor, rlutil
T
 tcols, rlutil
 test.cpp
 trows, rlutil
W
 WHITE, rlutil
Y
 YELLOW, rlutil
Black
Blue
Brown / dark yellow
Clears screen
Cyan
Dark grey / light black
Green
Grey / dark white
Light blue
Light cyan
Light green
Light magenta / light purple
Light red
Magenta / purple
Red
White (bright)
Yellow (bright)
inline void anykey(void)
Waits until a key is pressed.
Black
Blue
Brown / dark yellow
inline void cls(void)
Clears screen and moves cursor home.
These are the color codes used by rlutil’s functions.
© 2010 Tapio Vierros
struct CursorHider
RAII OOP wrapper for rlutil.hidecursor.
Cyan
Dark grey / light black
This file provides some useful utilities for console mode roguelike game development with C and C++.
This is a list of some development goals and guidelines used for developing this utility collection.
RLUTIL_STRING_T getANSIColor(const int c)
Return ANSI color escape sequence for specified number 0-15.
int getch(void)
Get character without waiting for Return to be pressed.
int getkey(void)
Reads a key press (blocking) and returns a key code.
inline void gotoxy(int x,
int y)
Same as rlutil.locate.
Green
Grey / dark white
inline void hidecursor(void)
Hides the cursor.
int kbhit(void)
Determines if keyboard has been hit.
Delete
Down arrow
End
Enter
Escape
F1
F10
F11
F12
F2
F3
F4
F5
F6
F7
F8
F9
Home
Insert
Left arrow
Numpad del
Numpad 0
Numpad 1
Numpad 2
Numpad 3
Numpad 4
Numpad 5
Numpad 6
Numpad 7
Numpad 8
Numpad 9
PageDown
PageUp
Right arrow
Space
Up arrow
See License
Light blue
Light cyan
Light green
Light magenta / light purple
Light red
void locate(int x,
int y)
Sets the cursor position to 1-based x,y.
Magenta / purple
#ifdef __cplusplus template <class T> const T& max (const &a,
const &b)
Returns the greater of the two arguments.
#ifdef __cplusplus template <class T> const T& min (const &a,
const &b)
Returns the lesser of the two arguments.
inline void msleep(unsigned int ms)
Waits given number of milliseconds before continuing.
inline int nb_getch(void)
Non-blocking getch().
Red
namespace rlutil
In C++ all functions except getch, kbhit and gotoxy are arranged under namespace rlutil.
Printing macro independent of C/C++
Define/typedef this to your preference to override rlutil’s string type.
String type depending on which one of C or C++ is used
Define this to use ANSI escape sequences also on Windows (defaults to using WinAPI instead).
inline void setColor(int c)
Change color specified by number (Windows / QBasic colors).
inline void showcursor(void)
Shows the cursor.
int tcols(void)
Get the number of columns in the terminal window or -1 on error.
int trows(void)
Get the number of rows in the terminal window or -1 on error.
White (bright)
Yellow (bright)
Close