Context: I've ported my WebGL matrix effect to a Lua Playdate project, and am attempting a C project to see how their performance compares on-device. I'm developing on a Mac.
My Lua project imports a spritesheet of glyphs into an image table, and then creates a cache of opaque faded variants of each glyph on initialization via blendWithImage
, to make a lookup table for drawing glyphs at different brightnesses in the update loop:
I can think of several strategies for implementing this in C, but I don't know what's possible, or what's best:
- Is it possible to invoke
blendWithImage
through the C API? I don't think so? - Could I invoke the Lua API's
playdate.graphics.image.blendWithImage
function from C somehow? - I could keep creating the images in Lua but maybe pass the images into the C somehow
- I could implement my own dithering in C
What should I be doing here?