Re: speed of text display

new topic     » goto parent     » topic index » view thread      » older message » newer message

JasonDube wrote:
> 
> Its nice to know that the same thing is showing up on others sytems, but I
> question
> whether its just because of windows because I can use draw_line and get a lot
> faster
> results. For example if I use:
> 
> for i = 1 to 45000
>   draw_line (1,{{1,i},{640,i}})
> end for
> 
> The result is instantaneous. 
> 
> So I think it has to do with the way text, specifically, is written to the
> screen in
> the various graphic modes.
>    
> so, go figure.
> 
> 
> I would make a good member of a large crowd :)
> 

I think that the slowdown is happening because of scrolling the graphics screen.
 Get putsxy from the archive and try it out.

I used this code on my laptop and got times of about 0.55.  No scrolling.

include graphics.e
include get.e
include putsxy.e

object gfx, junk, start
sequence txt, pos

gfx = graphics_mode(18)

txt =
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
pos = {0, 0}

start = time()

for i = 1 to 400 by 1 do
    putsxy(pos, txt, WHITE, BLACK, 'a')
    pos[2] = remainder(i * 16, 480)
end for

? time() - start

junk = wait_key()

gfx = graphics_mode(-1)
-- end


=====================================
Too many freaks, not enough circuses.

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu