Thought I'd share a little trick.
wjsteele
Posts: 697
I don't have any code to demonstrate this, but while using Ray's 4.3" LCD on his Prop System Board, I ran into memory issues because of the requirement for double buffering.
Or so I thought. What I found was that if I used gr.quad to draw over the areas that changed, then I can eliminate the gr.clear statement, which erases the entire screen. (gr.clear and redrawing a bunch causes the flicker.)
By doing this in my app, I now have freed up a bunch of memory but still have no screen flicker... all without double buffering.
Also, I noticed that if you are using vector graphics (with no fills,) like in Battlez0wned, you also have no flicker.
Bill
Or so I thought. What I found was that if I used gr.quad to draw over the areas that changed, then I can eliminate the gr.clear statement, which erases the entire screen. (gr.clear and redrawing a bunch causes the flicker.)
By doing this in my app, I now have freed up a bunch of memory but still have no screen flicker... all without double buffering.
Also, I noticed that if you are using vector graphics (with no fills,) like in Battlez0wned, you also have no flicker.
Bill
Comments
Just in case you really do need double-buffering...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
How do you keep track of what areas have changed?
Have you actually applied your trick to Battlez0wned?
This will help to avoid flicker without double buffers. The idea is to erase only what needs to be changed by simply drawing it again. So, with the first line(x1,y1,x2,y2,col) you'd draw the line, calling the same again would erase it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
backboxing before redraws, but if the redraw is small, no erasure at all is needed,
just copy (overwrite) a different "tile" onto the previous one, possibly from a much smaller buffer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I should be typing in Spin now.
Nevermind, I found it.· It's here: http://obex.parallax.com/objects/310/
Bill
Post Edited (wjsteele) : 2/6/2010 2:50:41 AM GMT