Definition in file fdf_mlx.c.
#include <stdlib.h>
#include <MLX42.h>
#include <ft_printf.h>
#include "../fdf.h"
#include "map.h"
Go to the source code of this file.
|
void | draw_line (mlx_image_t *img, int x1, int y1, int *p2) |
| Multi-directional implementation of the Bresenham incremental error line drawing algorithm.
|
|
int | project_map (t_map map, int *size) |
| Project map and attempt to automatically scale to viewport.
|
|
static void | keyhook (mlx_key_data_t key_data, void *arg) |
| Runs when a key is pressed to check whether the escape key was used, so the window can be closed.
|
|
static void | lines_from_point (mlx_image_t *img, t_map map, int x, int y) |
| Checks if adjacent points are available, and draws lines to them.
|
|
static void | fdf_row (void *data) |
| Draw rows in between frames if the image isn't complete.
|
|
static int | fdf_mlx (mlx_t *mlx, t_loop_data d, int *size) |
| Bulk of mlx functions used in fdf, to set up the key press and drawing hooks, set up the image, start the rendering, etc.
|
|
int | fdf (t_map map) |
| Initialize mlx, run map projection and scaling, execute mlx, and cleanup.
|
|
◆ draw_line()
void draw_line |
( |
mlx_image_t * |
img, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
int * |
p2 |
|
) |
| |
Multi-directional implementation of the Bresenham incremental error line drawing algorithm.
- Parameters
-
img | Mlx image pointer |
x1 | Starting x position |
y1 | Starting y position |
p2 | Ending [x, y] position |
Definition at line 32 of file draw_line.c.
References abs(), and err().
◆ fdf()
◆ fdf_mlx()
◆ fdf_row()
static void fdf_row |
( |
void * |
data | ) |
|
|
static |
◆ keyhook()
Runs when a key is pressed to check whether the escape key was used, so the window can be closed.
- Parameters
-
key_data | |
arg | Mlx instance pointer |
Definition at line 36 of file fdf_mlx.c.
◆ lines_from_point()
◆ project_map()
int project_map |
( |
t_map |
map, |
|
|
int * |
size |
|
) |
| |