我如何才能为Objective-C代码对iPhone而不是Mac做同样的事情?

EAGLContext *k_context = [[[EAGLContext alloc]
                           initWithAPI:kEAGLRenderingAPIOpenGLES1
                           sharegroup:[[[[CCDirector sharedDirector] openGLView] context] sharegroup]] autorelease];
[EAGLContext setCurrentContext:k_context];

最佳答案

苹果在developer documentation中很好地解释了这一点。在MacOS X上,有三种创建OpenGL上下文的方法:


Fullscreen
Windowed
Off-Screen

09-28 07:44