iPhone - OpenGL using C++ tutorial/snippet [closed]

∥☆過路亽.° 提交于 2019-12-21 20:27:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!