I have a program in which I open a file, perform lots of calculations, and then render a bunch(1,000s) of rectangles on the screen in different colors.
I am using GLUT to manage the window and event systems.
The problem is that I don’t want the program to have to execute all these draw commands over again everytime something covers the window or it is minimized. I’ve been searching around for a faster method.
I tried saving the buffer, using glReadPixels, and then writing that array of pixels back whenever the display callback is called, using glDrawPixels.
But that seems to be problematic, and is not working when I minimize and maximize the window.
Sorry for the newbie question, thanks for any help!