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

Author Topic: Sprite and Texture errors  (Read 6410 times)

0 Members and 1 Guest are viewing this topic.

sparkon

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Sprite and Texture errors
« Reply #15 on: September 04, 2012, 08:05:46 pm »
FRex thank you for your time ! I've already changed my code :P

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Sprite and Texture errors
« Reply #16 on: September 04, 2012, 08:18:20 pm »
But sprite holds pointer to sf texture not anything opengl and draws like that so there is garbage in the space where old texture pointer points to(maybe)?
Oh I had somehow the impression you were talking about textures in a vector...
I don't see any reason why a reallocation & copy of a sprite vector should cause any problwm (unless there's no copy constructor forthe sprite).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Sprite and Texture errors
« Reply #17 on: September 04, 2012, 08:21:10 pm »
We were talking about textures in a vector. If vector realocates then sprites that held pointers to it's elements now contain garbage pointers.
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Sprite and Texture errors
« Reply #18 on: September 04, 2012, 08:24:23 pm »
We were talking about textures in a vector. If vector realocates then sprites that held pointers to it's elements now contain garbage pointers.
I see.
Sorry should've probably read the whole conversation in detail. ;-)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Sprite and Texture errors
« Reply #19 on: September 04, 2012, 08:27:39 pm »
Yeah ;) Also the copy c-tor of texture seems quite heavy so this idea is getting worse by the minute.
« Last Edit: September 04, 2012, 08:29:20 pm by FRex »
Back to C++ gamedev with SFML in May 2023