PDA

View Full Version : how to create a RTT pbuffer that support FSAA



pango
07-22-2004, 12:50 AM
I write below code to create a RTT pbuffer support FSAA,but it always fail,anyone can tell me the reason?

int iAttrs[]={
WGL_SUPPORT_OPENGL_ARB,TRUE,
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_DRAW_TO_PBUFFER_ARB,GL_TRUE,
WGL_BIND_TO_TEXTURE_RGBA_ARB,GL_TRUE,
WGL_PIXEL_TYPE_ARB,WGL_TYPE_RGBA_ARB,

WGL_COLOR_BITS_ARB,32,
WGL_ALPHA_BITS_ARB,8,
WGL_DEPTH_BITS_ARB,16,

WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
WGL_SAMPLES_ARB,4,
0,0};
float fAttrs[]={0,0};

//create pbuffer
GLint nPixelFmt=0;
unsigned int nNumFmt=0;
//the result of below function call is true,but the value of "nNumFmt" is always 0,why?
if(!wglChoosePixelFormatARB(wglGetCurrentDC(),iAtt rs,fAttrs,1,&nPixelFmt,&nNumFmt))
{
ASSERT(FALSE);
return FALSE;
}

my code is tested in a NVIDIA Geforce FX5900