コード例 #1
0
ファイル: main.c プロジェクト: JesseEisen/tview
int 
main(int argc,char **argv)
{
	FILE *fp;
	char ch;

	enum request request;
	request = REQ_VIEW_MAIN;
	
	
	fp = fopen("config","r+");
	if(fp == NULL)
		T_ERR("cannot read the file config!\nplease checkout the file is exist\n");
	
	argvs = argv;

	load_command(fp);
	fclose(fp);
	convert_command();
	
	command_type = parser_option(argc, argv);
	if(command_type == -1)
		exit(1);
	
	g_current = 0;
	g_change = 0;
#if CURSES_MOD == 1
	Init_Screen();
	mvwaddstr(stdscr,LINES/2,COLS/2,"Loading......");
#endif 
	
#if CURSES_MOD == 1
	while(view_control(request))
	{
		 ch = wgetch(status_win);
		 request = get_request(ch);
	}
#endif

#if CURSES_MOD == 1
	getch();
#endif

#if CURSES_MOD == 1
	quit(0);
#endif 

	return 0;
}
コード例 #2
0
ファイル: hook.c プロジェクト: pengend/project
int key_hook(int keycode, t_env *e)
{
	if (keycode == 65307)
		exit(0);
	view_control(keycode, e);
	if (keycode == 65362)
	{
		e->cam.position.z += 10;
		e->cam.target.z += 10;
	}
	if (keycode == 65364)
	{
		e->cam.position.z -= 10;
		e->cam.target.z -= 10;
	}
	fresh_img(&(e->cam));
	wolf_image_to_window(e);
	return (0);
}