Is there any good tutorial or code snippet out there on how to use OpenGL via C/C++ on the iPhone?
+2
A:
I'm pretty sure you need a bit of Objective-C to create the context and do other initialization stuff. The rest is also usable in C++.
Axel Gneiting
2010-03-16 02:40:49
+3
A:
In XCode, go to File > New Project... and choose the "OpenGL ES Application" template. That creates a project with great example code for setting up an OpenGL context and drawing into it with the usual C functions. Plus some other neat tricks like loading a UIImage into an OpenGL texture.
Tom
2010-03-16 03:30:54
the openGL api is mercifly in C for the iphone.note that you might have a problem putting c++ in one of those files in that template. it might be set up to work only with c, not c++. if it is, right click on the file in the solution explorer in xcode, go Get Info->General tab->File Type and set it to 'sourcecode.cpp.objcpp'
matt
2010-03-16 06:57:59
@matt: or simply rename the cpp-file-extension to .mm
Till
2010-04-15 13:29:27
+2
A:
The author of "Beginning iPhone Development" has a number of iPhone OpenGL tutorials on his blog. Additionally, he provides a template project for OpenGL in his first tutorial. Some Objective-C is required to work with OpenGL on the iPhone.
Chris Ridgway
2010-03-16 04:38:27