Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I code for iPhone in Vala?

Tags:

iphone

vala

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.

like image 217
Damian Avatar asked Feb 01 '11 00:02

Damian


2 Answers

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.

like image 68
ptomato Avatar answered Oct 22 '22 05:10

ptomato


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.

like image 1
CYB3R Avatar answered Oct 22 '22 06:10

CYB3R