我正在开发 OpenCV 客户端应用程序,我的应用程序在 IOS 5.1 上运行良好,但是当我在 IOS 4.3 上运行我的应用程序时,它glColor4f
在类中定义的函数处崩溃gl.h
,但在崩溃时没有显示任何错误消息。我正在做以下事情:
QCAR::Matrix44F modelViewProjection;
glColor4f(0.5f,0.0f,0.0f,0.0f);
ShaderUtils::multiplyMatrix(&qUtils.projectionMatrix.data[0], &modelViewMatrix.data[0], &modelViewProjection.data[0]);
glUseProgram(shaderProgramID);
glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &vbVertices[0]);
glEnableVertexAttribArray(vertexHandle);
glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE, (GLfloat*)&modelViewProjection.data[0] );
glColor4f(0.5f,0.0f,0.0f,0.0f);
glEnableClientState (GL_VERTEX_ARRAY);
glEnableClientState (GL_COLOR_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
// glColorPointer(4, GL_FLOAT, 0, triangleColors);
glVertexPointer(3, GL_FLOAT, 0, (const GLvoid*) &vbVertices[0]);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);
glDrawArrays(GL_LINES, 0, 8);
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
//glDisable(GL_TEXTURE_2D);
glDisableVertexAttribArray(vertexHandle);