OpenGL Layered Windows Demo.
This demo builds on the Win32 layered windows demo by using OpenGL to render a rotating cube to an off-screen pbuffer. This off-screen pbuffer is then used as the shape of the per pixel alpha blended layered window.
This demo requires the following OpenGL WGL extensions: WGL_ARB_pbuffer, and WGL_ARB_pixel_format.
Note:
1. This demo requires Windows 2000, XP, or higher to run. The minimum supported operating system for the layered windows API is Windows 2000.
2. This demo requires the Visual C++ 2010 Library Runtimes. Download instructions can be found here.
Download executable, source, and Visual C++ 2010 solution files.
Change History:
7 August 2010.
Fixed an issue with the ImagePreMultAlpha() function where the pre-multiplied alpha-color channel product was being converted to a byte and then multiplied with the pixel value in the bitmap. This was causing those pixels with an alpha value to appear grey. Converting the bitmap channels to floating point values and then performing the pre-multiply operation on the floating point values corrected this problem. Thanks goes to Iulian Chivu for spotting this issue and submitting the fix for it.
10 July 2010.
Added missing .vcxproj.filters file to the project.
13 June 2010.
Updated solution to Microsoft Visual Studio 2010.
2 February 2008.
Updated solution to Microsoft Visual Studio 2008.
21 October 2006.
Updated the ImagePreMultAlpha() function with a performance optimization submitted by Jordan Bayliss-McCulloch.
24 March 2006.
Fixed a bug in the DrawFrame() function where the ImagePreMultAlpha() function was not being called to pre-multiply the pbuffer's pixel data.
22 March 2006.
This demo uses the same ImagePreMultAlpha() function as the Layered Windows Demo. This demo's ImagePreMultAlpha() function was updated to include the fix for the black pixels issue (as described in the Layered Windows Demo change history).
20 March 2006.
Fixed a bug in the pbuffer initialization function that was causing the application to crash on ATI cards. The pbuffer initialization function was incorrectly passing the wglChoosePixelFormatARB() function an attribute list containing WGL_BLUE_SHIFT_ARB instead of WGL_BLUE_BITS_ARB. |