views:

29

answers:

2

I have no experience at all with OpenGL and just started playing around with iPhone development. From google, it seems that iphone uses a special type of opengl (openGL ES). What are the languages that is supported by openGL ES? I know a little bit of C++ but by now i believe my C and Objective-C is better than C++.

A: 

You'll want to work with a framework if you have no OpenGL experience previously. There are 2 I have looked at:

  • SIO2 (free, but you need to pay a license fee if you want to include it in a published title)

  • Unity (harder to learn, but apparently more flexible).

As for languages, most are in C or C++. You can mix in Objective-C (cutely named Objective-C++) and it will compile fine, but the real trouble comes in when you mix UIKit and OpenGL - as long as you're not doing that, you should be all good to go with whichever language you like.

phooze
+2  A: 

Accessing the OpenGL is the same as working with any C library. If you can program with C then you'll be able to handle OpenGL. If you're familiar with adding frameworks and libraries to an Xcode project then you should be fine with OpenGL projects.

As a note: OpenGL ES is not unique to the iPhone. OpenGL ES is a reduced version of the OpenGL library for working with the smaller memory and slower processors found in mobile devices. Other phones like Android also use it.

One good thing about OpenGL ES when compared to standard OpenGL is that it really cut back on the number of API calls that the desktop version of OpenGL had. Only those calls that were considered necessary were kept. If there were duplicate ways of doing the same thing then one way was removed. This means that you have less to learn.

The bad thing about OpenGL ES when compared to standard OpenGL is that it really cut back on the number of API calls that the desktop version of OpenGL had. Again and again when researching how to do something in OpenGL you'll find a cool way to do it on a desktop but will find practically nothing for how to do it with the mobile version. Thankfully as mobile dev becomes more popular this will be less of a problem and already there are a number of OpenGL ES books (see Munshi) appearing.

Also, not all OpenGL ESes are the same. Roughly you have OpenGL ES 2.0 and what came before it and is typically called OpenGL ES 1.x. The most noticible difference between these two is the integration of the programmable pipeline (vertex and fragment shaders). If you create a basic OpenGL ES project with Xcode you find a simple example of the contortions that one needs to go through in order to handle the difference versions.

The shader code itself is a sort of C like programming language. There are some quirks but these are quickly learnt and are rather useful.

Call me weird but I enjoy playing about with Open GL and the ES variants. It's tough but the rewards are worth it as you'll get access to a powerful and useful API. Hopefully you'll be able to get through the early learning stages and really enjoy yourself with OpenGL.

No one in particular