LordOfTrident / pif

🎨 Palettized image format and software renderer for C 🖼️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License Contributors Stars Issues Pull requests


PIF

🎨 Palettized image format and software renderer 🖼️

Documentation . Demos . Todo · Report Bug · Request Feature


Table of contents

Introduction

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.

Why

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.

Demos

The demos folder contains subfolders for graphical, textmode and pure file IO demos.

Note

The terminal demos do not support Windows.

Pre-requisites

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

Debian

$ apt install gcc g++ make libsdl2-dev ncurses

Arch

$ pacman -S gcc make sdl2 ncurses

Quickstart

$ git clone https://github.com/LordOfTrident/pif
$ cd pif/demos/sdl2
$ make
$ ./dots3d

Documentation

Coming soon.

Bugs

Known bugs are listed in the todo file. If you find any more bugs, please, create an issue and report them.




C99 SDL2

Made with ❤️ love

(Back to top)

About

🎨 Palettized image format and software renderer for C 🖼️

License:MIT License


Languages

Language:C 100.0%