DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

DrawPoints(D3nfb)


DrawPoints -- NFB routine to draw pixel value at specified point

Synopsis

#include "nfbWinStr.h"

void xxxDrawPoints ( DDXPointPtr ppt, unsigned int npts, unsigned long fg, unsigned char alu, unsigned long planemask, DrawablePtr pDrawable );

xxx is the routine's prefix. Valid values are gen to use the default routine or your driver's prefix if you are rewriting this routine to use the specific capabilities of your hardware.

Description

DrawPoints draws the pixel value fg at points specified by ppt, applying alu and planemask.

Arguments

The arguments are:

ppt
points to the first in a series of DDXPointRec(D4nfb) structures that contain the starting x and y coordinates for each solid span.

npts
number of points to be drawn

fg
color to which a set bit must be expanded before the alu and planemask values are applied.

alu
is the raster bit operation that is to be applied when mixing the image with the contents of the frame buffer. See ``alu'' in Developing NFB graphics adapter drivers.

planemask
contains a value that determines which frame buffer planes get modified when drawing this image. If a bit is set, the plane will be modified. If no bits are set, the plane will not be modified. Almost all X drawing operations use a planemask that specifies modification of all planes.

pDrawable
pointer to an X structure called DrawableRec. This pointer is only used to access your screen private data. The ScreenRec structure is pointed to by pDrawable->pScreen. Your screen private is connected to the bottom of ScreenRec.

Exit codes

None

Usage

This is a very straightforward routine, but there may be opportunities to improve performance. You will always need to deal with the alu and planemask values, but you could create a specialized case where if alu == GXcopy and planemask == 0, you could write the fg color directly to the frame buffer address referenced by ppt[i].

DrawPoints( ) works for 1, 8, 16, and 32 bits-per-pixel hardware.

Examples

This sample code is for the S3 86C928 that uses short line commands to draw two points per iteration, thus reducing the number of times the command queue register needs to be checked and reducing the number of registers that need to be written per point.
   void
   NTE(DrawPoints)(
           DDXPointPtr ppt,
           unsigned int npts,
           unsigned long fg,
           unsigned char alu,
           unsigned long planemask,
           DrawablePtr pDrawable)
   {
           ntePrivateData_t *ntePriv = NTE_PRIVATE_DATA(pDrawable->pScreen);
           int count = npts;
   

NTE_BEGIN(ntePriv->regs); NTE_CLEAR_QUEUE(3); NTE_WRT_MASK(planemask); NTE_FRGD_MIX(NTE_FRGD_SOURCE, NTE(RasterOps)[alu]); NTE_FRGD_COLOR(fg); NTE_MAJ_AXIS_PCNT(0);

while ((count -= 2) >= 0) { NTE_CLEAR_QUEUE(6); NTE_CURX(ppt->x); NTE_CURY(ppt->y); NTE_CMD(S3C_CMD_LINE | S3C_CMD_DRAW | S3C_CMD_RADIAL | S3C_CMD_MULTIPLE | S3C_CMD_WRITE); ++ppt; NTE_CURX(ppt->x); NTE_CURY(ppt->y); NTE_CMD(S3C_CMD_LINE | S3C_CMD_DRAW | S3C_CMD_RADIAL | S3C_CMD_MULTIPLE | S3C_CMD_WRITE); ++ppt; } if (count == -1) { NTE_CLEAR_QUEUE(3); NTE_CURX(ppt->x); NTE_CURY(ppt->y); NTE_CMD(S3C_CMD_LINE | S3C_CMD_DRAW | S3C_CMD_RADIAL | S3C_CMD_MULTIPLE | S3C_CMD_WRITE); } NTE_END(); }

Version applicability

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

Source files


Routine source
./hw/sco/ports/gen/genRectOps.c

Driver source file
xxxSolid.c

Defined in
nfbWinOps structure in xxxData.c

Prototyped in
xxxProcs.h

References

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