src/video/x11/SDL_x11modes.c
changeset 5182 073b86030262
parent 5149 be02be2ea897
child 5243 3a8a452b49f0
--- a/src/video/x11/SDL_x11modes.c	Fri Feb 04 16:55:50 2011 -0800
+++ b/src/video/x11/SDL_x11modes.c	Fri Feb 04 18:05:20 2011 -0800
@@ -57,7 +57,23 @@
     return -1;
 }
 
-static Uint32
+int
+X11_GetVisualInfoFromVisual(Display * display, Visual * visual, XVisualInfo * vinfo)
+{
+    XVisualInfo *vi;
+    int nvis;
+
+    vinfo->visualid = XVisualIDFromVisual(visual);
+    vi = XGetVisualInfo(display, VisualIDMask, vinfo, &nvis);
+    if (vi) {
+        *vinfo = *vi;
+        XFree(vi);
+        return 0;
+    }
+    return -1;
+}
+
+Uint32
 X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
 {
     if (vinfo->class == DirectColor || vinfo->class == TrueColor) {