Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Sun, 30 May 1999 21:36:26 +0000

Re: BlitOp Implementation

tdphette wrote:
> 
> OK, I'm making good progress on the blit code, but before
> I implement too much, I've got some questions.
> 
> libggi2d/default/stubs/blit.c looks to be place to implement
> BlitOp and friends.  As this would be the lowest common
> denominator fallback code, I assume it should just use
> GetPixel and PutPixel to do its thing.

Yes, this is what the stubs lib is for - slow default fallbacks
which work everywhere.

> However, I am interested in using direct buffer access to get
> as much speed as possible.  I've already written the following
> function:
> 
> void dbFastBlit( ggi_directbuffer *src, int sx, int sy, int sw,
>                  int sh, ggi_directbuffer *dst, int dx, int dy )
> 
> This is a quick and dirty function that operates on two direct
> buffers and copies a rectangle from one to the other.  It
> assumes that the color palettes etc are the same for both
> visuals.  When both visuals are in video ram, this is very
> fast (MUCH more so than when the pixel is temporarily buffered
> while being copied).  It should be trivial to modify this
> to check the alpha value when copying... bingo, I've got
> transparent blitting.  This is fine for getting my game
> engine up and running, but I would also like to give something
> back to the GGI project.
> 
> My question is, what is the proper home for this code in GGI?
> My gut tells me it should NOT go in the default BlitOp stub.

Functions using directbuffer belong in the *-linear-* sublibs,
which for LibGGI and LibGGI2d resides in default/linear_*.
Please check out the code in libggi/default/linear_*/crossblit.c to
get a feeling about how to implement crossblit style functionality.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

Index: [thread] [date] [subject] [author]