当前位置: 首页>>代码示例>>C++>>正文


C++ IDirectFB::Release方法代码示例

本文整理汇总了C++中IDirectFB::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFB::Release方法的具体用法?C++ IDirectFB::Release怎么用?C++ IDirectFB::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDirectFB的用法示例。


在下文中一共展示了IDirectFB::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DirectFBInit

int
main( int argc, char *argv[] )
{
     DFBResult  ret;
     IDirectFB *dfb;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Resize: DirectFBInit() failed!\n" );
          return ret;
     }


     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Resize: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Required for keyboard access */
     dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );

     TestResize( dfb );



     /* Shutdown DirectFB. */
     dfb->Release( dfb );


     return ret;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:34,代码来源:dfbtest_resize.c

示例2: main

int
main( int argc, char *argv[] )
{
     DFBResult  ret;
     IDirectFB *dfb;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Shutdown DirectFB. */
     ret = dfb->Release( dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: IDirectFB::Release() failed!\n" );
          return ret;
     }

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:29,代码来源:dfbtest_init.c

示例3: CHECK

int
main( int argc, char** argv )
{
     IDirectFB      *dfb     = NULL; 
     ISaWMan        *saw     = NULL; 
     ISaWManManager *manager = NULL; 

     D_INFO( "SaWMan/Sample1: Initializing...\n" );

     CHECK( DirectFBInit( &argc, &argv ) );

     CHECK( DirectFBCreate( &dfb ) );

     CHECK( SaWManCreate( &saw ) );

     CHECK( saw->CreateManager( saw, &callbacks, NULL, &manager ) );

     pause();


out:
     D_INFO( "SaWMan/Sample1: Shutting down...\n" );

     if (manager)
          manager->Release( manager );

     if (saw)
          saw->Release( saw );

     if (dfb)
          dfb->Release( dfb );

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:34,代码来源:sample1.c

示例4: main

int
main( int argc, char *argv[] )
{
     DFBResult         ret;
     int               i;
     IDirectFB        *dfb;
     DFBInputDeviceID  device_id = 0;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Parse arguments. */
     for (i=1; i<argc; i++) {
          const char *arg = argv[i];

          if (strcmp( arg, "-h" ) == 0 || strcmp (arg, "--help") == 0)
               return print_usage( argv[0] );
          else if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) {
               fprintf (stderr, "dfbtest_input version %s\n", DIRECTFB_VERSION);
               return false;
          }
          else if (strcmp (arg, "-d") == 0 || strcmp (arg, "--device") == 0) {
               if (++i == argc) {
                    print_usage (argv[0]);
                    return false;
               }

               if (!parse_id( argv[i], &device_id ))
                    return false;
          }
          else
               return print_usage( argv[0] );
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: DirectFBCreate() failed!\n" );
          return ret;
     }

     Test_Sensitivity( dfb, device_id );

     /* Shutdown DirectFB. */
     ret = dfb->Release( dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: IDirectFB::Release() failed!\n" );
          return ret;
     }

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:56,代码来源:dfbtest_input.c

示例5: show_usage

int
main( int argc, char *argv[] )
{
     int                    i;
     DFBResult              ret;
     IDirectFB             *dfb;
     IDirectFBDisplayLayer *layer  = NULL;
     App                    apps[1];
     DFBDisplayLayerConfig  config;

     /* Parse arguments. */
     for (i=1; i<argc; i++) {
          if (!strcmp( argv[i], "-h" ))
               return show_usage( argv[0] );
     }

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Get primary layer. */
     ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: IDirectFB::GetDisplayLayer( PRIMARY ) failed!\n" );
          goto out;
     }

     
     layer->GetConfiguration( layer, &config );

     app_init( &apps[0], layer, 100, 50, config.width-300, config.height-150, 0 );

     while (true) {
          direct_thread_sleep( 1000000 );

          app_update( &apps[0] );
     }


out:
     /* Shutdown DirectFB. */
     dfb->Release( dfb );

     return ret;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:55,代码来源:dfbtest_window_update.c

示例6: CloseDisplay

static void CloseDisplay(vout_display_t *vd)
{
    vout_display_sys_t *sys = vd->sys;

    IDirectFBSurface *primary = sys->primary;
    if (primary)
        primary->Release(primary);

    IDirectFB *directfb = sys->directfb;
    if (directfb)
        directfb->Release(directfb);
}
开发者ID:shanewfx,项目名称:vlc-arib,代码行数:12,代码来源:directfb.c

示例7: print_usage

int
main( int argc, char *argv[] )
{
     DFBResult  ret;
     int        i;
     IDirectFB *dfb;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Blit: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Parse arguments. */
     for (i=1; i<argc; i++) {
          const char *arg = argv[i];

          if (strcmp( arg, "-h" ) == 0 || strcmp (arg, "--help") == 0)
               return print_usage( argv[0] );
          else if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) {
               fprintf (stderr, "dfbtest_blit version %s\n", DIRECTFB_VERSION);
               return false;
          }
          else
               return print_usage( argv[0] );
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Blit: DirectFBCreate() failed!\n" );
          return ret;
     }

     Test_Clipboard_Set( dfb, "text/plain", "This is a test string for clipboard" );
     Test_Clipboard_Get( dfb );

     /* Shutdown DirectFB. */
     dfb->Release( dfb );

     return ret;
}
开发者ID:lelou6666,项目名称:DirectFB-1.6.3-ab,代码行数:43,代码来源:dfbtest_clipboard.c

示例8: main

int main(int argc, char** argv) {
        
    IDirectFB *dfb = NULL;
    IDirectFBDisplayLayer *layer =  NULL;
    IDirectFBSurface *surface = NULL;
    IDirectFBVideoProvider *vp = NULL;

    CHECK(DirectFBInit (&argc, &argv));
    if (argc != 2) {
        return 1;
    }

    CHECK(DirectFBCreate(&dfb));
    /* Signals */
    signal(SIGINT, signal_handler);
    signal(SIGTERM, signal_handler);
    signal(SIGUSR1, signal_handler);
    signal(SIGUSR2, signal_handler);

    CHECK(dfb->GetDisplayLayer(dfb, 0, &layer));

    CHECK(dfb->CreateVideoProvider(dfb, argv[1], &vp));
   

    CHECK(layer->GetSurface(layer, &surface));
    CHECK(vp->PlayTo(vp, surface, NULL, flip, surface));
    while(to_exit == 0) {
        sleep(1);
    }

    CHECK(vp->Stop(vp));
    CHECK(vp->Release(vp));
    CHECK(surface->Release(surface));
    CHECK(layer->Release(layer));
    CHECK(dfb->Release(dfb));
    

    return 0;


}
开发者ID:iuridiniz,项目名称:eitv-lots,代码行数:41,代码来源:simples.c

示例9: CHECK

int
main( int argc, char** argv )
{
     IDirectFB *dfb = NULL; 
     ISaWMan   *saw = NULL; 
     pid_t      pid;

     D_INFO( "SaWMan/TestRun: Initializing...\n" );

     CHECK( DirectFBInit( &argc, &argv ) );

     CHECK( DirectFBCreate( &dfb ) );

     CHECK( SaWManCreate( &saw ) );

     CHECK( saw->Start( saw, ((argc > 1) && argv[1]) ? argv[1] : "Test Application", &pid ) );

     
     D_INFO( "SaWMan/TestRun: New process has pid %d.\n", pid );


//     sleep( 2 );
//     CHECK( saw->Stop( saw, pid ) );


out:
     D_INFO( "SaWMan/TestRun: Shutting down...\n" );

     if (saw)
          saw->Release( saw );

     if (dfb)
          dfb->Release( dfb );

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:36,代码来源:testrun.c

示例10: show_usage


//.........这里部分代码省略.........
    }

    /* Create an image provider for the image to be loaded. */
    ret = dfb->CreateImageProvider( dfb, url, &provider );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateImageProvider( '%s' ) failed!\n", url );
        goto out;
    }

    /* Get the surface description. */
    ret = provider->GetSurfaceDescription( provider, &desc );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" );
        goto out;
    }

    desc.pixelformat = DSPF_NV21;

    D_INFO( "DFBTest/Scale: Source is %dx%d using %s\n",
            desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );

    /* Create a surface for the image. */
    ret = dfb->CreateSurface( dfb, &desc, &source );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
        goto out;
    }

    ret = provider->RenderTo( provider, source, NULL );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::RenderTo() failed!\n" );
        goto out;
    }

    desc.width  = desc.width  * 3 / 4;
    desc.height = desc.height * 3 / 4;

    D_INFO( "DFBTest/Scale: Destination is %dx%d using %s\n",
            desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );

    /* Create a surface for the image. */
    ret = dfb->CreateSurface( dfb, &desc, &dest );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
        goto out;
    }

    DFBRectangle srect = {
        10, 10, 200, 200
    };

    DFBRectangle drect = {
        10, 10, 300, 300
    };

    DFBRegion clip = {
        40, 40, 199, 199
    };

    dest->Clear( dest, 0xff, 0xff, 0xff, 0xff );

    dest->SetClip( dest, &clip );
    dest->StretchBlit( dest, source, &srect, &drect );


    desc.pixelformat = DSPF_ARGB;

    D_INFO( "DFBTest/Scale: Destination2 is %dx%d using %s\n",
            desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );

    /* Create a surface for the image. */
    ret = dfb->CreateSurface( dfb, &desc, &dest2 );
    if (ret) {
        D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
        goto out;
    }

    dest2->Blit( dest2, dest, NULL, 0, 0 );

    dest2->Dump( dest2, "dfbtest_scale_nv21", NULL );


out:
    if (dest2)
        dest2->Release( dest2 );

    if (dest)
        dest->Release( dest );

    if (source)
        source->Release( source );

    if (provider)
        provider->Release( provider );

    /* Shutdown DirectFB. */
    dfb->Release( dfb );

    return ret;
}
开发者ID:lihp1603,项目名称:DirectFB,代码行数:101,代码来源:dfbtest_scale_nv21.c

示例11: main

int main( int argc, char *argv[] )
{
     IDirectFB              *dfb;
     IDirectFBDisplayLayer  *layer;

     IDirectFBSurface       *bgsurface;
     IDirectFBImageProvider *provider;

     IDirectFBWindow        *window1;
     IDirectFBWindow        *window2;
     IDirectFBSurface       *window_surface1;
     IDirectFBSurface       *window_surface2;

     IDirectFBEventBuffer   *buffer;

     DFBDisplayLayerConfig  layer_config;

#if ((DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23))
     DFBCardCapabilities    caps;
#else
     DFBGraphicsDeviceDescription caps;
#endif
     IDirectFBWindow*       upper;
     DFBWindowID            id1;

     IDirectFBFont          *font;
     int fontheight;
     int err;
     int quit = 0;


     DFBCHECK(DirectFBInit( &argc, &argv ));
     DFBCHECK(DirectFBCreate( &dfb ));

#if ((DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23))
     dfb->GetCardCapabilities( dfb, &caps );
#else
     dfb->GetDeviceDescription( dfb, &caps );
#endif

     dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );

     if (!((caps.blitting_flags & DSBLIT_BLEND_ALPHACHANNEL) &&
           (caps.blitting_flags & DSBLIT_BLEND_COLORALPHA  )))
     {
          layer_config.flags = DLCONF_BUFFERMODE;
          layer_config.buffermode = DLBM_BACKSYSTEM;

          layer->SetConfiguration( layer, &layer_config );
     }

     layer->GetConfiguration( layer, &layer_config );
     layer->EnableCursor ( layer, 1 );

     {
          DFBFontDescription desc;

          desc.flags = DFDESC_HEIGHT;
          desc.height = layer_config.width/50;

          DFBCHECK(dfb->CreateFont( dfb, PACKAGE_DATA_DIR"/grunge.ttf", &desc, &font ));
          font->GetHeight( font, &fontheight );
     }

     {
          DFBSurfaceDescription desc;

          DFBCHECK(dfb->CreateImageProvider( dfb,
                                             PACKAGE_DATA_DIR"/bg.png",
                                             &provider ));

          desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT;
          desc.width = layer_config.width;
          desc.height = layer_config.height;

          DFBCHECK(dfb->CreateSurface( dfb, &desc, &bgsurface ) );


          provider->RenderTo( provider, bgsurface, NULL );
          provider->Release( provider );

	  DFBCHECK(bgsurface->SetFont( bgsurface, font ));

          bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
          bgsurface->DrawString( bgsurface,
                                 "Move the mouse over a window to activate it.",
                                 -1, 10, 0, DSTF_LEFT | DSTF_TOP );

          bgsurface->SetColor( bgsurface, 0xFF, 0xCF, 0xFF, 0xFF );
          bgsurface->DrawString( bgsurface,
                    "You can drag them around, too, if you want.",
                                 -1, 10 , 40, DSTF_LEFT | DSTF_TOP );

          bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
	  bgsurface->DrawString( bgsurface,
                    "The one with funky stuff happening and things flying around is an evas.",
                                 -1, 10, 80, DSTF_LEFT | DSTF_TOP );



//.........这里部分代码省略.........
开发者ID:Limsik,项目名称:e17,代码行数:101,代码来源:evas_directfb_window.c

示例12: DirectFBInit

int
main( int argc, char *argv[] )
{
     DFBResult              ret;
     DFBSurfaceDescription  desc;
     IDirectFB             *dfb;
     IDirectFBSurface      *surface;
     IWater                *water;

     D_INFO( "Tests/Water: Starting up...\n" );

     /* Initialize DirectFB including command line parsing. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          DirectFBError( "DirectFBInit() failed", ret );
          return -1;
     }

     /* Parse the command line. */
     if (!parse_command_line( argc, argv ))
          return -2;

     /* Create the super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          DirectFBError( "DirectFBCreate() failed", ret );
          return -3;
     }

     /* Fill surface description, flipping primary. */
     desc.flags = DSDESC_CAPS;
     desc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;

     /* Set width or height? */
     if (m_width > 0) {
          desc.flags |= DSDESC_WIDTH;
          desc.width  = m_width;
     }
     if (m_height > 0) {
          desc.flags |= DSDESC_HEIGHT;
          desc.height = m_height;
     }

     /* Set pixel format? */
     if (m_format != DSPF_UNKNOWN) {
          desc.flags       |= DSDESC_PIXELFORMAT;
          desc.pixelformat  = m_format;
     }

     dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );

     /* Create a primary surface. */
     ret = dfb->CreateSurface( dfb, &desc, &surface );
     if (ret) {
          D_DERROR( ret, "IDirectFB::CreateSurface() failed!\n" );
          dfb->Release( dfb );
          return -4;
     }

     /* Get the extended rendering interface. */
     ret = dfb->GetInterface( dfb, "IWater", NULL, dfb, (void**) &water );
     if (ret) {
          DirectFBError( "IDirectFB::GetInterface( 'IWater' ) failed", ret );
          surface->Release( surface );
          dfb->Release( dfb );
          return -5;
     }


     D_INFO( "Tests/Water: Got render interface, running tests...\n" );

     RunTest( Test_Simple, water, surface );

     RunTest( Test_RenderElement, water, surface );

     RunTest( Test_RenderElements, water, surface );

     RunTest( Test_RenderShape, water, surface );

     RunTest( Test_RenderShapes, water, surface );


     D_INFO( "Tests/Water: Dumping surface...\n" );

     unlink( "dfbrender.pgm" );
     unlink( "dfbrender.ppm" );
     surface->Dump( surface, "dfbrender", NULL );


     D_INFO( "Tests/Water: Shutting down...\n" );

     /* Release the render interface. */
     water->Release( water );

     /* Release the surface. */
     surface->Release( surface );

     /* Release the super interface. */
     dfb->Release( dfb );

//.........这里部分代码省略.........
开发者ID:Distrotech,项目名称:DirectFB,代码行数:101,代码来源:dfbtest_water.c

示例13: GDK_DISPLAY_OBJECT

/* Main entry point for gdk in 2.6 args are parsed
 */
GdkDisplay *
gdk_display_open (const gchar *display_name)
{
  IDirectFB             *directfb;
  IDirectFBDisplayLayer *layer;
  IDirectFBInputDevice  *keyboard;
  DFBResult              ret;

  if (_gdk_display)
    {
      return GDK_DISPLAY_OBJECT (_gdk_display); /* single display only */
    }

  ret = DirectFBInit (NULL, NULL);
  if (ret != DFB_OK)
    {
      DirectFBError ("gdk_display_open: DirectFBInit", ret);
      return NULL;
    }

  ret = DirectFBCreate (&directfb);
  if (ret != DFB_OK)
    {
      DirectFBError ("gdk_display_open: DirectFBCreate", ret);
      return NULL;
    }

  _gdk_display = g_object_new (GDK_TYPE_DISPLAY_DFB, NULL);
  _gdk_display->directfb = directfb;

  ret = directfb->GetDisplayLayer (directfb, DLID_PRIMARY, &layer);
  if (ret != DFB_OK)
    {
      DirectFBError ("gdk_display_open: GetDisplayLayer", ret);
      directfb->Release (directfb);
      _gdk_display->directfb = NULL;
      return NULL;
    }


  ret = directfb->GetInputDevice (directfb, DIDID_KEYBOARD, &keyboard);
  if (ret != DFB_OK)
    {
      DirectFBError ("gdk_display_open: GetInputDevice", ret);
      directfb->Release (directfb);
      _gdk_display->directfb = NULL;
      return NULL;
    }

  _gdk_display->layer    = layer;
  _gdk_display->keyboard = keyboard;

  _gdk_directfb_keyboard_init ();

  _gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);

  _gdk_visual_init ();
  _gdk_windowing_window_init (_gdk_screen);

  gdk_screen_set_default_colormap (_gdk_screen,
                                   gdk_screen_get_system_colormap (_gdk_screen));
  _gdk_windowing_image_init ();

  _gdk_events_init ();
  _gdk_input_init ();
  _gdk_dnd_init ();

  layer->EnableCursor (layer, 1);

  g_signal_emit_by_name (gdk_display_manager_get (),
			 "display_opened", _gdk_display);

  return GDK_DISPLAY_OBJECT (_gdk_display);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:76,代码来源:gdkdisplay-directfb.c

示例14: DirectFBInit

int
main( int argc, char *argv[] )
{
     DFBResult              ret;
     IDirectFB             *dfb;
     IDirectFBDisplayLayer *layer;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Window_Surface: DirectFBInit() failed!\n" );
          return ret;
     }


     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Window_Surface: DirectFBCreate() failed!\n" );
          return ret;
     }

     dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );


     while (true) {
          DFBWindowDescription   desc;
          IDirectFBWindow       *window;
          IDirectFBSurface      *surface;

          desc.flags  = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS;
          desc.posx   = 150;
          desc.posy   = 150;
          desc.width  = 300;
          desc.height = 300;
          desc.caps   = DWCAPS_ALPHACHANNEL;
     
          ret = layer->CreateWindow( layer, &desc, &window );
          if (ret) {
               D_DERROR( ret, "DFBTest/Window_Surface: CreateWindow() failed!\n" );
               return ret;
          }
     
          window->GetSurface( window, &surface );

          D_INFO( "Created window and surface, going to release window... (in 2 seconds)\n" );
          usleep( 2000000 );

          D_INFO("Releasing window...\n");

          window->Release( window );

          D_INFO("Window released, going to release surface... (in 2 seconds)\n");
          usleep( 2000000 );

          D_INFO("Releasing surface...\n");

          surface->Release( surface );

          D_INFO("Surface released, done.\n");
          usleep( 5000000 );
     }


     /* Shutdown DirectFB. */
     dfb->Release( dfb );

     return ret;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:69,代码来源:dfbtest_window_surface.c

示例15: while

DFBResult
lite_theme_frame_load( LiteThemeFrame  *frame,
                       const char     **filenames )
{
     int       i, y;
     int       width  = 0;
     int       height = 0;
     DFBResult ret;

     D_ASSERT( frame != NULL );
     D_ASSERT( filenames != NULL );

     for (i=0; i<_LITE_THEME_FRAME_PART_NUM; i++) {
          D_ASSERT( filenames[i] != NULL );

          ret = lite_util_load_image( filenames[i],
                                      DSPF_UNKNOWN,
                                      &frame->parts[i].source,
                                      &frame->parts[i].rect.w,
                                      &frame->parts[i].rect.h,
                                      NULL );
          if (ret) {
               D_DERROR( ret, "Lite/ThemeFrame: Loading '%s' failed!\n", filenames[i] );

               while (i--)
                    frame->parts[i].source->Release( frame->parts[i].source );

               return ret;
          }

          if (width < frame->parts[i].rect.w)
               width = frame->parts[i].rect.w;

          height += frame->parts[i].rect.h;
     }


     IDirectFB             *dfb;
     IDirectFBSurface      *compact;
     DFBSurfaceDescription  desc;

     desc.flags       = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
     desc.width       = width;
     desc.height      = height;
     desc.pixelformat = DSPF_ARGB; //FIXME

     DirectFBCreate( &dfb );

     dfb->CreateSurface( dfb, &desc, &compact );

     compact->Clear( compact, 0, 0, 0, 0 );

     for (i=0, y=0; i<_LITE_THEME_FRAME_PART_NUM; i++) {
          compact->Blit( compact, frame->parts[i].source, &frame->parts[i].rect, 0, y );

          compact->AddRef( compact );

          frame->parts[i].source->Release( frame->parts[i].source );

          frame->parts[i].source = compact;

          frame->parts[i].rect.x = 0;
          frame->parts[i].rect.y = y;

          y += frame->parts[i].rect.h;
     }

     compact->ReleaseSource( compact );
     compact->Release( compact );

     dfb->Release( dfb );

     D_MAGIC_SET( frame, LiteThemeFrame );

     return DFB_OK;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:76,代码来源:theme.c


注:本文中的IDirectFB::Release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。