Esempio n. 1
0
void c_resolve_test_fixture::setup()
{
    g_scene.reset(new c_hbao_scene_component());
    g_resolver.reset(new c_hbao_resolve_component());

    setup_dxut_callbacks(on_device_create, 
        on_device_destroy,
        on_swap_chain_resize,
        on_swap_chain_release,
        on_frame_move,
        on_frame_render,
        msg_proc); 
    
    init_dxut(L"Resolve Test", true, 1024, 768);

    enter_main_loop();
}
Esempio n. 2
0
/// <summary>Our raspicomm daemon specific work gets done.</summary>
void do_work(void)
{
  /* setup the syslog for logging */
  init_syslog();

  /* read the settings from the settings file */
  Settings settings; int ret;
  if ((ret = load_settings(&settings)) < 0)
  {
    //syslog(LOG_ERR, "loading settings failed (%i)", ret); 
    exit(EXIT_FAILURE);
  }
    
  if (settings.log)
  {
    syslog(LOG_INFO, "starting...");

    syslog(LOG_INFO, "using %s: port '%i' and pidfile '%s' and log=%i", 
      ret == 0 ? "default configuration" : "configurationfile",
      settings.port, 
      settings.pidfile,
      settings.log);
  }  

  /* write the pidfile */
  if ( write_pidfile(settings.pidfile) != 0)
    if (settings.log)
      syslog(LOG_ERR, "writing PIDFILE '%s' failed", settings.pidfile);

  /* use the settings to initialize the raspicomm */
  if (daemon_init_raspicomm(&settings) != SUCCESS)
    exit(EXIT_FAILURE);

  /* init the pipe */
  if (init_pipe() != 0)
    if (settings.log)
      syslog(LOG_ERR, "init_pipe failed");

  /* block and work */
  enter_main_loop(&settings);
  
  /* tear down raspicomm */
  daemon_shutdown();

}