Is a fullscreen 8 bit framebuffer possible in X11, and if so, what am I doing wrong?
I'm trying to get a fullscreen 8 bit depth framebuffer but I can't find any visual to work with. I want 8 bit truec开发者_StackOverflow社区olor, where 3 bits are red, 3 bits are green and 2 bits are blue. I'm using XF86 to go fullscreen.
// pass
int found = XMatchVisualInfo(l_display, l_screen, 24, TrueColor, &visual);
// all of these fail
found = XMatchVisualInfo(l_display, l_screen, 8, StaticGray, &visual);
found = XMatchVisualInfo(l_display, l_screen, 8, GrayScale, &visual);
found = XMatchVisualInfo(l_display, l_screen, 8, StaticColor, &visual);
found = XMatchVisualInfo(l_display, l_screen, 8, PseudoColor, &visual);
found = XMatchVisualInfo(l_display, l_screen, 8, TrueColor, &visual);
found = XMatchVisualInfo(l_display, l_screen, 8, DirectColor, &visual);
Is this not possible or am I doing something wrong?
That's a rather ... niche display mode. It's not at all certain that your X server, or even the underlying hardware, even supports it.
It can of course be emulated, but perhaps there's no such code (again, since it's a niche mode).
I don't think merely requesting a visual will cause X to switch modes, either.
That's just MCGA or VGA in 256-colour indexed mode with a palette that matches your specification.
You shouldn't have any trouble setting that up, 256-colour was historically a popular mode.
You can try using xdpyinfo
to view the available visual id configuration.
XF86 has never had the ability to change bit depth at run time. The way X is designed I don't even think it's possible (applications adapt to the bit depth of the display at start up). You have to choose the bit depth then you start the server. And of course make sure your hardware supports some 8-bit video mode (I'd say it's not that unlikely). And make sure the X server knows about it. I'm not sure if it even works with modern X servers (I haven't tested it in a long time and I suspect few have).
精彩评论