I took the following code from a tutorial on directfb web site.
It compiles and links but does not work

I noticed that it resets the monitor not the tv connected to my tvout.
When I "modprobe fbcon" then I see the tv briefly clear.

So I conclude that a console must be bound to the framebuffer for this
directfb to work.

Is this assumption correct?

Is there any library that will allow me to put text on a framebuffer
that is not bound to the console?

This is the error message
------------------------------
pvr include # ./prang

       ---------------------- DirectFB v0.9.25 ---------------------
             (c) 2000-2002  convergence integrated media GmbH
             (c) 2002-2004  convergence GmbH
        -----------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-01-13 00:42)
(*) Direct/Memcpy: Using MMXEXT optimized memcpy()
(*) Direct/Thread: Running 'VT Switcher' (CRITICAL, 12282)...
(*) Direct/Thread: Running 'Keyboard Input' (INPUT, 12283)...
 (!!!)  *** UNIMPLEMENTED [fusion_reactor_set_lock] *** [reactor.c:853]
(*) DirectFB/Input: Keyboard 0.9 (convergence integrated media GmbH)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.6 (convergence
integrated media
 GmbH)
(*) DirectFB/Core/WM: Default 0.2 (Convergence GmbH)
demo1.c <35>:
        (#) DirectFBError [dfb->CreateFont (dfb,
"/usr/share/fonts/ttf-bitstream
-vera/Vera.ttf", &font_dsc, &font)]: No (suitable) implementation found!
 (!!!)  *** WARNING [Application exited without deinitialization of
DirectFB!] *
** [core.c:741 in dfb_core_deinit_check()]
----------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <directfb.h>
static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static int screen_width  = 0;
static int screen_height = 0;
#define DFBCHECK(x...)                                         \
  {                                                            \
      DFBResult err = x;                                         \
                                                                 \
     if (err != DFB_OK)                                         \
       {                                                        \
           fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
           DirectFBErrorFatal( #x, err );                         \
         }                                                        \
   }
static IDirectFBFont *font = NULL;
static char *text = "DirectFB rulez!";
int main (int argc, char **argv) {
        int i, width;
        DFBFontDescription font_dsc;
        DFBSurfaceDescription dsc;
        DFBCHECK (DirectFBInit (&argc, &argv));
        DFBCHECK (DirectFBCreate (&dfb));
        DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
        dsc.flags = DSDESC_CAPS;
        dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
        DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary ));
        DFBCHECK (primary->GetSize (primary, &screen_width,
&screen_height));
        font_dsc.flags = DFDESC_HEIGHT;
        font_dsc.height = 48;
        DFBCHECK (dfb->CreateFont (dfb,
"/usr/share/fonts/ttf-bitstream-vera/Vera.ttf", &font_dsc, &font));
        DFBCHECK (primary->SetFont (primary, font));
        DFBCHECK (font->GetStringWidth (font, text, -1, &width));
        for (i = screen_width; i > -width; i--) {
                DFBCHECK (primary->SetColor (primary, 0x0, 0x0, 0x0,
0xFF));
                DFBCHECK (primary->FillRectangle (primary, 0, 0,
screen_width, screen_height));
                DFBCHECK (primary->SetColor (primary, 0x80, 0x0, 0x20,
0xFF));
                DFBCHECK (primary->DrawString (primary, text, -1, i,
screen_height / 2, DSTF_LEFT));
                DFBCHECK (primary->Flip (primary, NULL,
DSFLIP_WAITFORSYNC));
        }
        font->Release (font);
        primary->Release (primary);
        dfb->Release (dfb);
        return 23;
}


_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to