SFML community forums

Help => General => Topic started by: sandwich hoop on March 19, 2023, 04:40:58 pm

Title: White square issue
Post by: sandwich hoop on March 19, 2023, 04:40:58 pm
Hi,
I'm sure this is asked a lot, but I've been trying for hours and can't seem to fix the white box issue with my textures.

This is the code I'm using:
(click to show/hide)
Sorry, thanks!
Title: Re: White square issue
Post by: Stauricus on March 19, 2023, 07:48:07 pm
this piece of code is too small to know for sure the problem, but my guess is that you are executing it from inside a function, right? if so, the texture is deleted when the function ends, and the sprite loses reference to it.
you need to keep the texture alive. maybe show a bit more of this class code can help