6 static int glXRating(Display *display, XVisualInfo *v)
10 RrDebug("evaluating visual %d\n", (int)v->visualid);
11 glXGetConfig(display, v, GLX_BUFFER_SIZE, &val);
12 RrDebug("buffer size %d\n", val);
26 glXGetConfig(display, v, GLX_LEVEL, &val);
27 RrDebug("level %d\n", val);
31 glXGetConfig(display, v, GLX_DEPTH_SIZE, &val);
32 RrDebug("depth size %d\n", val);
47 glXGetConfig(display, v, GLX_DOUBLEBUFFER, &val);
48 RrDebug("double buffer %d\n", val);
54 struct RrInstance *RrInit(Display *display,
57 int count, i = 0, val, best = 0, rate = 0, temp;
58 XVisualInfo vimatch, *vilist;
59 struct RrInstance *ret = NULL;
61 vimatch.screen = screen;
62 vimatch.class = TrueColor;
63 vilist = XGetVisualInfo(display, VisualScreenMask | VisualClassMask,
67 RrDebug("looking for a GL visual in %d visuals\n", count);
68 for (i = 0; i < count; i++) {
69 glXGetConfig(display, &vilist[i], GLX_USE_GL, &val);
71 temp = glXRating(display, &vilist[i]);
80 RrDebug("picked visual %d with rating %d\n", best, rate);
81 ret = RrInstanceNew(display, screen, vilist[best]);
89 void RrDestroy(struct RrInstance *inst)