mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing compatibility, workign on renderer
This commit is contained in:
27
test/main.c
27
test/main.c
@@ -6,23 +6,34 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
|
||||
/* Updated: 2022/10/05 19:25:46 by maldavid ### ########.fr */
|
||||
/* Updated: 2022/12/18 03:51:19 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../includes/mlx.h"
|
||||
|
||||
int update(void *mlx)
|
||||
{
|
||||
static int i = 0;
|
||||
|
||||
puts("dude");
|
||||
i++;
|
||||
if (i > 1000000)
|
||||
mlx_loop_end(mlx);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void *win_ptr;
|
||||
int x;
|
||||
int y;
|
||||
void *mlx_ptr;
|
||||
|
||||
mlx_init();
|
||||
win_ptr = mlx_new_window(400, 400, "My window");
|
||||
mlx_mouse_get_pos(win_ptr, &x, &y);
|
||||
printf("%d, %d\n", x, y);
|
||||
mlx_loop();
|
||||
mlx_ptr = mlx_init();
|
||||
win_ptr = mlx_new_window(mlx_ptr, 400, 400, "My window");
|
||||
mlx_loop_hook(mlx_ptr, update, mlx_ptr);
|
||||
mlx_loop(mlx_ptr);
|
||||
mlx_destroy_window(mlx_ptr, win_ptr);
|
||||
mlx_destroy_display(mlx_ptr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
clear && gcc main.c ../libMicroX.so `sdl2-config --cflags --libs` -lSDL2 && ./a.out
|
||||
clear && gcc main.c ../libmlx.so -lSDL2 && ./a.out
|
||||
|
||||
Reference in New Issue
Block a user