How can I interact with LOVE2D objects in C code?
Posted: Thu Sep 13, 2018 11:53 pm
Let's say I have the following Lua code:
and let's say that doSomethingTo() is defined by
What code needs to go at "// code here" so that the variable "data" will now hold the array of data of the ImageData?
I was able to find this code in LOVE2D's source if it helps at all:
Code: Select all
local imageData = love.image.newImageData(100, 100)
someLibrary.doSomethingTo(imageData)
Code: Select all
void doSomethingDo(lua_State *L) {
u_int8 * data = // code here
}
I was able to find this code in LOVE2D's source if it helps at all:
Code: Select all
void *ImageData::getData() const
{
return data;
}