Do not clear screen?
Don''t call glClear(), I guess?
It's not what you're taught, it's what you learn.
Although you should note that this may not work as expected if you are double-buffering.
ANDREW RUSSELL STUDIOS
Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA ]
Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Go FAQ yourself ]
Do not meddle in the affairs of moderators, for they are subtle and quick to anger.
ANDREW RUSSELL STUDIOS
Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA ]
Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Go FAQ yourself ]
i think what he meant is that if you write something in your backbuffer, than you will swap it so that the content is drawn on the screen. then you write again in your backbuffer again and even swap it again. when you swap it the second time there are no longer the things in it you drew the first time. but i am not sure about it... does glClear clear the buffer, the screen or both??? never tried this. interesting question
That depends on if the buffer swap copies the contents of the back buffer to the front buffer, or just does a page switch so that the back buffer is suddenly visible.
If it copies the contents, then you should get the results you want.
If it does a page switch, then you will get that "every other frame" effect.
EDIT: Maybe not, see next post!
You could do single buffering, but then you might notice the scene rendering itself, which takes away from the animation effect.
I'm fairly certain that glClear() only clears the current rendering target (which is whatever is allocated as the back buffer at the time, for double buffering)
[edited by - Waverider on October 1, 2002 11:42:56 AM]
If it copies the contents, then you should get the results you want.
If it does a page switch, then you will get that "every other frame" effect.
EDIT: Maybe not, see next post!
You could do single buffering, but then you might notice the scene rendering itself, which takes away from the animation effect.
I'm fairly certain that glClear() only clears the current rendering target (which is whatever is allocated as the back buffer at the time, for double buffering)
[edited by - Waverider on October 1, 2002 11:42:56 AM]
It's not what you're taught, it's what you learn.
glClear will clear the buffer specified by glDrawBuffer. Default draw buffer in double buffered mode is the back buffer only.
After a buffer swap, the content of the back buffer is undefined. The driver is free to fill it with garbage if it wants to, but usually you find the current or the previous frame there. You should not assume anything about the back buffer content after a buffer swap.
After a buffer swap, the content of the back buffer is undefined. The driver is free to fill it with garbage if it wants to, but usually you find the current or the previous frame there. You should not assume anything about the back buffer content after a buffer swap.
Good point. I was remembering my less-than-PC graphics programming days!
It's not what you're taught, it's what you learn.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement