this is the full code...........
----------------------------------
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600), "My window" , sf::Style::Close);
Window.setTitle("NULL Title");
sf::Vector2u size = Window.getSize();
unsigned int Width = size.x;
unsigned int Height = size.y;
Window.setSize(sf::Vector2u(999,777));
Window.setPosition(sf::Vector2i(300,20));
sf::WindowHandle handle = Window.getSystemHandle();
Window.setVerticalSyncEnabled(true);
//window.setFramerateLimit(60);
sf::Event event;
sf::Texture textureone;
sf::Sprite spriteone;
sf::Texture texturetwo;
sf::Sprite spritetwo;
while (Window.isOpen()) {
sf::Event event;
if (Window.pollEvent(event))
{
if (event.type == sf::Event::Closed || event.key.code == sf::Keyboard::Escape)
Window.close();
}
Window.display();
if (!textureone.loadFromFile("hs.png", sf::IntRect(111,111,111,111))) {
std::cout << "nope" << std::endl;
}
//else
//(std::cout << "yes" << std::endl);
spriteone.setTexture(textureone);
if (!texturetwo.loadFromFile("hs2.png", sf::IntRect(111, 111, 111, 111))) {
std::cout << "nope2" << std::endl;
}
spritetwo.setTexture(texturetwo);
//spritetwo.setPosition(sf::Vector2f(333,333));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) {
spritetwo.move(3,0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) {
spritetwo.move(-3, 0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) {
spritetwo.move(0, 3);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) {
spritetwo.move(0, -3);
}
if (spriteone.getLocalBounds().intersects(spritetwo.getGlobalBounds)) {
}
Window.clear(sf::Color::White);
Window.draw(spriteone);
Window.draw(spritetwo);
}
return 0;
}