#include <Gosu/Gosu.hpp>
class Win : public Gosu::Window
{
public:
Win()
: Gosu::Window(320, 240, false),
song(L"foo.ogg"),
frames(0)
{
song.play();
}
void draw() {}
void update()
{
if (frames++ == 60 * 2) // 2 seconds
song.stop();
}
private:
Gosu::Song song;
int frames;
};
int main()
{
Win w;
w.show();
return 0;
}
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill