Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. void draw_pixel(t_env *e, int x, int y, t_color color)
  2. {
  3. e->pixel_img = mlx_get_data_addr(e->img, &(e->bpp), &(e->s_line), &(e->ed));
  4. e->pixel_img[x * e->bpp / 8 + y * e->s_line] = (unsigned char)color.b;
  5. e->pixel_img[x * e->bpp / 8 + 1 + y * e->s_line] = (unsigned char)color.g;
  6. e->pixel_img[x * e->bpp / 8 + 2 + y * e->s_line] = (unsigned char)color.r;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement