#bitmap #homebrew #nintendo #nds #grit #graphics

no-std rgrit

A Rust interface to grit - the GBA Image Transmogrifier with batteries included!

1 unstable release

new 0.1.1 Jan 13, 2025

#590 in Images

MIT license

27KB
143 lines

rgrit - Rust bindings for grit

Crates.io Version docs.rs Crates.io License

This crate provides a Rust interface to grit - the GBA Image Transmogrifier (“grit” for short). It is a bitmap conversion tool for GBA/NDS development.

The bindings are generated using bindgen.

The manual for grit can be found here.

Building

git clone https://github.com/not-jan/rgrit.git
cd rgrit
git submodule update --init
cargo build

Requirements

MacOS

brew install automake libtool freeimage llvm

I'm not sure if llvm is required, but it's probably a good idea to install it anyway.

Linux (Ubuntu / Debian)

sudo apt-get install autoconf build-essential libtool libfreeimage-dev

Windows

Untested, but might work.

Usage

use rgrit::StaticBitmap;

const BACKGROUND: StaticBitmap = rgrit::grit! {
    "assets/test.png",
    transparency = Disabled,
    bit_depth = 16,
    format = Bitmap,
};

fn main() {
    dbg!(&BACKGROUND);
}

Dependencies

~0–1MB