The simplest way to do that is probably to create a list of all lines you need to draw and then iterate through them (or mark them as drawn using a boolean once you have drawn them but that isn't really necessary here). This shouldn't be much of an issue if your points don't or rarely change as you can maintain the list structure in memory.

Also, if you are simply drawing straight lines then there isn't much of point in trying to avoid drawing the same line twice because it will most likely be slower to prevent that from happening than it would be to draw them twice.


Your friendly mod is at your service.