Buildfix for OpenGL ES2 build

I'm not sure that these changes are correct so I need somebody to review.