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
NetherGranite
Prole
Posts: 22
Joined: Wed Jul 11, 2018 11:08 pm

How can I interact with LOVE2D objects in C code?

Post by NetherGranite » Thu Sep 13, 2018 11:53 pm

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: No registered users and 10 guests