On 15 Jul 1999, Nathan J. Williams wrote:
> Ralf Beckers <[EMAIL PROTECTED]> writes:
> 
> > I write some text to the window, when a user taps onto the screen, I
> > scroll the text up/down a line. For archiving this is do the following:
> > 
> > - setting the text/lookupbuffers
> > - getting a new line of text
> > - erasing the screen
> > - writing text in a loop onto the window.
> > 
> > But this is rather to slow.
> > 
> > Is there anyting like double buffering or s.th else, what would make it
> > more "fluid" to the user?
> 
>       Double-buffering would have a smoother appearance than what
> you're doing, but it would not be faster.
> 
>       Look at what MemoPad does*. Instead of redrawing the entire
> screen, it does a window-copy of most of the screen to make room for
> the new text, and then writes the new line. It requires some
> bookkeeping, but it is a lot faster. I successfully borrowed the idea
> (and quite a bit of code structure) to do the same thing in one of my
> applications.

  actually.. another way is to crop the area of the screen you
  draw to.. and then use WinDrawChar at (y-1) after every loop.

  double buffering is normally only good for animations.. scrolling
  of the screen may be fast enough to NOT flicker the screen..
  hence it would be acceptable.

  but the method described here, moving the upper segment of the
  screen up one pixel etc.. will work too.. but that means you
  need to manage which line needs to be drawn.. and the effects
  of scrolling one pixel at a time.

  the easiest way would be to create a window:

    160x??? in size..

  when you initialize, draw EVERYTHING to it.. then when you
  scroll, just copy the portion you need.

  this means that at every update, you just copy a segment
  of this "buffer" you created at the beginning.. (this method
  is ONLY good if the contents of the buffer does not change)

  cheers.

az.
--
Aaron Ardiri 
Lecturer                       http://www.hig.se/~ardiri/
University-College i G�vle     mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN       
Tel: +46 26 64 87 38           Fax: +46 26 64 87 88
Mob: +46 70 352 8192           A/H: +46 26 10 16 11

Reply via email to