r/GraphicsProgramming • • Jun 18 '20

Question Question about what's causing my window to "alternate" between two states, more in comments

Post image
0 Upvotes

2 comments sorted by

1

u/[deleted] Jun 18 '20

My app is just me drawing circles to the screen without clearing it each frame. I noticed that the circles would overlap each other without full transparency. After some investigation I found out that the window alternates between two frames, the two above, and the result ends up looking like the bottom picture. I'm not sure what's causing this. I think it might have something to do with ping pong rendering but either way I have no idea what to do about it.

7

u/CheapAlternative Jun 18 '20

They're back and front swap buffers. You're supposed to work on one while the other is being displayed. When you're done with the working copy youre supposed to swap it with the previous frame, clear the previous frame and render the next.