SFML community forums

Help => Graphics => Topic started by: Cayle on December 01, 2013, 12:43:45 am

Title: Screenshot whenever I create a window.
Post by: Cayle on December 01, 2013, 12:43:45 am
Hey guys, I have my code below. The problem is that when I create the window it just takes a screen shot of whatever is behind it, I tried using the clear command but it doesn't work.


#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>


using namespace std;

int main(){
sf::RenderWindow splashScreen(sf::VideoMode(180, 160), "Naval Command!");


       
while(splashScreen.isOpen()){
        splashScreen.clear();
                sf::Event event;

                while(splashScreen.pollEvent(event)){

                        if(event.type == sf::Event::Closed){
                                splashScreen.close();
                        }
                       
                }
}
return 0;
}
 
Title: Re: Screenshot whenever I create a window.
Post by: Nexus on December 01, 2013, 12:54:52 am
Please read the tutorials. A game loop is not supposed to look like this...