1
자습서에 따라 GLU 테셀레이터가 작동합니다.GLTessellator crashing
void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],
GLfloat weight[4], GLdouble **dataOut)
{
GLdouble *vertex;
int i;
vertex = (GLdouble *) malloc(6 * sizeof(GLdouble));
vertex[0] = coords[0];
vertex[1] = coords[1];
vertex[2] = coords[2];
//crashes here
**for (int i = 3; i < 6; i++)
{
vertex[i] = weight[0] * vertex_data[0][i] +
weight[1] * vertex_data[1][i] +
weight[2] * vertex_data[2][i] +
weight[3] * vertex_data[3][i];
}**
//crashes here
*dataOut = vertex;
}
내가 메모리 바라 보았다 : 그것은 충돌 임의의 다각형을 생성 한 후 충돌이 발생 신규 점의 컬러를 보간 (오류가 메모리에서 읽어 ...)
이 내 콜백입니다 제외하고 작동 충돌이 생기면 정확하게 내 손가락을 집어 넣을 수 없습니다.