Only Redraw if updated

Started by
0 comments, last by karwosts 13 years, 4 months ago
Hey,

I want to optimize some code, and wanted to only redraw the parts of the scene that need redrawing (2d graphics only, so i can break it into regions easily). Due to the SwapBuffers, this seems to break. What would be the best way to implement this?
Advertisement
You can probably swap, then blit the front framebuffer to the back framebuffer and then draw on top of that.

Maybe something like this, haven't tested it though.

glSwapBuffers();
glReadBuffer(GL_FRONT);
glDrawBuffer(GL_BACK);
glBlitFramebuffer(...);
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

This topic is closed to new replies.

Advertisement