我可以在 Vala 为 iPhone 编码吗?
我正在使用 OpenGL 以 ooc 语言(一种编译为 c 的新语言)为 iphone 编写游戏。确实进展顺利,ooc 是我非常喜欢的语言。现在我刚刚了解了 Vala,但我不太明白它依赖于 GLib 和 GObject 意味着什么。我在另一个问题中读到 Vala 依赖 GTK,但我不认为它依赖 GTK。
问题是:我对 ooc 所做的事情,我可以对 Vala 做同样的事情吗?我可以在 vala 中为 iPhone 编写 OpenGL 游戏吗? vala代码可以从c中使用吗?
谢谢。
I'm coding a game for iphone in ooc language (a new language that compiles to c) using OpenGL. It's really going well, and ooc is a language I really like. Now I've just found out about Vala and I don't get very well what it means that it relies on GLib and GObject. I've read in another question that Vala depends on GTK, but I don't think it does.
The question is: What I'm doing with ooc, could I do the same with Vala? Can I code in vala an OpenGL game for IPhone? And can be vala code used from c?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Vala 的面向对象是使用 GObject 库实现的,该库是 GLib 的一部分。可以在没有对象的情况下使用 Vala,因此不需要 GLib,但这没有多大意义。
无论如何,要从 Vala 访问 C 库,需要有人为该库编写 VAPI 绑定(请参阅 Google)。可能没有适用于 Apple API 的 API,因此您必须自己编写 - 如果 Apple 许可协议允许的话。
Vala's object orientation is implemented using the GObject library, which is part of GLib. It is possible to use Vala without objects, and therefore not requiring GLib, but there's not much point to that.
In any case, to access a C library from Vala, somebody needs to have written a VAPI binding (see Google) for that library. There probably isn't one for Apple APIs, so you'd have to write it yourself - if that's even allowed by the Apple license agreement.
您可以在此存储库中找到适用于 iOS 的旧版本原生 vala 编译器和 libgee:cydia.radare.org ( valac 版本是 0.15,已经很旧了)。 UPD:添加了 valac 0.34.4,这是一个相对较新的版本。
可以为 iOS 编译 GLib,因此编译 vala 代码不应该成为一个问题。这里真正的困难来自于已经提到的绑定,我怀疑有人已经拥有适用于 iOS 的 VAPI。
You can find old version of native vala compiler and libgee for iOS in this repo: cydia.radare.org (valac version is 0.15, it is very old). UPD: valac 0.34.4 was added, which is relatively new.
It is possible to compile GLib for iOS, so having vala code compiled should not be a problem. The real difficulty here comes with the bindings as already mentioned, I doubt that someone already has VAPIs for iOS.