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


C++ DirectFBInit函数代码示例

本文整理汇总了C++中DirectFBInit函数的典型用法代码示例。如果您正苦于以下问题:C++ DirectFBInit函数的具体用法?C++ DirectFBInit怎么用?C++ DirectFBInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: dfb_init

void
dfb_init(int argc, char *argv[])
{
     DFBCHECK(DirectFBInit( &argc, &argv ));

     /* quiet option is no longer supported in DFB 1.2 */
     /* DFBCHECK(DirectFBSetOption ("quiet", "")); */

     /* create the super interface */
     DFBCHECK(DirectFBCreate( &dfb ));

     dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);

     DFBCHECK(dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer ));
     layer->GetConfiguration (layer, &layer_config);

     /* get the primary surface, i.e. the surface of the primary layer we have
	exclusive access to */
     memset( &dsc, 0, sizeof(DFBSurfaceDescription) );     
     dsc.flags = 
	DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
     dsc.width = layer_config.width;
     dsc.height = layer_config.height;

     dsc.caps = DSCAPS_PRIMARY | DSCAPS_SYSTEMONLY /*| DSCAPS_FLIPPING */;
     /* FIXME */
     dsc.pixelformat = DSPF_RGB16;
     DFBCHECK(dfb->CreateSurface(dfb, &dsc, &primary ));
     primary->GetSize (primary, &opt.client.width, &opt.client.height);

     DFBCHECK(dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ));
     DFBCHECK(dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ));
     DFBCHECK (dfb->CreateInputEventBuffer (dfb, DICAPS_ALL, DFB_TRUE, &input_buffer));
}
开发者ID:andryblack,项目名称:ketlaer,代码行数:34,代码来源:dfb.c

示例2: dfb_init

int dfb_init(int argc, char** argv, unsigned short width, unsigned short height) {

	DFBCHECK(DirectFBInit (&argc, &argv));
	DFBCHECK(DirectFBCreate (&DFBC_INTERFACE_));
	DFBCHECK(DFBC_INTERFACE_->SetCooperativeLevel (DFBC_INTERFACE_, DFSCL_FULLSCREEN));

	DFBC_ESCAPECTRL_ = DIKS_UP;
	DFBC_SURFACE_DESC_.flags = DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT;
	DFBC_SURFACE_DESC_.height = height;
	DFBC_SURFACE_DESC_.width = width;
	DFBC_SURFACE_DESC_.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;

	DFBCHECK(DFBC_INTERFACE_->CreateSurface(DFBC_INTERFACE_, &DFBC_SURFACE_DESC_, &DFBC_SURFACE_));
	DFBCHECK(DFBC_SURFACE_->GetSize (DFBC_SURFACE_, &DFB_SCREENW, &DFB_SCREENH));

	//Hide the cursor
	DFBC_INTERFACE_->GetDisplayLayer(DFBC_INTERFACE_, 0x00, &DFBC_LAYER_);
	DFBC_LAYER_->SetCooperativeLevel(DFBC_LAYER_, DLSCL_ADMINISTRATIVE);
	DFBC_LAYER_->SetCursorOpacity(DFBC_LAYER_, 0);

	/*
	 * TO-DO
	 * Return code
	 */
	return 0;
}
开发者ID:iccthedral,项目名称:directfb-gui,代码行数:26,代码来源:dfb.c

示例3: main

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: directfb_init

int directfb_init(int argc, char *argv[])
{
    DFBSurfaceDescription dsc;
    DFBFontDescription font_dsc;

    DFBCHECK (DirectFBInit (&argc, &argv));
    DFBCHECK (DirectFBCreate (&dfb));
    DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_NORMAL));
    dsc.flags = DSDESC_CAPS | DSDESC_PIXELFORMAT;
    dsc.caps  = DSCAPS_PRIMARY | DSCAPS_INTERLACED | DSCAPS_FLIPPING; 
    dsc.pixelformat = DSPF_YUY2;
    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, "Vera.ttf", &font_dsc, &font));
    DFBCHECK (primary->SetFont(primary, font));

    /* Blank screen */
    DFBCHECK (primary->SetColor (primary, 0x0, 0x0, 0x0, 0xFF));
    DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width, screen_height));
    /* Print text */
    DFBCHECK (primary->SetColor (primary, 0x80, 0x0, 0x20, 0xFF));
    DFBCHECK (primary->DrawString (primary, title, -1, 10, screen_height-100, DSTF_LEFT));
    /* Flip the front and back buffer, but wait for the vertical retrace to avoid tearing. */
    DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC));

    font->Release (font);
    return 23;
}
开发者ID:Risca,项目名称:Kangaroo-Mysterious,代码行数:31,代码来源:directfb_inc.c

示例5: v4pDisplayInit

// Prepare things before the very first graphic rendering
Boolean v4pDisplayInit(int quality, Boolean fullscreen) {
   int rc = success;
   

   /* Get screen size from display structure macro */
   int wantedWidth = defaultScreenWidth * 2 / (3 - quality);
   int wantedHeight = defaultScreenHeight * 2 / (3 - quality);
   int argc = 0;
   char *argv[] = {"directFB"};
   DirectFBInit(&argc, &argv);
   DirectFBCreate(&dfb);
   if (fullscreen) {
	   dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);
	}

   DFBSurfaceDescription dsc;
   /* dsc.flags = DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT; */
   dsc.flags = DSDESC_CAPS;
   dsc.caps  = DSCAPS_PRIMARY /* | DSCAPS_FLIPPING */;
   dsc.width = wantedWidth;
   dsc.height = wantedHeight;
   
   dfb->CreateSurface( dfb, &dsc, &v4pDisplayDefaultContextS.surface);

   v4pDisplayDefaultContextS.surface->GetSize (
                     v4pDisplayDefaultContextS.surface,
                     &v4pDisplayDefaultContextS.width,
                     &v4pDisplayDefaultContextS.height); 

   v4pDisplaySetContext(v4pDisplayDefaultContext);
   
   return rc;
}
开发者ID:miellaby,项目名称:v4p,代码行数:34,代码来源:v4pi.c

示例6: putenv

DirectFBFrame *createWindowFrame(const char *inTitle, int inWidth, int inHeight, unsigned int inFlags)
{
   putenv ((char*)"DFBARGS=system=x11");
   
   DirectFBInit(0, NULL);
   DirectFBCreate(&dfb);
   
   bool fullscreen = (inFlags & wfFullScreen) != 0;
   if (fullscreen)
   {
      dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);
   }
   else
   {
      //dfb->SetCooperativeLevel(dfb, DFSCL_NORMAL);
      dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);
   }
   
   dfb->SetVideoMode(dfb, inWidth, inHeight, 32);
   dfb->CreateInputEventBuffer(dfb, (DFBInputDeviceCapabilities)(DICAPS_KEYS | DICAPS_BUTTONS), DFB_FALSE, &sgEventBuffer);
   
   DFBSurfaceDescription dsc;
   dsc.flags = DSDESC_CAPS;
   dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_FLIPPING);
   dsc.width = inWidth;
   dsc.height = inHeight;
   
   IDirectFBSurface *surface = NULL;
   dfb->CreateSurface(dfb, &dsc, &surface);
   
   return new DirectFBFrame(surface, inWidth, inHeight);
}
开发者ID:Gemioli,项目名称:lime,代码行数:32,代码来源:DirectFBStage.cpp

示例7: 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

示例8: main

int
main( int argc, char *argv[] )
{
     DFBResult       ret;
     int             i;
     VoodooPlayInfo  info;
     VoodooPlayer   *player = NULL;

     /* 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;

     if (m_name) {
          direct_snputs( info.name, m_name, VOODOO_PLAYER_NAME_LENGTH );
     }

     ret = voodoo_player_create( m_name ? &info : NULL, &player );
     if (ret) {
          D_ERROR( "Voodoo/Play: Could not create the player (%s)!\n", DirectFBErrorString(ret) );
          goto out;
     }


     do {
          voodoo_player_broadcast( player );

          direct_thread_sleep( 100000 );

          voodoo_player_enumerate( player, player_callback, NULL );

          if (m_lookup) {
               for (i=1; i<argc; i++) {
                    char buf[100];

                    if (voodoo_player_lookup( player, (const u8 *)argv[i], NULL, buf, sizeof(buf) )) {
                         D_ERROR( "Voodoo/Play: No '%s' found!\n", argv[i] );
                         continue;
                    }

                    D_INFO( "Voodoo/Play: Found '%s' with address %s\n", argv[i], buf );
               }
          }

          direct_thread_sleep( 2000000 );
     } while (m_run);


out:
     if (player)
          voodoo_player_destroy( player );

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

示例9: directfb_init

g_error directfb_init(void) {
   DFBResult err;
   DFBSurfaceDescription dsc;
   err = DirectFBInit(NULL, NULL); /* no argc/argv */
   dfb_errcheck_die;
   err = DirectFBCreate (&directfb);
   dfb_errcheck_die;
   //directfb->SetCooperativeLevel (directfb, DFSCL_FULLSCREEN);
   dsc.flags = DSDESC_CAPS;
   dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
   err = directfb->CreateSurface(directfb, &dsc, &primary);
   dfb_errcheck_die;
   err = primary->GetSize (primary, &vid->xres, &vid->yres);
   dfb_errcheck_die;
   vid->display = NULL;
   // FIXME
   if (!vid->bpp) vid->bpp = 32;

#ifdef DRIVER_DIRECTFBINPUT
   /* Load a main input driver */
   return load_inlib(&directfbinput_regfunc,&inlib_main);
#else
   return success;
#endif
}
开发者ID:UIKit0,项目名称:picogui,代码行数:25,代码来源:directfb.c

示例10: testing_multicore

int testing_multicore() {
    IDirectFB *dfb = NULL;
    IDirectFBSurface *surface = NULL;
    DFBSurfaceDescription dsc;

    pid_t n_pid = fork();

    if (n_pid) {
        sleep(1);
    }

    DFBCHECK(DirectFBInit(NULL, NULL));
    DFBCHECK(DirectFBCreate(&dfb));
    push_release(dfb, dfb->Release);

    DFBCHECK(dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
    dsc.flags = DSDESC_CAPS;
    dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
    DFBCHECK (dfb->CreateSurface( dfb, &dsc, &surface ));
    push_release(surface, surface->Release);

    if (!n_pid) {
        sleep(1);
    }
    sleep(2);

    //DFBCHECK(surface->Release(surface));
    //DFBCHECK(dfb->Release(dfb));
    release_all();

    if (n_pid) {
        wait(NULL);
    }
    return 0;
}
开发者ID:iuridiniz,项目名称:eitv-lots,代码行数:35,代码来源:main.c

示例11: main

int main(int, char **)
{
    DFBResult result = DFB_OK;
    result = DirectFBInit(0, 0);

    return (result == DFB_OK);
}
开发者ID:librelab,项目名称:qtmoko-test,代码行数:7,代码来源:directfb.cpp

示例12: get_display_layer_window

int get_display_layer_window() {
    IDirectFB *dfb = NULL;
    IDirectFBDisplayLayer   *layer   = NULL;
    IDirectFBWindow         *window  = NULL;

    DFBWindowDescription desc;


    DFBCHECK(DirectFBInit(NULL, NULL));

    DFBCHECK(DirectFBCreate(&dfb));
    push_release(dfb,dfb->Release);
    DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
    push_release(layer, layer->Release);

    desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY;

    desc.posx = desc.posy = desc.width = desc.height = 20;
    
    DFBCHECK(layer->CreateWindow(layer, &desc, &window));
    push_release(window, window->Release);

    /* check window */

    release_all();
    return 0;

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

示例13: main

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

示例14: DFBCHECK

/** Opens application window and return pointer to offscreen buffer for  */
char *directfbapp_open_window() {

    DFBWindowDescription wdesc;
    DFBDisplayLayerConfig lconfig;
    static char *argv_array[] = {
        "CVM",
        "--dfb:system=FBDev"
            ",force-windowed"   /* use windows instead of surfaces */
            ",no-vt-switch"     /* do not switch between Linux' VT */
            ",no-cursor"        /* do not use pointer */
            // ",no-deinit-check" /* do not check for deinit */
        ,NULL
    };
    int argc = sizeof argv_array / sizeof argv_array[0] - 1;
    char **argv = argv_array;
    IDirectFBDisplayLayer *dlayer;
    char *dst;
    int pitch;
    unsigned int win_id;
    int win_x, win_y;

    DFBCHECK(DirectFBInit(&argc, &argv));
    DFBCHECK(DirectFBCreate(&dfb));
    DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_NORMAL));

    DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &dlayer));
    DFBCHECK(dlayer->GetConfiguration(dlayer, &lconfig));
    wdesc.caps = DWCAPS_DOUBLEBUFFER;
    wdesc.surface_caps = DSCAPS_DOUBLE;
    wdesc.pixelformat = DSPF_RGB16;
    wdesc.width = CHAM_WIDTH;
    wdesc.height = CHAM_HEIGHT;
    wdesc.flags = DWDESC_CAPS | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT |
        DWDESC_SURFACE_CAPS;
    DFBCHECK(dlayer->CreateWindow(dlayer, &wdesc, &window));
    releaseInterface(dlayer);
    if ((lconfig.flags & (DLCONF_WIDTH | DLCONF_HEIGHT)) == (DLCONF_WIDTH | DLCONF_HEIGHT)) {
        DFBCHECK(window->GetID(window, &win_id));
        set_win_position(win_id, lconfig.width, lconfig.height, win_x, win_y);
        DFBCHECK(window->MoveTo(window, win_x, win_y));
    }
    DFBCHECK(window->RaiseToTop(window));
    DFBCHECK(window->SetOpacity(window, 0xff));
    DFBCHECK(window->RequestFocus(window));
    DFBCHECK(window->GetSurface(window, &screen));
    DFBCHECK(screen->GetSize(screen, &screen_width, &screen_height));
    DFBCHECK(screen->Lock(screen, DSLF_WRITE, (void**)(void*)&dst, &pitch));
    if (pitch != (int)sizeof(gxj_pixel_type) * screen_width) {
        REPORT_ERROR(LC_LOWUI,
            "Invalid pixel format: Supports only 16-bit, 5:6:5 display");
        goto dfb_err;
    }
    return dst;

dfb_err:;
    directfbapp_finalize();
    exit(1); /* TODO: exit from Java */
    /* return NULL; */
}
开发者ID:jiangxilong,项目名称:yari,代码行数:60,代码来源:directfbapp_export.c

示例15: main

int main(int argc, char* argv[])
{
	int status;
	pthread_t thread;
	freerdp* instance;
	dfContext* context;
	rdpChannels* channels;
	struct thread_data* data;

	setlocale(LC_ALL, "");

	freerdp_channels_global_init();

	g_sem = CreateSemaphore(NULL, 0, 1, NULL);

	instance = freerdp_new();
	instance->PreConnect = df_pre_connect;
	instance->PostConnect = df_post_connect;
	instance->VerifyCertificate = df_verify_certificate;
	instance->ReceiveChannelData = df_receive_channel_data;

	instance->ContextSize = sizeof(dfContext);
	instance->ContextNew = df_context_new;
	instance->ContextFree = df_context_free;
	freerdp_context_new(instance);

	context = (dfContext*) instance->context;
	channels = instance->context->channels;

	DirectFBInit(&argc, &argv);

	instance->context->argc = argc;
	instance->context->argv = argv;

	status = freerdp_client_parse_command_line_arguments(argc, argv, instance->settings);

	if (status < 0)
		exit(0);

	freerdp_client_load_addins(instance->context->channels, instance->settings);

	data = (struct thread_data*) malloc(sizeof(struct thread_data));
	ZeroMemory(data, sizeof(sizeof(struct thread_data)));

	data->instance = instance;

	g_thread_count++;
	pthread_create(&thread, 0, thread_func, data);

	while (g_thread_count > 0)
	{
		WaitForSingleObject(g_sem, INFINITE);
	}

	freerdp_channels_global_uninit();

	return 0;
}
开发者ID:ADILOFASKI,项目名称:FreeRDP,代码行数:58,代码来源:dfreerdp.c


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