I am converting an iPhone application from OpenGL ES 1.1 to ES 2.0. The application draws to an EAGLView as this is defined in the standard OpenGL ES application template as it is provided by Apple.
The ES 1.1 code was working fine on both the simulator and on the iPhone. The new ES 2.0 code is working fine on the simulator but on an iPhone 3GS I get artifacts (e.g. scaled fragments of views from other applications) that as far as I can understand show that my program gets confused about the framebuffer. I find this strange since I haven't made any changes to the framebuffer handling logic compared to the ES 1.1.
I include below the part of the code that does the drawing, although I don't see the point since it works fine in the simulator:
GLfloat data[600000];
// initialize data
glClearColor(0.f, 0.f, 0.f, 0.f);
glClear(GL_COLOR_BUFFER_BIT);
glUseProgram(program);
glUniformMatrix4fv(uniforms[UNIFORM_PROJECTION_MATRIX], 1, GL_FALSE, projection_matrix);
glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEW_MATRIX], 1, GL_FALSE, modelview_matrix);
glVertexAttribPointer(ATTRIBUTE_POSITION, 3, GL_FLOAT, GL_FALSE, 0, data);
glEnableVertexAttribArray(ATTRIBUTE_POSITION);
glDrawArrays(GL_POINTS, 0, 200000);
glFlush();