A C, C++, Rust and COBOL library to draw graphics with pixels in the terminal
A library to draw graphics with pixels in the terminal
To generate libpluto.a
, run:
$ make
To install it so that your compiler can use it directly, run:
# make install
To compile some examples, run:
$ make exp
Pre-compiled library files are available in the releases tab (only for Linux x86-64)
#include <path to pluto.h> // do #include <pluto.h> if the lib is already installed
#include <stdlib.h>
#include "pluto.h" /* Change path if needed */
int main()
{
pluto_init_window(); /* Initialize pluto */
pluto_save_screen(); /* Save screen */
for (;;)
{
for (int i = 0; i < _pluto_canvas.cheight; i++)
{
for (int j = 0; j < _pluto_canvas.cwidth; j++)
{
pluto_set_cpix(j, i, rand() % 256, rand() % 256, rand() % 256); /* Set pixel with random colours */
}
}
pluto_write_out(); /* Write to output buffer */
pluto_render(); /* Render the output buffer */
}
pluto_deinit();
return 0;
}
$ gcc -o program program.c -lpluto # install it before or use -L<lib_folder_path>
Comments in the pluto.h file describe what each function/data structure does
Perlin noise using plutonem
Mandelbrot (examples/mandelbrot.c)
Image rendered using plutonem
A raycaster written with plutonem
U+10240(10)
to U+10495(10)
. I recommend the Cascadia Mono
font.en_US.UTF-8
. On Arch Linux, which I use, I would use this command to set it:# localectl set-locale LANG=en_US.UTF-8