| 114 | |
| 115 | |
| 116 | XVisualInfo *getVisualFromConfig(Display *dpy, int screen, EGLDisplay edpy, |
| 117 | EGLConfig config) |
| 118 | { |
| 119 | if(!dpy || !edpy || !config) return NULL; |
| 120 | |
| 121 | EGLint redSize, greenSize, blueSize; |
| 122 | int depth = 24; |
| 123 | |
| 124 | if(eglGetConfigAttrib(edpy, config, EGL_RED_SIZE, &redSize) |
| 125 | && eglGetConfigAttrib(edpy, config, EGL_GREEN_SIZE, &greenSize) |
| 126 | && eglGetConfigAttrib(edpy, config, EGL_BLUE_SIZE, &blueSize) |
| 127 | && redSize == 10 && greenSize == 10 && blueSize == 10) |
| 128 | depth = 30; |
| 129 | |
| 130 | XVisualInfo vtemp; int nv = 0; |
| 131 | |
| 132 | vtemp.depth = depth; |
| 133 | vtemp.c_class = TrueColor; |
| 134 | vtemp.screen = screen; |
| 135 | |
| 136 | return XGetVisualInfo(dpy, |
| 137 | VisualDepthMask | VisualClassMask | VisualScreenMask, &vtemp, &nv); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | unsigned int checkBufferColor(void) |
no test coverage detected