I am trying to move my Playdate game to stage 2 and the Playdate API is a series of function pointers. I changed all of my function pointers to be of type *const fn but I am still getting the error message:
/Users/danielbokser/playdate_puzzle/src/main.zig:26:28: error: parameter of type '*playdate_api_definitions.PlaydateAPI' must be declared comptime
pub export fn eventHandler(playdate: *pdapi.PlaydateAPI, event: pdapi.PDSystemEvent, arg: u32) c_int {
The PlaydateAPI struct has the definition:
pub const PlaydateAPI = extern struct {
system: *const PlaydateSys,
file: *const PlaydateFile,
graphics: *const PlaydateGraphics,
sprite: *anyopaque,
display: *const PlaydateDisplay,
sound: *const PlaydateSound,
lua: *anyopaque,
json: *anyopaque,
scoreboards: *anyopaque,
};
I have no idea what field this error is coming from since all of function pointers have been converted to *const fn. Any ideas?