On Wed, Jun 30, 2004 at 10:18:46PM +0200, Otto Wyss wrote: > I tried to set the bpp via SetVideoMode to lower values (16 and 8) to > see how my CheckDFB looks like but it seems this doesn't work. With > fbset I can reduce the bpp of the frame buffer but DirectFB allways > seems to use the 32 bpp regardless what I specify via SetVideoMode. > > This is my source code: > > DFBCHECK (DirectFBInit (NULL, NULL)); > DFBCHECK (DirectFBCreate (&dfb)); > dfb->SetVideoMode (dfb, width, height, m_var_info.bits_per_pixel); > dfb->SetCooperativeLevel (dfb, DFSCL_NORMAL); > dsc.flags = DSDESC_CAPS; > dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_FLIPPING); > DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary )); > > Can anyone say what's wrong?
Apparently the bpp parameter of SetVideoMode() doesn't do anything for DFSCL_NORMAL primary surfaces. The window pixelformat is determined by one of the following options: 1. DSDESC_PIXELFORMAT 2. directfbrc pixelformat option 3. layer pixelformat For DFSCL_FULLSCREEN / DFSCL_EXCLUSIVE primary the order goes like this: 1. DSDESC_PIXELFORMAT 2. IDirectFB::SetVideoMode() 2. directfbrc pixelformat option 3. layer pixelformat There's even more weirness if the cooperative level is changed to !DFSCL_NORMAL between the SetVideoMode() and CreateSurface() calls. In that case the pixelformat can only come from DSDESC_PIXELFORMAT or the layer's current format. Also the layer's widht/height are affected in the same way (size set by SetVideoMode() is ignored, as is the mode= directfbrc option). Quite confusing really. Maybe we should try to clean it up a bit? And one other thing I noticed is that DSDESC_WIDTH / DSDESC_HEIGHT are ignored for !DFSCL_NORMAL primary surfaces. Should we use a sub-surface in that case? -- Ville Syrj�l� [EMAIL PROTECTED] http://www.sci.fi/~syrjala/
