SteeleR
11-20-2006, 02:43 AM
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("");
}
...
//---
any ideas why does it come in changed order?
10x...
//---
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("");
}
...
//---
any ideas why does it come in changed order?
10x...