How does love.dll expose love2d's functions?

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 does love.dll expose love2d's functions?

Post by NetherGranite »

I am looking to use love::image::setPixel(). If I am linking against love.dll during compilation, what will this function be called? Is it even plausible to link against love.dll, or should I just try to include all the relevant source .cpp files?
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How does love.dll expose love2d's functions?

Post by slime »

Most C++ classes aren't exported publicly from the dll I think. In ImageData::setPixel's case, it's actually a lot faster to call ImageData:mapPixel (from Lua) than setPixel, because that has a very fast FFI implementation.

What do you want to do in C++ with love's API?
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

Re: How does love.dll expose love2d's functions?

Post by NetherGranite »

slime wrote: Tue Oct 09, 2018 11:47 pm Most C++ classes aren't exported publicly from the dll I think. In ImageData::setPixel's case, it's actually a lot faster to call ImageData:mapPixel (from Lua) than setPixel, because that has a very fast FFI implementation.

What do you want to do in C++ with love's API?
Oh okay, good to know. I have some code that does some math per each pixel in an ImageData. I then have to take the result of this math and write it to each pixel. I was hoping that I could do this writing to every single pixel in C++ since there are around 1,000,000 pixels and Lua struggles to keep up with that.
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: How does love.dll expose love2d's functions?

Post by pgimeno »

Sounds like a job for a shader :) You've described basically how shaders work. http://blogs.love2d.org/content/beginners-guide-shaders
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

Re: How does love.dll expose love2d's functions?

Post by NetherGranite »

pgimeno wrote: Wed Oct 10, 2018 9:50 am Sounds like a job for a shader :) You've described basically how shaders work. http://blogs.love2d.org/content/beginners-guide-shaders
Unfortunately, there is sorting involved for each pixel, and the inputs to that sorting do not all come at the same time.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 71 guests