示例#1
0
文件: fdf.c 项目: Afxsoft/fdf
int		main (int argc, char **argv)
{
	t_mlx	*mlx;
	
	mlx = ft_mlx_init();
	ft_fdf(mlx, argv);
	printf("F**k tha police");
	argc = 0;
	printf("F**k tha police");
	mlx_key_hook(mlx->win, mlx_key_press, mlx);
	mlx_loop(mlx->mlx);
	return (0);
}
示例#2
0
void			ft_pre_w3d(t_w3d *w3d)
{
	w3d->mlx = ft_mlx_init(w3d->mlx, WIN_X, WIN_Y, "wolf3d");
	ft_load_w3d_textures(w3d, w3d->mlx, &w3d->texture);
	w3d->cam.pos.y = w3d->spawn.x + 0.5;
	w3d->cam.pos.x = w3d->spawn.y + 0.5;
	ft_wolf3d(w3d);
	mlx_hook(w3d->mlx->p_win, KeyPress, KeyPressMask, ft_wolf_move, w3d);
	mlx_hook(w3d->mlx->p_win, KeyRelease, KeyPressMask, ft_release_key, w3d);
	mlx_hook(w3d->mlx->p_win, DestroyNotify, StructureNotifyMask, &red_x, w3d);
	mlx_loop_hook(w3d->mlx->p_mlx, ft_wolf3d_loop, w3d);
	mlx_loop(w3d->mlx->p_mlx);
}
示例#3
0
文件: pre_fdf.c 项目: aperraul/Fdf
void	ft_pre_fdf(t_array *array)
{
	t_fdf	*fdf;
	t_mlx	*mlx;

	mlx = NULL;
	fdf = NULL;
	mlx = ft_mlx_init(mlx, 800, 800, "FDF");
	fdf = ft_init_fdf(mlx, array);
	ft_fdf(fdf);
	mlx_hook(mlx->p_win, KeyPress, KeyPressMask, ft_fdf_event, fdf);
	mlx_loop(fdf->mlx);
}
示例#4
0
文件: wolf.c 项目: tcarmet/wolf3D
int		main(void)
{
	t_all	all;
	int		i;

	i = 0;
	if (!ft_parse_map(&all))
		ft_error(MAP_ERROR);
	ft_printmap(&all);
	ft_mlx_init(&all.fn);
	ft_all_init(&all);
	mlx_hook(all.fn.win, KEYPRESS, KEYPRESSMASK, &ft_set_keyhook, &all);
	mlx_hook(all.fn.win, KEYRELEASE, KEYRELEASEMASK,\
			&ft_unset_keyhook, &all);
	mlx_loop_hook(all.fn.mlx, ft_loop, &all);
	mlx_loop(all.fn.mlx);
	return (0);
}
示例#5
0
int		ft_dev_mode(char **argv)
{
	t_map	*map;
	t_mlx	*mlx;

	map = NULL;
	mlx = NULL;
	if (!ft_check_for_level(argv[1]))
	{
		ft_parse_error_handling(002, argv[1]);
		return (-1);
	}
	mlx = ft_mlx_init(mlx);
	map = ft_load_map(argv[1], NULL, NULL, NULL);
	mlx->del_tmp = map;
	mlx = ft_launch_level(mlx, map);
	map = ft_dump_map(map);
	return (0);
}
示例#6
0
int		ft_story_mode(void)
{
	t_map	*map;
	t_mlx	*mlx;

	map = NULL;
	mlx = NULL;
	if (!ft_verify_cache_integrity())
	{
		ft_parse_error_handling(002, "StoryLevels");
		return (-1);
	}
	mlx = ft_mlx_init(mlx);
	map = ft_load_map("lvl/1.lvl", NULL, NULL, NULL);
	mlx->del_tmp = map;
	mlx = ft_launch_level(mlx, map);
	map = ft_dump_map(map);
	mlx = ft_mlx_shutdown(mlx);
	return (0);
}