On Wed, Mar 09, 2005 at 09:16:08PM +0100, Vincenzo Ampolo wrote:
> Hi all.
> i'm trying to make a simple program that paints an image with ++dfb
> library. this is the code:
>
> #include <iostream>
>
> #include <unistd.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> #include <++dfb.h>
>
>
> int main()
> {
> IDirectFB dfb;
> IDirectFBImageProvider provider;
> IDirectFBSurface surface;
> DFBSurfaceDescription desc;
>
> DirectFB::Init();
>
> dfb = DirectFB::Create();
>
> provider =
> dfb.CreateImageProvider("/etc/usplash/background.jpg");
>
> provider.GetSurfaceDescription( &desc );
>
> surface = dfb.CreateSurface( desc );
>
> provider.RenderTo( surface, NULL );
>
> }
>
> I've compiled this source with:
> $ g++ -l++dfb -I /usr/include/++dfb -I /usr/include/directfb prova.cc
> then i tried to run it :
> $ sudo ./a.out
> but i get some errors:
> Nothing is showed, but the terminal is switched correctly, if i came
> back to the shell i can read:
No errors. And the program does exactly what it should. If you want to see
something on the screen you must create a primary surface
(DSCAPS_PRIMARY) and either render the image direcly to it or to
an offscreen surface and blit to the primary surface.
--
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users