improve gexit with init function and add basic mlx image gestion
This commit is contained in:
@@ -3,33 +3,34 @@
|
||||
|
||||
// -------------------------------
|
||||
// SRC
|
||||
// -------------------------------
|
||||
// cube3d.c
|
||||
void destroy_mlx(void *param);
|
||||
int shut_down();
|
||||
|
||||
|
||||
// -------------------------------
|
||||
// SRC/INIT
|
||||
|
||||
// -------------------------------
|
||||
// init_struct.c
|
||||
t_game *init_game(void);
|
||||
|
||||
// init_parsing.c
|
||||
void init_parsing(int ac, char **av, t_game *game);
|
||||
|
||||
|
||||
// -------------------------------
|
||||
// SRC/PARSING
|
||||
// -------------------------------
|
||||
|
||||
|
||||
// -------------------------------
|
||||
// SRC/HOOK
|
||||
|
||||
// -------------------------------
|
||||
// key_hook.c
|
||||
int keypress(int keycode, t_game *game);
|
||||
int keyrelease(int keycode, t_game *game);
|
||||
|
||||
// key_do_action.c
|
||||
int shut_down(t_game *game);
|
||||
void keypress_do_action(t_game *game);
|
||||
|
||||
// key_is_action_1.c
|
||||
int is_esc(int *k_hook);
|
||||
int is_go_left(int *k_hook);
|
||||
@@ -40,10 +41,15 @@ int is_go_backward(int *k_hook);
|
||||
|
||||
// -------------------------------
|
||||
// SRC/DRAW
|
||||
|
||||
// -------------------------------
|
||||
// draw.c
|
||||
void draw(t_game *game);
|
||||
|
||||
// -------------------------------
|
||||
// SRC/FREE
|
||||
// SRC/MEM
|
||||
// -------------------------------
|
||||
// g_alloc_free_exit.c
|
||||
void gexit_init(void(*f)(void*), void *param);
|
||||
void *gmalloc(size_t size);
|
||||
void gfree(void *addr);
|
||||
void gexit(char *str);
|
||||
|
||||
@@ -3,13 +3,22 @@
|
||||
|
||||
typedef struct s_game
|
||||
{
|
||||
// window
|
||||
void *mlx_ptr;
|
||||
void *win_ptr;
|
||||
int plr_x;
|
||||
int plr_y;
|
||||
int win_size_x;
|
||||
int win_size_y;
|
||||
// player
|
||||
int plr_x;
|
||||
int plr_y;
|
||||
// key hook
|
||||
int k_hook[MAX_NB_KEY];
|
||||
// image
|
||||
void *img_ptr;
|
||||
char *img_data;
|
||||
int bpp;
|
||||
int sizel;
|
||||
int endian;
|
||||
} t_game;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user