SFML community forums

Help => Window => Topic started by: bazukas on July 09, 2012, 12:44:33 pm

Title: Window's BackGround Color [SOLVED]
Post by: bazukas on July 09, 2012, 12:44:33 pm
Don't know if I should have created this topic in the graphic's or window's section but anyways here it is:

Is there a way , without resorting to OpenGL to set/change the background color of a SFML's window?


Thanks in advance and forgive any grammar errors ;D.


--bazukas
Title: Re: Window's BackGround Color
Post by: Laurent on July 09, 2012, 12:54:18 pm
Depends which class (Window or RenderWindow) and which version of SFML.
Title: Re: Window's BackGround Color
Post by: bazukas on July 09, 2012, 12:58:51 pm
Thanks for the quick reply Laurent.

I don't know how I forgot to provide any useful info and for that I'm sorry.

I'm using SFML 2.0 and currently working with RenderWindow class for 2D rendering.

--bazukas
Title: Re: Window's BackGround Color
Post by: victorlevasseur on July 09, 2012, 01:18:07 pm
Hello,

To change the window's background color, you can add a sf::Color argumenht to sf::RenderWindow::clear method.
http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderTarget.php#a6bb6f0ba348f2b1e2f46114aeaf60f26
Title: Re: Window's BackGround Color
Post by: bazukas on July 09, 2012, 05:22:09 pm
Thanks a lot!  :D