www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/15/14:55:18

From: "Tain" <reseda AT netcene DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Urgent ! help in windowing system.
Date: 15 Apr 1999 13:31:01 -0500
Organization: Newscene Public Access Usenet News Service (http://www.newscene.com/)
Lines: 35
Message-ID: <4fqR2.23619$_H5.1356411@newscene.newscene.com>
References: <3711BAD9 DOT 6F0A730C AT ort DOT org DOT il>
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I can think of two ways to do this:

1. You write a routine that determines the common area of two overlapping
windows. You run thru every one
of your windows and you keep track of the common areas. You end up with a
list of areas you do not have to update. This should speed up your rendering
functions.

2. Along with each window background buffer (if you're not using the
painting algorithm, you probably save each windows background) you keep a
state buffer which you update every time you move, open, or close
a window. The state buffer holds visible/not visible information about each
single byte of the window. You can now alter your drawing routines to only
draw when the window's state buffer tells you that the window location in
question is visible.

I have coded version 2) a few years ago and it works. However, you need lots
of memory to do it. I have found that it is much simpler to just use the
painting algorithm to draw windows on top of each other. If you are not
working in a high-resolution graphics mode, this method is fast enough (If
you are using textmode, this is much much faster than you'll ever be able to
notice) and it won't eat up memory resources. And if you're using
high-resolution graphic modes, try version 1). This is more or less how
Windows does it.

 Pascal Schuppli

Jonathan Gross schrieb in Nachricht <3711BAD9 DOT 6F0A730C AT ort DOT org DOT il>...
>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!
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019