Quote:Exactly. Look at the gfxlib.txt documentation, MULTIKEY example; it uses page flipping. Let me know how well it performs!
I changed the mode to 16-bit, replaced CLS with a small hack (only cursor is wiped), added page flipping and FPS counter.
The old code speed on my PII 500MHz: 5-6 FPS
The new code: 500-800 FPS
LOOOOOOL
Thanks!!!
Code:
screen 18, 16, 2, 1
screenset 1,0
line (0,0)-(27,27), rgb(255,0,255), BF
line (0,0)-(27,27), rgb(255,255,255)
dim cursor((28 * 28 * 2) + 4)
get (0,0)-(27,27), cursor
cls
work_page = 0
dim ctime as single
dim count as integer
count = 0
ctime = timer + 1
do while not multikey(&h01)
screenset work_page, work_page xor 1
line (old_mx,old_my)-(old_mx+27,old_my+27), rgb(0,0,0)
old_mx=mx: old_my=my
getmouse mx,my
count = count + 1
if ctime <= timer then
locate 1,1: print count
count = 0
ctime = timer + 1
end if
circle (320, 240), 200, rgb(255,0,0)
put (mx, my), cursor, TRANS
work_page = work_page xor 1
loop