buffers

hi-i’m trying to use the selection buffer, but it seems like it is just getting filled with junk. here is my code:

void generate_feedback(void)
{
GLint size;
GLfloat feedBackBuff[4096];
glFeedbackBuffer(4096, GL_3D, feedBackBuff);
glRenderMode(GL_FEEDBACK);

display();

size = glRenderMode(GL_RENDER);

printf("size == %d
", size);
FILE* debugfile;
debugfile = fopen(“debug.txt”, “w”);

for(int i = 0; i <= 4096; i++)
fprintf(debugfile, "feedBackBuff[%d] == %f
", i, feedBackBuff[i]);

fclose(debugfile);

}

it doesn’t matter where in my scene i click, size always equals -1…i don’t know what’s going on…can anyone help?
thanks
lee

You say you want to use the selection buffer but do feedback in the source. What exactly do you want?

sorry - i said selection but i meant feedback…i messed with it some more, and when the selection buffer identifies 1 object, the feedback works OK. but when selection hits are more than 1, the SIZE in the feedback buffer equals -1. i’m puzzled. i printed the feedback buffer anyway, and i only see 1 passThrough value in there. the others are missing. has anyone else had this problem?