What you want to do is use page flipping. This lets you draw lines on one page then show it all at once when you are done drawing that frame. It gets rid of the flicker that way. Attached is a small example that rotates a triangle. The gpage call is the important part.