SFML community forums
Bindings - other languages => DotNet => Topic started by: TechRogue on July 03, 2013, 03:44:49 pm
-
When I use SFML with C++, I delete sound objects after they finish so as to not hit the limit of 256 sounds. How might I go about this in .NET? Is there a better way that I should be managing this?
-
You can do the same. Why would it have to be different?
-
I can't manually delete objects in C#, can I? To be honest I'm only using it because it's what my team agreed on; I don't have a lot of experience with it myself.
-
Explicitly destroying an object:
sound.Dispose();
Limiting an object's scope:
using (sound
= new Sound
()){} // implicitly calls sound.Dispose()
-
Thanks, I didn't know about the Dispose method.
-
It's inherited from the IDisposable interface, which is standard in .Net (not specific to SFML).