Archives for: November 2007

11/09/07

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 :-)

Permalink . Ikke . 11:16:30 pm . 156 Words . Desktop, Coding Corner . . 1696 views . Leave a comment

11/08/07

Clutter reflections

Clutter reflections

See src/view-reflection.c in your local gallery git clone. Suboptimal code, no slideshow (only displays the first picture for a given tag), but well.

Maybe I should try to load images (using GdkPixbuf or something alike), use GEGL to do some transforms on them (more optimized than my hackish filters :-P), then use these transformed images on a Clutter texture...

I wonder how hard it would be to play a movie using clutter-gst and add reflections of it.

Permalink . Ikke . 01:12:18 pm . 79 Words . Linux, Desktop, Coding Corner . . 3410 views . Leave a comment
Clutter, advanced UI graphics made fun

Today I looked at Clutter, a nifty "rich UI" creation library using OpenGL and the like. After playing around with some of the samples, reading some API docs and writing one dumb simple text-rotating application (think Windows' text-message screensaver, you know), I wanted to make something more advanced (hum-hum).

I decided writing some photo slideshow application would be cool. We already have several of those, obviously, remember this is just a playground.
Having some sort of F-Spot (a great photo management application) integration would be nifty too, so I started with that: loading taglists and picture-paths for one tag. In the end it turned out writing that took more time than writing the simple view I created.

Next I wrote the Clutter driver code and some system to be able to easily switch view functions. I only implemented one so far, which just fades between images (in, out, next image in, out etc) and stores the GdkPixbuf's in a ringbuffer. Not optimal, no cleanup code yet, jadajadajada.

No screenshots as a static screenshot would not be very impressive (the current application neither but hey ;-)).

Anyway, it might be useful as a sample/basic Clutter application for some people. You can find the source code, clone URL and compilation instructions here. If you implement some nifty view, share it!

Enjoy.

Permalink . Ikke . 02:54:57 am . 219 Words . Linux, Desktop, Coding Corner . . 2906 views . 6 comments