Thanks Nalin it Worked, but i've 3 questions.
1- What i did wrong, why we do this approach?
2- Can we reduce "canUseFrame" static integer from 100, because it take bit time to load app.
3- I've 3 device one iPhone 4S, and 2 iPhone 4. Now My app works fine on 4S(IOS 5.1) and one 4(IOS 5.1) but one iPhone4(IOS 4.3) still cause an error, when it detect marker on line "glColor4f(0.5f,0.0f,0.0f,0.0f);" which is same function "renderFrameQCAR" and error is "Thread 10: EXC_BAD_ACCESS (code=2, address=0x0)".
For more Clearification of what i am doing where crash happen, Code is:
" 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);
"
Thanks Again :)
If you look in the build/include/QCAR library you will find all the include files which you can drag into XCode.
Init() starts up the Vuforia library.
The leaks are not the problem in this particular case.
N