MiniLibX Helper Function
This page will showcase some helper functions for the MiniLibX library.
Simple put_pixel function
This is a simple function to put a pixel to the screen by its x
and y
coordinates.
I based this function on what I found here, and modified it a bit to make sure we only put a pixel that is inside the screen, without this check, the program could segfault
if we try to set a value somewhere outside the window.
Draw Line function (~Naive line algorithm)
There is no function in MiniLibX to draw a line between two points, but this will be particularly useful when you try to code FdF
, you'll have to join all your points by lines, so, here you go.
This function uses some function of the math library so make sure you can use it in your project and include it (#include <math.h>
).
For FdF
, Fractol
and so-long
, all the math library are authorized.
You will have to find a way to make it pass the Norm, you can check how I did this here.
Last updated