i need draw a counter onto a OpenGL view. here is my source code for the video frame display
cgl_ctx = CGLContextObj ( [[self openGLContext] CGLContextObj]);
glEnable(GL_TEXTURE_RECTANGLE_ARB);
glGenTextures(1, &_surfaceTexture);
glDisable(GL_TEXTURE_RECTANGLE_ARB);
GLint swapInt = 1;//100;//1;
[[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
[[self openGLContext] makeCurrentContext];//make the current opengl the priority
glMatrixMode(GL_TEXTURE);
glGenTextures(1, &_surfaceTexture);
glBindTexture(GL_TEXTURE_2D, _surfaceTexture);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(
GL_TEXTURE_2D,
0,
GL_RGBA,
displayWidth,//960,//1920,
displayHeight,//540,//1080,
0,
GL_BGRA,//GL_YCBCR_422_APPLE,//GL_RGB,//GL_APPLE_ycbcr_422,
GL_UNSIGNED_BYTE,//GL_BYTE,//GL_UNSIGNED_BYTE,//GL_UNSIGNED_SHORT_8_8_REV_APPLE,
IOSurfaceGetBaseAddress(videoBuffer->ioSurfaceDataBuffer[bufferCounter].RGBDest ));
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0);
glVertex3f(-1.0, -1.0, 0.0);
glTexCoord2f(1.0, 0.0);
glVertex3f(1.0, -1.0, 0.0);
glTexCoord2f(1.0, 1.0);
glVertex3f(1.0, 1.0, 0.0);
glTexCoord2f(0.0, 1.0);
glVertex3f(-1.0, 1.0, 0.0);
glEnd();
glFlush();
threadTracking ("view 11\n");
printf("view 2.2) videoBuffer->ioSurfaceDataBuffer[bufferCounter].played %d\n",videoBuffer->ioSurfaceDataBuffer[bufferCounter].played);
[[self openGLContext] flushBuffer];