Re: [Vala] Rewriting GLib C code in Vala



Thanks for your interest.

This turned out to be a bit more complicated than I expected.

I will go through your references and complete cogl-crate soon.

The new home for vapi is now here: http://blog.golovin.in/vala-cogl/vapi/
I also generated valadoc for it: http://blog.golovin.in/vala-cogl/doc/

I hope, there are people interested in it.

If you can compile and test the examples on different systems, please do. I want to receive some feedback on 
how cross-platform cogl really is.
I have already tested it on GNU/Linux+Xorg, GNU/Linux+Wayland and M$ Windows (not impressed).

Regards,
Dmitry

24.07.2015, 14:33, "Al Thomas" <astavale yahoo co uk>:
 From: Dmitry Golovin <dima golovin in>
 Sent: Friday, 24 July 2015, 10:04
 Subject: [Vala] Rewriting GLib C code in Vala

 I'm now transfering Cogl examples to Vala:
 https://github.com/tpimh/vala-cogl

Interesting stuff. I also like the reference you've
found where someone has written an image viewer in
Genie :-) ( http://onagat.hatenablog.com/ )

 I'm a GLib newbie, so I need help with rewriting cogl-crate example:
 https://github.com/GNOME/cogl/blob/master/examples/cogl-crate.c

 I don't fully understand what PollFD is and what function in Vala GLib
 binding should be used for g_poll.

It is an event descriptor. From
https://developer.gnome.org/cogl-2.0-experimental/stable/cogl-2.0-experimental-Main-loop-integration.html
it is deliberately the same as the Unix pollfd struct ( http://www.valadoc.org/#!api=posix/Posix.pollfd )
So it may help if you look for Vala examples with that.

I understand you are trying to replicate the example exactly, but as
you progress you may want to read
https://developer.gnome.org/cogl-2.0-experimental/stable/cogl-2.0-experimental-Main-loop-integration.html
if you haven't already. This is suggesting using cogl_glib_source_new()
to get a GSource event source that can then be integrated with GLib.MainLoop

Some references:
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html
http://valadoc.org/#!api=glib-2.0/GLib.MainLoop
https://wiki.gnome.org/Projects/Vala/AsyncSamples
https://sigquit.wordpress.com/2010/01/05/g_source_unref-and-g_source_destroy-are-your-friends/
http://stackoverflow.com/questions/21434669/creating-a-new-gsource-in-glib
https://tecnocode.co.uk/tag/gsource/

 You can find relevant vapi here:
 https://github.com/tpimh/vala-cogl/blob/master/vapi/cogl-2.0.vapi

Thanks, I will add this to the list of bindings wiki page
( https://wiki.gnome.org/Projects/Vala/ListOfBindings )

Al
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]