PDA

View Full Version : Confused about GUIComponent creation: what does GUITopLevelDescription do when given?



blep
01-15-2014, 08:33 AM
If I construct my custom GUIComponent without passing a GUITopLevelDescription to the GUIComponent constructor, the rendered text and filled rectangles are opaque (as I want and as it was before making this a GUIComponent):


PerfViewComponent::PerfViewComponent( clan::GUIComponent *parent, const clan::FontDescription *baseFontDesc )
: clan::GUIComponent( parent )
, view_( parent->get_canvas(), baseFontDesc )
{
set_constant_repaint(true);
set_geometry( parent->get_display_window().get_viewport() );
func_render().set(this, &PerfViewComponent::onRender);
}

If I construct my custom GUIComponent passing a GUITopLevelDescription to the GUIComponent constructor then the rendered text and filled rectangles have some sort of blending effects (which I don't want).


PerfViewComponent::PerfViewComponent( clan::GUIComponent *parent, const clan::FontDescription *baseFontDesc )
: clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false) )
, view_( parent->get_canvas(), baseFontDesc )
{
set_constant_repaint(true);
func_render().set(this, &PerfViewComponent::onRender);
}

Where does this blending effect come from? :confused:
Why would you want to pass a GUITopLevelDescription to the GUIComponent constructor as the clanlib GUICustomComponent example does?

rombust
01-15-2014, 09:50 AM
Out of interest, what happens if you change:


clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false) )


To...



clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false), "something_that_is_not_window" )

blep
01-15-2014, 08:13 PM
Out of interest, what happens if you change:
To...



clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false), "something_that_is_not_window" )


I've got the same result as when no string was given: some blending effect during rendering.

I've also tried "toolbar" and "radialmenu" string, it displays the background image of the corresponding css and also causes the blending effect during rendering.

moogtrain
02-04-2014, 10:24 AM
What sort of blending effects are you getting?