Toggle feature. (includes SFML)

I have tried to make a toggle feature for a options menu. This is so when the user clicks on the sprite for the options menu it will bring it up. But the options menu only comes up while the sprite is pressed. So then i added a toggle feature and it still does not work. Can someone help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
     bool toggle;
     if(sf::Mouse::isButtonPressed(sf::Mouse::Left))
{


    if (OptionsB.getGlobalBounds().contains(Window.mapPixelToCoords(sf::Mouse::getPosition(Window))))
    {
        toggle == true;
        while (toggle==true){
        Window.draw(Backing);
        Window.draw(CancelB);
        Window.draw(OkayB);
}

    }
}


Can someone please help. and tell me what i have done wrong and how i can fix it. Thank you.
Topic archived. No new replies allowed.