SFML community forums

Help => Graphics => Topic started by: jjfortherear on December 29, 2012, 03:35:28 am

Title: SFML2 Textures being overridden
Post by: jjfortherear on December 29, 2012, 03:35:28 am
Hi, I'm drawing textures and shapes on my render window, and occasionally when I draw shapes, certain textures won't show up (black box in place of the image).  I'm having trouble isolating the problem, but I'm wondering if it might have something to do with the order in which things are drawn?  Whether it's relevant or not, how does sfml decide what's in front/behind?  Is it purely the order in which they're drawn?  Thanks!

I notice it tends to happen when I set a nonzero outline on my shapes.
Title: Re: SFML2 Textures being overridden
Post by: masskiller on December 29, 2012, 04:30:58 am
Quote
Is it purely the order in which they're drawn?

Yes.

Quote
Hi, I'm drawing textures and shapes on my render window, and occasionally when I draw shapes, certain textures won't show up (black box in place of the image).

Is the texture you are using alive at that moment? If not it would describe your problem.

Were this to be a bug and not an error out of lack of understanding. You should specify if you are using the RC or the latest sources, since the title indicates you are already using SFML 2.

Title: Re: SFML2 Textures being overridden
Post by: jjfortherear on December 29, 2012, 04:41:40 am
Thanks, it's the RC.

What exactly do you mean "alive"?
Title: Re: SFML2 Textures being overridden
Post by: cire on December 29, 2012, 06:22:20 am
Quote
What exactly do you mean "alive"?

He means:  Have you verified the texture the sprite refers to is still valid when the problem occurs?  The texture must "live" as long as the sprite -- it's a mistake some new-to-SFML programmers make.

Sounds like it might possibly be another case of what's described here (http://en.sfml-dev.org/forums/index.php?topic=9561.0).
Title: Re: SFML2 Textures being overridden
Post by: masskiller on December 29, 2012, 06:25:00 am
That it hasn't gone out of scope if not assigned to heap.
Title: Re: SFML2 Textures being overridden
Post by: Laurent on December 29, 2012, 09:38:33 am
Try the latest Catalyst drivers (12.11 beta).