[EMAIL PROTECTED] writes:
> quick questions: (a) what is the format of the buffer for ggiPutBox
> (nothing on man page)? is it a trivial array of ggi_pixel? if so, why
> void*? (b) what is the speed improvement between a sequence of
> ggiPutPixel and ggiPutBox? can ggiPutBox be slower in any
> ocasion/target?
You may want to read a book about video display hardware.
If you are interested in 2d only, I'd suggest:
Richard F. Ferraro's "Programmer's Guide to the EGA and VGA Cards"
(published by Addison-Wesley).
The layout of the buffer depends on the videomode; in 8 bpp modes each
pixel is represented by an 8bit byte, in most 24 or 32bpp modes each
pixel is represented as a 32bit word containing a triple of 8bit bytes
representing Red, Green and Blue channels. This is the reason why the
buffer is pointed to by (void*).
Converting between bitdepths is costly, so you may want to write
specific routines for each bitdepth. If you want to speed up your
program, you have to write lots of code, or be happy with supporting
only one (or a few) bitdepth(s).
The speed improvement should be obvious: a call to a routine
(especially from a dynamic library) takes time. I'd suggest reading
some information about lowlevel programming, in case you are
interested in speed.
--
Tijs van Bakel, <[EMAIL PROTECTED]>