I'm trying to implement picking using Pyglet's OpenGL wrapper, but I'm having trouble converting a C tutorial to Python. Specifically the part below.
#define BUFSIZE 512
GLuint selectBuf[BUFSIZE]
void startPicking(int cursorX, int cursorY) {
GLint viewport[4];
glSelectBuffer(BUFSIZE,selectBuf);
glRenderMode(GL_SELECT);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glGetIntegerv(GL_VIEWPORT,viewport);
gluPickMatrix(cursorX,viewport[3]-cursorY,
5,5,viewport);
gluPerspective(45,ratio,0.1,1000);
glMatrixMode(GL_MODELVIEW);
glInitNames();
}
I'm not sure how to turn declare arrays of GLuint or GLint such that glSelectBuffer and glPickMatrix work. Does anyone know how to do this in Python with Pyglet? Thanks.