开发者

Compiler error on Stopped enum value using GetStatus

I'm trying to get the status of a sound effect but I don't know how to actually f开发者_C百科ind out what the status is. I'm quite new to C++. I tried to read up about enums and apply what I saw, but it won't work. Here's my code

sf::Sound::Status BeepStatus = Beep.GetStatus();
cout << BeepStatus;
if (BeepStatus == Stopped)
{
    Beep.SetPitch(float((rand()%15)-1)/10);
    Beep.Play();
}

That code won't work. During compile it will say that Stopped is not defined. What should I do?


You need to use the scope operator for your Stopped variable.

Likely, it's this:

sf::Sound::Stopped
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜