PDA

View Full Version : PBO in floating point PBuffer



Brainter
11-20-2004, 10:01 PM
I am programming using floating point pbuffer then read the result to PBO but when I use glMapbufferARB to see data in PBO I can find nothing! what is the problem? here is the code:

mypBuffer.activate();

render from pixel buffer OBJ1

glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT,pixelBu fferID_1);
glDrawBuffer(GL_FRONT);
glRasterPos2i(0, 0);
glDrawPixels(128,128, GL_RGBA, GL_FLOAT, NULL);

read from pbuffer

glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT,pixelBuff erID_2);
glReadBuffer(GL_FRONT);
glReadPixels(0, 0, 128, 128, GL_RGBA, GL_FLOAT, NULL);

probe data in pixel buffer OBJ2
glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT,pixelBuff erID_2);
void *pboMemory=glMapBufferARB(GL_PIXEL_PACK_BUFFER_EXT ,GL_READ_ONLY_ARB);
int n=0;
printf("the value is %f %f",*((float*)pboMemory),*((float*)pboMemory));

mypbuffer.deactivate;