Skip to main content
GameDev.net gamedev.net
🔒 Locked

Remembering the screen

Started by Lode Jan 6, 2005 at 5:39 AM 5 replies 1.2k views
Original Post
Lode
Lode
How can I, with OpenGL, do something like this? First a complex scene is drawn on the screen. Then, let OpenGL remember this screen. Then, draw something else on top of this screen (a window, for example). Then, bring back the scene it remembered (without the window on top of it). Is there a FAST way to do this, without having to redraw the scene polygon by polygon? I want somehow to be able to save the current screen and draw it back quickly at any time, without doing something like checking every pixel or polygon. Something like saving the current screen to a texture and then drawing that texture maybe, but I don't know how to do that and if it's the best way. I'm using OpenGL combined with SDL by the way, I don't know whether or not that's relevant.
Bradsco
Bradsco
Without re-drawing the scene, you'll probably just have to copy your current screen buffer to an offscreen buffer, render your window on top and then copy the offscreen buffer back. You may even be able to limit the amount of copying by specifying a viewport the same size and position as the window you intend to draw.
I set the clouds in motion, turn up light and sound...Activate the window, and watch the world go 'round
Lode
Lode
How to copy the screenbuffer and draw it again? Is there some way to let this all happen inside the videocard?
_the_phantom_
_the_phantom_
copy the viewport to a texture and then rerender that texture on a quad in ortho mode
shekharpk19
shekharpk19
U can use the glReadPixels command to copy parts of your FRAME BUFFER into an array. C if that works out .. .This copy will not be stored on Video Memory however .. I really dunno what sort application u are making .. .specyfying that may help
zedzeek
zedzeek
as well as rendering to a texture there is an extension
buffer_region (or someit)
it lets u store the screen (color+depth) in an offscreen buffer to be drawn back quickly when u want
Solias
Solias
You can also use glCopyTexImage2D to copy from the frame buffer into a texture.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.