Some further research...
I managed to modify the code on this page
http://ethanmiller.name/notes/pyglet_pycairo/?disqus_reply=8543776#comment-8543776
(ignore the embaressing show me the codez style comments :)
to use opengl + cairo together... however it's not fully working as my opengl-fu is not up
to scratch.
If anyone knows a little opengl and could have a look that would be great (I couldn't get
pyglet and cairo to play nice with each other (I can't get the text to render AND the opengl)).
As far as it works the framerate appears really good.
If it works, we can probably want to switch to pygtkglext for the drawing... unfortunately I
couldn't seem to find a simple example with pygykglext + cairo (although I believe some
C ones exist). If anyone has some good opengl and/or python-fu I can probably point
to some examples as I don't yet have enough open gl experience to know what I'm
doing :)
----- Original Message ----
From: Stuart Axon <stuaxo2-/***@public.gmane.org>
To: shoebot-devel-***@public.gmane.org
Sent: Thursday, April 16, 2009 5:58:32 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow
I'm thinking along the same lines, other advantages include the
inkscape plugin.
I've been playing with pure python + cairo + pygtk recently,
so will see if I can come up with a simple test case to push to
pygtk (and possibly gtk).
I'm really not sure how hard it is to get QT + python working
in windows either.
Certainly of interest is this page
http://cairographics.org/OpenGL/
on using cairo with opengl.
If QT is considered, I think we should keep the cairo backend
and look at having seperate backends (I guess we would need
some sort of test suite to make sure the output is consistent.
On the subject of a test suite, this is something we might want
to share with nodebox too).
----- Original Message ----
From: francesco fantoni <francesco-pB81QDORtWSUBmjqxMAjcGD2FQJk+8+***@public.gmane.org>
To: shoebot-devel-***@public.gmane.org
Sent: Thursday, April 16, 2009 5:47:59 PM
Subject: Re: [shoebot-devel] gtk.main_iteration is slow
I think it would be more interesting trying to optimize the code and get
faster with cairo, switching to Qt would mean quite a huge effort, and
cairo has some advantages (thinking about pango or pdf export e.g.).
Besides there's already nodebox port working on qt, so having a
different approach could be interesting for catching a different users
base.
Maybe we could get some python-cairo developer involved...
Post by ricardo lafuentePost by Stuart AxonI've been playing around with shoebot trying to find out some info on performance, and it seems that gtk.main_iteration takes quite a lot of the time rendering frames.
Time per frame
0.203320000172 gtk.main_iteration
0.210910000801 gtk.main_iteration(block = False)
0.0180599999428 No gtk.main_iteration
I wonder if there are alternate ways that we can render the canvas, still using cairo that might be faster (e.g. opengl) ?
yes, that was the easiest way to get animation working. I remember
seeing it work and never touching it again.
i assume that the big delay has to do with the Cairo rendering, i wonder
how much time it takes using the commandline version? If there's a huge
difference, the problem is obviously in the GTK side of things.
i've been working with Qt recently (which Nodebox also uses for their
*nix port) and read some benchmarks some time ago that place their
renderer orders of magnitude faster than Cairo... this would require
quite some effort to switch from GTK, but i would be happy to have just
a Qt window showing the canvas (i.e. no shoebot-ide porting). Should we
consider this?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
--
architetto Francesco Fantoni
<HVA - Hermanitos Verdes Architetti>
l.go san giacomo, 38
I-41100 modena (italia)
tel.& fax. +39.059.217554
skype: hva_studio
e.mail: francesco-***@public.gmane.org
web: http://www.hv-a.com