Is it possible to change the area affect by GlutSwapBuffers?

Is it possible to change the effect area of the glutswapbuffers so i can change only a portion of the screen in my window? or there is another function do this job?
No, that's not how it works.

With typical double buffering you have two "windows". One is the display (what the user sees), and the other is the "back buffer" (what you're drawing to). When you swap, you're basically flipping them. So the previous display becomes the new back buffer and vice versa.

So no... you can't swap a portion of the display. It's all or nothing.

You can draw to only a portion of the back buffer, though. See glViewport.
I tried the glviewport before, the things seem scaled to the size, so i have to figure out a way to enlarge them back, but i think this will be even more costly compare with drawing whole thing. Well thanks for the reply though.
but i think this will be even more costly compare with drawing whole thing.


You are expected to redraw the screen every frame. In fact you kind of have to.

Updating "dirty rects" (ie, only parts of the screen that have changed) has not been common practice in well over 10 years.

I tried the glviewport before, the things seem scaled to the size, so i have to figure out a way to enlarge them back,


If you do not understand how to do this, I can't help but feel you are using a sub-par (or outdated?) OpenGL tutorial.

I tend to recommend the arcsynthesis tutorial not only because it does a great job of explaining modern OpenGL, but also actually explains the underlying pipeline and why things work the way they do.

I highly recommend giving it a read

http://www.arcsynthesis.org/gltut/
Last edited on
Thanks, i will try to read through them.
Topic archived. No new replies allowed.