Is it nonetheless essential to test if the window is requested to be closed after I put together a 1920×1080 window, in full-screen mode? How might the consumer 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 primary()
{
// Create a video mode object
VideoMode vm(1920, 1080);
// Create and open a window for the sport
RenderWindow window(vm, "Pong", Type::Fullscreen);
/*
Some code right here
*******************************
*******************************
*******************************
*/
whereas (window.isOpen())
{
/*
Deal with the participant enter
*******************************
*******************************
*******************************
*/
Occasion occasion;
whereas (window.pollEvent(occasion))
{
if (occasion.kind == 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
****************************
****************************
****************************
*/
}
}