I am running WPF on Windows 7(tried it with both WDM/Aero switched on and off) with OpenGL for rendering. To prevent OpenGL airspace issues I render to the windows-generated-application backbuffer and read back the pixels by glReadPixels() which works great and I can have WPF and OpenGL on top/below/between each other.
However on remote desktop(running 32 bit with WDM/Aero turned on and off) glReadPixels returns pixels with all of its alpha channels as 255. This causes 'airspace' again and is no go. Not too many posts about this online and all "solutions" point to using a custom FBO, but Windows falls back to OpenGL 1.1 far far away from FBO extensions.
Here is a pseudo code.
readColor in this case is filled with alpha values of 255 in remote desktop mode. The only explanation I have is the pixel format, but I am running 32 bit colors when on Microsoft's Remote Desktop.Code :byte readColor = new byte[(int)ActualWidth * (int)ActualHeight * 4]; GL.ClearColor(0f, 0f, 0f, 0.0f); GL.Clear(ClearBufferMask.ColorBufferBit); GL.Viewport(0, 0, (int)ActualWidth, (int)ActualHeight); GL.LoadIdentity(); GL.Color4(_r, _g, _b, .5f); //render stuff GL.Finish(); GL.ReadPixels(0, 0, (int)ActualWidth, (int)ActualHeight, PixelFormat.Bgra, PixelType.UnsignedByte, readColor);
I have the pixel format with 32 bits color. 16 bits depth. 0 stencil. 0 accumulation. Supports Draw to Window, Supports OpenGL and Double Buffering.
Any idea what is going on here?