On Wed, 13 Dec 2000, [EMAIL PROTECTED] wrote:
> hi there. you probably remember that i was writing a terminal emulator
> in ggi/freetype2. well, i never released it partly because it is quite
> slow right now when scrolling. so my question is: what is the fastest
> way to draw a character in a visual (mostly fbdev and x11)? i will
> normally have an array where array[row][col] is the index of some
> color. do i blit? do i simply ggiPutPixel every time?
> 
> right now i'm ggiPutPixel'ing for every character. it is slow,
> specially in x11. for pure scrolling i've tried ggiCopyBox, but it is
> very very very slow in the framebuffer.
> 
> i plead almost complete ignorance on the subject. what i know is that
> rxvt scrolls very fast, and my emulator doesn't. hence i suspect that
> i should be able to do much better and that i'm doing something
> wrong/stupid right now...

I am more ignorant than you but here is my input.

For scrolling you can either:  
1)  Set origin  (this is not supported always so it isn't an option really)
2)  Erase the previous characters and redraw the new characters
3)  CopyBox to shift the old characters and then draw the new characters.

For the general, I think pixel by pixel is necessary because the glyphs do not
neccessarily all fit into side by side boxes.  If you blindly just write the
bitmap to the screen then you may overwrite a part of a previous glyph. 

Make sure you are caching the glyphs.  The freetype bitmap generation is a huge
overhead (makes drawing ten times slower).

Lee Brown Jr.
[EMAIL PROTECTED]

Reply via email to