opengl简单例子画rgb565数据
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];
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。