glColorMask and glDepthMask


from the tests I made, these functions work on “global” OpenGL state machine, meaning that calling them affect every framebuffer, not only the currently bound framebuffer.

I’ve searched on Internet but the man pages are not really explicit about the behavior. For example, from :

glColorMask specifies whether the individual color components in the frame buffer can or cannot be written.

Since they talk about frame buffer (yes I know “frame buffer” and not “framebuffer object” …) it’s a bit surprising for me. I would expect them to affect the bound framebuffer only. I think I just misunderstood the sentance.

What do you think about this ?

The state that is tracked with the currently bound framebuffer is listed in 4.2 Table 6.60 (“Framebuffer Dependent Values”.)

You’re right, the fbo documentation says about this, too. Thanks.