Hello, this is code cut off my game - strange thing is that fullscrean sometimes (randomly) falls. Sometimes it stays windowed, sometimes it falls to window and then resize back to fullscrean...
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed)window.close();
if (event.key.code == sf::Keyboard::F4)window.create(sf::VideoMode(800, 650), "My window", sf::Style::Fullscreen);
if (event.key.code == sf::Keyboard::Escape)window.create(sf::VideoMode(800, 650), "My window", sf::Style::Default);
}
is there a mistake in code? , is good idea to use events for this? Any ideas?
Thanks for replies.