Wow, very clear and simple example. Great comments in Ex1.c. Thanks so much for sharing, PeterO.
I have a question about this code in the Draw() function:
Code: Select all
// These will be needed later......
#if 0
glViewport(0,0,displayWidth,displayHeight);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
#endif
It seems to me that this code is needed only once (in the InitScene() function?), not every frame. Except for glClear() maybe, but I'm not sure. And what do you mean by 'This will be needed later...'? Enabling it doesn't seem to make a difference.
Thanks again, I'm still struggling a bit to make the transition from GLES1 to GLES2, and this will certainly help.