thyrgle
thyrgle

Reputation:

How does the OpenGL ES template work for the iPhone?

So, I've been trying to figure out why the square is moving up and down the iPhone simulator when I Build and Run the template that Apple provides for OpenGL ES. I don't understand why for example they have ES1Render.m, and ES2Render.m instead of just one ESRender.m. Also, where is the equivalent of the glutDisplayFunc, and glutTimerFunc? Thanks in advance.

Upvotes: 1

Views: 381

Answers (1)

Nathan S.
Nathan S.

Reputation: 5388

They are trying to the show the two versions of OpenGL ES. One uses shaders (v2) and the other (v1) uses older OpenGL technology. In the ES2 renderer I believe they are doing all the movement in the shader code. If you want something that looks like older OpenGL code try setting it to use the version 1 renderer. Then you can use stuff like the older demos on http://nehe.gamedev.net/. You just need to fill in the "render" function with your drawing code.

EAGLView has a timer which sets the frame rate, but there is a method which allows you to set it to be whatever you like.

Upvotes: 1

Related Questions