This commit is contained in:
whaffman 2025-05-07 15:21:00 +02:00
parent 25d2322b40
commit 73c0fc7694
2 changed files with 18 additions and 7 deletions

BIN
assets/overlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* screen.c :+: :+: :+: */ /* screen.c :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/15 15:30:27 by qmennen #+# #+# */ /* Created: 2025/04/15 15:30:27 by qmennen #+# #+# */
/* Updated: 2025/05/06 19:19:23 by qmennen ### ########.fr */ /* 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_width;
int m_height; int m_height;
m_width = 0; m_width = 0;
m_height = 0; m_height = 0;
fill_background(screen, 0x000000FF); fill_background(screen, 0x000000FF);
@ -81,6 +83,15 @@ int screen_display(t_screen *screen)
printf(RED"Failed to display buffer image\n"RESET); printf(RED"Failed to display buffer image\n"RESET);
return (FAILURE); 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); mlx_get_monitor_size(0, &m_width, &m_height);
if (m_width == 0 || m_height == 0) if (m_width == 0 || m_height == 0)
{ {