setClearColor doesn't work (C++)

Hi all,

I wanted to set the background color of the window in C++, and I’ve looked at how ShowBase does it. Well, it called the function DrawableRegion::set_clear_color on the GraphicsWindow.
So, I tried this code:


But the color remains gray. Any idea what I could be doing wrong? I also tried set_clear_color_active but that didnt help either.

I remember that has been discussed before :

Right, this worked fine:

win_ptr->get_graphics_window()->get_active_display_region(0)->set_clear_color(Colorf(0, 0, 0, 1));

Thanks a lot!
EDIT: Ralph now done, i’ll put it at the forums soon!