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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Giovanni

Pages: [1]
1
Audio / Crashing on loading a sound
« on: May 06, 2011, 07:30:46 pm »
Quote from: "Laurent"
What was the problem?


vc++2010, I had to compile the libs again

thank you,
your sfml is just awesome! :D

2
Audio / Crashing on loading a sound
« on: May 06, 2011, 02:49:53 pm »
Quote from: "Laurent"
Quote
I'm compiling in release mode, the libs to use are sfml-audio-s.lib and sfml-system-s.lib, aren't they?

Yes.

You should compile in debug mode and run the debugger, it will tell you what's wrong ;)

Also, make sure that your version of Visual Studio matches the one of the libs that you're using (for example VC++ 2010 can't use VC++ 2008 libraries).


I made it!
you're the best man, thank you! :D

3
Audio / Crashing on loading a sound
« on: May 06, 2011, 01:43:13 pm »
Quote from: "Laurent"
Code: [Select]
buffer->~SoundBuffer();
You must never call a destructor explicitely. Here you must call delete, since you allocated the object with new.


thanks :}

anyway it crashes here:
if (!buffer->LoadFromFile(strFileName))

I'm compiling in release mode, the libs to use are sfml-audio-s.lib and sfml-system-s.lib, aren't they?

Because I think I messed up the vcpp configurations. :S

4
Audio / Crashing on loading a sound
« on: May 06, 2011, 12:31:30 pm »
Hello,
I'm trying to make a soundmanager using sfml audio, but I'm having some problems on the loading. I searched in this website and tried to do everything of what you said, but still doesn't work :(

Here's the loading:

Code: [Select]
int SoundManager::LoadSound(string strFileName)
{
sf::SoundBuffer *buffer = new sf::SoundBuffer();

if (!buffer->LoadFromFile(strFileName))
{
buffer->~SoundBuffer();
return -1;
}

for (size_t i = 0; i < m_buffers.size(); i++)
{
if (!m_buffers[i])
{
m_buffers[i] = buffer;
return i;
}
}

m_buffers.push_back(buffer);
return m_buffers.size() - 1;
//return 0;
}


if I made a really stupid mistake, please don't bother me, I'm a newbie as a programmer so be patient.  :oops:

Pages: [1]