Q1) Does the GPU support 24 bit colour ?
not really as a packed pixel format, you need to think of it as XBGR, 24valid bits in a 32bit word
Q2) If so, how do I get EGL to give me a 24bit context ?
EGL has a sort order for the configs returned.
you need to do something like this
Code: Select all
if (!eglGetConfigs(p->display, NULL, 0, &numberConfigs))
{
errno = ECONNREFUSED;
return -1;
}
eglConfigs = (EGLConfig *)alloca(numberConfigs * sizeof(EGLConfig));
if (!eglChooseConfig(p->display, configAttributes, eglConfigs, numberConfigs, &numberConfigs) || (numberConfigs == 0))
{
errno = ECONNREFUSED;
return -1;
}
for (i = 0; i < numberConfigs; i++)
{
EGLint redSize, greenSize, blueSize, alphaSize, depthSize;
eglGetConfigAttrib(p->display, eglConfigs[i], EGL_RED_SIZE, &redSize);
eglGetConfigAttrib(p->display, eglConfigs[i], EGL_GREEN_SIZE, &greenSize);
eglGetConfigAttrib(p->display, eglConfigs[i], EGL_BLUE_SIZE, &blueSize);
eglGetConfigAttrib(p->display, eglConfigs[i], EGL_ALPHA_SIZE, &alphaSize);
eglGetConfigAttrib(p->display, eglConfigs[i], EGL_DEPTH_SIZE, &depthSize);
if (p->bpp == (redSize + greenSize + blueSize + alphaSize))
break;
}
selectedConfig = i;