On Sat, 2008-05-24 at 14:36 +0200, Mike Massonnet wrote: > > > How can i draw generic shapes like triangle, hexagon and all and how > > > can i apply texture on such shapes. > > > > you have to subclass ClutterActor and override the ::paint() virtual > > function; inside it, you can call GL primitives and draw complex shapes > > the way to prefer. > > Does it work with cairo also?
no, for that you can use the ClutterCairo texture actor provided by the clutter-cairo integration library. since Cairo does not have an OpenGL backend[1], the ClutterCairo texture will give you a context from an image surface and will then proceed to dump the contents of the drawing onto a GL texture. it's quite easy to write a composite actor with a ClutterCairo as an internal child to draw a background, for instance; I've done it in my Twitter client 'Tweet'[2] to have backgrounds with antialiased rounded corners. ciao, Emmanuele. +++ [1] though Pippin has been working on an experimental OpenVG backend. [2] http://github.com/ebassi/tweet/tree/master - see the TweetStatusCell, the TweetStatusInfo and the TweetSpinner actors. -- Emmanuele Bassi, OpenedHand Ltd. Unit R, Homesdale Business Centre 216-218 Homesdale Rd., Bromley - BR12QZ http://www.o-hand.com -- To unsubscribe send a mail to [EMAIL PROTECTED]