- attribs[i++] = EGL_ALPHA_SIZE;
- attribs[i++] = (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0;
- attribs[i++] = EGL_DEPTH_SIZE;
- attribs[i++] = (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0;
- attribs[i++] = EGL_STENCIL_SIZE;
- attribs[i++] = (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0;
- attribs[i++] = EGL_SAMPLE_BUFFERS;
- attribs[i++] = (fgState.DisplayMode & GLUT_MULTISAMPLE) ? 1 : 0;
- attribs[i++] = EGL_SAMPLES;
- attribs[i++] = (fgState.DisplayMode & GLUT_MULTISAMPLE) ? fgState.SampleNumber : 0;
- attribs[i++] = EGL_NONE;
+ ATTRIB_VAL(EGL_ALPHA_SIZE, (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0);
+ ATTRIB_VAL(EGL_DEPTH_SIZE, (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0);
+ ATTRIB_VAL(EGL_STENCIL_SIZE, (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0);
+ ATTRIB_VAL(EGL_SAMPLE_BUFFERS, (fgState.DisplayMode & GLUT_MULTISAMPLE) ? 1 : 0);
+ ATTRIB_VAL(EGL_SAMPLES, (fgState.DisplayMode & GLUT_MULTISAMPLE) ? fgState.SampleNumber : 0);
+ ATTRIB(EGL_NONE);