I've used the luajit ffi library to wrap a C library that contains a function to draw text on a ppm file:
void drawText(frameBuffer *fb, int px, int py, char* text, pixel color)
When I try to call it from lua using a string I get this error bad argument #4 to 'drawText' (cannot convert 'string' to 'char *')
. It doesn't look like the lua string library has anything to convert entire strings to byte arrays or anything that I could manipulate sufficiently.
Any tips on how I could do this on the lua side without modifying the C code?