Index: [thread] [date] [subject] [author]
  From: Hartmut Niemann <niemann@cip.e-technik.uni-erlangen.de>
  To  : ggi-develop@eskimo.com
  Date: Fri, 19 Feb 1999 08:59:16 +0100 (MEZ)

Re: New function ggiFlushRegion()

> 
> Aaron Gaudio wrote:
> > Why not allow a buffering mechanism which can store the region flushes and then
> > uses another function to commit the flushes, or in the case of region flushing
> > not being supported, simply does a ggiFlush()?
> 
> That would just mean extra work for applications.
> Region flushing is always supported. It's just the internal
> implementation that
> differs between targets. This how the two functions are implemented:
> 
> int ggiFlush(ggi_visual *vis)
> {
>         return vis->opdisplay->flush(vis, 0, 0, LIBGGI_X(vis),
> LIBGGI_Y(vis), 1);
> }
> 
> int ggiFlushRegion(ggi_visual *vis, int x, int y, int w, int h)
> {
> 	/* Do sanity check here so targets can assume correct values */
> 	if (x < 0) x = 0;
> 	else if (x > LIBGGI_X(vis)) return GGI_EARGINVAL;
> 	if (y < 0) x = 0;

y = 0;  ???

> 	else if (y > LIBGGI_Y(vis)) return GGI_EARGINVAL;
> 	if (x + w > LIBGGI_X(vis)) w = LIBGGI_X(vis) - x;
> 	if (y + h > LIBGGI_Y(vis)) h = LIBGGI_Y(vis) - y;
> 
> 	return vis->opdisplay->flush(vis, x, y, w, h, 1);
> }
> 
> //Marcus

Why do you fail on too large X values, but not on too small ones?
wouldn't it be better to either clip all the time (then x>xvirtual simply
returns 'GGI_EOK') or complain all the time?

Hartmut

--  
Hartmut Niemann   --   niemann(a)cip.e-technik.uni-erlangen.de
http://cip2.e-technik.uni-erlangen.de:8080/hyplan/niemann/index_en.html [/ggi]

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