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

Author Topic: Screenshot whenever I create a window.  (Read 858 times)

0 Members and 1 Guest are viewing this topic.

Cayle

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Screenshot whenever I create a window.
« 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;
}
 

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Screenshot whenever I create a window.
« Reply #1 on: December 01, 2013, 12:54:52 am »
Please read the tutorials. A game loop is not supposed to look like this...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything