问题
Is there any good tutorial or code snippet out there on how to use OpenGL via C/C++ on the iPhone?
回答1:
http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html
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++.
回答2:
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.
回答3:
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.
回答4:
This guy from Stanford shows step by step how-to make a game using C++ and Open GL. It's free on iTunes U. Here is the link
I learned so much from it. I actually made my first game after watching this video. He also teaches about the structure.
If you are looking for more in depth learning, you can also check out this link (which is not free). I believe the first video will put you on the right track though :)
来源:https://stackoverflow.com/questions/2451548/iphone-opengl-using-c-tutorial-snippet