Hi!
I’m going insane over this…
I have a really strange picking problem. glRenderMode(GL_RENDER) returns -1 if I draw anything while having anything else than zero on the name stack.
First I do picking, then I update the time and move things around and then I do the framebufffer rendering and after that I swap back and front buffer.
Here is the actual code:
glGetIntegerv(GL_VIEWPORT, viewPort);
glSelectBuffer(PICK_BUFFER_LENGTH, mPickBuffer);
glRenderMode(GL_SELECT);
glInitNames();
glPushName(0);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPickMatrix(screenX, (GLdouble)(viewPort[3]-screenY),
1.0f, 1.0f, viewPort);
TheGame->SetPerspective(); // set proper perspective go to modelview and call gluLookAt
TheGame->RenderScene();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
hits = glRenderMode(GL_RENDER);
glRenderMode is never ever supposed to return -1 according to any spec. No GL errors are reported.
Thanks for your help!
/Johan Torp