Exemplo n.º 1
0
static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform system) {
  int appId = get_app_id(server, config->app);
  if (appId<0) {
    fprintf(stderr, "Can't find app %s\n", config->app);
    exit(-1);
  }

  gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);

  void *context = NULL;
  #ifdef HAVE_SDL
  if (system == SDL)
    context = sdl_window;
  #endif

  LiStartConnection(server->address, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system), context, 0, server->serverMajorVersion);

  if (IS_EMBEDDED(system)) {
    evdev_start();
    loop_main();
    evdev_stop();
  }
  #ifdef HAVE_SDL
  else if (system == SDL)
    sdl_loop();
  #endif

  LiStopConnection();
}
Exemplo n.º 2
0
static void evdev_map_key(char* keyName, short* key) {
  printf("Press %s\n", keyName);
  currentKey = key;
  currentAbs = NULL;
  *key = -1;
  loop_main();

  usleep(250000);
  evdev_drain();
}
Exemplo n.º 3
0
Arquivo: main.c Projeto: prophile/dim3
int main(int argc,char *argv[])
{
	bool			app_start_ok;
	char			err_str[256];
	
		// setup paths

	if (!file_paths_setup(&setup.file_path_setup,FALSE)) {
		app_report_error("dim3 requires a data folder with project files.");
		return(0);
	}
	
		// check for required OS
		
	if (!app_check_os_support(err_str)) {
		app_report_error(err_str);
		return(0);
	}

		// check if editor is launching engine and
		// if a map needs to be auto-loaded
		
	app_check_editor_link();

		// run dim3
		
	err_str[0]=0x0;
	
	app_start_ok=app_start(err_str);
	if (app_start_ok) {

		game_loop_pause=FALSE;
		game_loop_quit=FALSE;
		
		while (!game_loop_quit) {
			if (!loop_main(err_str)) break;
		}
		
		app_end();

	}
	
		// if app couldn't start, then let user reset setup
		
	if (err_str[0]!=0x0) {
		if (app_start_ok) {
			app_report_error(err_str);
		}
		else {
			app_report_error_ask_fix_setup(err_str);
		}
	}
	
	return(0);
}
Exemplo n.º 4
0
static void evdev_map_abs(char* keyName, short* abs, bool* reverse) {
  printf("Move %s\n", keyName);
  currentKey = NULL;
  currentAbs = abs;
  currentReverse = reverse;
  *abs = -1;
  loop_main();

  usleep(250000);
  evdev_drain();
}
Exemplo n.º 5
0
static void evdev_map_abskey(char* keyName, short* key, short* abs, bool* reverse) {
  printf("Press %s\n", keyName);
  currentKey = key;
  currentAbs = abs;
  currentReverse = reverse;
  *key = -1;
  *abs = -1;
  *currentReverse = false;
  loop_main();

  usleep(250000);
  evdev_drain();
}
Exemplo n.º 6
0
int		main(int ac, char **argv, char **env)
{
    t_sh		*sh;
    static pid_t	pid;

    (void)ac;
    (void)argv;
    if ((init_sh(env, &sh)) == false || sh->env == NULL)
        return (EXIT_FAILURE);
    pid = getpid();
    my_builtinsinit(sh->env);
    return (loop_main(sh, pid));
}
Exemplo n.º 7
0
static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform system) {
    int appId = get_app_id(server, config->app);
    if (appId<0) {
        fprintf(stderr, "Can't find app %s\n", config->app);
        exit(-1);
    }

    int ret = gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);
    if (ret < 0) {
        if (ret == GS_NOT_SUPPORTED_4K)
            fprintf(stderr, "Server doesn't support 4K\n");
        else
            fprintf(stderr, "Errorcode starting app: %d\n", err);
        exit(-1);
    }

    int drFlags = 0;
    if (config->fullscreen)
        drFlags |= DISPLAY_FULLSCREEN;

    if (config->forcehw)
        drFlags |= FORCE_HARDWARE_ACCELERATION;

    printf("Stream %d x %d, %d fps, %d kbps\n", config->stream.width, config->stream.height, config->stream.fps, config->stream.bitrate);
    LiStartConnection(server->address, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system), NULL, drFlags, server->serverMajorVersion);

    if (IS_EMBEDDED(system)) {
        evdev_start();
        loop_main();
        evdev_stop();
    }
#ifdef HAVE_SDL
    else if (system == SDL)
        sdl_loop();
#endif

    LiStopConnection();
}