mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
fixing cross compilation issue
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
||||||
/* Updated: 2023/12/08 14:09:31 by kbz_8 ### ########.fr */
|
/* Updated: 2023/12/08 18:07:40 by kbz_8 ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ MLX_API void* mlx_new_window(void* mlx, int w, int h, const char* title);
|
|||||||
* @return (int) Always return 0, made this to copy the behaviour of the original MLX
|
* @return (int) Always return 0, made this to copy the behaviour of the original MLX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MLX_API int mlx_loop_hook(void* mlx, int (*f)(), void* param);
|
MLX_API int mlx_loop_hook(void* mlx, int (*f)(void*), void* param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Starts the internal main loop
|
* @brief Starts the internal main loop
|
||||||
@@ -141,7 +141,7 @@ MLX_API int mlx_mouse_get_pos(void* mlx, int* x, int* y);
|
|||||||
*
|
*
|
||||||
* @return (int) Always return 0, made this to copy the behaviour of the original MLX
|
* @return (int) Always return 0, made this to copy the behaviour of the original MLX
|
||||||
*/
|
*/
|
||||||
MLX_API int mlx_on_event(void* mlx, void* win, mlx_event_type event, int (*f)(), void* param);
|
MLX_API int mlx_on_event(void* mlx, void* win, mlx_event_type event, int (*f)(int, void*), void* param);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
17
test/main.c
17
test/main.c
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
|
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
|
||||||
/* Updated: 2023/12/08 12:23:07 by kbz_8 ### ########.fr */
|
/* Updated: 2023/12/08 18:08:13 by kbz_8 ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -22,12 +22,14 @@ typedef struct s_mlx
|
|||||||
void *img;
|
void *img;
|
||||||
} t_mlx;
|
} t_mlx;
|
||||||
|
|
||||||
int update(t_mlx *mlx)
|
int update(void *param)
|
||||||
{
|
{
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
int j;
|
int j;
|
||||||
int k;
|
int k;
|
||||||
|
t_mlx *mlx;
|
||||||
|
|
||||||
|
mlx = (t_mlx *)param;
|
||||||
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo, 100, 100);
|
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo, 100, 100);
|
||||||
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->img, 150, 60);
|
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->img, 150, 60);
|
||||||
mlx_string_put(mlx->mlx, mlx->win, 20, 50, 0xFFFFFFFF, "that's a text");
|
mlx_string_put(mlx->mlx, mlx->win, 20, 50, 0xFFFFFFFF, "that's a text");
|
||||||
@@ -41,8 +43,7 @@ int update(t_mlx *mlx)
|
|||||||
k++;
|
k++;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
i++;
|
if (++i == 5000)
|
||||||
if (i == 5000)
|
|
||||||
{
|
{
|
||||||
mlx_clear_window(mlx->mlx, mlx->win);
|
mlx_clear_window(mlx->mlx, mlx->win);
|
||||||
mlx_set_font_scale(mlx->mlx, mlx->win, "font.ttf", 16.f);
|
mlx_set_font_scale(mlx->mlx, mlx->win, "font.ttf", 16.f);
|
||||||
@@ -79,17 +80,17 @@ void *create_image(t_mlx *mlx)
|
|||||||
return (img);
|
return (img);
|
||||||
}
|
}
|
||||||
|
|
||||||
int key_hook(int key, t_mlx *param)
|
int key_hook(int key, void *param)
|
||||||
{
|
{
|
||||||
if (key == 41)
|
if (key == 41)
|
||||||
mlx_loop_end(param->mlx);
|
mlx_loop_end(((t_mlx *)param)->mlx);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int window_hook(int event, t_mlx *param)
|
int window_hook(int event, void *param)
|
||||||
{
|
{
|
||||||
if (event == 0)
|
if (event == 0)
|
||||||
mlx_loop_end(param->mlx);
|
mlx_loop_end(((t_mlx *)param)->mlx);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user