Wow, thanks for the quick replay
I will try this option and let you know how things go. To be honest i haven't tried the samples yet but i was planning on doing so soon. Also thanks for the tip about the dlls, i have now reduced the amount to 3.
My projects code was -
#include <SFML/Graphics.hpp>
int main() {
// Create the SFML window
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML App");
// Setup font and text
sf::Font font;
font.loadFromFile("assets/arial.ttf");
sf::Text text("", font);
text.setCharacterSize(18);
// Write default text
window.clear();
text.setString("Please press a arrow key or click a mouse button");
window.draw(text);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
// Window closed
if (event.type == sf::Event::Closed) {
window.close();
}
// Window lost focus
if (event.type == sf::Event::LostFocus) {
window.clear();
text.setString("Window lost focus");
window.draw(text);
}
// Window gained focus
if (event.type == sf::Event::GainedFocus) {
window.clear();
text.setString("Window gained focus");
window.draw(text);
}
// Window resized
if (event.type == sf::Event::Resized) {
window.clear();
text.setString("Window resized");
window.draw(text);
}
// Keyboard Keys Pressed
if (event.type == sf::Event::KeyPressed) {
if (event.key.code == sf::Keyboard::Up) {
window.clear();
text.setString("Up key was pressed");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Down) {
window.clear();
text.setString("Down key was pressed");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Left) {
window.clear();
text.setString("Left key was pressed");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Right) {
window.clear();
text.setString("Right key was pressed");
window.draw(text);
}
}
// Keyboard Keys Released
if (event.type == sf::Event::KeyReleased) {
if (event.key.code == sf::Keyboard::Up) {
window.clear();
text.setString("Up key was released");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Down) {
window.clear();
text.setString("Down key was released");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Left) {
window.clear();
text.setString("Left key was released");
window.draw(text);
} else if (event.key.code == sf::Keyboard::Right) {
window.clear();
text.setString("Right key was released");
window.draw(text);
}
}
// Mouse Buttons Pressed
if (event.type == sf::Event::MouseButtonPressed) {
if (event.mouseButton.button == sf::Mouse::Left) {
window.clear();
text.setString("Left mouse button is pressed");
window.draw(text);
} else if (event.mouseButton.button == sf::Mouse::Middle) {
window.clear();
text.setString("Middle mouse button is pressed");
window.draw(text);
} else if (event.mouseButton.button == sf::Mouse::Right) {
window.clear();
text.setString("Right mouse button is pressed");
window.draw(text);
}
}
// Mouse Buttons Released
if (event.type == sf::Event::MouseButtonReleased) {
if (event.mouseButton.button == sf::Mouse::Left) {
window.clear();
text.setString("Left mouse button is released");
window.draw(text);
} else if (event.mouseButton.button == sf::Mouse::Middle) {
window.clear();
text.setString("Middle mouse button is released");
window.draw(text);
} else if (event.mouseButton.button == sf::Mouse::Right) {
window.clear();
text.setString("Right mouse button is released");
window.draw(text);
}
}
// Mouse wheel moved
if (event.type == sf::Event::MouseWheelMoved) {
window.clear();
text.setString("Mouse wheel moved");
window.draw(text);
}
/*
// Mouse moved
if (event.type == sf::Event::MouseMoved) {
window.clear();
text.setString("Mouse moved");
window.draw(text);
}
// Mouse entered the window
if (event.type == sf::Event::MouseEntered) {
window.clear();
text.setString("Mouse entered the window");
window.draw(text);
}
// Mouse left the window
if (event.type == sf::Event::MouseLeft) {
window.clear();
text.setString("Mouse left the window");
window.draw(text);
}
*/
}
window.display();
}
return 0;
}
And i had set graphics, window and system in the linker settings after following the tutorial, i was not sure if this app needed more things set in that panel but it seems ok so i just left it as in the tutorial.
I will try using "window.setVerticalSyncEnabled(true);" and let you know how things go, thanks for the help