graphics library on lua

偶尔善良 提交于 2019-12-12 15:15:10

问题


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.



来源:https://stackoverflow.com/questions/7726430/graphics-library-on-lua

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!