summaryrefslogtreecommitdiff
path: root/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_x_main.c55
1 files changed, 51 insertions, 4 deletions
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c b/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
index 5571468d5b..0535aa749b 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
@@ -198,18 +198,65 @@ eng_best_visual_get(Display *disp, int screen)
198 XMatchVisualInfo(disp, screen, depth, TrueColor, _evas_gl_x11_vi); 198 XMatchVisualInfo(disp, screen, depth, TrueColor, _evas_gl_x11_vi);
199// GLX 199// GLX
200#else 200#else
201 int _evas_gl_x11_configuration[9] = 201
202#if 0 // use this if we want alpha
203 int config_attrs[20];
204 GLXFBConfig *configs = NULL, config = 0;
205 int i, num;
206
207 config_attrs[0] = GLX_DRAWABLE_TYPE;
208 config_attrs[1] = GLX_WINDOW_BIT;
209 config_attrs[2] = GLX_DOUBLEBUFFER;
210 config_attrs[3] = 1;
211 config_attrs[4] = GLX_RED_SIZE;
212 config_attrs[5] = 1;
213 config_attrs[6] = GLX_GREEN_SIZE;
214 config_attrs[7] = 1;
215 config_attrs[8] = GLX_BLUE_SIZE;
216 config_attrs[9] = 1;
217 config_attrs[10] = None;
218
219 // if rgba
220 config_attrs[10] = GLX_ALPHA_SIZE;
221 config_attrs[11] = 1;
222 config_attrs[12] = GLX_RENDER_TYPE;
223 config_attrs[13] = GLX_RGBA_BIT;
224 config_attrs[14] = None;
225
226 configs = glXChooseFBConfig(disp, 0, config_attrs, &num);
227 for (i = 0; i < num; i++)
228 {
229 XVisualInfo *visinfo;
230 XRenderPictFormat *format;
231
232 visinfo = glXGetVisualFromFBConfig(disp, configs[i]);
233 if (!visinfo) continue;
234 format = XRenderFindVisualFormat(disp, visinfo->visual);
235 if (!format) continue;
236
237 if (format->direct.alphaMask > 0)
238 {
239 config = configs[i];
240 _evas_gl_x11_vi = visinfo;
241 break;
242 }
243 XFree(visinfo);
244 }
245#else
246 int _evas_gl_x11_configuration[] =
202 { 247 {
203 GLX_DOUBLEBUFFER, 248 GLX_DOUBLEBUFFER,
204 GLX_RGBA, 249 GLX_RGBA,
205 GLX_RED_SIZE, 1, 250 GLX_RED_SIZE, 1,
206 GLX_GREEN_SIZE, 1, 251 GLX_GREEN_SIZE,1,
207 GLX_BLUE_SIZE, 1, 252 GLX_BLUE_SIZE, 1,
208 None 253 None
209 }; 254 };
210 _evas_gl_x11_vi = glXChooseVisual(disp, screen, 255 _evas_gl_x11_vi = glXChooseVisual(disp, screen,
211 _evas_gl_x11_configuration); 256 _evas_gl_x11_configuration);
212#endif 257#endif
258
259#endif
213 } 260 }
214 if (!_evas_gl_x11_vi) return NULL; 261 if (!_evas_gl_x11_vi) return NULL;
215 return _evas_gl_x11_vi->visual; 262 return _evas_gl_x11_vi->visual;