Consider this OpenGL ES 1.1 code, called every frame:
glPushMatrix();
glRotatef(m_currentAngle, 0, 0, 1);
//... enable, point, draw vertices
glPopMatrix();
All well and good. Now if I remove the push/pop, I get continuous rotation animation, which makes sense.
However, in ES 2.0, here is the equivalent effect:
//no glRotate so doing this:
float radians = m_currentAngle * 3.14159f / 180.0f;
float s = std::sin(radians);
float c = std::cos(radians);
float zRotation[16] = {
c, s, 0, 0,
-s, c, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
GLint modelviewUniform = glGetUniformLocation(m_simpleProgram, "Modelview");
glUniformMatrix4fv(modelviewUniform, 1, 0, &zRotation[0]);
//... then enable, point and draw vertices
This also creates the proper image, but despite nothing equivalent to a "push/pop" technique, it does not continuously rotate. Why does the 2.0 not continuous rotate, while the 1.1 does?
Or phrased another way, why does 1.1 require the push/pop to prevent continuous animation, while 2.0 does not?