So my programs works fine, and now I'm just upgrading it by toying with sound for the first time. However, what appears to be quite a simple attempt at importing and using a sound file is resulting in the program opening to a white screen.
Does anyone know what could be causing this?
The tiny amount of sound-related code I'm using is below:
sf::Music wind1;
wind1.openFromFile("ambient-loop2.wav");
wind1.setLoop(true);
int vol = 50;
wind1.setVolume(vol);
wind1.play();
This code is inside int main, but not inside the main game loop. I think I may be going wrong with that aspect - I'm not sure where I'm supposed to create the Music and then tell it to play.
As an aside, my aim is to make it so that the volume changes in unison with another parameter in the project - getting louder or quieter as the parameter value changes. It's currently setup to update the volume just before all the calls to draw all the new sprites at the end of each loop.
However, the program doesn't get any further than a white screen now anyway.
Hints appreciated, thanks.