user1311286
user1311286

Reputation:

OpenGL 4.0 quickly redraw entire rendering in GL_LINE (make everything see through)

I am new to OpenGL and just need to know if there is a quick way to save the rendering/picture/view as it is, redraw it all as lines not filled in (basically make everything see-thru) and then after the user is happy, go to the saved rendering and re-display it.

Must I go back through and try to redraw everything, isn't OpenGL setup such that I can just save whatever is currently drawn/displayed, copy it, change it (redraw it all with GL_LINES instead of GL_FILL), display it, let the user do whatever they wish, and when the user is done restore it back the original saved copy?

Upvotes: 0

Views: 328

Answers (1)

Christian Rau
Christian Rau

Reputation: 45948

That is not how OpenGL works, since OpenGL is not a scene management library. All that OpenGL does is draw simple primitives (like points, lines or triangles) to the screen. Once it has drawn something (converted it from a bunch of triangles or lines to a bunch of pixels in the framebuffer) it completely forgets about it. So you cannot tell OpenGL to magically redraw the scene you recently drew (what is "recently" in this context anyway?) with another render style (polygon mode in your case).

You can of course save the current rendering (the current contents of the framebuffer) by copying it into a texture (or directly rednering it into a texture using an FBO) and then restore it by just drawing this texture to the screen. But every higher level scene management is completely your responsibility and if you want to redraw the scene with a different polygon mode, then you don't have another option than redraw the whole scene yourself.

Upvotes: 2

Related Questions