Hi everybody. I am a newbie and i have a homework about coding a simple audio player. I can write a program that show a plain window when you open it and play the audio but could you show me how to insert a picture into that window and have click function (click to play-click to pause, something like that).
This is my code
sf::RenderWindow window(sf::VideoMode(sf::VideoMode::getDesktopMode()), "SFML");
sf::SoundBuffer buffer;
if (!buffer.loadFromFile("Music.wav"))
return -1;
sf::Sound sound;
sound.setBuffer(buffer);
sound.play();
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
window.close();
}
}