#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::VideoMode VMode(sf::VideoMode::getDesktopMode());
sf::RenderWindow window(VMode, "Sound Panning Test",sf::Style::Fullscreen);
sf::SoundBuffer sb_Sound;
sf::Sound snd_Sound;
sb_Sound.loadFromFile("SFMLSoundTestMono2.wav");
snd_Sound.setBuffer(sb_Sound);
snd_Sound.setPosition(VMode.width/2,VMode.height/2,0);
snd_Sound.setRelativeToListener(true);
snd_Sound.setMinDistance(50.f);
float listenerDepth=50.f;
sf::Listener::setPosition(VMode.width/2,VMode.height/2,listenerDepth);
sf::Listener::setDirection(0.f, 0.f,-listenerDepth);
snd_Sound.setLoop(true);
snd_Sound.play();
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.display();
}
return 0;
}
[/size]