开发者

Compiler error on Stopped enum value using GetStatus

开发者 https://www.devze.com 2023-02-25 14:52 出处:网络
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, b

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

精彩评论

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

关注公众号