lua上的图形库 [英] graphics library on lua

查看:289
本文介绍了lua上的图形库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在嵌入式platfrom上使用lua,而我面临下一个问题-我需要一些用lua编写的开源图形库.是否存在符合这些要求的库? 谢谢你.

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.

推荐答案

我需要一些用lua编写的开源图形库.

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.

Lua运行时不提供对在Lua本身中实际显示图形所需的特定于平台的低级详细信息的访问.您可以在Lua中编写图形例程,但是它永远无法绘制到实际的屏幕上.它可能会吸引到文件或类似性质的东西.但不是屏幕.

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.

这意味着您将不得不使用某种非Lua库来至少显示图像.但是,您也不会找到任何一个,因为没有人会费心地在Lua本身中编写图形库.毫无意义.那就太慢了.仅将Cairo或OpenGL或某些其他本机代码库绑定到Lua会容易得多.您可以拥有与本地Lua库相同的功能和灵活性,而且还可以获得性能.

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.

这篇关于lua上的图形库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆