diff --git a/assets/overlay.png b/assets/overlay.png new file mode 100644 index 0000000..6b12e3b Binary files /dev/null and b/assets/overlay.png differ diff --git a/src/screen.c b/src/screen.c index 6d7d0b6..d8f3471 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* screen.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/15 15:30:27 by qmennen #+# #+# */ -/* Updated: 2025/05/06 19:19:23 by qmennen ### ########.fr */ +/* :::::::: */ +/* screen.c :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/15 15:30:27 by qmennen #+# #+# */ +/* Updated: 2025/05/07 14:59:40 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -63,6 +63,8 @@ int screen_display(t_screen *screen) int m_width; int m_height; + + m_width = 0; m_height = 0; fill_background(screen, 0x000000FF); @@ -81,6 +83,15 @@ int screen_display(t_screen *screen) printf(RED"Failed to display buffer image\n"RESET); return (FAILURE); } + mlx_texture_t *texture; + texture = mlx_load_png("assets/overlay.png"); + mlx_image_t *overlay = mlx_texture_to_image(screen->mlx, texture); + if (mlx_image_to_window(screen->mlx, overlay, 0, 0) < 0) + { + printf(RED"Failed to display overlay image\n"RESET); + return (FAILURE); + } + mlx_get_monitor_size(0, &m_width, &m_height); if (m_width == 0 || m_height == 0) {