MiniLibX Helper Function
This page will showcase some helper functions for the MiniLibX library.
Simple put_pixel function
void ft_put_pixel(t_data *data, int x, int y, int color)
{
char *pxl;
if (x >= 0 && x < WINDOW_WIDTH && y >= 0 && y < WINDOW_HEIGHT
{
pxl = data->addr + (y * data->line_length + x * (data->bits_per_pixel / 8));
*(unsigned int *)pxl = color;
}
}Draw Line function (~Naive line algorithm)
Last updated