Friday, July 15, 2022
HomeGame Developmentsfml - Does checking the window requested to be closed ineffective after...

sfml – Does checking the window requested to be closed ineffective after I put together a 1920×1080 window, in full-screen mode?


Does checking the window requested to be closed ineffective after I put together a 1920×1080 window, in full-screen mode, how might the person shut the window in full-screen mode, when you could possibly not click on the X button of the window? I take this code from a guide.

int predominant()
{
    // Create a video mode object
    VideoMode vm(1920, 1080);
    // Create and open a window for the sport
    RenderWindow window(vm, "Pong", Fashion::Fullscreen);
    /*
    Some code right here
    *******************************
    *******************************
    *******************************
    */
    whereas (window.isOpen())
    {
        /*
        Deal with the participant enter
        *******************************
        *******************************
        *******************************
        */
        Occasion occasion;
        whereas (window.pollEvent(occasion))
        {
           if (occasion.sort == Occasion::Closed)
           {
               // Give up the sport when the window is closed
               window.shut();
           }
        }
        /*
        Replace the bat, the ball and the HUD
        ****************************
        ****************************
        ****************************
        */
        /*
        Draw the bat, the ball and the HUD
        ****************************
        ****************************
        ****************************
        */
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments