How does love.dll expose love2d's functions?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- NetherGranite
- Prole
- Posts: 30
- Joined: Wed Jul 11, 2018 11:08 pm
How does love.dll expose love2d's functions?
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?
- 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?
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?
What do you want to do in C++ with love's API?
- NetherGranite
- Prole
- Posts: 30
- Joined: Wed Jul 11, 2018 11:08 pm
Re: How does love.dll expose love2d's functions?
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.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?
Re: How does love.dll expose love2d's functions?
Sounds like a job for a shader You've described basically how shaders work. http://blogs.love2d.org/content/beginners-guide-shaders
- NetherGranite
- Prole
- Posts: 30
- Joined: Wed Jul 11, 2018 11:08 pm
Re: How does love.dll expose love2d's functions?
Unfortunately, there is sorting involved for each pixel, and the inputs to that sorting do not all come at the same time.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
Who is online
Users browsing this forum: Bing [Bot] and 71 guests