0
static GLuint selectBuff[BUFFER_LENGTH];
glSelectBuffer(BUFFER_LENGTH, selectBuff);
..
//Draw something..
..
// Collect the hits
hits = glRenderMode(GL_RENDER);
..
..
if(hits > 0){ //something's been selected
fprintf(stderr,"something has been selected");
unsigned int choiche;
// fi there's more than one figure (or control point) selected, take the top one
if (hits > 1)
choiche = selectBuff[(hits*4)-1];
else
choiche = selectBuff[3];
cpsel = false;
我基本上想知道selectBuff的结构。作者含义selectBuff[3]
和selectBuff[(hits*4)-1]
是什么意思?在opengl中glSelectBuffer的返回值
官方文档说,缓冲区返回名称堆栈中的值。但是,这并不能告诉我作者的意思是selectBuff[3]
。
欲了解完整的代码(这是一个绘图程序)see here。
最大深度值是不是selectBuff [2]? – Bart 2011-04-18 16:50:04
它必须是星期一。是的 - 编辑答案 - 谢谢你的收获。 – holtavolt 2011-04-18 18:01:14
链接已死亡。 https://www.opengl.org/sdk/docs/man2/xhtml/glSelectBuffer.xml – scry 2015-07-19 06:39:33