Hi… i’ve got a problem reading(or writing in) the select buffer… the result it returns is something like:
//—
1
2168957372
2168957372
7
2
2168957372
2168957372
7
6
3
2168957372
2168957372
7
6
5
4
2168957372
2168957372
7
6
5
4
5
2168957372
2168957372
7
6
5
4
3
6
2168957372
//—
when I got 8 hits… the first hit is right… so does the second… but in the third the values have changed places…
the code i use is as follows:
//—
GLuint selectBuf[1024];
glSelectBuffer(256, selectBuf);
…
hits = glRenderMode (GL_RENDER);
Memo2->Lines->Clear();
for(GLuint i=0;i<hits*4;i+=4)
{
Memo2->Lines->Add(selectBuf[i]);
Memo2->Lines->Add(selectBuf[i+1]);
Memo2->Lines->Add(selectBuf[i+2]);
Memo2->Lines->Add(selectBuf[i+3]);
Memo2->Lines->Add("");
}
…
//—
so… after the depth value it gives the names of the items hit, and not the name, depths and ID for every item hit so for every hit there are 4 values stored int the buffer…
just to be clear… the actual hits are given at the end of the buffer by the form:
1
2168957372
2168957372
7
6
5
4
3
2
1
… and the objects named 1,2,…,7 are the hit ones, right ?