Frage

I have a collection of objects that I use for drawing and have always used Cairo for that. I've decided to switch to Clutter with Cogl for the drawing, but Cogl seems to be somewhat limited for 2D. So far I'm already missing being able set the dash pattern for a line as well as the line width. I've read two things, that you can use raw GL calls within Cogl and that you can use a ClutterCairoTexture. Unfortunately I can't find any documentation on using GL calls inside of cogl_begin_gl/cogl_end_gl and ClutterCairoTexture has apparently been deprecated.

It would be incredibly useful to know either how to use a Cairo context with a Clutter texture, or how 2D drawing is accomplished now in Cogl. I can't really understand why you wouldn't be given the ability to change the line width in Cogl, but it doesn't seem to be in any of the documentation that I've read. The dash pattern I can deal with if I had to, but it would definitely be better if I could either continue to use Cairo in an Actor/Texture, or if Cogl had some way to do it.

Thanks.

War es hilfreich?

Lösung

Turns out the answer is to continue using Cairo but create a ClutterCanvas and add it to whatever ClutterActor you're drawing to. After that you just need to connect a function to the draw signal which gives the CairoContext as a parameter.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top