Cub3D
 
Loading...
Searching...
No Matches
ft_draw.h File Reference

Header file for the draw functions. More...

#include "data_structure.h"
#include <stdbool.h>
Include dependency graph for ft_draw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  s_circle
 Structure used to store circle informations. More...
 

Typedefs

typedef struct s_circle t_circle
 

Functions

void ft_put_pixel_to_img (t_img *img, int x, int y, int color)
 Should only be used for images with 32 bits per pixel. (standard) It will result as undefined behavior if used on images with other bit depths. it's because of alignment issues with the pixel data.
 
void ft_put_pixel_to_img_24bp (t_img *img, int x, int y, int color)
 Special case for 24 bits per pixel images.
 
void ft_draw_circle (t_mlx *mlx, void *win_ptr, t_circle element) __attribute__((deprecated))
 Draw a circle directly on the window.
 
void ft_put_circle_to_img (t_mlx *mlx, void *win_ptr, t_img *img, t_circle element)
 Put a circle to the image.
 
void ft_put_circle_to_win (t_mlx *mlx, void *win_ptr, t_circle element, bool is_enabled)
 Put ON circle if is_enabled, put OFF circle if not.
 
void ft_put_circle_specific (t_mlx *mlx, void *win_settings_ptr, enum e_screen_size num, bool is_enabled)
 Function to put the specific case of circles defined by the enum.
 
void ft_put_all_circle_to_win (t_mlx *mlx, void *win_settings_ptr, bool is_enabled)
 Function to pull all the circle to the window following their state.
 

Detailed Description

Header file for the draw functions.

Typedef Documentation

◆ t_circle

typedef struct s_circle t_circle

Function Documentation

◆ ft_draw_circle()

void ft_draw_circle ( t_mlx * mlx,
void * win_ptr,
t_circle element )

Draw a circle directly on the window.

Deprecated
Uses an old technique, should put pixels onto a img first and after onto the window (it's at least 10x faster)
Parameters
[in,out]mlxmlx structure
[in,out]win_ptrwindow pointer
[in]elementelement

◆ ft_put_all_circle_to_win()

void ft_put_all_circle_to_win ( t_mlx * mlx,
void * win_settings_ptr,
bool is_enabled )

Function to pull all the circle to the window following their state.

Parameters
[in,out]mlxmlx structure
[in,out]win_settings_ptrsettings window pointer
[in]is_enabledtrue is ON, false is OFF
Here is the call graph for this function:

◆ ft_put_circle_specific()

void ft_put_circle_specific ( t_mlx * mlx,
void * win_settings_ptr,
enum e_screen_size num,
bool is_enabled )

Function to put the specific case of circles defined by the enum.

Parameters
[in,out]mlxmlx structure
[in,out]win_settings_ptrsettings window pointer
[in,out]numstate to put
[in]is_enabledtrue is ON, false is OFF
Here is the call graph for this function:

◆ ft_put_circle_to_img()

void ft_put_circle_to_img ( t_mlx * mlx,
void * win_ptr,
t_img * img,
t_circle element )

Put a circle to the image.

Parameters
[in,out]mlxmlx structure
[in,out]win_ptrwindow pointer
[in,out]imgimg structure
[in]elementcircle element to draw
Here is the call graph for this function:

◆ ft_put_circle_to_win()

void ft_put_circle_to_win ( t_mlx * mlx,
void * win_ptr,
t_circle element,
bool is_enabled )

Put ON circle if is_enabled, put OFF circle if not.

Parameters
[in,out]mlxmlx structure
[in,out]win_ptrwindow pointer
[in]elementelement
[in]is_enabledtrue is ON, false is OFF

◆ ft_put_pixel_to_img()

void ft_put_pixel_to_img ( t_img * img,
int x,
int y,
int color )

Should only be used for images with 32 bits per pixel. (standard) It will result as undefined behavior if used on images with other bit depths. it's because of alignment issues with the pixel data.

Parameters
[in,out]imgimage structure
[in]xx axis
[in]yy axis
[in]colorcolor

◆ ft_put_pixel_to_img_24bp()

void ft_put_pixel_to_img_24bp ( t_img * img,
int x,
int y,
int color )

Special case for 24 bits per pixel images.

Parameters
[in,out]imgimage structure
[in]xx axis
[in]yy axis
[in]colorcolor