I recently made the switch to Windows 8 (from Windows 7) and have not had a pleasant time moving my code over. This code, which is just a combination of the examples for sf::Text and the Visual Studio set-up example, works on my old machine -
#include <SFML\Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML doesn't work :(");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
// Create a text
sf::Text text("hello");
//text.setCharacterSize(30);
//text.setStyle(sf::Text::Bold);
//text.setColor(sf::Color::Red);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
//window.draw(text);
window.display();
}
return 0;
}
- but produces the following error "Access violation reading location 0xfeeefef6" on the new one. Both machines have the same version of SFML (2.0, downloaded from the RC page), are linked in the exact same manner, and have the exact same code. I also created a new solution instead of simply copying over an old one, which didn't fix the problem. From some other posts on the forums it appears that a few other people are having issues running code with Windows 8. Is there a reason for this? If there is, is a fix available or when can one be expected?
If it makes any difference, the issue appears to occur when I instantiate the sf::Text object, as commenting that line out eliminates the error. Does anyone have any insight into this problem?