1
Graphics / sf Variable declaration outside the main
« on: July 08, 2009, 03:02:28 am »
Hi,
When I declare my image and sprite variables outside of the main function, any access to the sprites crashes the program, but it works fine if the variables are declared inside the main. Why is it that way and what if I really need global stuff?
This doesn't affect myimage.LoadFromFile(myfilename). I also can declare my sf::Event variables outside without problem.
Edit: I get the same crashing problem with rendering windows declared outside the main.
When I declare my image and sprite variables outside of the main function, any access to the sprites crashes the program, but it works fine if the variables are declared inside the main. Why is it that way and what if I really need global stuff?
This doesn't affect myimage.LoadFromFile(myfilename). I also can declare my sf::Event variables outside without problem.
Edit: I get the same crashing problem with rendering windows declared outside the main.