SFML community forums
Help => General => Topic started by: Allptraum on November 13, 2015, 11:59:47 pm
-
Hello. I made a pong-copy for my school project.
I have to do a presentation about game developers, so i devided, to show the class the source of a little game.
This is why everything is in the main.cpp. Usually i dont do this :D
The Game works fine, aslong i run it in VS12.
If i run the .exe in my explorer it works for about 3 seconds and it crashes! pong.exe stopped working!
I compile it in the release mode. It is a Win32 project and i linked the sfml-name-s.lib libs
Heres my Quellcode (the RenderWindow instance isnt global!)
http://pastebin.com/7PXsVG7w
Please help me! I have this problem on nearly EVERY sfml program wich uses the RenderWindow instance!
-
Globals? Really?
Why are you passing (a pointer to) the render window to the load texture function and using then its size. The render window hasn't even been 'created' by this point!
It doesn't look like you're processing any of the window's events. You should very carefully read this tutorial (http://www.sfml-dev.org/tutorials/2.3/window-window.php) before continuing.