How can I interact with LOVE2D objects in C code?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

How can I interact with LOVE2D objects in C code?

Post by NetherGranite »

Let's say I have the following Lua code:

Code: Select all

local imageData = love.image.newImageData(100, 100)

someLibrary.doSomethingTo(imageData)
and let's say that doSomethingTo() is defined by

Code: Select all

void doSomethingDo(lua_State *L) {
    u_int8 * data = // code here
}
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

void *ImageData::getData() const
{
    return data;
}
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 56 guests