🎨 Palettized image format and software renderer 🖼️
Documentation . Demos . Todo · Report Bug · Request Feature
Table of contents
PIF is a library for palettized software rendering
(inspired by the Doom and Quake
palettized software renderers) and handling .pif
(Palettized Image Format) files, .pal
(Palette) files and .pbf
(Palettized Bitmap Font) files.
While making a not-yet-published retro 256-color 3D raycaster engine,
I found myself writing a lot of code for the palettized software rendering, image/palette file format
loading and text rendering. I had to make utilities to convert from .bmp
files to my palettized image
files, utilities to view these palettized image files and more.
I realised I am probably going to do more palettized software rendering in the future, so I decided to make a library for it to handle all of these things like image files, palettes, software rendering, converting etc. Then I could make utilities for working with these image files, and reuse all of this for every palettized software rendered game I make in the future. And so the idea of PIF was born.
The demos folder contains subfolders for graphical, textmode and pure file IO demos.
Note
The terminal demos do not support Windows.
Demos are written in C and C++. PIF does not handle displaying images onto the screen, so the SDL2 and NCurses libraries are used for that in the demos.
The following is required to compile the demos:
- A C/C++ compiler
- Makefile
- NCurses
- SDL2
$ apt install gcc g++ make libsdl2-dev ncurses
$ pacman -S gcc make sdl2 ncurses
$ git clone https://github.com/LordOfTrident/pif
$ cd pif/demos/sdl2
$ make
$ ./dots3d
Coming soon.
Known bugs are listed in the todo file. If you find any more bugs, please, create an issue and report them.