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 escape strings, rlutil
 ANSI_ATTRIBUTE_RESET, rlutil
 ANSI_BACKGROUND_BLACK, rlutil
 ANSI_BACKGROUND_BLUE, rlutil
 ANSI_BACKGROUND_CYAN, rlutil
 ANSI_BACKGROUND_GREEN, rlutil
 ANSI_BACKGROUND_MAGENTA, rlutil
 ANSI_BACKGROUND_RED, rlutil
 ANSI_BACKGROUND_WHITE, rlutil
 ANSI_BACKGROUND_YELLOW, rlutil
 ANSI_BLACK, rlutil
 ANSI_BLUE, rlutil
 ANSI_BROWN, rlutil
 ANSI_CLS, rlutil
 ANSI_CURSOR_HIDE, rlutil
 ANSI_CURSOR_HOME, rlutil
 ANSI_CURSOR_SHOW, 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
 Copyright
 CursorHider
 CYAN, rlutil
D
 DARKGREY, rlutil
 Description
 Developing
E
 Enumerations and Constants, rlutil
F
 Functions
G
 getANSIBackgroundColor, rlutil
 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
 resetColor, rlutil
 rlutil
 rlutil.h
 RLUTIL_PRINT(str), rlutil
 RLUTIL_STRING_T
 RLUTIL_USE_ANSI
Resets all attributes
Black background
Blue background
Cyan background
Green background
Magenta / purple background
Red background
White background
Yellow background
Black
Blue
Brown / dark yellow
Clears screen
Hides the cursor
Moves the cursor home (0,0)
Shows the cursor
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)
#ifdef __cplusplus RLUTIL_INLINE void anykey()
Waits until a key is pressed.
Black
Blue
Brown / dark yellow
RLUTIL_INLINE void cls(void)
Clears screen, resets all attributes 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_INLINE RLUTIL_STRING_T getANSIBackgroundColor(const int c)
Return ANSI background color escape sequence for specified number 0-15.
RLUTIL_INLINE RLUTIL_STRING_T getANSIColor(const int c)
Return ANSI color escape sequence for specified number 0-15.
RLUTIL_INLINE int getch(void)
Get character without waiting for Return to be pressed.
RLUTIL_INLINE int getkey(void)
Reads a key press (blocking) and returns a key code.
RLUTIL_INLINE void gotoxy(int x,
int y)
Same as rlutil.locate.
Green
Grey / dark white
RLUTIL_INLINE void hidecursor(void)
Hides the cursor.
RLUTIL_INLINE 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
RLUTIL_INLINE 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.
RLUTIL_INLINE void msleep(unsigned int ms)
Waits given number of milliseconds before continuing.
RLUTIL_INLINE int nb_getch(void)
Non-blocking getch().
Red
RLUTIL_INLINE void resetColor()
Reset color to default Requires a call to saveDefaultColor() to set the defaults
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).
Close