DropMapPixel changed to RenderFrame
This commit is contained in:
2
Makefile
2
Makefile
@@ -31,7 +31,7 @@ gnl:
|
||||
@$(MAKE) -C $(GNL)
|
||||
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS) && printf "Compiling: $(notdir $<)"
|
||||
@$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS) && printf "Compiling: $(notdir $<)\n"
|
||||
|
||||
$(NAME): $(OBJS)
|
||||
@$(CC) $(OBJS) $(LIBS) $(HEADERS) -o $(NAME)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/25 19:47:02 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 21:48:51 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/11 19:47:53 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -25,18 +25,13 @@
|
||||
# include "../lib/ft_printf/ft_printf.h"
|
||||
# include "../lib/gnl/get_next_line.h"
|
||||
|
||||
/*═══════════════════════════ [ MACROS ] ═══════════════════════════════════*/
|
||||
|
||||
// MLX - GAME
|
||||
|
||||
# define S_W 1900 // screen width
|
||||
# define S_H 1000 // screen height
|
||||
# define WALL_SIZE 30 // wall size
|
||||
# define FOV 60 // field of view
|
||||
# define ROTATION_SPEED 0.045 // rotation speed
|
||||
# define PLAYER_SPEED 3 // player speed
|
||||
|
||||
// ERROR
|
||||
# define S_W 1900
|
||||
# define S_H 1000
|
||||
# define WALL_SIZE 30
|
||||
# define FOV 60
|
||||
# define ROTATION_SPEED 0.045
|
||||
# define PLAYER_SPEED 3
|
||||
|
||||
# define ERR_INV_COP "Error: invalid argument\n"
|
||||
# define ERR_INV_FILE "Error: invalid file\n"
|
||||
@@ -47,8 +42,6 @@
|
||||
# define ERR_MAP_DUP "Error: duplicate map element\n"
|
||||
# define ERR_MAP_RGB "Error: invalid color map [RGB]\n"
|
||||
|
||||
/*══════════════════════════ [ STRUCTS ] ═══════════════════════════════════*/
|
||||
|
||||
typedef struct s_tex
|
||||
{
|
||||
mlx_texture_t *no;
|
||||
@@ -205,7 +198,7 @@ float nor_angle(float angle);
|
||||
int unit_circle(float angle, char c);
|
||||
|
||||
// execution.c
|
||||
void drow_map_pixel(void *mlxl);
|
||||
void render_frame(void *mlx_ptr);
|
||||
int check_load_ture(t_turelist *list);
|
||||
int load_texture(t_tex *tex, t_turelist *l_ture);
|
||||
void get_angle(t_mlx *mlx);
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/09 18:46:27 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 20:56:36 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/11 19:48:18 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../includes/cub3d.h"
|
||||
|
||||
void drow_map_pixel(void *mlxl)
|
||||
void render_frame(void *mlx_ptr)
|
||||
{
|
||||
t_mlx *mlx;
|
||||
|
||||
mlx = mlxl;
|
||||
mlx = mlx_ptr;
|
||||
mlx_delete_image(mlx->mlx_ptr, mlx->img);
|
||||
mlx->img = mlx_new_image(mlx->mlx_ptr, S_W, S_H);
|
||||
cub_hook(mlx, 0, 0);
|
||||
@@ -110,7 +110,7 @@ int execution(t_data *dt)
|
||||
return (ft_exit(&mlx), 0);
|
||||
get_angle(&mlx);
|
||||
mlx_key_hook(mlx.mlx_ptr, &key_press, &mlx);
|
||||
mlx_loop_hook(mlx.mlx_ptr, &drow_map_pixel, &mlx);
|
||||
mlx_loop_hook(mlx.mlx_ptr, &render_frame, &mlx);
|
||||
mlx_loop(mlx.mlx_ptr);
|
||||
ft_exit(&mlx);
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user