Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Thu, 27 Aug 1998 12:14:39 +0200

About Libggi (Re: LibGGI2D, LibGGI3D and targets)

Jon M. Taylor wrote:
> > Now, some
> > displays might not fit this model, but stripping LibGGI down even further is
> > unreasonable.
> 
>         Why?  What would be hurt by pulling the remaining 2D stuff out of
> LibGGI and placing it with LibGGI2D?  Everyone would have to target their
> apps to LibGGI2D instead of LibGGI, but is that a big deal?

Yes! It's a big deal, because it will cause bloat.

Libggi is _not_ a 2D library, and it's not just a framework.
It's primarily a library to abstract framebuffer, mouse and
keyboard access for lot's of different targets. And it also
provides means to access the framebuffer of an underlying
susbsystem that doesn't support direct access to it (via the
ggiGet/Put*() functions).

This is the basic system that allows any application to run on
any target, using a simple lightweight library.

It also contains a bunch of other functions:

* Functions to tell how the framebuffer should be displayed:
int ggiSetOrigin(ggi_visual_t vis,int x,int y);
int ggiGetOrigin(ggi_visual_t vis,int *x,int *y);
int ggiSetDisplayFrame(ggi_visual_t vis, int frameno);
int ggiSetReadFrame(ggi_visual_t vis, int frameno);
int ggiSetWriteFrame(ggi_visual_t vis, int frameno);
int ggiGetDisplayFrame(ggi_visual_t vis);
int ggiGetReadFrame(ggi_visual_t vis);
int ggiGetWriteFrame(ggi_visual_t vis);

* A function to draw a pixel with the current GC color:
int ggiDrawPixel(ggi_visual_t vis,int x,int y);

* A function to clear the framebuffer to a single color:
int ggiFillscreen(ggi_visual_t vis);

* A function to copy areas around in the framebuffer:
int ggiCopyBox(ggi_visual_t vis,int x,int y,int w,int h,int nx,int ny);

* A function to copy areas between different framebuffers:
int ggiCrossBlit(ggi_visual_t src,int sx,int sy,int w,int h,
		 ggi_visual_t dst,int dx,int dy);

* Functions to set the current drawing color(s)
int ggiSetGCForeground(ggi_visual_t vis,ggi_pixel  color);
int ggiGetGCForeground(ggi_visual_t vis,ggi_pixel *color);
int ggiSetGCBackground(ggi_visual_t vis,ggi_pixel  color);
int ggiGetGCBackground(ggi_visual_t vis,ggi_pixel *color);

* Functions to do clipping
int ggiSetGCClipping(ggi_visual_t vis,int  left,int  top,int  right,int 
bottom);
int ggiGetGCClipping(ggi_visual_t vis,int *left,int *top,int *right,int
*bottom);

* Gamma map functions:
int ggiGetGamma(ggi_visual_t vis,ggi_float *r,ggi_float *g,ggi_float *b);
int ggiSetGamma(ggi_visual_t vis,ggi_float r,ggi_float g,ggi_float b);
int ggiGetGammaMap(ggi_visual_t vis,int s,int len,ggi_color *gammamap);
int ggiSetGammaMap(ggi_visual_t vis,int s,int len,ggi_color *gammamap);

IMO these should _definitely_ go into an extension or libggi2d.

* Functions to do display simple text.
int ggiPutc(ggi_visual_t vis,int x,int y,char c);
int ggiPuts(ggi_visual_t vis,int x,int y,const char *str);
int ggiGetCharSize(ggi_visual_t vis,int *width,int *height);

IMO these should be in a "simple-fixedfont" extension.

I consider none of the above functions to be "2D" functions.

Then we have the following:
int ggiDrawLine(ggi_visual_t vis,int x,int y,int xe,int ye);
int ggiDrawHLine(ggi_visual_t vis,int x,int y,int w);
int ggiDrawVLine(ggi_visual_t vis,int x,int y,int h);
int ggiDrawBox(ggi_visual_t vis,int x,int y,int w,int h);
which could be considered "2D" functions, but all except
ggiDrawLine is very simple to implement in software, and
all are often HW-accelerated on HW that supports acceleration
att all. They are also very useful to test the library and it's
targets, and provides a simple way for the libggi beginner to
get something displayed on the screen.

Therefore they should be kept in the core libggi (with, IMO,
the exception for ggiDrawLine, which is ten times bigger than
any other function in the stub library and should go into
libggi2d)

//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]