Hi,
When I try to render a frame to a texture(1024*768) via pbuffer, somehow I cannot set alpha enable. I read the extension headers and prepared the pfd as follows:
const int iAttribList[]={ WGL_DRAW_TO_PBUFFER_ARB, 1,
WGL_TRANSPARENT_ARB,1,
WGL_COLOR_BITS_ARB, 24,
WGL_ALPHA_BITS_ARB, 8,
WGL_DEPTH_BITS_ARB, 8,
WGL_STENCIL_BITS_ARB, 0,
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV, true,
0};
const float fAttribList[]={0};
//Choose pixel format
unsigned int numFormats;
if(!wglChoosePixelFormatARB( hDC, iAttribList, fAttribList, 1, &pixelFormat, &numFormats))
{
MessageBox(NULL,"Can't find a suitable pixel format for the pbuffer","ERROR",MB_OK|MB_ICONEXCLAMATION);
return ;
}
const int otherAttribs[]={ WGL_TEXTURE_FORMAT_ARB,
WGL_TEXTURE_RGBA_ARB,
WGL_TEXTURE_TARGET_ARB,
WGL_TEXTURE_RECTANGLE_NV,
0};
//Create the pbuffer
hpbuffer = wglCreatePbufferARB(hDC, pixelFormat,1024, 768, otherAttribs);
if(!hpbuffer)
{
MessageBox(NULL,"Can't create the pbuffer","ERROR",MB_OK|MB_ICONEXCLAMATION);
return ;
}
pbufferDC = wglGetPbufferDCARB(hpbuffer);
pbufferRC = wglCreateContext(pbufferDC);
Everything is OK, but no transparency in the prepared texture
What is missing?
Thanks a lot.
System: Win2000, GeForceFx5200,
driver version 5.6.7.2 ( April 2004 )