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

Author Topic: "Improved management of dependant resources"  (Read 4002 times)

0 Members and 1 Guest are viewing this topic.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
"Improved management of dependant resources"
« on: August 09, 2008, 11:26:42 pm »
Any chance we can get a bit more specific information on what you've changed around here with the "Improved management of dependant resources" changes?
The change log mentions something about new Resource and ResourcePtr classes, but I can't find those classes in the SVN browser.  Did you forget to add them to the SVN or am I blind?  What are those classes supposed to do and where are they?
Also, are there any other changes to how resources are handled internally?  (I've been making a couple of my own VideoResource classes, so I'm trying to keep up.)
Thanks.

Edit:  It appears that VideoResource.hpp is still in there.  Is that class still used?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
"Improved management of dependant resources"
« Reply #1 on: August 10, 2008, 06:35:29 am »
Quote
Any chance we can get a bit more specific information on what you've changed around here with the "Improved management of dependant resources" changes?

It's an internal change, all you have to know is that an object pointing to a resource which have been destroyed will no longer cause a crash (well, actually it didn't, which was quite surprising).

Quote
The change log mentions something about new Resource and ResourcePtr classes, but I can't find those classes in the SVN browser. Did you forget to add them to the SVN or am I blind?

You're probably blind : they are all under include/SFML/System ;)

Quote
What are those classes supposed to

Raw pointers to resources (Image, SoundBuffer, Font) have been replaced by a particular kind of smart pointer which is notified when the resource is destroyed and then properly resets to NULL. It's actually not supposed to happen if you program properly, but it avoids crashes and provide a well-defined and much more consistent behaviour if you don't.
But again, everything is internal and will not affect the end user.

Quote
Also, are there any other changes to how resources are handled internally? (I've been making a couple of my own VideoResource classes, so I'm trying to keep up.)

The new resource system is completely unrelated to the hardware resources (VideoResource, AudioResource). So the VideoResource you know will still work like before.
Laurent Gomila - SFML developer

 

anything