Quoting Carlos Ojea Castro:
> Hello!:
> 
> I boot with fb in 640x480. Later with 'fbset' I change to another
> resolution (720x576), but, if I run my user program now, screen
> resolution changes automatically back to 640x480.

DirectFB uses the first valid mode found in /etc/fb.modes or the current
one if no other is found. You can use the "mode = <width>x<height>" option
to choose another default resolution.

> Anybody knows why? I also want to change the screen resolution at
> runtime if possible. I tried "SetVideoMode" but screen resolution
> didn't change.

You might want to read the description of IDirectFB in the API reference
to know more about the 'primary surface'. If you call SetVideoMode() you
need to recreate it after releasing the old one.

Instead of using the primary surface 'API shortcut [tm]' you can do this:

- IDirectFB::GetDisplayLayer( DLID_PRIMARY )
- IDirectFBDisplayLayer::SetCooperativeLevel( DLSCL_EXCLUSIVE )
- IDirectFBDisplayLayer::SetConfiguration(...)
- IDirectFBDisplayLayer::GetSurface()

This is just one possibility that CreateSurface(DSCAPS_PRIMARY) expands to.

-- 
Best regards,
  Denis Oliver Kropp
 
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to