PDA

View Full Version : glClearColor and integer/float frambuffers



Jan
04-13-2009, 09:43 AM
Hi there

If i interpret the spec correctly, i can set three clear-colors: one for all float buffers, one for all signed integer buffers and finally one for all unsigned integer buffers.

Is this correct?

That would mean, that when i glClear (GL_COLOR_BUFFER_BIT), ALL current color attachments will be cleared with the value corresponding to their value type. And if i wanted to clear different integer attachments with different values, i would somehow need to bind and clear them one after another, right?

I just want to make sure i get these details right, before i write an abstraction around them.

Thanks,
Jan.

martinsm
04-13-2009, 10:17 AM
There is also glClearBuffer{if ui}v(enum buffer, int drawbuffer, const T* value) functions for clearing individual buffers. See page 189 of gl3.1 spec.

arekkusu
04-13-2009, 12:45 PM
No-- there is only a single clear color (see the state table). But there are three different ways to set it.