openglview
initWithCoder
NSOpenGLContext *glcontext = [self openGLContext];
[glcontext makeCurrentContext];
drawRect
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glPushMatrix ();
// x,y(1->-1)
glPixelZoom(1.0, -1.0);
//set draw pos
glRasterPos2i( -1.0, 1.0);
[dataCondition lock];
glDrawPixels(size.width,size.height,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,pData);
[dataCondition unlock];
//Signal that drawing is done - causes a buffer swap
[[self openGLContext] flushBuffer];