#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
//Render Window
sf::RenderWindow window(sf::VideoMode(200, 200), "Demo");
//Render Objects
sf::RectangleShape shape(sf::Vector2f(100,100));
//Move code
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Right))
{
shape.move(1, 0);
}
//Window Stuff
while (window.isOpen())
{
sf::Event evnt;
while (window.pollEvent(evnt))
{
if (evnt.type == sf::Event::Closed)
window.close();
switch (evnt.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::Resized:
printf("New Height: %i New Width: %i\n", evnt.size.height, evnt.size.width);
break;
case sf::Event::TextEntered:
if (evnt.text.unicode < 128)
{
printf("%c", evnt.text.unicode);
}
}
}
window.draw(shape);
window.display();
}
return 0;
}
It seems to skip the if statement on line 11
I've tried everything from fixing simple errors to completely reinstalling the library but nothing is working, any idea of what is going wrong?