Well,

Now that the fade effect is working, I'm trying to get the other stuff
that used to be painted in the same surface to show. For some reason,
the image from the image provider paints on top of the
primary_surface, and the progressbar and textbox (overlay) seem to be
painting in yet another surface (offscreen?).

When the fade effect goes out, you can see a glimpse of the
progressbar and textbox flashing in the screen.

How do I make those two buffers sync? There seem to be an offscreen
buffer, I just don't know how to tap into it.

On 5/30/06, Luis <[EMAIL PROTECTED]> wrote:
> Hello Claudio,
>
> Thanks a MILLION for your help. I follow your simple instructions and
> I got the effect done right the way.
>
> The only thing is that I lost the stuff that used to draw on top of
> the surface. I can see that it's just being masked by the window,
> because during fadeout, it shows. As if it was simply in the layer
> below... I gave up for the day.
>
> Thanks again for your help.
>
> (if anybody wants to see the solution to this problem, just point your
> browsers to http://svn.debian.org and click on Splashy. You will get
> the source from there).
>
> On 5/29/06, Claudio Ciccani <[EMAIL PROTECTED]> wrote:
> > Luis wrote:
> > > Hello,
> > >
> > > I sent this question to this mailing list before, but never got an
> > > answer. Can somebody please point me in the right direction? I have
> > > been researching this topic for a long time in the usual venues but I
> > > couldn't get this to work (without some serious, hackish, misues of
> > > blit()). I'd like to have a fade effect that works smoothly. I'm using
> > > the XDirectFB technique of setting the opacity level of the top-most
> > > window. This doesn't seem to be working.
> >
> > See below.
> >
> > > When i do my image provider routine, i call video_fade_in() like:
> > >
> > > void
> > > video_start_splash (splashy_video_t * video, const gchar * background)
> > > {
> > >         DFBSurfaceDescription desc;
> > >         /* DFBDisplayLayerDescription ldesc; */
> > >         DFBWindowDescription win_desc;
> > >
> > >         /*
> > >          * initializing Directfb
> > >          */
> > >         /*
> > >          * - no-debug           := suppresses debug messages
> > >          * - quiet              := suppresses all messages (but debug)
> > >          * - graphics-vt        := puts directfb vt in graphics mode
> > >          * - no-cursor          := disallow showing a cursor
> > >          */
> > >
> > >         _current_background = background;
> > >
> > >         DFBCHECK (DirectFBInit (NULL, NULL));
> > >         DirectFBSetOption ("quiet", NULL);
> > >         DirectFBSetOption ("no-debug", NULL);
> > >         DirectFBSetOption ("graphics-vt", NULL);
> > >         DirectFBSetOption ("no-cursor", NULL);
> > >         /*
> > >          * in window-mode our dfb seems to prefer to go to the top layer
> > >          * which masks the progress bar! commented out 
> > > (libdirectfb-0.9.22)
> > >          * This also makes the progressbar draw slower!
> > >          */
> > >         /*
> > >          * DirectFBSetOption( "force-windowed", NULL);
> > >          */
> > >
> > >         DFBCHECK (DirectFBCreate (&video->dfb));
> > >
> > >         video->mode = g_new0 (splashy_videomode_t, 1);
> > >         /*
> > >          * set our expectation to a very big number
> > >          */
> > >         preinit (NULL);
> > >         video->mode->out_height = fb_vinfo.yres;
> > >         video->mode->out_width = fb_vinfo.xres;
> > >
> > >         DEBUG_PRINT ("Setting min Width (x) resolution to %d",
> > >                         video->mode->out_width);
> > >         DEBUG_PRINT ("Setting min Height (y) resolution to %d",
> > >                         video->mode->out_height);
> > >
> > >         video_set_mode (video);
> >
> > If you are calling IDirectFB::SetCooperativeLevel(DFSCL_FULLSCREEN) +
> > IDirectFB::SetVideoMode() from video_set_mode(), it won't work.
> > Use IDirectFBDisplayLayer::SetCooperativeLevel(DLSCL_EXCLUSIVE) +
> > IDirectFBDisplayLayer::SetConfiguration() instead.
> >
> > >
> > >         DFBCHECK (video->dfb->CreateImageProvider (video->dfb, background,
> > >                                 &video->provider));
> > >         DFBCHECK (video->provider->GetSurfaceDescription (video->provider,
> > >                                 &desc));
> > >         /*
> > >          * flags to set the default surface as main surface
> > >          */
> > >         desc.flags = DSDESC_CAPS;
> > >         desc.caps = DSCAPS_PRIMARY;
> > >
> > >         /*
> > >          * store our primary layer as this will be use for setting the 
> > > opacity
> > >          * levels later
> > >          */
> > >         DFBCHECK (video->dfb->GetDisplayLayer(video->dfb,
> > >                                 DLID_PRIMARY,&video->primary_layer));
> > >
> > >         /* DFBCHECK
> > > (video->primary_layer->GetDescription(video->primary_layer,&ldesc));
> > > */
> > >
> > >         /* this only applies for directfb 0.9.12 and up */
> > >         /* ldesc.caps = DLCAPS_SURFACE | DLCAPS_ALPHACHANNEL | 
> > > DLCAPS_OPACITY;*/
> > >
> > >         win_desc.flags = ( DWDESC_POSX | DWDESC_POSY |
> > >                      DWDESC_WIDTH | DWDESC_HEIGHT );
> > >         win_desc.posx = 0;
> > >         win_desc.posy = 0;
> > >         win_desc.width = video->mode->out_width;
> > >         win_desc.height = video->mode->out_height;
> > >
> > >         DFBCHECK (video->primary_layer->CreateWindow 
> > > (video->primary_layer,
> > >                 &win_desc, &video->primary_window));
> > >         DFBCHECK (video->primary_window->GetSurface(video->primary_window,
> > >                 &video->primary_surface));
> >
> > Remove the following line: you are overwriting the window's surface.
> > >         DFBCHECK (video->dfb->CreateSurface (video->dfb, &desc,
> > >           &video->primary_surface));
> > >
> > >         /*
> > >          * allow surface to have alpha channels
> > >          * fade in effect won't work with alpha channels in window
> > >          * because we use Opacity levels
> > >          */
> > >         /*
> > >         DFBCHECK (video->primary_surface->SetBlittingFlags
> > >                         (video->primary_surface, 
> > > DSBLIT_BLEND_ALPHACHANNEL));*/
> >
> > To have an alpha channeled window, add DWCAPS_ALPHACHANNEL to the window
> > capabilities flags.
> >
> > >
> > >         /*
> > >          * it writes on the framebuffer the background image
> > >          */
> > >         video->provider->RenderTo (video->provider, 
> > > video->primary_surface,
> > >                         NULL);
> > >
> > >         /*
> > >          * fade in effect
> > >          */
> > >
> > >         if (g_ascii_strncasecmp (xml_parser_get_text
> > > ("/splashy/fadein"),"yes",3) == 0 )
> > >                 video_fade_in (video);
> > >
> > > }
> > >
> >
> >
> > --
> > Regards,
> >       Claudio Ciccani
> >
> > [EMAIL PROTECTED]
> > http://directfb.org
> > http://sf.net/projects/php-directfb
> >
>
>
> --
> ----)(-----
> Luis Mondesi
> *NIX Guru
>
> Kiskeyix.org
>
> "We think basically you watch television to turn your brain off, and
> you work on your computer when you want to turn your brain on" --
> Steve Jobs in an interview for MacWorld Magazine 2004-Feb
>
> No .doc: http://www.gnu.org/philosophy/no-word-attachments.es.html
>


-- 
----)(-----
Luis Mondesi
*NIX Guru

Kiskeyix.org

"We think basically you watch television to turn your brain off, and
you work on your computer when you want to turn your brain on" --
Steve Jobs in an interview for MacWorld Magazine 2004-Feb

No .doc: http://www.gnu.org/philosophy/no-word-attachments.es.html

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

Reply via email to