> If using writepixel, there need be 16 writes to videomemory.
> When using the native HGC linedraw, there need be only 4 writes to videomem.
> 
> Also, the algo. uses an incrementing form of bresenham. Very standard,
> yes. But the incrementing scheme takes into account the bizarre
> HGC memory layout.
> 
> Regards,
> Jakob Eriksson
> 
> 

Why not take the approach that Linux takes with the module:

Create the driver structure, have the primitives referenced in the
driver structure.  If the driver doesn't implement a primitive, set
the structure member to NULL, and the driver loader will take care
to use the builtin function.  EG:

struct driver {
        ptr_t   hline
        ptr_t   vline
        ptr_t   bline
        ...
} DRIVER;

struct driver herc_card[]={
        herc_hline,
        herc_vline,
        NULL
};

That way you can have driver optimized primitives or rely on the default,
which just calls write_pixel.

--Perry

-- 
Perry Harrington       Linux rules all OSes.    APSoft      ()
email: [EMAIL PROTECTED]                         Think Blue. /\

Reply via email to