-
Clearing the buffer
Ok - WinNT 4.0 sp6, Visual C++. I have created a COpenGLWnd class, derived from CWnd. When my scene redraws (10 fps), it does not clear the previous image. I am using double buffering, and I am calling glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BITS | GL_ACCUM_BUFFER_BIT) with a glClearColor( 0, 0, 0, 0).
Any ideas as to why it is not clearing the previous image?
Thankx,
Tom
-
Re: Clearing the buffer
Make sure your rendering context is made current before calling glClear (i.e. use wglMakeCurrent)...
Eric
P.S. : I can't see any other explanation...
-
Senior Member
OpenGL Guru
Re: Clearing the buffer
The correct call is glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
not GL_DEPTH_BITS. Though GL_DEPTH_BITS is defined in the gl.h for glGet functionality and therefore this compiles!
If that's not helping, make sure
- you have the glDrawBuffer set on the correct buffer,
- you have the user scissor disabled or set to the correct area, as this is one of the few calls which affect the glClear,
- you have the color maks and depth mask set correctly.
Do you need the accumulation buffer?
On most boards this is virtual memory on the host and it takes very long to clear that in comparison to the color buffer. Maybe you get much more than 10 fps.
-
Senior Member
OpenGL Guru
Re: Clearing the buffer
Shoot, it swallowed my previous answer...
Oh, now it's there... seems to be a problem with the proxy, here.
[This message has been edited by Relic (edited 10-18-2000).]
-
Re: Clearing the buffer
That was it! Thanks!
My mind must have said, "Those two are close, so they must be the same."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules