Goksteroo Senior Member
 Joined: 15/03/2021 Location: AustraliaPosts: 114 |
| Posted: 06:36am 10 Nov 2022 |
Copy link to clipboard |
 Print this post |
|
Hi all,
I'm getting back into some programming and have the need for same quasi windows for an adventure type programme - I know there is a library for a similar thing, but hey, I wanted to exercise what's left of my brain!
I've used the approach of resizing several pages, writing to those pages and then BLITting them to the appropriate place on page 0. This all seems to work well (and for my intended use is most suitable).
But... an issue occurs in testing if I repeatedly run the routine with little pause between runs. The issue is artifact showing on the displayed screen, that gets worse as the delay between repeats is made shorter via a PAUSE command. I'm not sure if it's my setup (gen12 I5 + 27" 1080p monitor) or my programming that's causing the artifacts to appear, or if its a peculiarity of MMB4W.
Anyway, here's my test code - be brutal....
mode -16 option default integer option base 1
colour rgb(red),rgb(black) text 920,0,"Windows Test",C,3,6,rgb(red),rgb(black) font 3,1
'set up window/pages 'wx(x)=horizontal size, wy(x)=vertical size, px(x)=x pos on screen 0, py(x)=y pos on screen 0 'a$(x) test text 'c(x) colour to print text 'hp(x) and vp(x) saves and sets cursor position
dim wx(6),wy(6),px(6),py(6),a$(6),hp(6),vp(6) dim c(6)=(rgb(white),rgb(pink),rgb(blue),rgb(cyan),rgb(gold),rgb(green))
for x= 1 to 6 read wx(x),wy(x),px(x),py(x),a$(x) page resize x,wx(x),wy(x) hp(x)=0 vp(x)=0 page write x cls page write 0 box px(x)-5,py(x)-5,wx(x)+8,wy(x)+8,2,rgb(grey) next x
do for x=1 to 6 page write x colour c(x) print @(hp(x),vp(x))a$(x);space$(rnd*5); hp(x)=mm.info(hpos) vp(x)=mm.info(vpos) page write 0 blit 0,0,px(x),py(x),wx(x),wy(x),x next x
pause 150 'edit this for faster scrolling text '10 is t=interesting - lots of artifact '1 is "What the hell!!" - nearly all artifact 'til SPACE is pressed
loop until inkey$=" "
wins: data 1390,555,500,200,"WOOP DE DOOOO!!!! It appears to be working as I wanted it to.... now for functions to make it all easy! " data 420,245,20,200,"How about that!! I didn't think it'd work.... but it does!!! " data 420,245,20,505,"Some more stuff to take up space in that little rectangle..... " data 420,245,20,815,"I don't want anything printed here, but if I did that then I wouldn't know if the routine was working.... " data 940,245,500,815," Oooooo.... and now for the other big window... impressive? NO??? WTF!!! I'm impressed! " data 420,245,1480,815,"19z48g 1494fnb 1968x4f41 149479 4fdt 14448cg (random typing here!) "
Edit the pause command value to see the artifact increasing.
Thanks all, Geoff |