Ok, I think I understand what you want now. Tell me if I’m off on some details.
The thing you ask for, to not touch the alpha channel, can be done using glColorMask to prevent the alpha channel to be updated. However, judging by your description, I don’t think this is what you really want.
So, my guess is that, at the moment, when you draw the button on the window, the button will appear to be a second layer ontop of the window layer. But you want the button to be a part of the window, and have the same transparency as the window itself. Is this correct?
I think this can be done using this blending mode.
glBlendFunc(GL_DST_ALPHA, GL_ZERO);
This assumes you have a destination alpha channel, and that the window background is drawn first to set the general alpha channel for the window. The alpha channel for the button shouldn’t matter, the transparency will be determined by the destination alpha. If buttons, or whatever other objects you have, can overlap, you may want to disable alpha channel writes as descibed above, or overlapping components will appear as multiple layers, not a single layer.
Another option could be to render the window and all it’s content to a texture, and then draw everything as a single textured quad, with alpha channel depending on how transparent you want the window to appear. Then you don’t have to care about tranparency when drawing the window content.
I hope I got the above correct, as I haven’t tried it myself. :rolleyes: