예제 #1
0
/// main draw method
void display() {
    hud_fps_display.start();
    if(draw_opts.cameralights) scene_cameralights_update(scene,draw_opts.cameralights_dir,draw_opts.cameralights_col);
    draw_scene(scene,draw_opts,true);
    draw_scene_decorations(scene,draw_opts,false);
    glFlush();
    hud_fps_display.stop();
    
    if(selected_frame) {
        auto axes = Axes();
        axes.frame = *selected_frame;
        draw_gizmo(&axes);
        if(selected_point) {
            auto dot = Dot();
            dot.pos = transform_point(*selected_frame, *selected_point);
            draw_gizmo(&dot);
        }
    }
    
    if(hud) display_hud();
    
    glutSwapBuffers();
    
    if(screenshotAndExit) {
        if(time_init_advance <= 0.0f or draw_opts.time >= time_init_advance ) {
            screenshot(filename_image.c_str());
            exit(0);
        }
    }
}
예제 #2
0
파일: hooks.c 프로젝트: Es-so/Wolf3D
int		loop_hook(t_mega *all)
{
	open_door(all);
	if (all->e.refresh == 1)
	{
		ft_bzero(all->img.data, WWIN * HWIN * 4);
		raycasting_calcul(all);
		mlx_put_image_to_window(all->e.mlx, all->e.wmlx, all->img.img,
			(WWIN_HUD / 2) - (WWIN / 2), 20);
		loot_ammo(all->sprites, &all->player, &all->cam);
		display_weapon(all);
		display_hud(all);
		all->e.refresh = 0;
	}
	key_hook(all);
	return (1);
}
예제 #3
0
void control_ship(int y, int x) {
    int input;

    change_colors(COLOR_WHITE);
    show_stars();

    while (1) {
        display_hud();
        display_wormhole();
        input = getch();
        move_ship(&y, &x, input);
        //shoot(&y, &x, input);
        shoot(y, x, input);
        check_if_bumped(y, x);
        check_if_wormhole_is_hit(y, x);
        mvprintw(2,2,"x %i - %i", x, COLS);
        mvprintw(3,3,"y %i - %i",y, LINES);
    } 
}