i’m trying to clear the screen framebuffer with
glClear(GL_COLOR_BUFFER_BIT);
i want the framebuffer to become black.
but this doesn’t seem to do anything and the last drawn shader is still on the screen.
what’s my bug?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you swapping frames after clearing?
The clear operation, depending on how the window is set up (double-buffered or no), will likely only clear the backbuffer. This leaves the frontbuffer, which is visible, unchanged.
In order for any operations to become visible, you need to swap your buffers. This is done different ways depending on platform, it may be
wglSwapBuffers,glxSwapBuffers, or any number of others; check your docs.You may be able to dodge that requirement by using a single buffer, but that will have rather large performance implications.