SFML community forums

Help => Window => Topic started by: Burat on August 25, 2017, 04:58:49 pm

Title: Cant access to window.draw thru function on C++.
Post by: Burat on August 25, 2017, 04:58:49 pm
Hello.

"RenderWindow window" initialized in main.

When i try to window.clear\draw\display in function. The window stay clear and have no any picture, just white screen.

But same code works, when im unroll the function.

Whats im do wrong?
Title: Re: Cant access to window.draw thru function on C++.
Post by: Arcade on August 25, 2017, 05:59:29 pm
Are you perhaps trying to draw a sprite after its corresponding texture has gone out of scope and been destroyed? See the section titled "The white square problem" in the sprites and textures tutorial (https://www.sfml-dev.org/tutorials/2.4/graphics-sprite.php).

If this is not the issue then post a minimal example of your code so we can see what is going on.