Now that we have basic window management, we can get started with drawing pixels to the window.
To do so you can use mlx_pixel_put by giving it your mlx pointer, your window pointer, coordinates where to draw it and its color:
You can use it to draw as much pixels as you want
🏙️ Drawing images
The MacroLibX is also capable of loading and rendering images from disk. It accepts PNGs, JPEGs, and BMPs and has a function for each of them
(mlx_png_file_to_image, mlx_jpg_file_to_image, mlx_bmp_file_to_image).
The difference with put pixel is that the image must be destroyed when it is no longer needed.
We’ll see later how we can create empty images and how to manipulate them.