Port openGLES iPhone app to OSX?

IPhone development is my first experience with objective-c and my first in-depth experience with xcode. How difficult would it be to port openGLES iPhone to the OSX desktop using openGL? I am not asking about the user interface - it is obvious that there is no equivalent cocoa touch UI on the desktop. I am specifically asking about application delegate levels and openGLES. Are there any serious obstacles? Isn't it as simple as just creating a new application delegate in a project like cocoa?

+5
objective-c cocoa opengl-es opengl macos
source share
1 answer

I started learning the same thing, and it seems that OpenGL-heavy applications will be some of the easiest to back up on a Mac. Almost everything in OpenGL ES is present in OpenGL on the desktop (with the exception of some things with a fixed point), so the code can remain unchanged.

The way OpenGL is handled on the iPhone is with a Core Animation (CAEAGLLayer) layer, not a specific view. Therefore, you should port this to a Leopard-based desktop application, although you will need to convert all references to EAGL classes to their OpenGL equivalent (e.g. EAGLContext to NSOpenGLContext). You can display in CAOpenGLLayer, which is displayed by itself, or use this layer to support custom NSView.

The fundamental structure of a Cocoa working application will be different from Cocoa Touch one, but you can start with one of the Xcode templates and add back to your components from the Cocoa Touch application.

Again, I have not done this for my application yet, but it looks quite simple.

+8
source share

All Articles