setting the function to GL_NEVER means it will always fail, ie show everything,
So you need one of the other functions for testing which are the same as used by stencil
But to actually get depth functions to work you need to have a depth buffer, and thats set up when you get an EGL config, so you should also have a depth buffer enabled in your EGL config which may look something like this
static const EGLint attribute_list =
// these 1st 4, let us define the size of our colour components and from that the size of a pixel.
// In this case 32bits made up of 8xR, 8xG,8xB and 8xA
EGL_SAMPLE_BUFFERS,1, // if you want anti alias at a slight fps cost, it won't make a huge difference on a 2D system
EGL_SAMPLES, 4, //keep these 2 lines
// These lines set up some basic internal features that help with depth sorting
// These lines tell EGL how the surface is made up.
I usually set up my OpenGL states like this
you may also need to consider
as it can make it look like things behind things are being seen
Btw, OpenGLES1.1 is basically outdated now, it does still work of course, but much better to move to OpenGLES2.0 when you get a grip on what that static pipeline is doing.. A lot of things like depth sorting work the same way so you're not losing anything by starting with 1.1
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!