working on xpm support

This commit is contained in:
kbz_8
2023-04-05 01:11:49 +02:00
parent f4bf7ea6b7
commit 83e6ebb430
10 changed files with 110 additions and 82 deletions

View File

@@ -6,14 +6,14 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
/* Updated: 2023/04/04 14:54:04 by maldavid ### ########.fr */
/* Updated: 2023/04/04 21:41:32 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "../includes/mlx.h"
static char * exemple_xpm[] = {
static char* exemple_xpm[] = {
"24 20 3 1",
" c None",
". c #3A32E4",
@@ -102,12 +102,12 @@ int main(void)
mlx.mlx = mlx_init();
mlx.win = mlx_new_window(mlx.mlx, 400, 400, "My window");
mlx.logo = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &w, &h);
pic = mlx_xpm_to_image(mlx.mlx, exemple_xpm, &w, &h);
mlx_put_image_to_window(mlx.mlx, mlx.win, pic, 20, 20);
mlx_pixel_put(mlx.mlx, mlx.win, 200, 10, 0xFFFF00FF);
mlx_put_image_to_window(mlx.mlx, mlx.win, mlx.logo, 200, 200);
img = create_image(&mlx);
mlx_put_image_to_window(mlx.mlx, mlx.win, img, 200, 20);
pic = mlx_xpm_to_image(mlx.mlx, exemple_xpm, &w, &h);
mlx_put_image_to_window(mlx.mlx, mlx.win, pic, 100, 20);
mlx_loop_hook(mlx.mlx, update, &mlx);
mlx_loop(mlx.mlx);
mlx_destroy_image(mlx.mlx, img);

View File

@@ -1 +1 @@
clang main.c ../libmlx.so `/nfs/homes/maldavid/.xmake/packages/l/libsdl/2.26.4/8dfbcb8049e744a597cd5333e1b399cd/bin/sdl2-config --cflags --libs` -g && ./a.out
clang main.c ../libmlx.so -lSDL2 -lXpm -g && ./a.out