-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_mlx_pixel_put.c
24 lines (21 loc) · 1.13 KB
/
ft_mlx_pixel_put.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_mlx_pixel_put.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: emende <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/26 21:01:30 by emende #+# #+# */
/* Updated: 2022/04/09 22:23:02 by emende ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void ft_mlx_pixel_put(t_vars *v, int x, int y)
{
char *dst;
if (x >= 0 && x < W_WIDTH && y >= 0 && y < W_HEIGHT)
{
dst = v->data.addr + (y * v->data.line_len + x * (v->data.bpp / 8));
*(unsigned int *)dst = (unsigned int) v->color;
}
}