Tubulii
13-08-2012 12:47:17
I am using mogre for quite some time, but there is still a not I do not know.
This recent topic made me thing about myself and how I am using mogre. As far as I know, there a some rules about resource handling.
So my question is:
In which cases do I have to care about the wrapper handles and implicit conversions in order to avoid errors (like in the mentioned in the topic above)?
I will write down, what I know...
Resource ptrs (e.g. MaterialPtr, TexturePtr, MeshPtr)
Always dispose (the wrapper) with .Dispose (e.g. by using a 'using' statement), even if you still want to keep the resource.
Implicit convertions (between ptrs) are (or could be) dangerous, FromResourcePtr(...) is a safe alternative.
Get the object by 'Target' (as an alternative to an implicit convertion).
Are there any other classes which are some how 'dangerous'? And need special care?
Thanks
This recent topic made me thing about myself and how I am using mogre. As far as I know, there a some rules about resource handling.
So my question is:
In which cases do I have to care about the wrapper handles and implicit conversions in order to avoid errors (like in the mentioned in the topic above)?
I will write down, what I know...
Resource ptrs (e.g. MaterialPtr, TexturePtr, MeshPtr)
Always dispose (the wrapper) with .Dispose (e.g. by using a 'using' statement), even if you still want to keep the resource.
Implicit convertions (between ptrs) are (or could be) dangerous, FromResourcePtr(...) is a safe alternative.
Get the object by 'Target' (as an alternative to an implicit convertion).
Are there any other classes which are some how 'dangerous'? And need special care?
Thanks