Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML2 Textures being overridden  (Read 1840 times)

0 Members and 1 Guest are viewing this topic.

jjfortherear

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML2 Textures being overridden
« 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.
« Last Edit: December 29, 2012, 03:40:03 am by jjfortherear »

masskiller

  • Sr. Member
  • ****
  • Posts: 284
  • Pointers to Functions rock!
    • MSN Messenger - kyogre_jb@hotmail.com
    • View Profile
    • Email
Re: SFML2 Textures being overridden
« Reply #1 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.

Programmer, Artist, Composer and Storyline/Script Writer of "Origin of Magic". If all goes well this could turn into a commercial project!

Finally back into the programming world!

jjfortherear

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML2 Textures being overridden
« Reply #2 on: December 29, 2012, 04:41:40 am »
Thanks, it's the RC.

What exactly do you mean "alive"?

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: SFML2 Textures being overridden
« Reply #3 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.

masskiller

  • Sr. Member
  • ****
  • Posts: 284
  • Pointers to Functions rock!
    • MSN Messenger - kyogre_jb@hotmail.com
    • View Profile
    • Email
Re: SFML2 Textures being overridden
« Reply #4 on: December 29, 2012, 06:25:00 am »
That it hasn't gone out of scope if not assigned to heap.
Programmer, Artist, Composer and Storyline/Script Writer of "Origin of Magic". If all goes well this could turn into a commercial project!

Finally back into the programming world!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML2 Textures being overridden
« Reply #5 on: December 29, 2012, 09:38:33 am »
Try the latest Catalyst drivers (12.11 beta).
Laurent Gomila - SFML developer

 

anything