Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Is there any good tutorial or code snippet out there on how to use OpenGL via C/C++ on the iPhone?

like image 753
rui Avatar asked Jul 15 '26 16:07

rui


2 Answers

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++.

like image 194
Axel Gneiting Avatar answered Jul 18 '26 06:07

Axel Gneiting


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.

like image 35
Tom Avatar answered Jul 18 '26 07:07

Tom