6
6
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
9
- /* Updated: 2023/12/08 12:23:07 by kbz_8 ### ########.fr */
9
+ /* Updated: 2023/12/08 18:08:13 by kbz_8 ### ########.fr */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
@@ -22,12 +22,14 @@ typedef struct s_mlx
22
22
void * img ;
23
23
} t_mlx ;
24
24
25
- int update (t_mlx * mlx )
25
+ int update (void * param )
26
26
{
27
27
static int i = 0 ;
28
28
int j ;
29
29
int k ;
30
+ t_mlx * mlx ;
30
31
32
+ mlx = (t_mlx * )param ;
31
33
mlx_put_image_to_window (mlx -> mlx , mlx -> win , mlx -> logo , 100 , 100 );
32
34
mlx_put_image_to_window (mlx -> mlx , mlx -> win , mlx -> img , 150 , 60 );
33
35
mlx_string_put (mlx -> mlx , mlx -> win , 20 , 50 , 0xFFFFFFFF , "that's a text" );
@@ -41,8 +43,7 @@ int update(t_mlx *mlx)
41
43
k ++ ;
42
44
j ++ ;
43
45
}
44
- i ++ ;
45
- if (i == 5000 )
46
+ if (++ i == 5000 )
46
47
{
47
48
mlx_clear_window (mlx -> mlx , mlx -> win );
48
49
mlx_set_font_scale (mlx -> mlx , mlx -> win , "font.ttf" , 16.f );
@@ -79,17 +80,17 @@ void *create_image(t_mlx *mlx)
79
80
return (img );
80
81
}
81
82
82
- int key_hook (int key , t_mlx * param )
83
+ int key_hook (int key , void * param )
83
84
{
84
85
if (key == 41 )
85
- mlx_loop_end (param -> mlx );
86
+ mlx_loop_end ((( t_mlx * ) param ) -> mlx );
86
87
return (0 );
87
88
}
88
89
89
- int window_hook (int event , t_mlx * param )
90
+ int window_hook (int event , void * param )
90
91
{
91
92
if (event == 0 )
92
- mlx_loop_end (param -> mlx );
93
+ mlx_loop_end ((( t_mlx * ) param ) -> mlx );
93
94
return (0 );
94
95
}
95
96
0 commit comments