How do you clear OpenGL buffers?

I’m getting this effect where all vertexes ever created are redrawn every frame.

I got a tip that it has something to do with needing to clear the buffer:

But I can’t figure out how that relates to my project.

It should be looking more like this:

Interestingly enough, if I resize the frame (manually with my mouse), it clears the buffer… now how to do that automatically…

Use OpenGLHelpers::clear() at the start of every frame.

1 Like

Thanks. Actually it was an issue with sending all vertexes every frame to be drawn rather than a problem with not clearing the frame.

Might as well ask: how do you apply a low alpha black to get a “pixel decay” effect?