PDA

View Full Version : Importance of alpha buffer in PIXELFORMATDESCRIPTOR ???



merp
03-27-2002, 03:03 AM
My main doubt is Alpha buffer,Z-buffer and Stencil buffer are card dependent ??

The AGP card in my system is NVIDIA RIVA TNT2 Model 64/Model 64 pro.

In my application if i give the alpha buffer as 8 then a black area on right and bottom of the window is appeared.But if i give 0 bit then no probs in display.But the system is crashed if we try to do any GDI operations in another view.But before OpenGL window creation, no problem on GDI operations on another view.So it is purely OpenGL settings and the display card related.Application is in MFC using WGL API's.

The PIXELFORMATDESCRIPTOR structure in my code is

static PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER | // double buffered
PFD_GENERIC_ACCELERATED,
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
8, // 8 bit alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
24, // 24-bit z-buffer
8, // stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};


Waiting the remedy for this problem...

DFrey
03-27-2002, 05:27 AM
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q272222

Reckoner
03-27-2002, 06:11 AM
If you request a feature in the pixel format that the driver doesn't support in hardware, it will return an unaccelerated pixel format. To check if it is accelerated:

DescribePixelFormat(hDC, m_nPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
if ((pfd.dwFlags & PFD_GENERIC_FORMAT) > 0)
{
//Report warning or change pfd and try again
}