GLboolean bDither = GL_CHECK(glIsEnabled(GL_DITHER));LOGD("glIsEnabled(GL_DITHER) = %i\n", bDither);GL_CHECK(glDisable(GL_DITHER));LOGD("glDisable(GL_DITHER)\n");bDither = GL_CHECK(glIsEnabled(GL_DITHER));LOGD("glIsEnabled(GL_DITHER) = %i\n", bDither);GL_CHECK(glEnable(GL_DITHER));LOGD("glEnable(GL_DITHER)\n");bDither = GL_CHECK(glIsEnabled(GL_DITHER));LOGD("glIsEnabled(GL_DITHER) = %i\n", bDither);
glView = new GLView(this);glView.getHolder().setFormat(PixelFormat.RGBA_8888); // Gives smooth gradient.setContentView(glView);
Hi Peter,OK I have looked into this and I have a workaround but I need to investigate further.Even with the app as it is, I do see dithering between colour levels in screenshots from DDMS:
My suspicion is that on other platforms you are requesting RGB565 but getting a higher colour depth returned. The EGL spec allows this, as does Android's setEGLConfigChooser() method.
Leaving the request at 565 but modifying the onCreate() method in SimpleGL.java:glView = new GLView(this);glView.getHolder().setFormat(PixelFormat.RGBA_8888); // Gives smooth gradient.setContentView(glView);I still need to investigate whether this addition is correct and necessary, and also your point about glGet() but in the meantime, does this change produce the same results across platforms for you?
I used glGetBooleanv (and glGetIntegerv) to query the state, glIsEnabled does indeed return 1.And I noticed that glGet doesn't return zero which I thought, they don't touch my parameter at all..(shouldn't glGet work for state queries as well as glIsEnabled?)
setEGLConfigChooser(8, 8, 8, 0, 0, 0);
glView = new GLView(this);glView.getHolder().setFormat(PixelFormat.RGBA_8888);setContentView(glView);