/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   menu_util.c                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: qmennen <qmennen@student.codam.nl>         +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2025/05/28 14:45:59 by qmennen           #+#    #+#             */
/*   Updated: 2025/05/28 14:46:31 by qmennen          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "game_menu.h"

mlx_image_t	*menu_load_background(mlx_t *mlx, char *background_path)
{
	mlx_texture_t	*background_texture;
	mlx_image_t		*background_image;

	if (!background_path)
		return (NULL);
	background_texture = mlx_load_png(background_path);
	if (!background_texture)
	{
		printf("Failed to load background texture from %s\n", background_path);
		return (NULL);
	}
	background_image = mlx_texture_to_image(mlx, background_texture);
	return (mlx_delete_texture(background_texture), background_image);
}
