Hi! I'm trying to display Mouse coordinates in the render window. Here's my code:
...
sf::Font MyFont;
if (!MyFont.loadFromFile("arial.ttf"))
{
return 1;
}
sf::Text myPos;
std::string str;
while (window.pollEvent(event))
{
if (event.type == sf::Event::MouseMoved)
{
str=event.mouseMove.x+" "+event.mouseMove.y;
myPos.setString(str);
myPos.setFont(MyFont);
myPos.setCharacterSize(20);
myPos.setColor(sf::Color::Red);
myPos.setPosition(0,0);
std::cout<<str;
}
}
...
...but instead of the coordinates the string gets some weird system messages about problems with relocation:
[attachment deleted by admin]