Both clear the color buffer, right? Do they do it the same way?
The glClear function takes a single argument (mask) that is the bitwise OR of several values indicating which buffer is to be cleared. The value to which each buffer is cleared depends on the setting of the clear value for that buffer. If a buffer is not present, a glClear call directed at that buffer has no effect.
The fourth parameter indicates the trasparency. The alpha is opacity, not transparency. This means that when it is 0, you can't see it at all.
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].
glClear is a Command: which clears the buffer.
glClearColor is State Setting: which sets the color value to buffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With