Hello all,
I'm almost to my final straw with SFML. I can't get it to work! As soon as I clear up one error, another pops up! I can't wait to get started using it, but I can't with all these errors.
In the beginning, I got an error whenever I closed a RenderWindow, something about the stack around the VideoMode object being corrupted. However, I rectified this after I followed a tutorial to recompile the vb2008 version of SFML for newer versions.
But now, I have two issues. First, my RenderWindow has odd symbols at the top of it instead of the title I set in the constructor. Second, when I try to set the image of a sprite or to draw the sprite, I get this error:
Unhandled exception at 0x6FFB576E (msvcp110.dll) in sfml-sandbox.exe: 0xC0000005: Access violation reading location 0x0025E000.
Just before this error is thrown, the console behind my RenderWindow is spewing thousands of lines of meaningless ASCII symbols.
Here is some information about my system, including the code I used:
OS: Windows 7 Home
IDE: Microsoft Visual C++ 2011 Beta (although I've tried the same with 2010)
SFML: 1.6; I rebuilt the entire library using the newer version of C++
Code:
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
using namespace sf;
int main() {
VideoMode v(800,600);
RenderWindow w(v,"Test");
Image face;
if (!face.LoadFromFile("HappyFace.png")) {
return 1;
}
Sprite faceSprite;
faceSprite.SetImage(face);
while (w.IsOpened()) {
Event e;
while (w.GetEvent(e)) {
if (e.Type == Event::Closed) {
w.Close();
}
}
w.Clear(Color(0,255,255));
w.Draw(faceSprite);
w.Display();
}
return 0;
}
Thank you in advance for your help!
EDIT:
After commenting out the "while" loop of my code, I realized that an error is also thrown when I do faceSpirte.SetImage(face);
I don't know which section of code is causing this, although I would guess it is the first.