Yes
First I tried it so...
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <windows.h>
sf::RenderWindow Main;
sf::Event Eventmenu;
sf::Image ImMainBackground;
sf::Sprite SpMainBackground;
sf::String StIp;
bool exit2;
int main()
{
Main.Create(sf::VideoMode(300, 500, 32), "test", sf::Style::Close);
//Main.SetBackgroundColor (sf::Color(0,200,100));
exit2=false;
sf::IPAddress IP("nobody");
StIp.SetText(IP.ToString());
if (!ImMainBackground.LoadFromFile("1.jpg"))
return EXIT_FAILURE;
SpMainBackground.SetImage(ImMainBackground);
while(exit2==false)
{
while (Main.GetEvent(Eventmenu))
{
// Close window : exit
if (Eventmenu.Type == sf::Event::Closed)
{
exit2=true;
}
}
//Main.SetFramerateLimit(50);
Main.Draw(SpMainBackground);
Main.Display();
}
return 0;
}