DRAWENV

Drawing environment

typedef struct {
        RECT clip;
        short ofs[2];
        RECT tw;
        u_short tpage;
        u_char dtd;
        u_char dfe;
        u_char isbg;
        u_char r0, g0, b0;
        DR_ENV dr_env;
} DRAWENV;

Members

clip Drawing area.
clip specifies the rectangular area used for drawing. Drawing will not be performed outside the area specified by clip.
ofs Offset.
The values (ofs[0], ofs[1]) are used as offsets when calculating the address that is used for drawing in the frame buffer. The offsets are added to the values of all coordinates to determine the address used by drawing commands when drawing in the frame buffer.
tw Texture window.
tw specifies the rectangular area within the texture page that is used repeatedly for applying textures.
tpage Texture page initial value.
dtd Dither treatment flag
0: Dithering OFF.
1: Dithering ON.
dfe Display area drawing flag
0: Drawing to the display area is disabled.
1: Drawing to the display area is enabled.
isbg Clear drawing area flag
0: The drawing area is not cleared when the drawing environment is established.
1: The entire clipped area is painted with the brightness values (r0,g0,b0) when the drawing environment is established.
r0, g0, b0 Background colour. Valid only when isbg = 1.
dr_env System reserved.

Explanation

DRAWENV sets basic parameters related to drawing such as the drawing offset and the drawing clip area.

Notes

Drawing can be performed in the region (0, 0)-(1023, 511) within the drawing space. Offsets and addresses to which the offset has been added are wrapped around at (-1024, -1024)-(1023, 1023). Values that can be specified for the texture window are limited to the combinations shown in the following table:

tw.w
0(=256)
16
32
64
128
tw.x
0
multiple of 16
multiple of 32
multiple of 64
multiple of 128
tw.h
0(=256)
16
32
64
128
tw.y
0
multiple of 16
multiple of 32
multiple of 64
multiple of 128