sf::SoundloadSound(std::string filename){ sf::SoundBuffer buffer;// this buffer is local to the function, it will be destroyed...buffer.loadFromFile(filename);returnsf::Sound(buffer); }// ... heresf::Sound sound =loadSound("s.wav"); sound.play();// ERROR: the sound's buffer n...
sfSound* sfSound_create(const sfSoundBuffer* buffer) { assert(buffer); return new sfSound{sf::Sound(buffer->This), buffer}; auto sound = new sfSound(*buffer); sound->Buffer = buffer; return sound; } Expand All @@ -58,23 +60,23 @@ void sfSound_destroy(const sfSound* sound) voi...