Drawing on top of video

Today I was trying to draw on top of a video, and here is the result:

Learning Openframeworks: Drawing on top of video from berio on Vimeo.

At the beggining I didn”t know how to do for drawing lines without being hidden by the video each time the aplication was updated, I mean, at each “frame” the video was drawn on screen followed by the draw of the line, so on the next frame the video will be on the top of the previous line draw.

So thanks to Arturo 😉 who gave me the answer to the problem, and I could realize that I had to put all the pointers of the line inside an array, and then load them each time the aplication was updated.
You can read more about it on the openframeworks forum

Limitations:
The aplication runs slow when there are many lines.
The “framerate” of the aplication and the framerate of the video are not syncronized, so sometimes the timming relation between them change. It makes rendering difficult and when there are many lines, the result is chaotic.

Here is the code:

What I want to do next is making collage with different videos, picking fragments from several ones and paste them into another one or between them. I am going to use this drawing tool for making selections and take fragments from the videos.