Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window's BackGround Color [SOLVED]  (Read 22339 times)

0 Members and 1 Guest are viewing this topic.

bazukas

  • Newbie
  • *
  • Posts: 5
    • View Profile
Window's BackGround Color [SOLVED]
« 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
« Last Edit: July 09, 2012, 05:23:03 pm by bazukas »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32464
    • View Profile
    • SFML's website
    • Email
Re: Window's BackGround Color
« Reply #1 on: July 09, 2012, 12:54:18 pm »
Depends which class (Window or RenderWindow) and which version of SFML.
Laurent Gomila - SFML developer

bazukas

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Window's BackGround Color
« Reply #2 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
« Last Edit: July 09, 2012, 01:00:30 pm by bazukas »

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Window's BackGround Color
« Reply #3 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

bazukas

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Window's BackGround Color
« Reply #4 on: July 09, 2012, 05:22:09 pm »
Thanks a lot!  :D