nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: RE: Bitblt proposal (was: Re: bogl routines)
From: Greg Haerr
Date: Mon, 17 May 1999 20:16:44 -0600


> An evil thought just occurred to me, actually.  With most visuals (not
> vga16) we can easily add a `struct bogl_bitmap *' parameter to all the
> bogl_*() functions, which could be a bitmap or NULL to represent the
> screen.  Then we'd be able to support drawing on off-screen bitmaps
> just as easily as with the screen.
> 
> Comments?
> 

	Your evil thought is a very good one.  Having just implemented
bitmaps over the weekend, I've been thinking about off-screen drawing the
same way many other graphics systems do it:  The screen is just another
bitmap.  All graphics draw functions work on bitmaps, rather than screens.
Right now, the graphics functions work by calling the device api to draw.

A useful architecture change would be to have all the mid-level graphics functions
work on a "bitmap structure" which would include function pointers for the draw functions.
The drawing functions are organized according to their ability to draw on 1 plane 8-bit
pixels, 4-plane 4-bit pixels, etc.  In this way, drawing to the screen is a special
case of drawing to an in-core bitmap.

For a really cool implmentation of these ideas, refer to the great allegro link
that Alex sent to this list last week.  There is much to be learned by studying these
sources, which I did over the weekend.

Greg

nanogui@linuxhacker.org