Re: [clutter] Using cogl without clutter

2010-04-07 Thread Oscar Lazzarino
On Tue, Apr 6, 2010 at 6:07 PM, Robert Bragg b...@o-hand.com wrote:

 The long term goal is for Cogl to become a standalone 3D graphics API
 and we are incrementally working towards this goal.

 Cogl will also have a window system abstraction (only as far as
 framebuffer management is concerned, I don't mean anything relating
 input events etc) that could make it possible to integrate tightly with
 GTK in one way or another.

 Integrating with a GL context not owned by Cogl adds additional
 complexity but theoretically it would be possible to create a Cogl
 winsys that allowed this.

 Sorry that doesn't really help you, but you might be interested to know
 it may be possible one day.


OK, let's try lowering the bar ;-)

Would it be possible to use cogl_pango outside of the clutter_text
actor (i.e. in a custom actor)?

The cogl_pango functions are treated as private functions and not
documented, as far as I can see, and the simple approach

CoglColor *lWhite = cogl_color_new();
cogl_color_set_from_4f(lWhite, 1.0, 1.0, 1.0, 1.0);
cogl_set_source_color(lWhite);

PangoContext *lPangoCtx = pango_context_new();
PangoFontDescription *lPangoFontDescr = pango_font_description_new();
pango_font_description_set_family(lPangoFontDescr, Sans);
pango_font_description_set_size(lPangoFontDescr, 10 * PANGO_SCALE);
PangoLayout *lPangoLayout = pango_layout_new(lPangoCtx);
pango_layout_set_font_description(lPangoLayout, lPangoFontDescr);
pango_layout_set_text(lPangoLayout, Sopra la panca la capra
campa, strlen(Sopra la panca la capra campa));
cogl_pango_render_layout(lPangoLayout, mWidth/2, mHeight/2, lWhite, 0);

cogl_path_ellipse(mWidth/2.0, mHeight/2.0, mWidth/4.0, mHeight/4.0);
cogl_path_stroke();

cogl_color_free(lWhite);

shows me the ellipse, but not the text.

I get the message

(testCOGL:13610): CoglPango-CRITICAL **:
cogl_pango_get_renderer_from_context: assertion
`COGL_PANGO_IS_FONT_MAP (font_map)' failed

Any hints?

Thanks

O.
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] Using cogl without clutter

2010-04-07 Thread Oscar Lazzarino
On Wed, Apr 7, 2010 at 4:43 PM, Neil Roberts n...@linux.intel.com wrote:

 You can't call the cogl_pango_* functions using a layout created with a
 regular pango context - instead it has to be a context created with the
 special Cogl font map. The cogl_pango functions in cogl-pango.h are
 meant to be public so it is safe to use them. The lack of documentation
 is an oversight not an attempt to hide them.

 The usual way to paint custom text in an actor is to call
 clutter_actor_create_pango_layout() and then render it with
 cogl_pango_render_layout(). This will take advantage of the CoglPango
 glyph cache and render the text from textures so it should be relatively
 efficient.

 Hope that helps

 - Neil


I did as you said, and it works :)

Actually, just out of curiosity, I also tried to create the Pango
context like this

PangoFontMap *lPangoFontMap = cogl_pango_font_map_new();
PangoContext *lPangoCtx = pango_font_map_create_context(lPangoFontMap);

and it also works.

Thanks to everyone who answered :)

O.
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] Using cogl without clutter

2010-04-06 Thread Oscar Lazzarino
Hi,

would it be possibile to use cogl without clutter, on a gl context
created with gtkglext? If so, a small example or some hints would be
very useful.

Thanks

O.
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] Small bug in configure script for clutter 1.2.4

2010-03-29 Thread Oscar Lazzarino
Just tried to compile clutter 1.2.4 on an old-ish kubuntu 8.10.

The configure script went fine, but looks like clutter depends on the
function g_signal_override_class_handler which is in glib since 2.18
(kubuntu 8.10 has glib 2.16). I guess there is a missing check
somewhere.

Thanks.

O.
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com