MONOCHROME GRAPHICS FUNCTIONS (graphics.h)

Header {z88dk}/include/graphics.h
Source {z88dk}/libsrc/graphics
Include #include <graphics.h>
Linking n/a
Compile n/a
Comments These library functions implement various monochrome graphics functions thought to be easily portable.

Mono Graphics API

These APIs (along with the monochrome sprites ones) have been developed for many platforms with the intentions to make possible the portability of simple graphical applications. For that reason no color extensions are implemented. The developer wishing to create portable applications has to keep in mind the differences between the various screen resolutions.

The most common ones are:

256×192

256×64

128×64

96×64 and 80×72 (those could converge on a minimal 78×64 and cover as much platform as possible).

void plot(int x, int y)

Plot a pixel to screen

void unplot(int x, int y)

Reset a pixel on the screen

void xorplot(int x, int y)

Invert a pixel on the screen

void xorplot(int x, int y)

Invert a pixel on the screen

int point(int x, int y)

Get the status of a pixel (this function might not work correctly on all the platforms)

void draw(int x1, int y1, int x2, int y2)

Draw a line, given absolute coordinates

void undraw(int x1, int y1, int x2, int y2)

Draw a white line (clear a line), given absolute coordinates

void drawr(int px, int py)

Draw a line, starting from the last plotted pixel to the given position

void undrawr(int px, int py)

Draw a white line starting from the last plotted pixel to the given position

void drawb(int tlx, int tly, int width, int height)

Draw a box border

void undrawb(int tlx, int tly, int width, int height)

Draw a white box border

void xorborder(int tlx, int tly, int width, int height)

Invert the given box border. Useful for “select area” functions.

void circle(int x, int y, int radius, int skip)

Draw a circle.

void uncircle(int x, int y, int radius, int skip)

Draw a white circle.

void clg(void)

Clear the screen and (if necessary for the platform) enter in graphics mode.

void clga(int tlx, int tly, int width, int height)

Clear the given screen area.

void fill(int x, int y)

Fill an area starting at the given point. (this function might not work correctly on all the platforms)

 
library/monographics.txt · Last modified: 2007/01/18 12:00 by stefano
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki