OpenGL|ES tutorials - Follows NeHe track.

Apprentice
Posts: 13
Joined: 2008.10
Post: #2
Setting up an OpenGL Window

Because of the NDA on the iPhone SDK, I will be instructing users where they can download the necessary code from Apple to perform specific operations on that code to get where we need to be.

Begin by going to the development center and getting the sample code for GLGravity. We will use a modified version of this source for our base code.

To create the basis for these tutorials duplicate the GLGravity folder and call it OpenGLCore.

Rename the xcodeproj file to OpenGLCore.xcodeproj.

Open the project.

Remove ReadMe.txt from the project and move it to the trash.

Go to Resources and remove Default.png and icon.png and send the files to the trash, we won't need them either.

In the Models folder, remove the teapot.h file. This is just an array list for the teapot that is so often used in graphics programs.

Rename the GLGravityView.h and .m files to OpenGLCoreView.

Do a Find Selected Text in Project and look for GLGravityView. Replace all Occurances with OpenGLCoreView. Save the changed files (Should be OpenGLCoreView.h/.m, and AppController.m).

Open AppController.h and remove the UIAccerlerationValue and the UIAccelerometerDelegate.

Open AppController.m and remove the reference to teapot.h, remove all defines except kRenderingFrequency.

Find the drawView function and remove everything inside the function. This is where we will do a majority of our code.

Find the setupView function and remove everything from this function as well. This is where we will set up our viewport and configure the state of the GL engine.

Find the applicationDidFinishLaunching function and go to the end, remove the accelerometer code. Also remove the didAccelerate function entirely.

Build and Run the application in the iPhone Simulator. If all goes well you will see an empty black screen. We will use this as the base for the rest of our tutorials for OpenGL|ES.
Quote this message in a reply
Post Reply 


Messages In This Thread
OpenGL|ES tutorials - Follows NeHe track. - dragagon - Oct 26, 2008 09:52 PM
Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Track down an autorelease bug kendric 2 3,053 Jun 28, 2009 05:09 AM
Last Post: kendric