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.
+2
A:
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.
Nathan S.
2010-04-26 02:46:50
Ok, I'll be sure to try that out. Thanks!
thyrgle
2010-04-26 03:39:57
@thyrgle - Also note that GLUT is not available in its full form in OpenGL ES, so you may need to find alternate ways of implementing any code that relies on that toolkit.
Brad Larson
2010-04-26 14:22:12
Oh yeah I feel really stupid now... should have thought about that... I'm to use to desktop OpenGL/GLUT programming.
thyrgle
2010-04-26 23:20:46