-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_image_draw.c
49 lines (44 loc) · 1.37 KB
/
create_image_draw.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* create_image_draw.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kristori <kristori@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/23 15:22:26 by kristori #+# #+# */
/* Updated: 2023/05/24 14:53:13 by kristori ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void ft_draw_ceiling(t_program *program, t_image buffer)
{
int y;
int x;
y = 0;
while (y < SCREEN_H / 2)
{
x = 0;
while (x < SCREEN_W)
{
ft_mlx_pixel_put(x, y, ft_create_trgb(0, program->ceiling), buffer);
x++;
}
y++;
}
}
void ft_draw_floor(t_program *program, t_image buffer)
{
int y;
int x;
y = SCREEN_H / 2;
while (y < SCREEN_H)
{
x = 0;
while (x < SCREEN_W)
{
ft_mlx_pixel_put(x, y, ft_create_trgb(0, program->floor), buffer);
x++;
}
y++;
}
}