Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The glClearColor function specifies clear values for the color buffers.
void glClearColor(
GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
The glClearColor function specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range [0,1].
The following functions retrieve information related to the glClearColor function:
glGet with argument GL_ACCUM_CLEAR_VALUE
glGet with argument GL_COLOR_CLEAR_VALUE
The following is the error code generated and its condition.
Error code | Condition |
---|---|
GL_INVALID_OPERATION | glClearColor was called between a call to glBegin and the corresponding call to glEnd. |
** Windows NT/2000:** Requires Windows NT 3.5 or later.
** Windows 95/98:** Requires Windows 95 or later. Available as a redistributable for Windows 95.
** Header:** Declared in Gl.h.
** Library:** Use Opengl32.lib.
Please sign in to use this experience.
Sign in