graphics library on lua

2019-07-03 16:16发布

问题:

Currently I am working with lua on embedded platfrom, and I faced the next problem - I need some open-source graphic library written in lua. Is there any existed library which match these requirments? Thank you on advance.

回答1:

I need some open-source graphic library written in lua.

Such a thing not only does not exist, it is not actually possible to write one.

The Lua runtime does not provide access to the low-level platform-specific details that would be required to actually display graphics in Lua itself. You could code graphics routines in Lua, but it would never be able to draw to an actual screen. It could draw to a file or something of that nature. But not the screen.

This means that you are going to have to use some kind of non-Lua library to at least display the image. However, you won't find one of those either, because nobody would bother to write a graphics library in Lua itself. There's just no point; it would be terribly slow. It would be so much easier to just bind Cairo or OpenGL or some other native code library to Lua. You get all the same power and flexibility that you would out of a native Lua library, but you also get performance.



回答2:

While it is not clear what your requirements are (except for open source, and graphics), you could take a look at luagd.