andandandand
andandandand

Reputation: 22270

Is there a difference between glClearColor(0.0,0.0,0.0,0.0) and glClear(COLOR_BUFFER_BIT)?

Both clear the color buffer, right? Do they do it the same way?

Upvotes: 10

Views: 5252

Answers (2)

user2110239
user2110239

Reputation: 134

glClear is a Command: which clears the buffer.

glClearColor is State Setting: which sets the color value to buffer.

Upvotes: 3

Mariy
Mariy

Reputation: 5914

glClear actually clears the buffer, while glClearColor just sets the colour to clear the buffer to.

Upvotes: 25

Related Questions