I'm trying to modify my OpenGL project to OpenGL ES 1.x. But there is a function call I can't find any solution for me to replace it.
glPushAttrib(GL_CURRENT_BIT | GL_LIGHTING_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
I can't find GL_CURRENT_BIT mask and glPushAttrib function in OpenGL ES 1.x.
Simply, I just remove the GL_CURRENT_BIT mask from the glPushAttrib parameters, and the application show the wrong background on the window(I tested it on the OpenGL environment. and the background is a texutre.). Is there any solution for me to replace glPushAttrib(GL_CURRENT_BIT) and let me run the application correctly on the OpenGL or Is there any solution for me to implement glPushAttrib(GL_CURRENT_BIT) which I can run both on OpenGL and OpenGL ES correctly? Thanks!
glPushAttribdoes not exist in OpenGL ES. The function that is intended to take theGL_CLIENT_PIXEL_STORE_BITas an input is actuallyglPushClientAttrib, which also doesn't exist (and thus, neither does the constant).The functionality of these is essentially to store all states that can be set with the
glPixelStoreifunction. This can be implemented manually, by recording these states as they are set, and making the equivalent calls toglPixelStoreito restore them. See here (item #8) for a discussion (which about OpenGL, by applies to OpenGL ES, in that, it doesn't haveglPush/PopClientAttrib).