DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

TileRects(D3nfb)


TileRects -- NFB routine to draw and fill specified rectangles

Synopsis

#include "nfbWinStr.h"

void xxxTileRects( BoxPtr pbox, unsigned int nbox, unsigned char *tile, unsigned int stride, unsigned int w, unsigned int h, DDXPointPtr patOrg, unsigned char alu, unsigned long planemask, DrawablePtr pDrawable );

Description

TileRects( ) draws the rectangles specified by pbox and nbox, filling them with the tile pointed to by tile. Its dimensions are w and h. stride specifies the number of bytes from the start of one scan line to the start of the next scan line within tile. patOrg specifies the screen-relative starting position of the first tile. All pixel writes must apply alu and planemask.

Arguments

The meaning of the arguments are:

pbox
pointer to the first of nbox count of BoxRec(D4nfb) structures that contain the coordinates of all the rectangles that must be filled. pbox[0] is the first, pbox[1] is the second, and pbox[nbox-1] is the last.

nbox
number of tiled rectangles to be drawn.

tile
pointer to an image of the tile to be drawn. In the case of a 16 bits-per-pixel image, tile points to an unsigned short; for a 32-bits-per-pixel image, tile points to an unsigned int.

stride
number of bytes that must be added to tile for it to point to the next line of the tile image. See ``stride'' in Developing NFB graphics adapter drivers.

w
width, in pixels, of the tile image. Note that, for 8 bit-per-pixel displays, w is not necessarily equivalent to stride.

h
height, in pixels, of the tile image

alu
see ``alu'' in Developing NFB graphics adapter drivers.

planemask
the window planes to be affected.

patOrg
pointer to the DDXPointRec(D4nfb) structure that contains two members: patOrg->x and patOrg->y. This coordinate is used to ensure that, when multiple rectangles are filled in different parts of a window, the tile patterns will match up if the rectangles overlap. A simple analogy of this would be when you are putting wallpaper up and need to make sure that the wallpaper pattern matches as you paper each strip to the wall.

Exit codes

None

Usage

This routine is optional.

X requires the ability to fill rectangles with a full pixel tile pattern. If you have an 8 bits-per-pixel display, TileRects( ) is used to fill a series of rectangles with an 8 bits-per-pixel tile. Most graphics adapters have unused video memory when configured to a particular resolution. For example, if the adapter is able to display a resolution of 1024x768 but, because of monitor and other hardware restrictions and conventions, actually uses a 1024x768 display, 256 lines of free memory are available on the graphics adapter. This can be used to improve the performance of drawing routines such as the tile drawer. If no off-screen memory is available, then the genTileRects( ) function should be adequate. In some cases, even if off-screen memory is available, expanding the tile in off-screen memory is actually slower than just using the gen code to fill the rectangles. genTileRects( ) just draws the tile directly to the screen using the DrawImage(D3nfb) and CopyRect(D3nfb) routines.

Version applicability

This function is supported for NFB drivers on all releases of SCO OpenServer 5, SVR5, and AIX 5L.

Source files


Driver source file
xxxData.c

Defined in
nfbWinOps(D4nfb) structure

Prototyped in
xxxProcs.h

References

BoxRec(D4nfb), CopyRect(D3nfb), DrawImage(D3nfb), nfbWinOps(D4nfb) DDXPointRec(D4nfb)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005