Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Jonathan Gross , djgpp AT delorie DOT com Date: Mon, 12 Apr 1999 15:34:42 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Urgent ! help in windowing system. In-reply-to: <3711BAD9.6F0A730C@ort.org.il> X-mailer: Pegasus Mail for Windows (v2.54) Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Jonathan Gross asked: > I am building an MS-DOS windowing system with DJGPP. > I need a way to draw all windows without drawing them one on > top of the other but only where needed. > any help is very appreciated! Well, the solution depends on your architecture. Here is more or less what Turbo Vision does: For each character of a window that will be drawed TVision checks in the list of windows (that's Z axis sorted) if any other window overlaps, if no overlap then the content of this window is used. To speed up the things Turbo Vision does it with lines and uses a recursive methode to break the lines in segments when other window overlap partially. The mechanism is relative complex and to make it worst windows have shadows ;-). As the original algorithm was in assembler the Robert's adaptation is just a mess. I have an implementation in C++ that does the work for one character in the screen, I use it for other class called TViewPlus, but you can see how the line optimization works in this example. Basically the optimization looks if other object is over the line, it can hide the whole line (not drawing) or: the left part or the right part or just be in the middle, in any of these cases the routine is called recursivelly to solve the part/s that can be hided by the next object. When you reach the top off the list of objects the recursion ends and you start drawing. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://welcome.to/SetSoft or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(5411) 4759 0013