BRender x86 Installation Guide:Platform- Specific Functions:4.1 Graphics Functions
Next|Prev|Up
DOSGfxBegin()
DOSGfxEnd()
DOSGfxPaletteSet()
DOSGfxPaletteSetEntry()

4.1 Graphics Functions


DOSGfx is a small set of screen handling functions intended for DOS based BRender applications. The functions simplify initialisation of colour buffers, palettes and video display hardware.

The BRENDER_DOS_GFX environment variable can be used to set the default graphics mode and resolution. It has the following format:

VESA|MCGA,[W:<width>],[H:<height>],[B:<bits/pixel>],[M:<mode number>]

If the environment variable specifies an unavailable mode or resolution, DOSGfx will fail to initialise and return an error message.


DOSGfxBegin()

Description:
Create a pixelmap which represents the graphics hardware screen. Subsequently, BrPixelmapMatch() can be used to create a second screen, and BrPixelmapDoubleBuffer() can be used to swap between them.

Declaration:
br_pixelmap* DOSGfxBegin(char* setup_string);

Arguments:
char * setup_string

An options string, given in the following format:

VESA|MCGA,[W:<width>],[H:<height>],[B:<bits/pixel>],[M:<modenumber>]

The default string `MCGA,W:320,H:200,B:8' is used if NULL is passed and the BRENDER_DOS_GFX environment variable has not been set. If the environment variable has been set, any options given here that differ will be used instead.

Result:
br_pixelmap *

Returns a pointer to a pixelmap representing the graphics hardware screen.


DOSGfxEnd()

Description:
Close down DOSGfx.

Declaration:
void DOSGfxEnd(void);


DOSGfxPaletteSet()

Description:
Copy the contents of a given pixelmap to the VGA/VESA hardware palette.

Declaration:
void DOSGfxPaletteSet(br_pixelmap* pm);

Arguments:
br_pixelmap * pm

A pointer to a 1x256 BR_PMT_RGBX_888 pixelmap containing the palette.


DOSGfxPaletteSetEntry()

Description:
Set a single colour in the VGA/VESA hardware palette.

Declaration:
void DOSGfxPaletteSetEntry(int I, br_colour colour);

Arguments:
int I

Colour number.

br_colour colour

New colour.


Generated with
CERN WebMaker