Beispiel #1
0
int		resolution(t_letubbies po)
{
	t_mlx	list;

	list = init_mlx(po);
	list.lp = put_gap_lpoint(list);
	ft_try(list);
	mlx_hook(list.win, 2, 1, key_hook, &list);
	mlx_mouse_hook(list.win, mouse_hook, &list);
	mlx_put_image_to_window(list.mlx, list.win, list.link,
			list.pos_x_image, list.pos_y_image);
	mlx_loop(list.mlx);
	return (0);
}
Beispiel #2
0
static void			launch_fractol(int type)
{
	t_env			e;

	e.type = type;
	init_mlx(&(e.mlx));
	if (type == TYPE_JULIA)
		init_julia(&(e.info), &(e.data));
	else if (type == TYPE_MANDELBROT)
		init_mandelbrot(&(e.info), &(e.data));
	else if (type == TYPE_BUDDHABROT)
		init_buddhabrot(&(e.info), &(e.data));
	mlx_expose_hook(e.mlx.win, expose_hook, &e);
	mlx_loop(e.mlx.mlx);
}
Beispiel #3
0
t_data			*init(void)
{
	t_data		*d;

	if(!(d = tt_malloc(sizeof(t_data))))
		exit(tt_pl("Failed to alloc data"));
	d->r.o = VEC3(0, 0, 0);
	tt_pl("Init mlx");
	init_mlx(d);
	tt_pl("Init obj");
	init_obj(d);
	tt_pl("Init light");
	init_light(d);
	return (d);
}
Beispiel #4
0
int				main(int argc, char **argv)
{
	t_ref		*d_ref;
	t_mlx		*d_mlx;

	if (argc != 2)
		return (0);
	if ((d_ref = init_ref(argv[1])) == NULL)
		free_ex(d_ref, 0, 0, argv[0]);
	if ((d_mlx = init_mlx(d_ref->win_i, d_ref->win_j, d_ref)) == NULL)
		free_ex(d_ref, d_mlx, 0, argv[0]);
	if (print_it(d_ref, d_mlx) == 0)
		free_ex(d_ref, d_mlx, 0, argv[0]);
	mlx_hook(d_mlx->win, 2, 0, (*key_hook), d_mlx);
	mlx_loop(d_mlx->mlx);
}
Beispiel #5
0
int		main(int argc, char **argv)
{
  t_mlx		*ptr;
  t_img		*i;

  ptr = init_mlx();
  i = init_img(ptr);
  if (argc == 2)
    bombyx1(i, ptr, argv[1]);
  if (argc == 3)
    graph2(argv, ptr, i);
  else
    printf("Usage: ./106bombyx [-k] OR [-i_min -i_max]");
  printf("\n");
  return (0);
}
Beispiel #6
0
int			main(int ac, char **av)
{
	int two_win;

	if (ac < 2)
		ft_error(INVALID_ARGZ);
	init_all();
	two_win = parse_params(av);
	init_mlx(two_win);
	mlx_hook(g()->p.win, 6, 64, &mouse_hook, &g()->p);
	mlx_key_hook(g()->p.win, key_hook, &g()->p);
	mlx_mouse_hook(g()->p.win, mouse2_hook, &g()->p);
	mlx_expose_hook(g()->p.win, expose_hook, &g()->p);
	if (two_win)
		handle_second_win();
	mlx_loop_hook(g()->e.mlx, loop_hook, &g()->cur);
	mlx_loop(g()->e.mlx);
	return (0);
}
Beispiel #7
0
int		main(int argc, char **argv)
{
  t_vm		*vm;
  int		i;

  if ((vm = malloc(sizeof(t_vm))) == NULL)
    my_print_error("Error with a memory allocation\n");
  if ((vm->arena = malloc(sizeof(t_vm))) == NULL)
    my_print_error("Error with a memory allocation\n");
  init_arena(vm->arena->arena, MEM_SIZE);
  check_arg(argc);
  i = check_dump(vm, argv);
  check_champ(vm, argc, argv, i);
  init_champs(vm);
  my_parsing(vm, argc, argv, i);
  init_mlx(vm);
  aff_grid(vm);
  my_hook(vm);
  corewar(vm);
  return (0);
}
Beispiel #8
0
int		main(void)
{
	t_env	e;
	int		fd;
	t_ray	ray;

	e = init_mlx(1000, 1022);
	init_env(&e);
	ray.origin = e.cam;
	fd = ft_open();
	e.list = recur_list_build(fd, NULL);
	close(fd);
	fd = ft_open();
	e.lights = recur_lights_build(fd, NULL);
	close(fd);
	e.ray = ray;
	mlx_do_key_autorepeaton(e.mlx);
	mlx_hook(e.win, 2, 1L << 0, key_hook, &e);
	mlx_expose_hook(e.win, expose_hook, &e);
	mlx_loop(e.mlx);
	return (0);
}
Beispiel #9
0
int			main(int argc, char **argv)
{
	t_rt		s_rt;

	if (argc == 3)
	{
		s_rt.s_eye.x = -3000;
		s_rt.s_eye.y = 0;
		s_rt.s_eye.z = 0;
		s_rt.s_rot.x = 0;
		s_rt.s_rot.y = 0;
		s_rt.s_rot.z = 0;
		s_rt.mode = 0;
		init_mlx(&s_rt);
		load_scene(&s_rt, argv);
		raytracing(&s_rt);
		launch_mlx(&s_rt);
		mlx_loop(s_rt.mlx_ptr);
	}
	else
		ft_putstr("Usage : ./rtv1 misc/objects.rt misc/spots.rt\n", 2);
	return (EXIT_SUCCESS);
}
void	init_struct(t_all *all)
{
  init_mlx(all);
  init_draw(all);
}