views:

37

answers:

1

I want to develop OpenGL application for iPhone. However I don't like using iPhone simulator. Is it possible to create Cocoa desktop application and then just copy-paste drawing code to iPhone application? How different is coding OpenGL for iPhone and Cocoa?

+3  A: 

The iPhone uses OpenGL ES, which is a restricted subset of OpenGL. What makes things complicated is that earlier iPhones (pre-3GS) only support OpenGL ES 1.1, which only provides a fixed-function pipeline, and if you are targeting more recent hardware, you can use OpenGL ES 2.0, but that only has a shader pipeline, no fixed function.

If you keep these issues in mind, and keep an eye on whether the functions you want to use are supported on ES 1.1 or ES 2.0 (whichever you choose), you can get by with desktop development, followed by copy-pasting, and fixing up.

Personally, I think you'll find it easier just to use the simulator. But a real iPad provides the best dev/test environment, IMO.

Marcelo Cantos
Thank you for your answer.
Pavels
You should correct your answer, iPhone uses OpenGL ES 1.1, and more recently, OpenGL ES 2.0, not OpenGL 1.1 and 2.0. Both are very different.
Matias Valdenegro
@Matias: Simple typo; thank you for pointing it out.
Marcelo Cantos