/*Read values back*/
/*Set the target framebuffer to read*/
glReadBuffer(GL_FRONT);
/*Read the packet payload from framebuffer to PBO*/
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboread);
glReadPixels(0,0,size,noOfpacket,GL_RED,GL_UNSIGNED_BYTE,0);
checkError("Readpixel");
printf("Data after roundtrip:
");
/*Map the PBO to process the data by CPU*/
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboread);
glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB,noOfpacket*size,result,GL_STREAM_READ_ARB);
for (i=0; i<noOfpacket*size; i++)
printf("%c",result[i]);
printf("
");
glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
It returns me GL Error: Invalid enumerant. I cant find this error from the glReadPixels functions.
Here is the function check code:
void checkError(char *str)
{
GLenum error;
if ((error = glGetError()) != GL_NO_ERROR)
printf("GL Error: %s (%s)
", gluErrorString(error), str);
}
This is GL error but not the function error right? Why?