Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11modes.c @ 5185:073b86030262
Added the X11 framebuffer implementation. Simple! :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 04 Feb 2011 18:05:20 -0800 |
parents | be02be2ea897 |
children | 3a8a452b49f0 |
comparison
equal
deleted
inserted
replaced
5184:d2652aafafbb | 5185:073b86030262 |
---|---|
55 return 0; | 55 return 0; |
56 } | 56 } |
57 return -1; | 57 return -1; |
58 } | 58 } |
59 | 59 |
60 static Uint32 | 60 int |
61 X11_GetVisualInfoFromVisual(Display * display, Visual * visual, XVisualInfo * vinfo) | |
62 { | |
63 XVisualInfo *vi; | |
64 int nvis; | |
65 | |
66 vinfo->visualid = XVisualIDFromVisual(visual); | |
67 vi = XGetVisualInfo(display, VisualIDMask, vinfo, &nvis); | |
68 if (vi) { | |
69 *vinfo = *vi; | |
70 XFree(vi); | |
71 return 0; | |
72 } | |
73 return -1; | |
74 } | |
75 | |
76 Uint32 | |
61 X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo) | 77 X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo) |
62 { | 78 { |
63 if (vinfo->class == DirectColor || vinfo->class == TrueColor) { | 79 if (vinfo->class == DirectColor || vinfo->class == TrueColor) { |
64 int bpp; | 80 int bpp; |
65 Uint32 Rmask, Gmask, Bmask, Amask; | 81 Uint32 Rmask, Gmask, Bmask, Amask; |