You should not use "masking" -- that creates aliasing artifacts.
The proper way to implement a stereo wrapper in OpenGL is to do the following:
* Have two textures set up to store the left and right eye screen images, one for the left eye and one for the right eye. They should be "rectangle textures" -- GL_TEXTURE_RECTANGLE -- so that there is no filtering (GL_NEAREST) and the texels are fetched directly.
* Have two renderbuffers set up to store the depth buffers, one for the left eye and one for the right eye. You need separate depth buffers for the left and right eyes because the left and right eye images have to be rendered effectively at the same time.
* Have two framebuffer objects set up, one for the left eye and one for the right eye. Attach the left texture and left depth renderbuffer to the left framebuffer and the right texture and right depth renderbuffer to the right framebuffer. You need separate framebuffers for the left and right eyes because OpenGL only allows one depth buffer per framebuffer.
* Whenever the color buffer and/or depth buffer is cleared, clear the respective buffer(s) in both the left and right framebuffers. Whenever a set of primitives is rendered, render it to both the left and right framebuffers. Use a vertex buffer, even if it's streamed data, so each set of verticies is only transferred to the GPU once. Use a matrix to do the necessary stereo transformation.
* Whenever the front screen buffer is swapped with the back screen buffer, before doing the swap, display the left and right screen textures to the back buffer, using a separate shader program to display it in the proper format (such as interleaved). Have the left and right screen textures bound to separate texture units. If the format requires a lower resolution, use pixel averaging to downscale them. If quad buffering is being used, use multiple render targets to render to both back buffers in one rendering pass. The shader should also do screen shifting (shifting the left and right eye images in opposite directions by the set number of pixels). The scissor test should be used to clip out the parts of the screen images that are out of range after shifting.
Although this requires OpenGL 3 or later, it is the cleanest, most efficient, and most bug-free way of doing it. It also allows the left and right eye images to be rendered at full resolution, and downsampled if necessary with pixel averaging.