cub3d/inc/render.h
2025-05-16 15:02:43 +02:00

43 lines
1.9 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* render.h :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/04/15 16:28:16 by qmennen #+# #+# */
/* Updated: 2025/05/15 14:25:46 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef RENDER_H
# define RENDER_H
# include "cub3d.h"
int render_check_bounds(t_screen *screen, t_vec2 *point);
void render_line(t_screen *screen,
t_vec2 start, t_vec2 end, unsigned int color);
void render_circle(t_screen *screen,
t_vec2 point, int radius, unsigned int color);
void render_clear(t_screen *screen);
void render_entities(t_game *game);
void render_map(t_game *game);
t_render cast_ray(t_game *game, int x);
void cast_rays(t_game *game);
void render_sprites(t_render *render, t_game *game);
double dda(t_vec2 ray_dir, t_vec2 pos, t_map *map);
void draw_floor(t_game *game);
void draw_line(t_game *game, t_render render, int x);
unsigned int get_texture_color(mlx_texture_t *texture,
t_render render, t_vec2_int tex);
void sort_sprites(t_game *game);
void calculate_sprite_dist(t_game *game);
void cam_fraction(t_game *game, t_sprite *sprite);
unsigned int calculate_alpha(int x, int y, double dist);
unsigned int sample_texture_color(t_sprite *sprite,
t_vec2_int tex, int n);
#endif