nanogui: [Nano-X] PolygonRegion


Previous by date: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, tanghao
Next by date: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, Greg Haerr
Previous in thread: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, tanghao
Next in thread: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, Greg Haerr

Subject: Re: [Nano-X] PolygonRegion
From: "Greg Haerr" ####@####.####
Date: 7 Jun 2000 02:00:40 -0000
Message-Id: <002001bfd024$8372c480$15320cd0@gregh>

: My concern is:
: Say, if the polygon region is composed of a triangle shape,
: wouldn't there be too many rectangles for filling
: the triangle? 
: 

No - this is how it's done with many windowing systems,
including X11.  At first it seems strange, but then you realize
that absolutely any region can be specified in this manner.  And
the benefit is that you have a single set of region handling routines
that work for all region code in the entire system; as well as getting
tested and/or/xor/exclude code, which is very hard to debug.

At first I used different region handling code for Microwindows.
But then as I was debugging some of the more obscure (no pun
intended) aspects of the system, I realized how cool the y-x-banding
algorithm that X uses is.  The rectangle list is always kept in
y then x sorted order, and no rectangle overlaps another.  In
this way, simpler routines can be used for the region intersection
calculations, and they're actually quite fast, as the y values can be 
skipped over in a quick for loop while not intersection.  Yes,
complex shapes take more memory, but not really that much.  An
interesting test is to printf the size member of the MWCLIPREGION
struct just for kicks using complex shapes.  Also, the way
that Microwindows now works, it recalculates a new MWCLIPREGION
every time that a program wants to display something.  In this
way, the clip region allocation is reused alot between windows.  At
some point, I'm still planning on implementing separate clip regions
per window, which would speed drawing somewhat, at a potentially
larger memory requirement...


: > (polygons).  I can find you some code for this if you are
: > interested.
: 
: Great, please send me some. :)

Ok!  Since your hacking, I better hurry up and find them!

Regards,

Greg




Previous by date: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, tanghao
Next by date: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, Greg Haerr
Previous in thread: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, tanghao
Next in thread: 7 Jun 2000 02:00:40 -0000 Re: [Nano-X] PolygonRegion, Greg Haerr


Powered by ezmlm-browse 0.20.