Main Page   Compound List   File List   Header Files   File Members  

drawing.h File Reference

All Points Addressable (APA) mode drawing library. More...


Defines

#define GRAPHICS_WIDTH
Size of the screen in pixels.

#define SOLID
Possible drawing modes.

#define WHITE
Possible drawing colours.

#define M_NOFILL
Possible fill styles for box() and circle().

#define SIGNED
Possible values for signed_value in gprintln() and gprintn().


Functions

void gprint (char *str)
Print the string 'str' with no interpretation.

void gprintln (INT16 number, INT8 radix, INT8 signed_value)
Print the long number 'number' in radix 'radix'. More...

void gprintn (INT8 number, INT8 radix, INT8 signed_value)
Print the number 'number' as in 'gprintln'.

INT8 gprintf (char *fmt,...)
Print the formatted string 'fmt' with arguments '...'.

void plot (UINT8 x, UINT8 y, UINT8 colour, UINT8 mode)
Old style plot - try plot_point().

void plot_point (UINT8 x, UINT8 y)
Plot a point in the current drawing mode and colour at (x,y).

void switch_data (UINT8 x, UINT8 y, unsigned char *src, unsigned char *dst)
I (MLH) have no idea what switch_data does...

void draw_image (unsigned char *data)
Ditto.

void line (UINT8 x1, UINT8 y1, UINT8 x2, UINT8 y2)
Draw a line in the current drawing mode and colour from (x1,y1) to (x2,y2).

void box (UINT8 x1, UINT8 y1, UINT8 x2, UINT8 y2, UINT8 style)
Draw a box (rectangle) with corners (x1,y1) and (x2,y2) using fill mode 'style' (one of NOFILL or FILL.

void circle (UINT8 x, UINT8 y, UINT8 radius, UINT8 style)
Draw a circle with centre at (x,y) and radius 'radius'. More...

UINT8 getpix (UINT8 x, UINT8 y)
Returns the current colour of the pixel at (x,y).

void wrtchr (char chr)
Prints the character 'chr' in the default font at the current position.

void gotogxy (UINT8 x, UINT8 y)
Sets the current text position to (x,y). More...

void color (UINT8 forecolor, UINT8 backcolor, UINT8 mode)
Set the current foreground colour (for pixels), background colour, and draw mode.


Detailed Description

All Points Addressable (APA) mode drawing library.

Drawing routines originally by Pascal Felber Legendary overhall by Jon Fuge <jonny@q-continuum.demon.co.uk> Commenting by Michael Hope

Note that the standard text printf() and putchar() cannot be used in APA mode - use gprintf() and wrtchr() instead.


Function Documentation

void gprintln (INT16 number, INT8 radix, INT8 signed_value)

Print the long number 'number' in radix 'radix'.

signed_value should be set to SIGNED or UNSIGNED depending on whether the number is signed or not

void circle (UINT8 x, UINT8 y, UINT8 radius, UINT8 style)

Draw a circle with centre at (x,y) and radius 'radius'.

'style' sets the fill mode

void gotogxy (UINT8 x, UINT8 y)

Sets the current text position to (x,y).

Note that x and y have units of cells (8 pixels)


Generated at Sun May 7 12:16:58 2000 for gbdk-lib by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999