The following code gives me the uncaught exception (specifically line 6):
Unhandled exception at 0x701ADEF8 (msvcr110.dll) in SFML.exe: 0xC0000005: Access violation reading location 0x05260000. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
int _tmain(int argc, wchar_t* argv[]) {
sf::RenderWindow window(sf::VideoMode(512, 512), "ChessPlusPlus", sf::Style::Close);
sf::Sprite chessboard;
sf::Texture txtr;
txtr.loadFromFile("C:/Users/kidz/Documents/Visual Studio 2012/Projects/SFML/Debug/chessboard.gif");
chessboard.setTexture(txtr);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
window.close();
}
}
window.clear();
window.draw(chessboard);
window.display();
}
getwchar();
return 0;
}
|
Also, during the debugging of the program, a bunch of random ASCII characters get outputted onto the console (sometimes even personal files like essays, etc...). Then, the console goes blank (null characters) and the exception is thrown.
Once, I was able to pause the program and scroll all the way up at it said something like: "Unable to open file 'chessboard.gif (with some random ASCII characters in the word)'" and then the long list of ASCII characters.
Is there something wrong with SFML or am I doing something wrong? I know that SFML docs say that sometimes the file may not load and throw a exception, but in this case, it's going crazy. Also, I have randomly put a filename that does not exist and the same thing still occurred instead of throwing a file not found exception.
I have tried the same code on Orwell Dev-C++ and it just returns a white box where the image is supposed to be and returns an exception when the file does not exist.
Some pictures:
http://i.stack.imgur.com/gq420.png
http://i.stack.imgur.com/Os8jw.png
I will be glad to provide any extra information.
Thank you,
Usandfriends!