Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Bindings - other languages
»
DotNet
»
Sound recycling on .NET
Print
Pages: [
1
]
Author
Topic: Sound recycling on .NET (Read 3532 times)
0 Members and 2 Guests are viewing this topic.
TechRogue
Jr. Member
Posts: 63
Sound recycling on .NET
«
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?
Logged
sf::RichText
My blog
Laurent
Administrator
Hero Member
Posts: 32504
Re: Sound recycling on .NET
«
Reply #1 on:
July 03, 2013, 04:06:47 pm »
You can do the same. Why would it have to be different?
Logged
Laurent Gomila - SFML developer
TechRogue
Jr. Member
Posts: 63
Re: Sound recycling on .NET
«
Reply #2 on:
July 03, 2013, 04:07:36 pm »
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.
Logged
sf::RichText
My blog
Laurent
Administrator
Hero Member
Posts: 32504
Re: Sound recycling on .NET
«
Reply #3 on:
July 03, 2013, 05:06:48 pm »
Explicitly destroying an object:
sound
.
Dispose
(
)
;
Limiting an object's scope:
using
(
sound
=
new
Sound
(
)
)
{
}
// implicitly calls sound.Dispose()
Logged
Laurent Gomila - SFML developer
TechRogue
Jr. Member
Posts: 63
Re: Sound recycling on .NET
«
Reply #4 on:
July 03, 2013, 05:21:32 pm »
Thanks, I didn't know about the Dispose method.
Logged
sf::RichText
My blog
Laurent
Administrator
Hero Member
Posts: 32504
Re: Sound recycling on .NET
«
Reply #5 on:
July 03, 2013, 06:11:59 pm »
It's inherited from the IDisposable interface, which is standard in .Net (not specific to SFML).
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Bindings - other languages
»
DotNet
»
Sound recycling on .NET
anything