PDA

View Full Version : P-buffer



03-31-2003, 04:45 AM
I've followed nvidia's document (http://developer.nvidia.com/docs/IO/1312/ATT/PixelBuffers.pdf) for creating a P-buffer, and get as far as 'wglCreatePbufferARB(...)'. The "WGL_ARB_pixel_format" and "WGL_ARB_pbuffer" extensions are supported, I can get all the procedure addresses, and the 'wglChoosePixelFormatARB' indicates that it has 14 supporting pixel formats.
Calling 'hBuffer = wglCreatePbufferARB(hdc, pformat[0], 64, 64, NULL);' gives me a 'Undandled exception in test.exe (NVOGLNT.DLL): ... Access Violation.'

Does anyone have any suggestions as to what might be going wrong?

I'm using GLUT and attempting to create the p-buffer immediately before the 'glutMainLoop' and after initialising GLUT and creating a window (so I have a valid wglGetCurrentDC()).
The attributes I'm requesting in the 'wglChoosePixelFormatARB' function's int attributes array are -
(WGL_DRAW_TO_PBUFFER_ARB,true)
(WGL_SUPPORT_OPENGL_ARB,true)
(WGL_DEPTH_BITS_ARB,24)
(WGL_RED_BITS_ARB,8)
(WGL_GREEN_BITS_ARB,8)
(WGL_BLUE_BITS_ARB,8)
(WGL_ALPHA_BITS_ARB,8)

03-31-2003, 11:37 PM
The problem was I was passing NULL for the 'wglCreatePbufferARB' attributes array, which is a little odd because it lets you use NULL for the 'wglChoosePixelFormatARB' attributes int and float arrays.