Hey guys,
I've made a simple window application with SFML and although I've
loaded the needed sound there comes no music. But otherwise
everything is running well.
Here's the source code:
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
using namespace sf;
int main(){
RenderWindow Window(VideoMode(600, 400, 32), "The Deployment - Here they come!");
while(Window.IsOpened()){
Event Close;
while(Window.GetEvent(Close)){
if(Close.Type == Event::Closed){
Window.Close();
}
}
Music BackgroundMusic;
if(!BackgroundMusic.OpenFromFile("/usr/local/games/The Deployment/sounds/BGSound.ogg")){
return 0;
}
BackgroundMusic.SetLoop(true);
BackgroundMusic.SetVolume(75.f);
BackgroundMusic.Play();
Window.Clear(Color(0, 191, 255));
Window.Display();
}
return 0;
}
I using Code::Blocks on Ubuntu 11.10 and the needed libraries are all linked.
Thanks for any help,
Patrik