From: Andreas Oberritter Date: Thu, 2 Oct 2008 14:02:41 +0000 (+0000) Subject: properly request a video mode with an alpha channel X-Git-Tag: 2.6.0~826 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/471b217e32f45b8ca085593f8f93735883e2be2a properly request a video mode with an alpha channel --- diff --git a/lib/gdi/fb.cpp b/lib/gdi/fb.cpp index 8e8221c3..bb6041e0 100644 --- a/lib/gdi/fb.cpp +++ b/lib/gdi/fb.cpp @@ -102,7 +102,32 @@ int fbClass::SetMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; screeninfo.bits_per_pixel=nbpp; - + + switch (nbpp) { + case 16: + // ARGB 1555 + screeninfo.transp.offset = 15; + screeninfo.transp.length = 1; + screeninfo.red.offset = 10; + screeninfo.red.length = 5; + screeninfo.green.offset = 5; + screeninfo.green.length = 5; + screeninfo.blue.offset = 0; + screeninfo.blue.length = 5; + break; + case 32: + // ARGB 8888 + screeninfo.transp.offset = 24; + screeninfo.transp.length = 8; + screeninfo.red.offset = 16; + screeninfo.red.length = 8; + screeninfo.green.offset = 8; + screeninfo.green.length = 8; + screeninfo.blue.offset = 0; + screeninfo.blue.length = 8; + break; + } + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) { // try single buffering