Ikke's Blog

Post details: More Clutter

Nov 9
More Clutter

This afternoon I wanted to implement some custom ClutterActor. I made a very basic actor which is basicly a simple rectangle, like ClutterRectangle, but allows you to define a color for every corner, which are blended by OpenGL.

Like this:
ClutterGlColorRect

I also added a simple animation sequence which changes all corner colors over time, so you get some visual effect, and added some motion effects (a simple rotation around 2 axes). The color changing effect is badly written now, should become a ClutterBehaviour, if possible.

Code is here, it could be a good starting point to learn how to write a custom actor using OpenGL (first time I ever wrote OpenGL code myself, it's not that hard, more experimenting later).

Performance and anti-aliasing is rather sluggish now, but I don't think it's related to my code as doing the same rotations on a single-color ClutterRectangle gives the same result.

Oh: yes, this code leaks at exit.

Enjoy :-)

Comments:

No Comments for this post yet...

This post has 1 feedback awaiting moderation...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Categories

Who's Online?

  • Guest Users: 16

Misc

XML Feeds

What is RSS?