
HEBitmap (High Efficiency Bitmap) is a custom implementation of the drawBitmap function (Playdate SDK).
This implementation is up to 2x faster than the SDK drawBitmap function, but native features (flip, stencil) are not supported.
Bitmap info: 96x96 (masked)
Bitmap count | HEBitmap | drawBitmap | Faster |
---|---|---|---|
1000 | 22 ms | 42 ms | 1.9x |
#include "he_api.h"
// Initialize with PlaydateAPI pointer
he_library_init(pd);
// Load HEBitmap from a Playdate image file
HEBitmap *bitmap = HEBitmap_load("catbus");
// Draw
HEBitmap_draw(bitmap, 0, 0);
// Free
HEBitmap_free(bitmap);
- Run
cd <your_build_folder>
- Run
cmake ..
- Run
make
- Before building again, delete all the files in the build folder
- Run
cmake -DCMAKE_TOOLCHAIN_FILE=<path to SDK>/PlaydateSDK/C_API/buildsupport/arm.cmake -DCMAKE_BUILD_TYPE=Release ..
- Note: replace
<path to SDK>
with your SDK path - Run
make
You can use the Python encoder to create heb/hebt files, supported inputs are:
- Image
- Animated GIF (saved as bitmap table)
- Folder containing a Playdate image table (name-table-1.png, name-table-2.png, ...)
-i
--input
input file or folder-r
--raw
save as raw data (no compression)
python encoder.py -i <file_or_folder>