I am unable to change the background color of the windows I create. I tried using glClearColor( 1.f , 1.f , 1.f , 1.f ) but it doesn't do anything
glClearColor only sets the clear color. It doesn't clear the screen. To do so, you have to call glClear(GL_COLOr_BUFFER_BIT).
I would also like to know why the SetBackgroundColor() function from version 1.3 (which was a member of the renderWindow class) doesn't exist in version 1.4
It has been replaced with
Clear(sf::Color). This is much more flexible :
- Many applications have a background sprite and thus can avoid calling it
- You can now call RenderWindow::Capture wherever you want between Display() and Clear(), especially in your event loop
- Some people think it's a good optimization to keep the contents of the previous frame and update only what's needed; at least now they can do it