rlutil.rlutil

D port of rlutil.h https://github.com/tapio/rlutil

About: Description This file provides some useful utilities for console mode roguelike game development with C and C++. It is aimed to be cross-platform (at least Windows and Linux).

Members

Enums

BLACK
enum BLACK

Enums: Color codes

Functions

anykey
void anykey()

Function: trows // Get the number of rows in the terminal window or -1 on error. / return csbi.dwSize.Y; // Buffer height // Function: tcols // Get the number of columns in the terminal window or -1 on error. / return csbi.dwSize.X; // Buffer width Function: anykey Waits until a key is pressed.

getANSIColor
RLUTIL_STRING_T getANSIColor(const(int) c)

Function: getANSIColor Return ANSI color escape sequence for specified number 0-15.

getch
int getch()

Function: getch Get character without waiting for Return to be pressed. Windows has this in conio.h

getkey
int getkey()

Function: getkey Reads a key press (blocking) and returns a key code.

gotoxy
void gotoxy(int x, int y)

Function: gotoxy Same as <rlutil.locate>.

hidecursor
void hidecursor()

Function: hidecursor Hides the cursor.

kbhit
int kbhit()

Function: kbhit Determines if keyboard has been hit. Windows has this in conio.h

locate
void locate(int x, int y)

Function: locate Sets the cursor position to 1-based x,y.

msleep
void msleep(uint ms)

Function: msleep Waits given number of milliseconds before continuing.

nb_getch
int nb_getch()

Function: nb_getch Non-blocking getch(). Returns 0 if no key was pressed.

setColor
void setColor(int c)

Function: setColor Change color specified by number (Windows / QBasic colors).

showcursor
void showcursor()

Function: showcursor Shows the cursor.

Manifest constants

RLUTIL_USE_ANSI
enum RLUTIL_USE_ANSI;

Define: RLUTIL_USE_ANSI Define this to use ANSI escape sequences also on Windows (defaults to using WinAPI instead).

Variables

ANSI_CLS
RLUTIL_STRING_T ANSI_CLS;

Consts: ANSI color strings

KEY_ESCAPE
int KEY_ESCAPE;

Consts: Key codes for keyhit()

Meta

Authors

<a href="http://github.com/danyalzia">Danyal Zia</a>