Apr 05
Richard S. Wright, Jr. one of the authors of the OpenGL(R) SuperBible: Comprehensive Tutorial and Reference (4th Edition)
has written an article for Doctor Dobb’s Journal:
OpenGL and Mobile Devices: Round 2 – OpenGL ES for the iPhone and iPod Touch
If you know basic OpenGL and are trying to get started on the iPhone, this may be a good place to start.
UPDATE: Be forewarned – I have yet to successfully port the application listed in the article to the iPhone. For suggestions see my next post about mixing C++.
Tags: graphics
Mar 02
The iPhone uses a special form of OpenGL known as OpenGL ES. The ES stands for “embedded systems.” It’s a scaled back version to fit on small devices (like the iPhone).
I’ve decided to teach myself Open GL first – then go through the pain of learning OpenGL ES – which means when I scale back to ES, some features I’m going to learn about may be missing.
Even though I’m more comfortable in Windows, I’m going to make life even more complicated by learning OpenGL on the Mac first.
OpenGL on the Mac
To get started developing for OpenGL on the Mac you are going to need Xcode. See my previous post for information on that. I’m assuming you are using the latest version of Mac OS X.
Then what you need to do is visit this link:
http://blog.onesadcookie.com/2007/12/xcodeglut-tutorial.html
At this point you could be done. What I’m doing here is taking my notes from that article and compressing them. In a few places I did things a little differently. But in each case the goal was met: have a working project that will compile OpenGL and GLUT code.
- In Xcode select: File / New Project …
- Under Mac OS X select: Other
- Click on: Empty Project
- Click: Choose …
- Select your development root directory
- Click: New Folder
- Give the folder the name of your project, like TestOpenGL
- For Save As enter the name of your project, like TestOpenGL
- Click: Save
- Under Groups & Files right-click on Targets
- Select: Add / New Target …
- Under Mac OS X select: Cocoa
- Select: Application
- Click: Next
- Enter a Target Name, like TestOpenGL
- Click: Finish
- You’ll be presented with a Target “TestOpenGL” Info window
- Scroll to the bottom and double click: GCC_PREFIX_HEADER
- Clear the contents and click OK
- Close the Info window
- In the Groups & Files window of Xcode, right click on the Products folder
- Select: Add / Existing Frameworks …
- Expand: Frameworks
- Select: GLUT.framework
- Apple-key + click OpenGL.framework
- Click: Add
- You’ll see a dialog box, just use the defaults and click Add
- In the Groups & Files window of Xcode, right click on the Products folder
- Select: Add / New File …
- Under Mac OS X select: C and C++
- Select: C File
- Click: Next
- Name it main.c
- Click: Finish
Now you have a main.c file where you can plug in OpenGL code – including code that uses the GLUT framework – from your favorite tutorial. It should compile and run on the Mac just fine.
Tags: GLUT, graphics