DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing NFB graphical adapter drivers

Replace GC operations

The GC (graphical context) routines are closely related to the Window Private routines, but are accessed through the nfbGCOps(D4nfb) structure. These routines allow your hardware to get a little closer to some of the more heavily-used X graphics primitives. The gen directory contains samples of all these routines.

Four nfbGCOps structures are declared in the xxxData.c file, although not all these routines are used in the current release.

NFB GC context operations

Fill style GC components Operations
Solid alu
planemask
fgPixel
FillRects(D3nfb)
FillSpans(D3nfb)
ZeroSegs(D3nfb)
FillPolygons(D3nfb)
Stippled alu
planemask
fgPixel
stipple
pagOrg
FillRects(D3nfb)
FillSpans(D3nfb)
Opaque stippled alu
planemask
fgPixel
bgPixel
stipple
pagOrg
FillRects(D3nfb)
FillSpans(D3nfb)
Tiled alu
planemask
tile
pagOrg
FillRects(D3nfb)
FillSpans(D3nfb)

By having a stub pointer in the routines, the X server can provide generic routines which your existing device driver can use in place of these stubs. This means that a display driver that uses these routines will automatically take advantage of new routines provided in future releases without being rewritten or recompiled.

If you are developing on a SVR5 system, look at the nteGC.c example. You'll see that the ValidateWindowGC(D3nfb) routine switches in the appropriate routine according to what changes have taken place in the GC. You should not need to optimize this code unless you need to optimize beyond the NFB interface.


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