Dirty Rectangles (Combined Video & Fx Rendering) This demo make simple scrolling backdrop with overlaid alpha blended circle over the top. Rather than drawing the entire scene to an FX buffer, then copying this down to the PB screen, we're drawing everything to the Pb screen, then overlaying the transparent circle. This greatly reduces the work load the program has to do and is obviously quicker. So the moral of the day is "think then act!"
Press SPACE to toggle the frame rate cap.
Video:Related To A Crash Course In Optimization (http://www.underwaredesign.com/forums/index.php?topic=2548.0)
Download: Attached
thanks kev,
this makes an amazing difference. how do you come up with these ideas?
stevmjon
it's not my idea, it's been used in game engines for decades
well, i am certainly glad you are sharing these ideas, and many others, to the playbasic community.
stevmjon
There's nothing new here, as all the technical info can be found in -> Economizing Image Blitting (drawing!) (http://www.underwaredesign.com/forums/index.php?topic=1799.0) - How well you understand it, will directly impact on the solutions you write.