Hello everybody,
first, I want to excuse for my bad english, it's foreign to me. I am also a novice hobby programmer.
Now, I've installed and tried SFML on my notebook - everything works fine!
However, the same code, as well as the code provided with the "Using render windows" tutorial, crashes on execution on my "main rig". My "own" code is also close to the tutorials code, with just an shape added for playing around (code follows).
I am well aware that this is probably a maschine specific problem, however, I have no idea how.
I'm using VS2008 SP1, and I have compiled SFML separatly on both maschines with the same settings. Both maschines use Win XP SP3. In my project, I link against the static libraries:
sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
sfml-main-d.lib
Im creating a debug version, of course. I am also providing the IDE with the libs created by the rebuild.
Now, my source code:
#include <SFML/Graphics.hpp>
int main(int argc, char** argv)
{
sf::RenderWindow Window( sf::VideoMode(800, 600), "My SFML Test");
//I commented the shape out again, trying to pin the problem down
//sf::Shape Polygon;
//Polygon.AddPoint(0,100, sf::Color(255,255,255), sf::Color(128,128,128) );
//Polygon.AddPoint(50,0, sf::Color(255,255,255), sf::Color(128,128,128) );
//Polygon.AddPoint(-50,0, sf::Color(255,255,255), sf::Color(128,128,128) );
//Window.SetView( sf::View(sf::FloatRect(-500, -500, 500, 500) ) );
while( Window.IsOpened() )
{
sf::Event Event;
while( Window.GetEvent( Event ) )
{
if( Event.Type == sf::Event::Closed )
Window.Close();
}
Window.Clear();
//Window.Draw(Polygon);
Window.Display();
}
return 0;
}
Again, everything runs fine on my notebook - including the "shape parts".
Starting a debug session from IDE gives me following error message (from VS2008, translated as good as possible):
Unhandled exception at 0x00000008 in SFML_Test.exe: 0xC0000005: Access violation reading at position 0x00000008.
Thanks to the wonders of "step-by-step" execution, I have found the crashes happens at "Window.Clear()"
Commenting the line out, but leaving the "shape parts" in leads to a similiar error message on "Window.Draw(Polygon)".
Commenting both out gives me a working window (with the expectable garbage showing), but gives me another error message once it hits "return 0":
Run-Time Check Failure #2 - Stack around the variable 'Window' was corrupted.
The same behaviour can be observed with just the downloaded, mentioned tutorial, as well as an app using sf::Window instead of RenderWindow.
I already looked into the other thread "SFML Crash on App.Clear() and App.Display()", but none of the hints provided there have worked for me so far.
I have installed the newest video drivers, reinstalled my IDE, and completly rebuild SFML, and now I have reached the end of my (admittedly meager) knowledge.
If any of you folks here could provide me with help, I'd be very thankful.
Great thanks in advance!
Kazuar